diff --git a/swaggerci/eventgrid/.gitattributes b/swaggerci/eventgrid/.gitattributes new file mode 100644 index 000000000000..2125666142eb --- /dev/null +++ b/swaggerci/eventgrid/.gitattributes @@ -0,0 +1 @@ +* text=auto \ No newline at end of file diff --git a/swaggerci/eventgrid/.gitignore b/swaggerci/eventgrid/.gitignore new file mode 100644 index 000000000000..7998f37e1e47 --- /dev/null +++ b/swaggerci/eventgrid/.gitignore @@ -0,0 +1,5 @@ +bin +obj +.vs +tools +test/*-TestResults.xml \ No newline at end of file diff --git a/swaggerci/eventgrid/Az.EventGrid.csproj b/swaggerci/eventgrid/Az.EventGrid.csproj new file mode 100644 index 000000000000..96963581565e --- /dev/null +++ b/swaggerci/eventgrid/Az.EventGrid.csproj @@ -0,0 +1,43 @@ + + + + 0.1.0 + 7.1 + netstandard2.0 + Library + Az.EventGrid.private + Microsoft.Azure.PowerShell.Cmdlets.EventGrid + true + false + ./bin + $(OutputPath) + Az.EventGrid.nuspec + true + + 1998 + true + + + + + false + TRACE;DEBUG;NETSTANDARD + + + + true + true + MSSharedLibKey.snk + TRACE;RELEASE;NETSTANDARD;SIGN + + + + + + + + + $(DefaultItemExcludes);resources/** + + + \ No newline at end of file diff --git a/swaggerci/eventgrid/Az.EventGrid.format.ps1xml b/swaggerci/eventgrid/Az.EventGrid.format.ps1xml new file mode 100644 index 000000000000..635de7016259 --- /dev/null +++ b/swaggerci/eventgrid/Az.EventGrid.format.ps1xml @@ -0,0 +1,5071 @@ + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.EventGridIdentity + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.EventGridIdentity + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ChannelName + + + DomainName + + + DomainTopicName + + + EventChannelName + + + EventSubscriptionName + + + Id + + + Location + + + ParentName + + + ParentType + + + PartnerDestinationName + + + PartnerNamespaceName + + + PartnerRegistrationName + + + PartnerTopicName + + + PrivateEndpointConnectionName + + + PrivateLinkResourceName + + + ProviderNamespace + + + ResourceGroupName + + + ResourceName + + + ResourceTypeName + + + Scope + + + SubscriptionId + + + SystemTopicName + + + TopicName + + + TopicTypeName + + + VerifiedPartnerName + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.AdvancedFilter + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.AdvancedFilter + + + + + + + + + + + + + + + Key + + + OperatorType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.AzureAdPartnerClientAuthentication + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.AzureAdPartnerClientAuthentication + + + + + + + + + + + + ClientAuthenticationType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.AzureAdPartnerClientAuthenticationProperties + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.AzureAdPartnerClientAuthenticationProperties + + + + + + + + + + + + + + + AzureActiveDirectoryApplicationIdOrUri + + + AzureActiveDirectoryTenantId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.AzureFunctionEventSubscriptionDestination + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.AzureFunctionEventSubscriptionDestination + + + + + + + + + + + + EndpointType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.AzureFunctionEventSubscriptionDestinationProperties + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.AzureFunctionEventSubscriptionDestinationProperties + + + + + + + + + + + + + + + + + + MaxEventsPerBatch + + + PreferredBatchSizeInKilobyte + + + ResourceId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.BoolEqualsAdvancedFilter + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.BoolEqualsAdvancedFilter + + + + + + + + + + + + + + + + + + Key + + + OperatorType + + + Value + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.Channel + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.Channel + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ChannelProperties + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ChannelProperties + + + + + + + + + + + + + + + + + + + + + + + + ChannelType + + + ExpirationTimeIfNotActivatedUtc + + + MessageForActivation + + + ProvisioningState + + + ReadinessState + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ChannelsListResult + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ChannelsListResult + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ChannelUpdateParametersProperties + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ChannelUpdateParametersProperties + + + + + + + + + + + + ExpirationTimeIfNotActivatedUtc + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ConnectionState + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ConnectionState + + + + + + + + + + + + + + + + + + ActionsRequired + + + Description + + + Status + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeadLetterDestination + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeadLetterDestination + + + + + + + + + + + + EndpointType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeliveryAttributeMapping + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeliveryAttributeMapping + + + + + + + + + + + + + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.Domain + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.Domain + + + + + + + + + + + + + + + + + + + + + Id + + + Location + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DomainProperties + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DomainProperties + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AutoCreateTopicWithFirstSubscription + + + AutoDeleteTopicWithLastSubscription + + + DataResidencyBoundary + + + DisableLocalAuth + + + Endpoint + + + InputSchema + + + MetricResourceId + + + ProvisioningState + + + PublicNetworkAccess + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DomainRegenerateKeyRequest + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DomainRegenerateKeyRequest + + + + + + + + + + + + KeyName + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DomainSharedAccessKeys + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DomainSharedAccessKeys + + + + + + + + + + + + + + + Key1 + + + Key2 + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DomainsListResult + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DomainsListResult + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DomainTopic + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DomainTopic + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DomainTopicProperties + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DomainTopicProperties + + + + + + + + + + + + ProvisioningState + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DomainTopicsListResult + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DomainTopicsListResult + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DomainUpdateParameterProperties + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DomainUpdateParameterProperties + + + + + + + + + + + + + + + + + + + + + + + + AutoCreateTopicWithFirstSubscription + + + AutoDeleteTopicWithLastSubscription + + + DataResidencyBoundary + + + DisableLocalAuth + + + PublicNetworkAccess + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DomainUpdateParametersTags + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DomainUpdateParametersTags + + + + + + + + + + + + Item + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DynamicDeliveryAttributeMapping + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DynamicDeliveryAttributeMapping + + + + + + + + + + + + + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DynamicDeliveryAttributeMappingProperties + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DynamicDeliveryAttributeMappingProperties + + + + + + + + + + + + SourceField + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventChannel + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventChannel + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventChannelDestination + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventChannelDestination + + + + + + + + + + + + + + + + + + AzureSubscriptionId + + + PartnerTopicName + + + ResourceGroup + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventChannelFilter + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventChannelFilter + + + + + + + + + + + + EnableAdvancedFilteringOnArray + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventChannelProperties + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventChannelProperties + + + + + + + + + + + + + + + + + + + + + ExpirationTimeIfNotActivatedUtc + + + PartnerTopicFriendlyDescription + + + PartnerTopicReadinessState + + + ProvisioningState + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventChannelsListResult + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventChannelsListResult + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventChannelSource + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventChannelSource + + + + + + + + + + + + Source + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventHubEventSubscriptionDestination + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventHubEventSubscriptionDestination + + + + + + + + + + + + EndpointType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventHubEventSubscriptionDestinationProperties + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventHubEventSubscriptionDestinationProperties + + + + + + + + + + + + ResourceId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscription + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscription + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionDestination + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionDestination + + + + + + + + + + + + EndpointType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionFilter + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionFilter + + + + + + + + + + + + + + + + + + + + + + + + EnableAdvancedFilteringOnArray + + + IncludedEventType + + + IsSubjectCaseSensitive + + + SubjectBeginsWith + + + SubjectEndsWith + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionFullUrl + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionFullUrl + + + + + + + + + + + + EndpointUrl + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionIdentity + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionIdentity + + + + + + + + + + + + + + + Type + + + UserAssignedIdentity + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionProperties + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionProperties + + + + + + + + + + + + + + + + + + + + + + + + EventDeliverySchema + + + ExpirationTimeUtc + + + Label + + + ProvisioningState + + + Topic + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionsListResult + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionsListResult + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionUpdateParameters + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionUpdateParameters + + + + + + + + + + + + + + + + + + EventDeliverySchema + + + ExpirationTimeUtc + + + Label + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventType + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventType + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventTypeInfo + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventTypeInfo + + + + + + + + + + + + Kind + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventTypeProperties + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventTypeProperties + + + + + + + + + + + + + + + + + + + + + Description + + + DisplayName + + + IsInDefaultSet + + + SchemaUrl + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ExtendedLocation + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ExtendedLocation + + + + + + + + + + + + + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ExtensionTopic + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ExtensionTopic + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ExtensionTopicProperties + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ExtensionTopicProperties + + + + + + + + + + + + + + + Description + + + SystemTopic + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.HybridConnectionEventSubscriptionDestination + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.HybridConnectionEventSubscriptionDestination + + + + + + + + + + + + EndpointType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.HybridConnectionEventSubscriptionDestinationProperties + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.HybridConnectionEventSubscriptionDestinationProperties + + + + + + + + + + + + ResourceId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IdentityInfo + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IdentityInfo + + + + + + + + + + + + + + + + + + PrincipalId + + + TenantId + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.InboundIPRule + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.InboundIPRule + + + + + + + + + + + + + + + Action + + + IPMask + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.InlineEventProperties + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.InlineEventProperties + + + + + + + + + + + + + + + + + + DataSchemaUrl + + + Description + + + DocumentationUrl + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.InputSchemaMapping + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.InputSchemaMapping + + + + + + + + + + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IsNotNullAdvancedFilter + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IsNotNullAdvancedFilter + + + + + + + + + + + + + + + Key + + + OperatorType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IsNullOrUndefinedAdvancedFilter + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IsNullOrUndefinedAdvancedFilter + + + + + + + + + + + + + + + Key + + + OperatorType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.JsonField + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.JsonField + + + + + + + + + + + + SourceField + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.JsonFieldWithDefault + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.JsonFieldWithDefault + + + + + + + + + + + + + + + DefaultValue + + + SourceField + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.JsonInputSchemaMapping + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.JsonInputSchemaMapping + + + + + + + + + + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.NumberGreaterThanAdvancedFilter + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.NumberGreaterThanAdvancedFilter + + + + + + + + + + + + + + + + + + Key + + + OperatorType + + + Value + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.NumberGreaterThanOrEqualsAdvancedFilter + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.NumberGreaterThanOrEqualsAdvancedFilter + + + + + + + + + + + + + + + + + + Key + + + OperatorType + + + Value + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.NumberInAdvancedFilter + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.NumberInAdvancedFilter + + + + + + + + + + + + + + + + + + Key + + + OperatorType + + + Value + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.NumberInRangeAdvancedFilter + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.NumberInRangeAdvancedFilter + + + + + + + + + + + + + + + + + + Key + + + OperatorType + + + Value + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.NumberLessThanAdvancedFilter + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.NumberLessThanAdvancedFilter + + + + + + + + + + + + + + + + + + Key + + + OperatorType + + + Value + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.NumberLessThanOrEqualsAdvancedFilter + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.NumberLessThanOrEqualsAdvancedFilter + + + + + + + + + + + + + + + + + + Key + + + OperatorType + + + Value + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.NumberNotInAdvancedFilter + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.NumberNotInAdvancedFilter + + + + + + + + + + + + + + + + + + Key + + + OperatorType + + + Value + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.NumberNotInRangeAdvancedFilter + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.NumberNotInRangeAdvancedFilter + + + + + + + + + + + + + + + + + + Key + + + OperatorType + + + Value + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.Operation + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.Operation + + + + + + + + + + + + + + + + + + IsDataAction + + + Name + + + Origin + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.OperationInfo + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.OperationInfo + + + + + + + + + + + + + + + + + + + + + Description + + + Operation + + + Provider + + + Resource + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.Partner + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.Partner + + + + + + + + + + + + + + + + + + AuthorizationExpirationTimeInUtc + + + Name + + + RegistrationImmutableId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerAuthorization + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerAuthorization + + + + + + + + + + + + DefaultMaximumExpirationTimeInDay + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerClientAuthentication + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerClientAuthentication + + + + + + + + + + + + ClientAuthenticationType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerConfiguration + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerConfiguration + + + + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + Location + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerConfigurationProperties + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerConfigurationProperties + + + + + + + + + + + + ProvisioningState + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerConfigurationsListResult + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerConfigurationsListResult + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerConfigurationTags + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerConfigurationTags + + + + + + + + + + + + Item + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerConfigurationUpdateParameterProperties + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerConfigurationUpdateParameterProperties + + + + + + + + + + + + DefaultMaximumExpirationTimeInDay + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerConfigurationUpdateParametersTags + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerConfigurationUpdateParametersTags + + + + + + + + + + + + Item + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerDestination + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerDestination + + + + + + + + + + + + + + + + + + + + + Id + + + Location + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerDestinationInfo + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerDestinationInfo + + + + + + + + + + + + + + + + + + + + + + + + AzureSubscriptionId + + + EndpointServiceContext + + + EndpointType + + + Name + + + ResourceGroupName + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerDestinationProperties + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerDestinationProperties + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ActivationState + + + EndpointBaseUrl + + + EndpointServiceContext + + + ExpirationTimeIfNotActivatedUtc + + + MessageForActivation + + + PartnerRegistrationImmutableId + + + ProvisioningState + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerDestinationsListResult + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerDestinationsListResult + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerDestinationUpdateParametersTags + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerDestinationUpdateParametersTags + + + + + + + + + + + + Item + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerDetails + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerDetails + + + + + + + + + + + + + + + + + + Description + + + LongDescription + + + SetupUri + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerEventSubscriptionDestination + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerEventSubscriptionDestination + + + + + + + + + + + + EndpointType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerEventSubscriptionDestinationProperties + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerEventSubscriptionDestinationProperties + + + + + + + + + + + + ResourceId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerNamespace + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerNamespace + + + + + + + + + + + + + + + + + + + + + Id + + + Location + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerNamespaceProperties + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerNamespaceProperties + + + + + + + + + + + + + + + + + + + + + + + + + + + DisableLocalAuth + + + Endpoint + + + PartnerRegistrationFullyQualifiedId + + + PartnerTopicRoutingMode + + + ProvisioningState + + + PublicNetworkAccess + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerNamespaceRegenerateKeyRequest + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerNamespaceRegenerateKeyRequest + + + + + + + + + + + + KeyName + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerNamespaceSharedAccessKeys + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerNamespaceSharedAccessKeys + + + + + + + + + + + + + + + Key1 + + + Key2 + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerNamespacesListResult + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerNamespacesListResult + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerNamespaceUpdateParameterProperties + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerNamespaceUpdateParameterProperties + + + + + + + + + + + + + + + DisableLocalAuth + + + PublicNetworkAccess + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerNamespaceUpdateParametersTags + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerNamespaceUpdateParametersTags + + + + + + + + + + + + Item + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerRegistration + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerRegistration + + + + + + + + + + + + + + + + + + + + + Id + + + Location + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerRegistrationProperties + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerRegistrationProperties + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AuthorizedAzureSubscriptionId + + + CustomerServiceUri + + + LogoUri + + + LongDescription + + + PartnerCustomerServiceExtension + + + PartnerCustomerServiceNumber + + + PartnerName + + + PartnerRegistrationImmutableId + + + PartnerResourceTypeDescription + + + PartnerResourceTypeDisplayName + + + PartnerResourceTypeName + + + ProvisioningState + + + SetupUri + + + VisibilityState + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerRegistrationsListResult + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerRegistrationsListResult + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerRegistrationUpdateParameters + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerRegistrationUpdateParameters + + + + + + + + + + + + + + + + + + + + + + + + + + + AuthorizedAzureSubscriptionId + + + LogoUri + + + PartnerTopicTypeDescription + + + PartnerTopicTypeDisplayName + + + PartnerTopicTypeName + + + SetupUri + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerRegistrationUpdateParametersTags + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerRegistrationUpdateParametersTags + + + + + + + + + + + + Item + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerTopic + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerTopic + + + + + + + + + + + + + + + + + + + + + Id + + + Location + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerTopicInfo + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerTopicInfo + + + + + + + + + + + + + + + + + + + + + AzureSubscriptionId + + + Name + + + ResourceGroupName + + + Source + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerTopicProperties + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerTopicProperties + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ActivationState + + + ExpirationTimeIfNotActivatedUtc + + + MessageForActivation + + + PartnerRegistrationImmutableId + + + PartnerTopicFriendlyDescription + + + ProvisioningState + + + Source + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerTopicsListResult + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerTopicsListResult + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerTopicUpdateParametersTags + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerTopicUpdateParametersTags + + + + + + + + + + + + Item + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerUpdateDestinationInfo + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerUpdateDestinationInfo + + + + + + + + + + + + EndpointType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PrivateEndpoint + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PrivateEndpoint + + + + + + + + + + + + Id + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PrivateEndpointConnection + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PrivateEndpointConnection + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PrivateEndpointConnectionListResult + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PrivateEndpointConnectionListResult + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PrivateEndpointConnectionProperties + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PrivateEndpointConnectionProperties + + + + + + + + + + + + + + + GroupId + + + ProvisioningState + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PrivateLinkResource + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PrivateLinkResource + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PrivateLinkResourceProperties + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PrivateLinkResourceProperties + + + + + + + + + + + + + + + + + + + + + DisplayName + + + GroupId + + + RequiredMember + + + RequiredZoneName + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PrivateLinkResourcesListResult + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PrivateLinkResourcesListResult + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.Resource + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.Resource + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ResourceMoveChangeHistory + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ResourceMoveChangeHistory + + + + + + + + + + + + + + + + + + AzureSubscriptionId + + + ChangedTimeUtc + + + ResourceGroupName + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ResourceSku + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ResourceSku + + + + + + + + + + + + Name + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.RetryPolicy + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.RetryPolicy + + + + + + + + + + + + + + + EventTimeToLiveInMinute + + + MaxDeliveryAttempt + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ServiceBusQueueEventSubscriptionDestination + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ServiceBusQueueEventSubscriptionDestination + + + + + + + + + + + + EndpointType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ServiceBusQueueEventSubscriptionDestinationProperties + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ServiceBusQueueEventSubscriptionDestinationProperties + + + + + + + + + + + + ResourceId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ServiceBusTopicEventSubscriptionDestination + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ServiceBusTopicEventSubscriptionDestination + + + + + + + + + + + + EndpointType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ServiceBusTopicEventSubscriptionDestinationProperties + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ServiceBusTopicEventSubscriptionDestinationProperties + + + + + + + + + + + + ResourceId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.StaticDeliveryAttributeMapping + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.StaticDeliveryAttributeMapping + + + + + + + + + + + + + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.StaticDeliveryAttributeMappingProperties + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.StaticDeliveryAttributeMappingProperties + + + + + + + + + + + + + + + IsSecret + + + Value + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.StorageBlobDeadLetterDestination + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.StorageBlobDeadLetterDestination + + + + + + + + + + + + EndpointType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.StorageBlobDeadLetterDestinationProperties + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.StorageBlobDeadLetterDestinationProperties + + + + + + + + + + + + + + + BlobContainerName + + + ResourceId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.StorageQueueEventSubscriptionDestination + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.StorageQueueEventSubscriptionDestination + + + + + + + + + + + + EndpointType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.StorageQueueEventSubscriptionDestinationProperties + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.StorageQueueEventSubscriptionDestinationProperties + + + + + + + + + + + + + + + + + + QueueMessageTimeToLiveInSecond + + + QueueName + + + ResourceId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.StringBeginsWithAdvancedFilter + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.StringBeginsWithAdvancedFilter + + + + + + + + + + + + + + + + + + Key + + + OperatorType + + + Value + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.StringContainsAdvancedFilter + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.StringContainsAdvancedFilter + + + + + + + + + + + + + + + + + + Key + + + OperatorType + + + Value + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.StringEndsWithAdvancedFilter + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.StringEndsWithAdvancedFilter + + + + + + + + + + + + + + + + + + Key + + + OperatorType + + + Value + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.StringInAdvancedFilter + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.StringInAdvancedFilter + + + + + + + + + + + + + + + + + + Key + + + OperatorType + + + Value + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.StringNotBeginsWithAdvancedFilter + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.StringNotBeginsWithAdvancedFilter + + + + + + + + + + + + + + + + + + Key + + + OperatorType + + + Value + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.StringNotContainsAdvancedFilter + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.StringNotContainsAdvancedFilter + + + + + + + + + + + + + + + + + + Key + + + OperatorType + + + Value + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.StringNotEndsWithAdvancedFilter + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.StringNotEndsWithAdvancedFilter + + + + + + + + + + + + + + + + + + Key + + + OperatorType + + + Value + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.StringNotInAdvancedFilter + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.StringNotInAdvancedFilter + + + + + + + + + + + + + + + + + + Key + + + OperatorType + + + Value + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.SystemTopic + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.SystemTopic + + + + + + + + + + + + + + + + + + + + + Id + + + Location + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.SystemTopicProperties + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.SystemTopicProperties + + + + + + + + + + + + + + + + + + + + + MetricResourceId + + + ProvisioningState + + + Source + + + TopicType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.SystemTopicsListResult + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.SystemTopicsListResult + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.SystemTopicUpdateParametersTags + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.SystemTopicUpdateParametersTags + + + + + + + + + + + + Item + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.Topic + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.Topic + + + + + + + + + + + + + + + + + + + + + + + + Id + + + Location + + + Name + + + Type + + + Kind + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.TopicProperties + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.TopicProperties + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + DataResidencyBoundary + + + DisableLocalAuth + + + Endpoint + + + InputSchema + + + MetricResourceId + + + ProvisioningState + + + PublicNetworkAccess + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.TopicRegenerateKeyRequest + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.TopicRegenerateKeyRequest + + + + + + + + + + + + KeyName + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.TopicSharedAccessKeys + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.TopicSharedAccessKeys + + + + + + + + + + + + + + + Key1 + + + Key2 + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.TopicsListResult + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.TopicsListResult + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.TopicTypeInfo + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.TopicTypeInfo + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.TopicTypeProperties + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.TopicTypeProperties + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Description + + + DisplayName + + + Provider + + + ProvisioningState + + + ResourceRegionType + + + SourceResourceFormat + + + SupportedLocation + + + SupportedScopesForSource + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.TopicUpdateParameterProperties + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.TopicUpdateParameterProperties + + + + + + + + + + + + + + + + + + DataResidencyBoundary + + + DisableLocalAuth + + + PublicNetworkAccess + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.TopicUpdateParametersTags + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.TopicUpdateParametersTags + + + + + + + + + + + + Item + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.TrackedResource + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.TrackedResource + + + + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + Location + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.TrackedResourceTags + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.TrackedResourceTags + + + + + + + + + + + + Item + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.UserIdentityProperties + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.UserIdentityProperties + + + + + + + + + + + + + + + ClientId + + + PrincipalId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.VerifiedPartner + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.VerifiedPartner + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.VerifiedPartnerProperties + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.VerifiedPartnerProperties + + + + + + + + + + + + + + + + + + + + + OrganizationName + + + PartnerDisplayName + + + PartnerRegistrationImmutableId + + + ProvisioningState + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.VerifiedPartnersListResult + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.VerifiedPartnersListResult + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.WebHookEventSubscriptionDestination + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.WebHookEventSubscriptionDestination + + + + + + + + + + + + EndpointType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.WebHookEventSubscriptionDestinationProperties + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.WebHookEventSubscriptionDestinationProperties + + + + + + + + + + + + + + + + + + + + + + + + + + + AzureActiveDirectoryApplicationIdOrUri + + + AzureActiveDirectoryTenantId + + + EndpointBaseUrl + + + EndpointUrl + + + MaxEventsPerBatch + + + PreferredBatchSizeInKilobyte + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.WebhookPartnerDestinationInfo + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.WebhookPartnerDestinationInfo + + + + + + + + + + + + + + + + + + + + + + + + AzureSubscriptionId + + + EndpointServiceContext + + + EndpointType + + + Name + + + ResourceGroupName + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.WebhookPartnerDestinationProperties + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.WebhookPartnerDestinationProperties + + + + + + + + + + + + + + + EndpointBaseUrl + + + EndpointUrl + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.WebhookUpdatePartnerDestinationInfo + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.WebhookUpdatePartnerDestinationInfo + + + + + + + + + + + + EndpointType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.SystemData + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.SystemData + + + + + + + + + + + + + + + + + + + + + + + + + + + CreatedAt + + + CreatedBy + + + CreatedByType + + + LastModifiedAt + + + LastModifiedBy + + + LastModifiedByType + + + + + + + + \ No newline at end of file diff --git a/swaggerci/eventgrid/Az.EventGrid.nuspec b/swaggerci/eventgrid/Az.EventGrid.nuspec new file mode 100644 index 000000000000..719fb5d97996 --- /dev/null +++ b/swaggerci/eventgrid/Az.EventGrid.nuspec @@ -0,0 +1,32 @@ + + + + Az.EventGrid + 0.1.0 + Microsoft Corporation + Microsoft Corporation + true + https://aka.ms/azps-license + https://github.com/Azure/azure-powershell + Microsoft Azure PowerShell: $(service-name) cmdlets + + Microsoft Corporation. All rights reserved. + Azure ResourceManager ARM PSModule $(service-name) + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/swaggerci/eventgrid/Az.EventGrid.psd1 b/swaggerci/eventgrid/Az.EventGrid.psd1 new file mode 100644 index 000000000000..105f9ee0db69 --- /dev/null +++ b/swaggerci/eventgrid/Az.EventGrid.psd1 @@ -0,0 +1,24 @@ +@{ + GUID = '81899402-b274-4991-afb3-de0af64abf19' + RootModule = './Az.EventGrid.psm1' + ModuleVersion = '0.1.0' + CompatiblePSEditions = 'Core', 'Desktop' + Author = 'Microsoft Corporation' + CompanyName = 'Microsoft Corporation' + Copyright = 'Microsoft Corporation. All rights reserved.' + Description = 'Microsoft Azure PowerShell: EventGrid cmdlets' + PowerShellVersion = '5.1' + DotNetFrameworkVersion = '4.7.2' + RequiredAssemblies = './bin/Az.EventGrid.private.dll' + FormatsToProcess = './Az.EventGrid.format.ps1xml' + FunctionsToExport = 'Get-AzEventGridChannel', 'Get-AzEventGridChannelFullUrl', 'Get-AzEventGridDomain', 'Get-AzEventGridDomainEventSubscription', 'Get-AzEventGridDomainEventSubscriptionDeliveryAttribute', 'Get-AzEventGridDomainEventSubscriptionFullUrl', 'Get-AzEventGridDomainSharedAccessKey', 'Get-AzEventGridDomainTopic', 'Get-AzEventGridDomainTopicEventSubscription', 'Get-AzEventGridDomainTopicEventSubscriptionDeliveryAttribute', 'Get-AzEventGridDomainTopicEventSubscriptionFullUrl', 'Get-AzEventGridEventChannel', 'Get-AzEventGridEventSubscription', 'Get-AzEventGridEventSubscriptionDeliveryAttribute', 'Get-AzEventGridEventSubscriptionFullUrl', 'Get-AzEventGridEventSubscriptionGlobal', 'Get-AzEventGridEventSubscriptionRegional', 'Get-AzEventGridExtensionTopic', 'Get-AzEventGridPartnerConfiguration', 'Get-AzEventGridPartnerDestination', 'Get-AzEventGridPartnerNamespace', 'Get-AzEventGridPartnerNamespaceSharedAccessKey', 'Get-AzEventGridPartnerRegistration', 'Get-AzEventGridPartnerTopic', 'Get-AzEventGridPartnerTopicEventSubscription', 'Get-AzEventGridPartnerTopicEventSubscriptionDeliveryAttribute', 'Get-AzEventGridPartnerTopicEventSubscriptionFullUrl', 'Get-AzEventGridPrivateEndpointConnection', 'Get-AzEventGridPrivateLinkResource', 'Get-AzEventGridSystemTopic', 'Get-AzEventGridSystemTopicEventSubscription', 'Get-AzEventGridSystemTopicEventSubscriptionDeliveryAttribute', 'Get-AzEventGridSystemTopicEventSubscriptionFullUrl', 'Get-AzEventGridTopic', 'Get-AzEventGridTopicEventSubscription', 'Get-AzEventGridTopicEventSubscriptionDeliveryAttribute', 'Get-AzEventGridTopicEventSubscriptionFullUrl', 'Get-AzEventGridTopicEventType', 'Get-AzEventGridTopicSharedAccessKey', 'Get-AzEventGridTopicType', 'Get-AzEventGridTopicTypeEventType', 'Get-AzEventGridVerifiedPartner', 'Grant-AzEventGridPartnerConfigurationPartner', 'Initialize-AzEventGridPartnerDestination', 'Initialize-AzEventGridPartnerTopic', 'Invoke-AzEventGridDeactivatePartnerTopic', 'Invoke-AzEventGridPartnerConfigurationUnauthorize', 'New-AzEventGridChannel', 'New-AzEventGridDomain', 'New-AzEventGridDomainEventSubscription', 'New-AzEventGridDomainKey', 'New-AzEventGridDomainTopicEventSubscription', 'New-AzEventGridEventChannel', 'New-AzEventGridEventSubscription', 'New-AzEventGridPartnerConfiguration', 'New-AzEventGridPartnerDestination', 'New-AzEventGridPartnerNamespace', 'New-AzEventGridPartnerNamespaceKey', 'New-AzEventGridPartnerRegistration', 'New-AzEventGridPartnerTopic', 'New-AzEventGridPartnerTopicEventSubscription', 'New-AzEventGridSystemTopic', 'New-AzEventGridSystemTopicEventSubscription', 'New-AzEventGridTopic', 'New-AzEventGridTopicEventSubscription', 'New-AzEventGridTopicKey', 'Remove-AzEventGridChannel', 'Remove-AzEventGridDomain', 'Remove-AzEventGridDomainEventSubscription', 'Remove-AzEventGridDomainTopic', 'Remove-AzEventGridDomainTopicEventSubscription', 'Remove-AzEventGridEventChannel', 'Remove-AzEventGridEventSubscription', 'Remove-AzEventGridPartnerConfiguration', 'Remove-AzEventGridPartnerDestination', 'Remove-AzEventGridPartnerNamespace', 'Remove-AzEventGridPartnerRegistration', 'Remove-AzEventGridPartnerTopic', 'Remove-AzEventGridPartnerTopicEventSubscription', 'Remove-AzEventGridPrivateEndpointConnection', 'Remove-AzEventGridSystemTopic', 'Remove-AzEventGridSystemTopicEventSubscription', 'Remove-AzEventGridTopic', 'Remove-AzEventGridTopicEventSubscription', 'Update-AzEventGridChannel', 'Update-AzEventGridDomain', 'Update-AzEventGridDomainEventSubscription', 'Update-AzEventGridDomainTopicEventSubscription', 'Update-AzEventGridEventSubscription', 'Update-AzEventGridPartnerConfiguration', 'Update-AzEventGridPartnerDestination', 'Update-AzEventGridPartnerNamespace', 'Update-AzEventGridPartnerRegistration', 'Update-AzEventGridPartnerTopic', 'Update-AzEventGridPartnerTopicEventSubscription', 'Update-AzEventGridSystemTopic', 'Update-AzEventGridSystemTopicEventSubscription', 'Update-AzEventGridTopic', 'Update-AzEventGridTopicEventSubscription', '*' + AliasesToExport = '*' + PrivateData = @{ + PSData = @{ + Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'EventGrid' + LicenseUri = 'https://aka.ms/azps-license' + ProjectUri = 'https://github.com/Azure/azure-powershell' + ReleaseNotes = '' + } + } +} diff --git a/swaggerci/eventgrid/Az.EventGrid.psm1 b/swaggerci/eventgrid/Az.EventGrid.psm1 new file mode 100644 index 000000000000..fa71f3f13a45 --- /dev/null +++ b/swaggerci/eventgrid/Az.EventGrid.psm1 @@ -0,0 +1,107 @@ +# region Generated + # ---------------------------------------------------------------------------------- + # 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. + # ---------------------------------------------------------------------------------- + # Load required Az.Accounts module + $accountsName = 'Az.Accounts' + $accountsModule = Get-Module -Name $accountsName + if(-not $accountsModule) { + $localAccountsPath = Join-Path $PSScriptRoot 'generated/modules' + if(Test-Path -Path $localAccountsPath) { + $localAccounts = Get-ChildItem -Path $localAccountsPath -Recurse -Include 'Az.Accounts.psd1' | Select-Object -Last 1 + if($localAccounts) { + $accountsModule = Import-Module -Name ($localAccounts.FullName) -Scope Global -PassThru + } + } + if(-not $accountsModule) { + $hasAdequateVersion = (Get-Module -Name $accountsName -ListAvailable | Where-Object { $_.Version -ge [System.Version]'2.7.5' } | Measure-Object).Count -gt 0 + if($hasAdequateVersion) { + $accountsModule = Import-Module -Name $accountsName -MinimumVersion 2.7.5 -Scope Global -PassThru + } + } + } + + if(-not $accountsModule) { + Write-Error "`nThis module requires $accountsName version 2.7.5 or greater. For installation instructions, please see: https://docs.microsoft.com/powershell/azure/install-az-ps" -ErrorAction Stop + } elseif (($accountsModule.Version -lt [System.Version]'2.7.5') -and (-not $localAccounts)) { + Write-Error "`nThis module requires $accountsName version 2.7.5 or greater. An earlier version of Az.Accounts is imported in the current PowerShell session. If you are running test, please try to add the switch '-RegenerateSupportModule' when executing 'test-module.ps1'. Otherwise please open a new PowerShell session and import this module again.`nAdditionally, this error could indicate that multiple incompatible versions of Azure PowerShell modules are installed on your system. For troubleshooting information, please see: https://aka.ms/azps-version-error" -ErrorAction Stop + } + Write-Information "Loaded Module '$($accountsModule.Name)'" + + # Load the private module dll + $null = Import-Module -Name (Join-Path $PSScriptRoot './bin/Az.EventGrid.private.dll') + + # Get the private module's instance + $instance = [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module]::Instance + + # Ask for the shared functionality table + $VTable = Register-AzModule + + # Tweaks the pipeline on module load + $instance.OnModuleLoad = $VTable.OnModuleLoad + + # Following two delegates are added for telemetry + $instance.GetTelemetryId = $VTable.GetTelemetryId + $instance.Telemetry = $VTable.Telemetry + + + # Tweaks the pipeline per call + $instance.OnNewRequest = $VTable.OnNewRequest + + # Gets shared parameter values + $instance.GetParameterValue = $VTable.GetParameterValue + + # Allows shared module to listen to events from this module + $instance.EventListener = $VTable.EventListener + + # Gets shared argument completers + $instance.ArgumentCompleter = $VTable.ArgumentCompleter + + # The name of the currently selected Azure profile + $instance.ProfileName = $VTable.ProfileName + + + # Load the custom module + $customModulePath = Join-Path $PSScriptRoot './custom/Az.EventGrid.custom.psm1' + if(Test-Path $customModulePath) { + $null = Import-Module -Name $customModulePath + } + + # Export nothing to clear implicit exports + Export-ModuleMember + + # Export proxy cmdlet scripts + $exportsPath = Join-Path $PSScriptRoot './exports' + $directories = Get-ChildItem -Directory -Path $exportsPath + $profileDirectory = $null + if($instance.ProfileName) { + if(($directories | ForEach-Object { $_.Name }) -contains $instance.ProfileName) { + $profileDirectory = $directories | Where-Object { $_.Name -eq $instance.ProfileName } + } else { + # Don't export anything if the profile doesn't exist for the module + $exportsPath = $null + Write-Warning "Selected Azure profile '$($instance.ProfileName)' does not exist for module '$($instance.Name)'. No cmdlets were loaded." + } + } elseif(($directories | Measure-Object).Count -gt 0) { + # Load the last folder if no profile is selected + $profileDirectory = $directories | Select-Object -Last 1 + } + + if($profileDirectory) { + Write-Information "Loaded Azure profile '$($profileDirectory.Name)' for module '$($instance.Name)'" + $exportsPath = $profileDirectory.FullName + } + + if($exportsPath) { + Get-ChildItem -Path $exportsPath -Recurse -Include '*.ps1' -File | ForEach-Object { . $_.FullName } + $cmdletNames = Get-ScriptCmdlet -ScriptFolder $exportsPath + Export-ModuleMember -Function $cmdletNames -Alias (Get-ScriptCmdlet -ScriptFolder $exportsPath -AsAlias) + } + + # Finalize initialization of this module + $instance.Init(); + Write-Information "Loaded Module '$($instance.Name)'" +# endregion diff --git a/swaggerci/eventgrid/MSSharedLibKey.snk b/swaggerci/eventgrid/MSSharedLibKey.snk new file mode 100644 index 000000000000..695f1b38774e Binary files /dev/null and b/swaggerci/eventgrid/MSSharedLibKey.snk differ diff --git a/swaggerci/eventgrid/README.md b/swaggerci/eventgrid/README.md new file mode 100644 index 000000000000..7dee6c39f3e1 --- /dev/null +++ b/swaggerci/eventgrid/README.md @@ -0,0 +1,27 @@ + +# Az.EventGrid +This directory contains the PowerShell module for the EventGrid service. + +--- +## Status +[![Az.EventGrid](https://img.shields.io/powershellgallery/v/Az.EventGrid.svg?style=flat-square&label=Az.EventGrid "Az.EventGrid")](https://www.powershellgallery.com/packages/Az.EventGrid/) + +## Info +- Modifiable: yes +- Generated: all +- Committed: yes +- Packaged: yes + +--- +## Detail +This module was primarily generated via [AutoRest](https://github.com/Azure/autorest) using the [PowerShell](https://github.com/Azure/autorest.powershell) extension. + +## Module Requirements +- [Az.Accounts module](https://www.powershellgallery.com/packages/Az.Accounts/), version 2.7.5 or greater + +## Authentication +AutoRest does not generate authentication code for the module. Authentication is handled via Az.Accounts by altering the HTTP payload before it is sent. + +## Development +For information on how to develop for `Az.EventGrid`, see [how-to.md](how-to.md). + diff --git a/swaggerci/eventgrid/build-module.ps1 b/swaggerci/eventgrid/build-module.ps1 new file mode 100644 index 000000000000..931386b4ae3e --- /dev/null +++ b/swaggerci/eventgrid/build-module.ps1 @@ -0,0 +1,153 @@ +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- +param([switch]$Isolated, [switch]$Run, [switch]$Test, [switch]$Docs, [switch]$Pack, [switch]$Code, [switch]$Release, [switch]$Debugger, [switch]$NoDocs) +$ErrorActionPreference = 'Stop' + +if($PSEdition -ne 'Core') { + Write-Error 'This script requires PowerShell Core to execute. [Note] Generated cmdlets will work in both PowerShell Core or Windows PowerShell.' +} + +if(-not $Isolated -and -not $Debugger) { + Write-Host -ForegroundColor Green 'Creating isolated process...' + $pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path + & "$pwsh" -NonInteractive -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -Isolated + + if($LastExitCode -ne 0) { + # Build failed. Don't attempt to run the module. + return + } + + if($Test) { + . (Join-Path $PSScriptRoot 'test-module.ps1') + if($LastExitCode -ne 0) { + # Tests failed. Don't attempt to run the module. + return + } + } + + if($Docs) { + . (Join-Path $PSScriptRoot 'generate-help.ps1') + if($LastExitCode -ne 0) { + # Docs generation failed. Don't attempt to run the module. + return + } + } + + if($Pack) { + . (Join-Path $PSScriptRoot 'pack-module.ps1') + if($LastExitCode -ne 0) { + # Packing failed. Don't attempt to run the module. + return + } + } + + $runModulePath = Join-Path $PSScriptRoot 'run-module.ps1' + if($Code) { + . $runModulePath -Code + } elseif($Run) { + . $runModulePath + } else { + Write-Host -ForegroundColor Cyan "To run this module in an isolated PowerShell session, run the 'run-module.ps1' script or provide the '-Run' parameter to this script." + } + return +} + +$binFolder = Join-Path $PSScriptRoot 'bin' +$objFolder = Join-Path $PSScriptRoot 'obj' + +if(-not $Debugger) { + Write-Host -ForegroundColor Green 'Cleaning build folders...' + $null = Remove-Item -Recurse -ErrorAction SilentlyContinue -Path $binFolder, $objFolder + + if((Test-Path $binFolder) -or (Test-Path $objFolder)) { + Write-Host -ForegroundColor Cyan 'Did you forget to exit your isolated module session before rebuilding?' + Write-Error 'Unable to clean ''bin'' or ''obj'' folder. A process may have an open handle.' + } + + Write-Host -ForegroundColor Green 'Compiling module...' + $buildConfig = 'Debug' + if($Release) { + $buildConfig = 'Release' + } + dotnet publish $PSScriptRoot --verbosity quiet --configuration $buildConfig /nologo + if($LastExitCode -ne 0) { + Write-Error 'Compilation failed.' + } + + $null = Remove-Item -Recurse -ErrorAction SilentlyContinue -Path (Join-Path $binFolder 'Debug'), (Join-Path $binFolder 'Release') +} + +$dll = Join-Path $PSScriptRoot 'bin/Az.EventGrid.private.dll' +if(-not (Test-Path $dll)) { + Write-Error "Unable to find output assembly in '$binFolder'." +} + +# Load DLL to use build-time cmdlets +$null = Import-Module -Name $dll + +$modulePaths = $dll +$customPsm1 = Join-Path $PSScriptRoot 'custom/Az.EventGrid.custom.psm1' +if(Test-Path $customPsm1) { + $modulePaths = @($dll, $customPsm1) +} + +$exportsFolder = Join-Path $PSScriptRoot 'exports' +if(Test-Path $exportsFolder) { + $null = Get-ChildItem -Path $exportsFolder -Recurse -Exclude 'README.md' | Remove-Item -Recurse -ErrorAction SilentlyContinue +} +$null = New-Item -ItemType Directory -Force -Path $exportsFolder + +$internalFolder = Join-Path $PSScriptRoot 'internal' +if(Test-Path $internalFolder) { + $null = Get-ChildItem -Path $internalFolder -Recurse -Exclude '*.psm1', 'README.md' | Remove-Item -Recurse -ErrorAction SilentlyContinue +} +$null = New-Item -ItemType Directory -Force -Path $internalFolder + +$psd1 = Join-Path $PSScriptRoot './Az.EventGrid.psd1' +$guid = Get-ModuleGuid -Psd1Path $psd1 +$moduleName = 'Az.EventGrid' +$examplesFolder = Join-Path $PSScriptRoot 'examples' +$null = New-Item -ItemType Directory -Force -Path $examplesFolder + +Write-Host -ForegroundColor Green 'Creating cmdlets for specified models...' +$modelCmdlets = @() +if ($modelCmdlets.Count -gt 0) { + . (Join-Path $PSScriptRoot 'create-model-cmdlets.ps1') + CreateModelCmdlet($modelCmdlets) +} + +if($NoDocs) { + Write-Host -ForegroundColor Green 'Creating exports...' + Export-ProxyCmdlet -ModuleName $moduleName -ModulePath $modulePaths -ExportsFolder $exportsFolder -InternalFolder $internalFolder -ExcludeDocs -ExamplesFolder $examplesFolder +} else { + Write-Host -ForegroundColor Green 'Creating exports and docs...' + $moduleDescription = 'Microsoft Azure PowerShell: EventGrid cmdlets' + $docsFolder = Join-Path $PSScriptRoot 'docs' + if(Test-Path $docsFolder) { + $null = Get-ChildItem -Path $docsFolder -Recurse -Exclude 'README.md' | Remove-Item -Recurse -ErrorAction SilentlyContinue + } + $null = New-Item -ItemType Directory -Force -Path $docsFolder + Export-ProxyCmdlet -ModuleName $moduleName -ModulePath $modulePaths -ExportsFolder $exportsFolder -InternalFolder $internalFolder -ModuleDescription $moduleDescription -DocsFolder $docsFolder -ExamplesFolder $examplesFolder -ModuleGuid $guid +} + +Write-Host -ForegroundColor Green 'Creating format.ps1xml...' +$formatPs1xml = Join-Path $PSScriptRoot './Az.EventGrid.format.ps1xml' +Export-FormatPs1xml -FilePath $formatPs1xml + +Write-Host -ForegroundColor Green 'Creating psd1...' +$customFolder = Join-Path $PSScriptRoot 'custom' +Export-Psd1 -ExportsFolder $exportsFolder -CustomFolder $customFolder -Psd1Path $psd1 -ModuleGuid $guid + +Write-Host -ForegroundColor Green 'Creating test stubs...' +$testFolder = Join-Path $PSScriptRoot 'test' +$null = New-Item -ItemType Directory -Force -Path $testFolder +Export-TestStub -ModuleName $moduleName -ExportsFolder $exportsFolder -OutputFolder $testFolder + +Write-Host -ForegroundColor Green 'Creating example stubs...' +Export-ExampleStub -ExportsFolder $exportsFolder -OutputFolder $examplesFolder + +Write-Host -ForegroundColor Green '-------------Done-------------' diff --git a/swaggerci/eventgrid/check-dependencies.ps1 b/swaggerci/eventgrid/check-dependencies.ps1 new file mode 100644 index 000000000000..ec3055201a71 --- /dev/null +++ b/swaggerci/eventgrid/check-dependencies.ps1 @@ -0,0 +1,57 @@ +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- +param([switch]$Isolated, [switch]$Accounts, [switch]$Pester, [switch]$Resources) +$ErrorActionPreference = 'Stop' + +if(-not $Isolated) { + Write-Host -ForegroundColor Green 'Creating isolated process...' + $pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path + & "$pwsh" -NoExit -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -Isolated + return +} + +function DownloadModule ([bool]$predicate, [string]$path, [string]$moduleName, [string]$versionMinimum, [string]$requiredVersion) { + if($predicate) { + $module = Get-Module -ListAvailable -Name $moduleName + if((-not $module) -or ($versionMinimum -and ($module | ForEach-Object { $_.Version } | Where-Object { $_ -ge [System.Version]$versionMinimum } | Measure-Object).Count -eq 0) -or ($requiredVersion -and ($module | ForEach-Object { $_.Version } | Where-Object { $_ -eq [System.Version]$requiredVersion } | Measure-Object).Count -eq 0)) { + $null = New-Item -ItemType Directory -Force -Path $path + Write-Host -ForegroundColor Green "Installing local $moduleName module into '$path'..." + if ($requiredVersion) { + Find-Module -Name $moduleName -RequiredVersion $requiredVersion -Repository PSGallery | Save-Module -Path $path + }elseif($versionMinimum) { + Find-Module -Name $moduleName -MinimumVersion $versionMinimum -Repository PSGallery | Save-Module -Path $path + } else { + Find-Module -Name $moduleName -Repository PSGallery | Save-Module -Path $path + } + } + } +} + +$ProgressPreference = 'SilentlyContinue' +$all = (@($Accounts.IsPresent, $Pester.IsPresent) | Select-Object -Unique | Measure-Object).Count -eq 1 + +$localModulesPath = Join-Path $PSScriptRoot 'generated/modules' +if(Test-Path -Path $localModulesPath) { + $env:PSModulePath = "$localModulesPath$([IO.Path]::PathSeparator)$env:PSModulePath" +} + +DownloadModule -predicate ($all -or $Accounts) -path $localModulesPath -moduleName 'Az.Accounts' -versionMinimum '2.7.5' +DownloadModule -predicate ($all -or $Pester) -path $localModulesPath -moduleName 'Pester' -requiredVersion '4.10.1' + +$tools = Join-Path $PSScriptRoot 'tools' +$resourceDir = Join-Path $tools 'Resources' +$resourceModule = Join-Path $HOME '.PSSharedModules\Resources\Az.Resources.TestSupport.psm1' + +if ($Resources.IsPresent -and ((-not (Test-Path -Path $resourceModule)) -or $RegenerateSupportModule.IsPresent)) { + Write-Host -ForegroundColor Green "Building local Resource module used for test..." + Set-Location $resourceDir + $null = autorest .\README.md --use:@autorest/powershell@3.0.414 --output-folder=$HOME/.PSSharedModules/Resources + $null = Copy-Item custom/* $HOME/.PSSharedModules/Resources/custom/ + Set-Location $HOME/.PSSharedModules/Resources + $null = .\build-module.ps1 + Set-Location $PSScriptRoot +} diff --git a/swaggerci/eventgrid/create-model-cmdlets.ps1 b/swaggerci/eventgrid/create-model-cmdlets.ps1 new file mode 100644 index 000000000000..1ce75e45b308 --- /dev/null +++ b/swaggerci/eventgrid/create-model-cmdlets.ps1 @@ -0,0 +1,163 @@ +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +function CreateModelCmdlet { + + param([string[]]$Models) + + if ($Models.Count -eq 0) + { + return + } + + $ModelCsPath = Join-Path (Join-Path $PSScriptRoot 'generated/api') 'Models' + $ModuleName = 'EventGrid' + $OutputDir = Join-Path $PSScriptRoot 'custom/autogen-model-cmdlets' + $null = New-Item -ItemType Directory -Force -Path $OutputDir + + $CsFiles = Get-ChildItem -Path $ModelCsPath -Recurse -Filter *.cs + $Content = '' + $null = $CsFiles | ForEach-Object -Process { if ($_.Name.Split('.').count -eq 2 ) + { $Content += get-content $_.fullname -raw + } } + + $Tree = [Microsoft.CodeAnalysis.CSharp.SyntaxFactory]::ParseCompilationUnit($Content) + $Nodes = $Tree.ChildNodes().ChildNodes() + foreach ($Model in $Models) + { + $InterfaceNode = $Nodes | Where-Object { ($_.Keyword.value -eq 'interface') -and ($_.Identifier.value -eq "I$Model") } + if ($InterfaceNode.count -eq 0) { + continue + } + # through a queue, we iterate all the parent models. + $Queue = @($InterfaceNode) + $visited = @("I$Model") + $AllInterfaceNodes = @() + while ($Queue.count -ne 0) + { + $AllInterfaceNodes += $Queue[0] + # Baselist contains the direct parent models. + foreach ($parent in $Queue[0].BaseList.Types) + { + if (($parent.Type.Right.Identifier.Value -ne 'IJsonSerializable') -and (-not $visited.Contains($parent.Type.Right.Identifier.Value))) + { + $Queue = [Array]$Queue + ($Nodes | Where-Object { ($_.Keyword.value -eq 'interface') -and ($_.Identifier.value -eq $parent.Type.Right.Identifier.Value) }) + $visited = [Array]$visited + $parent.Type.Right.Identifier.Value + } + } + $first, $Queue = $Queue + } + + $Namespace = $InterfaceNode.Parent.Name + $ObjectType = $Model + $ObjectTypeWithNamespace = "${Namespace}.${ObjectType}" + # remove duplicated module name + if ($ObjectType.StartsWith($ModuleName)) { + $ModulePrefix = '' + } else { + $ModulePrefix = $ModuleName + } + $OutputPath = Join-Path -ChildPath "New-Az${ModulePrefix}${ObjectType}Object.ps1" -Path $OutputDir + + $ParameterDefineScriptList = New-Object System.Collections.Generic.List[string] + $ParameterAssignScriptList = New-Object System.Collections.Generic.List[string] + foreach ($Node in $AllInterfaceNodes) + { + foreach ($Member in $Node.Members) + { + $Arguments = $Member.AttributeLists.Attributes.ArgumentList.Arguments + $Required = $false + $Description = "" + $Readonly = $False + foreach ($Argument in $Arguments) + { + if ($Argument.NameEquals.Name.Identifier.Value -eq "Required") + { + $Required = $Argument.Expression.Token.Value + } + if ($Argument.NameEquals.Name.Identifier.Value -eq "Description") + { + $Description = $Argument.Expression.Token.Value.Trim('.').replace('"', '`"') + } + if ($Argument.NameEquals.Name.Identifier.Value -eq "Readonly") + { + $Readonly = $Argument.Expression.Token.Value + } + } + if ($Readonly) + { + continue + } + $Identifier = $Member.Identifier.Value + $Type = $Member.Type.ToString().replace('?', '').Split("::")[-1] + $ParameterDefinePropertyList = New-Object System.Collections.Generic.List[string] + if ($Required) + { + $ParameterDefinePropertyList.Add("Mandatory") + } + if ($Description -ne "") + { + $ParameterDefinePropertyList.Add("HelpMessage=`"${Description}.`"") + } + $ParameterDefineProperty = [System.String]::Join(", ", $ParameterDefinePropertyList) + # check whether completer is needed + $completer = ''; + if($Type.Split('.').Split('.')[-2] -eq 'Support') { + # If Type is an array, need to strip [] + $strippedType = $Type.Replace('[]', '') + $completer += "`n [ArgumentCompleter([${strippedType}])]" + } + $ParameterDefineScript = " + [Parameter($ParameterDefineProperty)]${completer} + [${Type}] + `$${Identifier}" + $ParameterDefineScriptList.Add($ParameterDefineScript) + $ParameterAssignScriptList.Add(" + if (`$PSBoundParameters.ContainsKey('${Identifier}')) { + `$Object.${Identifier} = `$${Identifier} + }") + } + } + $ParameterDefineScript = $ParameterDefineScriptList | Join-String -Separator "," + $ParameterAssignScript = $ParameterAssignScriptList | Join-String -Separator "" + + $Script = " +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Create an in-memory object for ${ObjectType}. +.Description +Create an in-memory object for ${ObjectType}. + +.Outputs +${ObjectTypeWithNamespace} +.Link +https://docs.microsoft.com/en-us/powershell/module/az.${ModuleName}/new-Az${ModulePrefix}${ObjectType}Object +#> +function New-Az${ModulePrefix}${ObjectType}Object { + [OutputType('${ObjectTypeWithNamespace}')] + [CmdletBinding(PositionalBinding=`$false)] + Param( +${ParameterDefineScript} + ) + + process { + `$Object = [${ObjectTypeWithNamespace}]::New() +${ParameterAssignScript} + return `$Object + } +} +" + Set-Content -Path $OutputPath -Value $Script + } +} diff --git a/swaggerci/eventgrid/custom/Az.EventGrid.custom.psm1 b/swaggerci/eventgrid/custom/Az.EventGrid.custom.psm1 new file mode 100644 index 000000000000..2fc634378d25 --- /dev/null +++ b/swaggerci/eventgrid/custom/Az.EventGrid.custom.psm1 @@ -0,0 +1,17 @@ +# region Generated + # Load the private module dll + $null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '../bin/Az.EventGrid.private.dll') + + # Load the internal module + $internalModulePath = Join-Path $PSScriptRoot '../internal/Az.EventGrid.internal.psm1' + if(Test-Path $internalModulePath) { + $null = Import-Module -Name $internalModulePath + } + + # Export nothing to clear implicit exports + Export-ModuleMember + + # Export script cmdlets + Get-ChildItem -Path $PSScriptRoot -Recurse -Include '*.ps1' -File | ForEach-Object { . $_.FullName } + Export-ModuleMember -Function (Get-ScriptCmdlet -ScriptFolder $PSScriptRoot) -Alias (Get-ScriptCmdlet -ScriptFolder $PSScriptRoot -AsAlias) +# endregion diff --git a/swaggerci/eventgrid/custom/README.md b/swaggerci/eventgrid/custom/README.md new file mode 100644 index 000000000000..65def177084a --- /dev/null +++ b/swaggerci/eventgrid/custom/README.md @@ -0,0 +1,41 @@ +# Custom +This directory contains custom implementation for non-generated cmdlets for the `Az.EventGrid` module. Both scripts (`.ps1`) and C# files (`.cs`) can be implemented here. They will be used during the build process in `build-module.ps1`, and create cmdlets into the `../exports` folder. The only generated file into this folder is the `Az.EventGrid.custom.psm1`. This file should not be modified. + +## Info +- Modifiable: yes +- Generated: partial +- Committed: yes +- Packaged: yes + +## Details +For `Az.EventGrid` to use custom cmdlets, it does this two different ways. We **highly recommend** creating script cmdlets, as they are easier to write and allow access to the other exported cmdlets. C# cmdlets *cannot access exported cmdlets*. + +For C# cmdlets, they are compiled with the rest of the generated low-level cmdlets into the `./bin/Az.EventGrid.private.dll`. The names of the cmdlets (methods) and files must follow the `[cmdletName]_[variantName]` syntax used for generated cmdlets. The `variantName` is used as the `ParameterSetName`, so use something appropriate that doesn't clash with already created variant or parameter set names. You cannot use the `ParameterSetName` property in the `Parameter` attribute on C# cmdlets. Each cmdlet must be separated into variants using the same pattern as seen in the `generated/cmdlets` folder. + +For script cmdlets, these are loaded via the `Az.EventGrid.custom.psm1`. Then, during the build process, this module is loaded and processed in the same manner as the C# cmdlets. The fundamental difference is the script cmdlets use the `ParameterSetName` attribute and C# cmdlets do not. To create a script cmdlet variant of a generated cmdlet, simply decorate all parameters in the script with the new `ParameterSetName` in the `Parameter` attribute. This will appropriately treat each parameter set as a separate variant when processed to be exported during the build. + +## Purpose +This allows the modules to have cmdlets that were not defined in the REST specification. It also allows combining logic using generated cmdlets. This is a level of customization beyond what can be done using the [readme configuration options](https://github.com/Azure/autorest/blob/master/docs/powershell/options.md) that are currently available. These custom cmdlets are then referenced by the cmdlets created at build-time in the `../exports` folder. + +## Usage +The easiest way currently to start developing custom cmdlets is to copy an existing cmdlet. For C# cmdlets, copy one from the `generated/cmdlets` folder. For script cmdlets, build the project using `build-module.ps1` and copy one of the scripts from the `../exports` folder. After that, if you want to add new parameter sets, follow the guidelines in the `Details` section above. For implementing a new cmdlets, at minimum, please keep these parameters: +- Break +- DefaultProfile +- HttpPipelineAppend +- HttpPipelinePrepend +- Proxy +- ProxyCredential +- ProxyUseDefaultCredentials + +These provide functionality to our HTTP pipeline and other useful features. In script, you can forward these parameters using `$PSBoundParameters` to the other cmdlets you're calling within `Az.EventGrid`. For C#, follow the usage seen in the `ProcessRecordAsync` method. + +### Attributes +For processing the cmdlets, we've created some additional attributes: +- `Microsoft.Azure.PowerShell.Cmdlets.EventGrid.DescriptionAttribute` + - Used in C# cmdlets to provide a high-level description of the cmdlet. This is propagated to reference documentation via [help comments](https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_comment_based_help) in the exported scripts. +- `Microsoft.Azure.PowerShell.Cmdlets.EventGrid.DoNotExportAttribute` + - Used in C# and script cmdlets to suppress creating an exported cmdlet at build-time. These cmdlets will *not be exposed* by `Az.EventGrid`. +- `Microsoft.Azure.PowerShell.Cmdlets.EventGrid.InternalExportAttribute` + - Used in C# cmdlets to route exported cmdlets to the `../internal`, which are *not exposed* by `Az.EventGrid`. For more information, see [README.md](../internal/README.md) in the `../internal` folder. +- `Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ProfileAttribute` + - Used in C# and script cmdlets to define which Azure profiles the cmdlet supports. This is only supported for Azure (`--azure`) modules. \ No newline at end of file diff --git a/swaggerci/eventgrid/docs/Az.EventGrid.md b/swaggerci/eventgrid/docs/Az.EventGrid.md new file mode 100644 index 000000000000..573842b70b26 --- /dev/null +++ b/swaggerci/eventgrid/docs/Az.EventGrid.md @@ -0,0 +1,312 @@ +--- +Module Name: Az.EventGrid +Module Guid: 81899402-b274-4991-afb3-de0af64abf19 +Download Help Link: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid +Help Version: 1.0.0.0 +Locale: en-US +--- + +# Az.EventGrid Module +## Description +Microsoft Azure PowerShell: EventGrid cmdlets + +## Az.EventGrid Cmdlets +### [Get-AzEventGridChannel](Get-AzEventGridChannel.md) +Get properties of a channel. + +### [Get-AzEventGridChannelFullUrl](Get-AzEventGridChannelFullUrl.md) +Get the full endpoint URL of a partner destination channel. + +### [Get-AzEventGridDomain](Get-AzEventGridDomain.md) +Get properties of a domain. + +### [Get-AzEventGridDomainEventSubscription](Get-AzEventGridDomainEventSubscription.md) +Get properties of an event subscription of a domain. + +### [Get-AzEventGridDomainEventSubscriptionDeliveryAttribute](Get-AzEventGridDomainEventSubscriptionDeliveryAttribute.md) +Get all delivery attributes for an event subscription for domain. + +### [Get-AzEventGridDomainEventSubscriptionFullUrl](Get-AzEventGridDomainEventSubscriptionFullUrl.md) +Get the full endpoint URL for an event subscription for domain. + +### [Get-AzEventGridDomainSharedAccessKey](Get-AzEventGridDomainSharedAccessKey.md) +List the two keys used to publish to a domain. + +### [Get-AzEventGridDomainTopic](Get-AzEventGridDomainTopic.md) +Get properties of a domain topic. + +### [Get-AzEventGridDomainTopicEventSubscription](Get-AzEventGridDomainTopicEventSubscription.md) +Get properties of a nested event subscription for a domain topic. + +### [Get-AzEventGridDomainTopicEventSubscriptionDeliveryAttribute](Get-AzEventGridDomainTopicEventSubscriptionDeliveryAttribute.md) +Get all delivery attributes for an event subscription for domain topic. + +### [Get-AzEventGridDomainTopicEventSubscriptionFullUrl](Get-AzEventGridDomainTopicEventSubscriptionFullUrl.md) +Get the full endpoint URL for a nested event subscription for domain topic. + +### [Get-AzEventGridEventChannel](Get-AzEventGridEventChannel.md) +Get properties of an event channel. + +### [Get-AzEventGridEventSubscription](Get-AzEventGridEventSubscription.md) +Get properties of an event subscription. + +### [Get-AzEventGridEventSubscriptionDeliveryAttribute](Get-AzEventGridEventSubscriptionDeliveryAttribute.md) +Get all delivery attributes for an event subscription. + +### [Get-AzEventGridEventSubscriptionFullUrl](Get-AzEventGridEventSubscriptionFullUrl.md) +Get the full endpoint URL for an event subscription. + +### [Get-AzEventGridEventSubscriptionGlobal](Get-AzEventGridEventSubscriptionGlobal.md) +List all aggregated global event subscriptions under a specific Azure subscription. + +### [Get-AzEventGridEventSubscriptionRegional](Get-AzEventGridEventSubscriptionRegional.md) +List all event subscriptions from the given location under a specific Azure subscription. + +### [Get-AzEventGridExtensionTopic](Get-AzEventGridExtensionTopic.md) +Get the properties of an extension topic. + +### [Get-AzEventGridPartnerConfiguration](Get-AzEventGridPartnerConfiguration.md) +Get properties of a partner configuration. + +### [Get-AzEventGridPartnerDestination](Get-AzEventGridPartnerDestination.md) +Get properties of a partner destination. + +### [Get-AzEventGridPartnerNamespace](Get-AzEventGridPartnerNamespace.md) +Get properties of a partner namespace. + +### [Get-AzEventGridPartnerNamespaceSharedAccessKey](Get-AzEventGridPartnerNamespaceSharedAccessKey.md) +List the two keys used to publish to a partner namespace. + +### [Get-AzEventGridPartnerRegistration](Get-AzEventGridPartnerRegistration.md) +Gets a partner registration with the specified parameters. + +### [Get-AzEventGridPartnerTopic](Get-AzEventGridPartnerTopic.md) +Get properties of a partner topic. + +### [Get-AzEventGridPartnerTopicEventSubscription](Get-AzEventGridPartnerTopicEventSubscription.md) +Get properties of an event subscription of a partner topic. + +### [Get-AzEventGridPartnerTopicEventSubscriptionDeliveryAttribute](Get-AzEventGridPartnerTopicEventSubscriptionDeliveryAttribute.md) +Get all delivery attributes for an event subscription of a partner topic. + +### [Get-AzEventGridPartnerTopicEventSubscriptionFullUrl](Get-AzEventGridPartnerTopicEventSubscriptionFullUrl.md) +Get the full endpoint URL for an event subscription of a partner topic. + +### [Get-AzEventGridPrivateEndpointConnection](Get-AzEventGridPrivateEndpointConnection.md) +Get a specific private endpoint connection under a topic, domain, or partner namespace. + +### [Get-AzEventGridPrivateLinkResource](Get-AzEventGridPrivateLinkResource.md) +Get properties of a private link resource. + +### [Get-AzEventGridSystemTopic](Get-AzEventGridSystemTopic.md) +Get properties of a system topic. + +### [Get-AzEventGridSystemTopicEventSubscription](Get-AzEventGridSystemTopicEventSubscription.md) +Get an event subscription. + +### [Get-AzEventGridSystemTopicEventSubscriptionDeliveryAttribute](Get-AzEventGridSystemTopicEventSubscriptionDeliveryAttribute.md) +Get all delivery attributes for an event subscription. + +### [Get-AzEventGridSystemTopicEventSubscriptionFullUrl](Get-AzEventGridSystemTopicEventSubscriptionFullUrl.md) +Get the full endpoint URL for an event subscription of a system topic. + +### [Get-AzEventGridTopic](Get-AzEventGridTopic.md) +Get properties of a topic. + +### [Get-AzEventGridTopicEventSubscription](Get-AzEventGridTopicEventSubscription.md) +Get properties of an event subscription of a topic. + +### [Get-AzEventGridTopicEventSubscriptionDeliveryAttribute](Get-AzEventGridTopicEventSubscriptionDeliveryAttribute.md) +Get all delivery attributes for an event subscription for topic. + +### [Get-AzEventGridTopicEventSubscriptionFullUrl](Get-AzEventGridTopicEventSubscriptionFullUrl.md) +Get the full endpoint URL for an event subscription for topic. + +### [Get-AzEventGridTopicEventType](Get-AzEventGridTopicEventType.md) +List event types for a topic. + +### [Get-AzEventGridTopicSharedAccessKey](Get-AzEventGridTopicSharedAccessKey.md) +List the two keys used to publish to a topic. + +### [Get-AzEventGridTopicType](Get-AzEventGridTopicType.md) +Get information about a topic type. + +### [Get-AzEventGridTopicTypeEventType](Get-AzEventGridTopicTypeEventType.md) +List event types for a topic type. + +### [Get-AzEventGridVerifiedPartner](Get-AzEventGridVerifiedPartner.md) +Get properties of a verified partner. + +### [Grant-AzEventGridPartnerConfigurationPartner](Grant-AzEventGridPartnerConfigurationPartner.md) +Authorize a single partner either by partner registration immutable Id or by partner name. + +### [Initialize-AzEventGridPartnerDestination](Initialize-AzEventGridPartnerDestination.md) +Activate a newly created partner destination. + +### [Initialize-AzEventGridPartnerTopic](Initialize-AzEventGridPartnerTopic.md) +Activate a newly created partner topic. + +### [Invoke-AzEventGridDeactivatePartnerTopic](Invoke-AzEventGridDeactivatePartnerTopic.md) +Deactivate specific partner topic. + +### [Invoke-AzEventGridPartnerConfigurationUnauthorize](Invoke-AzEventGridPartnerConfigurationUnauthorize.md) +Unauthorize a single partner either by partner registration immutable Id or by partner name. + +### [New-AzEventGridChannel](New-AzEventGridChannel.md) +Synchronously creates or updates a new channel with the specified parameters. + +### [New-AzEventGridDomain](New-AzEventGridDomain.md) +Asynchronously creates or updates a new domain with the specified parameters. + +### [New-AzEventGridDomainEventSubscription](New-AzEventGridDomainEventSubscription.md) +Asynchronously creates a new event subscription or updates an existing event subscription. + +### [New-AzEventGridDomainKey](New-AzEventGridDomainKey.md) +Regenerate a shared access key for a domain. + +### [New-AzEventGridDomainTopicEventSubscription](New-AzEventGridDomainTopicEventSubscription.md) +Asynchronously creates a new event subscription or updates an existing event subscription. + +### [New-AzEventGridEventChannel](New-AzEventGridEventChannel.md) +Asynchronously creates a new event channel with the specified parameters. + +### [New-AzEventGridEventSubscription](New-AzEventGridEventSubscription.md) +Asynchronously creates a new event subscription or updates an existing event subscription based on the specified scope. + +### [New-AzEventGridPartnerConfiguration](New-AzEventGridPartnerConfiguration.md) +Synchronously creates or updates a partner configuration with the specified parameters. + +### [New-AzEventGridPartnerDestination](New-AzEventGridPartnerDestination.md) +Asynchronously creates a new partner destination with the specified parameters. + +### [New-AzEventGridPartnerNamespace](New-AzEventGridPartnerNamespace.md) +Asynchronously creates a new partner namespace with the specified parameters. + +### [New-AzEventGridPartnerNamespaceKey](New-AzEventGridPartnerNamespaceKey.md) +Regenerate a shared access key for a partner namespace. + +### [New-AzEventGridPartnerRegistration](New-AzEventGridPartnerRegistration.md) +Creates a new partner registration with the specified parameters. + +### [New-AzEventGridPartnerTopic](New-AzEventGridPartnerTopic.md) +Asynchronously creates a new partner topic with the specified parameters. + +### [New-AzEventGridPartnerTopicEventSubscription](New-AzEventGridPartnerTopicEventSubscription.md) +Asynchronously creates or updates an event subscription of a partner topic with the specified parameters. +Existing event subscriptions will be updated with this API. + +### [New-AzEventGridSystemTopic](New-AzEventGridSystemTopic.md) +Asynchronously creates a new system topic with the specified parameters. + +### [New-AzEventGridSystemTopicEventSubscription](New-AzEventGridSystemTopicEventSubscription.md) +Asynchronously creates or updates an event subscription with the specified parameters. +Existing event subscriptions will be updated with this API. + +### [New-AzEventGridTopic](New-AzEventGridTopic.md) +Asynchronously creates a new topic with the specified parameters. + +### [New-AzEventGridTopicEventSubscription](New-AzEventGridTopicEventSubscription.md) +Asynchronously creates a new event subscription or updates an existing event subscription. + +### [New-AzEventGridTopicKey](New-AzEventGridTopicKey.md) +Regenerate a shared access key for a topic. + +### [Remove-AzEventGridChannel](Remove-AzEventGridChannel.md) +Delete an existing channel. + +### [Remove-AzEventGridDomain](Remove-AzEventGridDomain.md) +Delete existing domain. + +### [Remove-AzEventGridDomainEventSubscription](Remove-AzEventGridDomainEventSubscription.md) +Delete an existing event subscription for a domain. + +### [Remove-AzEventGridDomainTopic](Remove-AzEventGridDomainTopic.md) +Delete existing domain topic. + +### [Remove-AzEventGridDomainTopicEventSubscription](Remove-AzEventGridDomainTopicEventSubscription.md) +Delete a nested existing event subscription for a domain topic. + +### [Remove-AzEventGridEventChannel](Remove-AzEventGridEventChannel.md) +Delete existing event channel. + +### [Remove-AzEventGridEventSubscription](Remove-AzEventGridEventSubscription.md) +Delete an existing event subscription. + +### [Remove-AzEventGridPartnerConfiguration](Remove-AzEventGridPartnerConfiguration.md) +Delete existing partner configuration. + +### [Remove-AzEventGridPartnerDestination](Remove-AzEventGridPartnerDestination.md) +Delete existing partner destination. + +### [Remove-AzEventGridPartnerNamespace](Remove-AzEventGridPartnerNamespace.md) +Delete existing partner namespace. + +### [Remove-AzEventGridPartnerRegistration](Remove-AzEventGridPartnerRegistration.md) +Deletes a partner registration with the specified parameters. + +### [Remove-AzEventGridPartnerTopic](Remove-AzEventGridPartnerTopic.md) +Delete existing partner topic. + +### [Remove-AzEventGridPartnerTopicEventSubscription](Remove-AzEventGridPartnerTopicEventSubscription.md) +Delete an existing event subscription of a partner topic. + +### [Remove-AzEventGridPrivateEndpointConnection](Remove-AzEventGridPrivateEndpointConnection.md) +Delete a specific private endpoint connection under a topic, domain, or partner namespace. + +### [Remove-AzEventGridSystemTopic](Remove-AzEventGridSystemTopic.md) +Delete existing system topic. + +### [Remove-AzEventGridSystemTopicEventSubscription](Remove-AzEventGridSystemTopicEventSubscription.md) +Delete an existing event subscription of a system topic. + +### [Remove-AzEventGridTopic](Remove-AzEventGridTopic.md) +Delete existing topic. + +### [Remove-AzEventGridTopicEventSubscription](Remove-AzEventGridTopicEventSubscription.md) +Delete an existing event subscription for a topic. + +### [Update-AzEventGridChannel](Update-AzEventGridChannel.md) +Synchronously updates a channel with the specified parameters. + +### [Update-AzEventGridDomain](Update-AzEventGridDomain.md) +Asynchronously updates a domain with the specified parameters. + +### [Update-AzEventGridDomainEventSubscription](Update-AzEventGridDomainEventSubscription.md) +Update an existing event subscription for a topic. + +### [Update-AzEventGridDomainTopicEventSubscription](Update-AzEventGridDomainTopicEventSubscription.md) +Update an existing event subscription for a domain topic. + +### [Update-AzEventGridEventSubscription](Update-AzEventGridEventSubscription.md) +Asynchronously updates an existing event subscription. + +### [Update-AzEventGridPartnerConfiguration](Update-AzEventGridPartnerConfiguration.md) +Synchronously updates a partner configuration with the specified parameters. + +### [Update-AzEventGridPartnerDestination](Update-AzEventGridPartnerDestination.md) +Asynchronously updates a partner destination with the specified parameters. + +### [Update-AzEventGridPartnerNamespace](Update-AzEventGridPartnerNamespace.md) +Asynchronously updates a partner namespace with the specified parameters. + +### [Update-AzEventGridPartnerRegistration](Update-AzEventGridPartnerRegistration.md) +Updates a partner registration with the specified parameters. + +### [Update-AzEventGridPartnerTopic](Update-AzEventGridPartnerTopic.md) +Asynchronously updates a partner topic with the specified parameters. + +### [Update-AzEventGridPartnerTopicEventSubscription](Update-AzEventGridPartnerTopicEventSubscription.md) +Update an existing event subscription of a partner topic. + +### [Update-AzEventGridSystemTopic](Update-AzEventGridSystemTopic.md) +Asynchronously updates a system topic with the specified parameters. + +### [Update-AzEventGridSystemTopicEventSubscription](Update-AzEventGridSystemTopicEventSubscription.md) +Update an existing event subscription of a system topic. + +### [Update-AzEventGridTopic](Update-AzEventGridTopic.md) +Asynchronously updates a topic with the specified parameters. + +### [Update-AzEventGridTopicEventSubscription](Update-AzEventGridTopicEventSubscription.md) +Update an existing event subscription for a topic. + diff --git a/swaggerci/eventgrid/docs/Get-AzEventGridChannel.md b/swaggerci/eventgrid/docs/Get-AzEventGridChannel.md new file mode 100644 index 000000000000..6d019e5cdfe1 --- /dev/null +++ b/swaggerci/eventgrid/docs/Get-AzEventGridChannel.md @@ -0,0 +1,254 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgridchannel +schema: 2.0.0 +--- + +# Get-AzEventGridChannel + +## SYNOPSIS +Get properties of a channel. + +## SYNTAX + +### List (Default) +``` +Get-AzEventGridChannel -PartnerNamespaceName -ResourceGroupName [-SubscriptionId ] + [-Filter ] [-Top ] [-DefaultProfile ] [-PassThru] [] +``` + +### Get +``` +Get-AzEventGridChannel -Name -PartnerNamespaceName -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [-PassThru] [] +``` + +### GetViaIdentity +``` +Get-AzEventGridChannel -InputObject [-DefaultProfile ] [-PassThru] + [] +``` + +## DESCRIPTION +Get properties of a channel. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Filter +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'. + +```yaml +Type: System.String +Parameter Sets: List +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +Name of the channel. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: ChannelName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PartnerNamespaceName +Name of the partner namespace. + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the partners subscription. + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription credentials that uniquely identify a Microsoft Azure subscription. +The subscription ID forms part of the URI for every service call. + +```yaml +Type: System.String[] +Parameter Sets: Get, List +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Top +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. + +```yaml +Type: System.Int32 +Parameter Sets: List +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannel + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[ChannelName ]`: Name of the channel. + - `[DomainName ]`: Name of the domain. + - `[DomainTopicName ]`: Name of the topic. + - `[EventChannelName ]`: Name of the event channel. + - `[EventSubscriptionName ]`: Name of the event subscription. + - `[Id ]`: Resource identity path + - `[Location ]`: Name of the location. + - `[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\'. + - `[PartnerDestinationName ]`: Name of the partner destination. + - `[PartnerNamespaceName ]`: Name of the partner namespace. + - `[PartnerRegistrationName ]`: Name of the partner registration. + - `[PartnerTopicName ]`: Name of the partner topic. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection connection. + - `[PrivateLinkResourceName ]`: The name of private link resource. + - `[ProviderNamespace ]`: Namespace of the provider of the topic. + - `[ResourceGroupName ]`: The name of the resource group within the partners subscription. + - `[ResourceName ]`: Name of the resource. + - `[ResourceTypeName ]`: Name of the resource type. + - `[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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + - `[SubscriptionId ]`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + - `[SystemTopicName ]`: Name of the system topic. + - `[TopicName ]`: Name of the domain topic. + - `[TopicTypeName ]`: Name of the topic type. + - `[VerifiedPartnerName ]`: Name of the verified partner. + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/Get-AzEventGridChannelFullUrl.md b/swaggerci/eventgrid/docs/Get-AzEventGridChannelFullUrl.md new file mode 100644 index 000000000000..b85b26a85830 --- /dev/null +++ b/swaggerci/eventgrid/docs/Get-AzEventGridChannelFullUrl.md @@ -0,0 +1,243 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgridchannelfullurl +schema: 2.0.0 +--- + +# Get-AzEventGridChannelFullUrl + +## SYNOPSIS +Get the full endpoint URL of a partner destination channel. + +## SYNTAX + +### Get (Default) +``` +Get-AzEventGridChannelFullUrl -ChannelName -PartnerNamespaceName -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] + [] +``` + +### GetViaIdentity +``` +Get-AzEventGridChannelFullUrl -InputObject [-DefaultProfile ] [-PassThru] + [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Get the full endpoint URL of a partner destination channel. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -ChannelName +Name of the Channel. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -PartnerNamespaceName +Name of the partner namespace. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the partners subscription. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription credentials that uniquely identify a Microsoft Azure subscription. +The subscription ID forms part of the URI for every service call. + +```yaml +Type: System.String[] +Parameter Sets: Get +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity + +## OUTPUTS + +### System.String + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[ChannelName ]`: Name of the channel. + - `[DomainName ]`: Name of the domain. + - `[DomainTopicName ]`: Name of the topic. + - `[EventChannelName ]`: Name of the event channel. + - `[EventSubscriptionName ]`: Name of the event subscription. + - `[Id ]`: Resource identity path + - `[Location ]`: Name of the location. + - `[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\'. + - `[PartnerDestinationName ]`: Name of the partner destination. + - `[PartnerNamespaceName ]`: Name of the partner namespace. + - `[PartnerRegistrationName ]`: Name of the partner registration. + - `[PartnerTopicName ]`: Name of the partner topic. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection connection. + - `[PrivateLinkResourceName ]`: The name of private link resource. + - `[ProviderNamespace ]`: Namespace of the provider of the topic. + - `[ResourceGroupName ]`: The name of the resource group within the partners subscription. + - `[ResourceName ]`: Name of the resource. + - `[ResourceTypeName ]`: Name of the resource type. + - `[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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + - `[SubscriptionId ]`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + - `[SystemTopicName ]`: Name of the system topic. + - `[TopicName ]`: Name of the domain topic. + - `[TopicTypeName ]`: Name of the topic type. + - `[VerifiedPartnerName ]`: Name of the verified partner. + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/Get-AzEventGridDomain.md b/swaggerci/eventgrid/docs/Get-AzEventGridDomain.md new file mode 100644 index 000000000000..cc5c964ada50 --- /dev/null +++ b/swaggerci/eventgrid/docs/Get-AzEventGridDomain.md @@ -0,0 +1,245 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgriddomain +schema: 2.0.0 +--- + +# Get-AzEventGridDomain + +## SYNOPSIS +Get properties of a domain. + +## SYNTAX + +### List (Default) +``` +Get-AzEventGridDomain [-SubscriptionId ] [-Filter ] [-Top ] + [-DefaultProfile ] [-PassThru] [] +``` + +### Get +``` +Get-AzEventGridDomain -Name -ResourceGroupName [-SubscriptionId ] + [-DefaultProfile ] [-PassThru] [] +``` + +### GetViaIdentity +``` +Get-AzEventGridDomain -InputObject [-DefaultProfile ] [-PassThru] + [] +``` + +### List1 +``` +Get-AzEventGridDomain -ResourceGroupName [-SubscriptionId ] [-Filter ] + [-Top ] [-DefaultProfile ] [-PassThru] [] +``` + +## DESCRIPTION +Get properties of a domain. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Filter +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'. + +```yaml +Type: System.String +Parameter Sets: List, List1 +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +Name of the domain. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: DomainName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. + +```yaml +Type: System.String +Parameter Sets: Get, List1 +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription credentials that uniquely identify a Microsoft Azure subscription. +The subscription ID forms part of the URI for every service call. + +```yaml +Type: System.String[] +Parameter Sets: Get, List, List1 +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Top +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. + +```yaml +Type: System.Int32 +Parameter Sets: List, List1 +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomain + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[ChannelName ]`: Name of the channel. + - `[DomainName ]`: Name of the domain. + - `[DomainTopicName ]`: Name of the topic. + - `[EventChannelName ]`: Name of the event channel. + - `[EventSubscriptionName ]`: Name of the event subscription. + - `[Id ]`: Resource identity path + - `[Location ]`: Name of the location. + - `[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\'. + - `[PartnerDestinationName ]`: Name of the partner destination. + - `[PartnerNamespaceName ]`: Name of the partner namespace. + - `[PartnerRegistrationName ]`: Name of the partner registration. + - `[PartnerTopicName ]`: Name of the partner topic. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection connection. + - `[PrivateLinkResourceName ]`: The name of private link resource. + - `[ProviderNamespace ]`: Namespace of the provider of the topic. + - `[ResourceGroupName ]`: The name of the resource group within the partners subscription. + - `[ResourceName ]`: Name of the resource. + - `[ResourceTypeName ]`: Name of the resource type. + - `[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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + - `[SubscriptionId ]`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + - `[SystemTopicName ]`: Name of the system topic. + - `[TopicName ]`: Name of the domain topic. + - `[TopicTypeName ]`: Name of the topic type. + - `[VerifiedPartnerName ]`: Name of the verified partner. + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/Get-AzEventGridDomainEventSubscription.md b/swaggerci/eventgrid/docs/Get-AzEventGridDomainEventSubscription.md new file mode 100644 index 000000000000..3a27347a0c3a --- /dev/null +++ b/swaggerci/eventgrid/docs/Get-AzEventGridDomainEventSubscription.md @@ -0,0 +1,257 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgriddomaineventsubscription +schema: 2.0.0 +--- + +# Get-AzEventGridDomainEventSubscription + +## SYNOPSIS +Get properties of an event subscription of a domain. + +## SYNTAX + +### List (Default) +``` +Get-AzEventGridDomainEventSubscription -DomainName -ResourceGroupName + [-SubscriptionId ] [-Filter ] [-Top ] [-DefaultProfile ] [-PassThru] + [] +``` + +### Get +``` +Get-AzEventGridDomainEventSubscription -DomainName -EventSubscriptionName + -ResourceGroupName [-SubscriptionId ] [-DefaultProfile ] [-PassThru] + [] +``` + +### GetViaIdentity +``` +Get-AzEventGridDomainEventSubscription -InputObject [-DefaultProfile ] + [-PassThru] [] +``` + +## DESCRIPTION +Get properties of an event subscription of a domain. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DomainName +Name of the partner topic. + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -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. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Filter +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'. + +```yaml +Type: System.String +Parameter Sets: List +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription credentials that uniquely identify a Microsoft Azure subscription. +The subscription ID forms part of the URI for every service call. + +```yaml +Type: System.String[] +Parameter Sets: Get, List +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Top +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. + +```yaml +Type: System.Int32 +Parameter Sets: List +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[ChannelName ]`: Name of the channel. + - `[DomainName ]`: Name of the domain. + - `[DomainTopicName ]`: Name of the topic. + - `[EventChannelName ]`: Name of the event channel. + - `[EventSubscriptionName ]`: Name of the event subscription. + - `[Id ]`: Resource identity path + - `[Location ]`: Name of the location. + - `[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\'. + - `[PartnerDestinationName ]`: Name of the partner destination. + - `[PartnerNamespaceName ]`: Name of the partner namespace. + - `[PartnerRegistrationName ]`: Name of the partner registration. + - `[PartnerTopicName ]`: Name of the partner topic. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection connection. + - `[PrivateLinkResourceName ]`: The name of private link resource. + - `[ProviderNamespace ]`: Namespace of the provider of the topic. + - `[ResourceGroupName ]`: The name of the resource group within the partners subscription. + - `[ResourceName ]`: Name of the resource. + - `[ResourceTypeName ]`: Name of the resource type. + - `[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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + - `[SubscriptionId ]`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + - `[SystemTopicName ]`: Name of the system topic. + - `[TopicName ]`: Name of the domain topic. + - `[TopicTypeName ]`: Name of the topic type. + - `[VerifiedPartnerName ]`: Name of the verified partner. + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/Get-AzEventGridDomainEventSubscriptionDeliveryAttribute.md b/swaggerci/eventgrid/docs/Get-AzEventGridDomainEventSubscriptionDeliveryAttribute.md new file mode 100644 index 000000000000..8a379fd603c3 --- /dev/null +++ b/swaggerci/eventgrid/docs/Get-AzEventGridDomainEventSubscriptionDeliveryAttribute.md @@ -0,0 +1,243 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgriddomaineventsubscriptiondeliveryattribute +schema: 2.0.0 +--- + +# Get-AzEventGridDomainEventSubscriptionDeliveryAttribute + +## SYNOPSIS +Get all delivery attributes for an event subscription for domain. + +## SYNTAX + +### Get (Default) +``` +Get-AzEventGridDomainEventSubscriptionDeliveryAttribute -DomainName -EventSubscriptionName + -ResourceGroupName [-SubscriptionId ] [-DefaultProfile ] [-PassThru] [-Confirm] + [-WhatIf] [] +``` + +### GetViaIdentity +``` +Get-AzEventGridDomainEventSubscriptionDeliveryAttribute -InputObject + [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Get all delivery attributes for an event subscription for domain. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DomainName +Name of the domain topic. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EventSubscriptionName +Name of the event subscription. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription credentials that uniquely identify a Microsoft Azure subscription. +The subscription ID forms part of the URI for every service call. + +```yaml +Type: System.String[] +Parameter Sets: Get +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[ChannelName ]`: Name of the channel. + - `[DomainName ]`: Name of the domain. + - `[DomainTopicName ]`: Name of the topic. + - `[EventChannelName ]`: Name of the event channel. + - `[EventSubscriptionName ]`: Name of the event subscription. + - `[Id ]`: Resource identity path + - `[Location ]`: Name of the location. + - `[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\'. + - `[PartnerDestinationName ]`: Name of the partner destination. + - `[PartnerNamespaceName ]`: Name of the partner namespace. + - `[PartnerRegistrationName ]`: Name of the partner registration. + - `[PartnerTopicName ]`: Name of the partner topic. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection connection. + - `[PrivateLinkResourceName ]`: The name of private link resource. + - `[ProviderNamespace ]`: Namespace of the provider of the topic. + - `[ResourceGroupName ]`: The name of the resource group within the partners subscription. + - `[ResourceName ]`: Name of the resource. + - `[ResourceTypeName ]`: Name of the resource type. + - `[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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + - `[SubscriptionId ]`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + - `[SystemTopicName ]`: Name of the system topic. + - `[TopicName ]`: Name of the domain topic. + - `[TopicTypeName ]`: Name of the topic type. + - `[VerifiedPartnerName ]`: Name of the verified partner. + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/Get-AzEventGridDomainEventSubscriptionFullUrl.md b/swaggerci/eventgrid/docs/Get-AzEventGridDomainEventSubscriptionFullUrl.md new file mode 100644 index 000000000000..4006b33b1bc5 --- /dev/null +++ b/swaggerci/eventgrid/docs/Get-AzEventGridDomainEventSubscriptionFullUrl.md @@ -0,0 +1,243 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgriddomaineventsubscriptionfullurl +schema: 2.0.0 +--- + +# Get-AzEventGridDomainEventSubscriptionFullUrl + +## SYNOPSIS +Get the full endpoint URL for an event subscription for domain. + +## SYNTAX + +### Get (Default) +``` +Get-AzEventGridDomainEventSubscriptionFullUrl -DomainName -EventSubscriptionName + -ResourceGroupName [-SubscriptionId ] [-DefaultProfile ] [-PassThru] [-Confirm] + [-WhatIf] [] +``` + +### GetViaIdentity +``` +Get-AzEventGridDomainEventSubscriptionFullUrl -InputObject [-DefaultProfile ] + [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Get the full endpoint URL for an event subscription for domain. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DomainName +Name of the domain topic. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EventSubscriptionName +Name of the event subscription. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription credentials that uniquely identify a Microsoft Azure subscription. +The subscription ID forms part of the URI for every service call. + +```yaml +Type: System.String[] +Parameter Sets: Get +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity + +## OUTPUTS + +### System.String + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[ChannelName ]`: Name of the channel. + - `[DomainName ]`: Name of the domain. + - `[DomainTopicName ]`: Name of the topic. + - `[EventChannelName ]`: Name of the event channel. + - `[EventSubscriptionName ]`: Name of the event subscription. + - `[Id ]`: Resource identity path + - `[Location ]`: Name of the location. + - `[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\'. + - `[PartnerDestinationName ]`: Name of the partner destination. + - `[PartnerNamespaceName ]`: Name of the partner namespace. + - `[PartnerRegistrationName ]`: Name of the partner registration. + - `[PartnerTopicName ]`: Name of the partner topic. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection connection. + - `[PrivateLinkResourceName ]`: The name of private link resource. + - `[ProviderNamespace ]`: Namespace of the provider of the topic. + - `[ResourceGroupName ]`: The name of the resource group within the partners subscription. + - `[ResourceName ]`: Name of the resource. + - `[ResourceTypeName ]`: Name of the resource type. + - `[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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + - `[SubscriptionId ]`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + - `[SystemTopicName ]`: Name of the system topic. + - `[TopicName ]`: Name of the domain topic. + - `[TopicTypeName ]`: Name of the topic type. + - `[VerifiedPartnerName ]`: Name of the verified partner. + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/Get-AzEventGridDomainSharedAccessKey.md b/swaggerci/eventgrid/docs/Get-AzEventGridDomainSharedAccessKey.md new file mode 100644 index 000000000000..b2c8a316dddb --- /dev/null +++ b/swaggerci/eventgrid/docs/Get-AzEventGridDomainSharedAccessKey.md @@ -0,0 +1,171 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgriddomainsharedaccesskey +schema: 2.0.0 +--- + +# Get-AzEventGridDomainSharedAccessKey + +## SYNOPSIS +List the two keys used to publish to a domain. + +## SYNTAX + +``` +Get-AzEventGridDomainSharedAccessKey -DomainName -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] + [] +``` + +## DESCRIPTION +List the two keys used to publish to a domain. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DomainName +Name of the domain. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription credentials that uniquely identify a Microsoft Azure subscription. +The subscription ID forms part of the URI for every service call. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainSharedAccessKeys + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/Get-AzEventGridDomainTopic.md b/swaggerci/eventgrid/docs/Get-AzEventGridDomainTopic.md new file mode 100644 index 000000000000..7f6c61a09c41 --- /dev/null +++ b/swaggerci/eventgrid/docs/Get-AzEventGridDomainTopic.md @@ -0,0 +1,254 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgriddomaintopic +schema: 2.0.0 +--- + +# Get-AzEventGridDomainTopic + +## SYNOPSIS +Get properties of a domain topic. + +## SYNTAX + +### List (Default) +``` +Get-AzEventGridDomainTopic -DomainName -ResourceGroupName [-SubscriptionId ] + [-Filter ] [-Top ] [-DefaultProfile ] [-PassThru] [] +``` + +### Get +``` +Get-AzEventGridDomainTopic -DomainName -Name -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [-PassThru] [] +``` + +### GetViaIdentity +``` +Get-AzEventGridDomainTopic -InputObject [-DefaultProfile ] [-PassThru] + [] +``` + +## DESCRIPTION +Get properties of a domain topic. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DomainName +Name of the domain. + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Filter +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'. + +```yaml +Type: System.String +Parameter Sets: List +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +Name of the topic. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: DomainTopicName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription credentials that uniquely identify a Microsoft Azure subscription. +The subscription ID forms part of the URI for every service call. + +```yaml +Type: System.String[] +Parameter Sets: Get, List +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Top +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. + +```yaml +Type: System.Int32 +Parameter Sets: List +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopic + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[ChannelName ]`: Name of the channel. + - `[DomainName ]`: Name of the domain. + - `[DomainTopicName ]`: Name of the topic. + - `[EventChannelName ]`: Name of the event channel. + - `[EventSubscriptionName ]`: Name of the event subscription. + - `[Id ]`: Resource identity path + - `[Location ]`: Name of the location. + - `[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\'. + - `[PartnerDestinationName ]`: Name of the partner destination. + - `[PartnerNamespaceName ]`: Name of the partner namespace. + - `[PartnerRegistrationName ]`: Name of the partner registration. + - `[PartnerTopicName ]`: Name of the partner topic. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection connection. + - `[PrivateLinkResourceName ]`: The name of private link resource. + - `[ProviderNamespace ]`: Namespace of the provider of the topic. + - `[ResourceGroupName ]`: The name of the resource group within the partners subscription. + - `[ResourceName ]`: Name of the resource. + - `[ResourceTypeName ]`: Name of the resource type. + - `[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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + - `[SubscriptionId ]`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + - `[SystemTopicName ]`: Name of the system topic. + - `[TopicName ]`: Name of the domain topic. + - `[TopicTypeName ]`: Name of the topic type. + - `[VerifiedPartnerName ]`: Name of the verified partner. + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/Get-AzEventGridDomainTopicEventSubscription.md b/swaggerci/eventgrid/docs/Get-AzEventGridDomainTopicEventSubscription.md new file mode 100644 index 000000000000..e728130e323e --- /dev/null +++ b/swaggerci/eventgrid/docs/Get-AzEventGridDomainTopicEventSubscription.md @@ -0,0 +1,271 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgriddomaintopiceventsubscription +schema: 2.0.0 +--- + +# Get-AzEventGridDomainTopicEventSubscription + +## SYNOPSIS +Get properties of a nested event subscription for a domain topic. + +## SYNTAX + +### List (Default) +``` +Get-AzEventGridDomainTopicEventSubscription -DomainName -ResourceGroupName + -TopicName [-SubscriptionId ] [-Filter ] [-Top ] + [-DefaultProfile ] [-PassThru] [] +``` + +### Get +``` +Get-AzEventGridDomainTopicEventSubscription -DomainName -EventSubscriptionName + -ResourceGroupName -TopicName [-SubscriptionId ] [-DefaultProfile ] + [-PassThru] [] +``` + +### GetViaIdentity +``` +Get-AzEventGridDomainTopicEventSubscription -InputObject [-DefaultProfile ] + [-PassThru] [] +``` + +## DESCRIPTION +Get properties of a nested event subscription for a domain topic. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DomainName +Name of the top level domain. + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EventSubscriptionName +Name of the event subscription. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Filter +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'. + +```yaml +Type: System.String +Parameter Sets: List +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription credentials that uniquely identify a Microsoft Azure subscription. +The subscription ID forms part of the URI for every service call. + +```yaml +Type: System.String[] +Parameter Sets: Get, List +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Top +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. + +```yaml +Type: System.Int32 +Parameter Sets: List +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TopicName +Name of the domain topic. + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[ChannelName ]`: Name of the channel. + - `[DomainName ]`: Name of the domain. + - `[DomainTopicName ]`: Name of the topic. + - `[EventChannelName ]`: Name of the event channel. + - `[EventSubscriptionName ]`: Name of the event subscription. + - `[Id ]`: Resource identity path + - `[Location ]`: Name of the location. + - `[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\'. + - `[PartnerDestinationName ]`: Name of the partner destination. + - `[PartnerNamespaceName ]`: Name of the partner namespace. + - `[PartnerRegistrationName ]`: Name of the partner registration. + - `[PartnerTopicName ]`: Name of the partner topic. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection connection. + - `[PrivateLinkResourceName ]`: The name of private link resource. + - `[ProviderNamespace ]`: Namespace of the provider of the topic. + - `[ResourceGroupName ]`: The name of the resource group within the partners subscription. + - `[ResourceName ]`: Name of the resource. + - `[ResourceTypeName ]`: Name of the resource type. + - `[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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + - `[SubscriptionId ]`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + - `[SystemTopicName ]`: Name of the system topic. + - `[TopicName ]`: Name of the domain topic. + - `[TopicTypeName ]`: Name of the topic type. + - `[VerifiedPartnerName ]`: Name of the verified partner. + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/Get-AzEventGridDomainTopicEventSubscriptionDeliveryAttribute.md b/swaggerci/eventgrid/docs/Get-AzEventGridDomainTopicEventSubscriptionDeliveryAttribute.md new file mode 100644 index 000000000000..8ecb53bc960b --- /dev/null +++ b/swaggerci/eventgrid/docs/Get-AzEventGridDomainTopicEventSubscriptionDeliveryAttribute.md @@ -0,0 +1,258 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgriddomaintopiceventsubscriptiondeliveryattribute +schema: 2.0.0 +--- + +# Get-AzEventGridDomainTopicEventSubscriptionDeliveryAttribute + +## SYNOPSIS +Get all delivery attributes for an event subscription for domain topic. + +## SYNTAX + +### Get (Default) +``` +Get-AzEventGridDomainTopicEventSubscriptionDeliveryAttribute -DomainName + -EventSubscriptionName -ResourceGroupName -TopicName [-SubscriptionId ] + [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### GetViaIdentity +``` +Get-AzEventGridDomainTopicEventSubscriptionDeliveryAttribute -InputObject + [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Get all delivery attributes for an event subscription for domain topic. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DomainName +Name of the top level domain. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EventSubscriptionName +Name of the event subscription. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription credentials that uniquely identify a Microsoft Azure subscription. +The subscription ID forms part of the URI for every service call. + +```yaml +Type: System.String[] +Parameter Sets: Get +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TopicName +Name of the domain topic. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[ChannelName ]`: Name of the channel. + - `[DomainName ]`: Name of the domain. + - `[DomainTopicName ]`: Name of the topic. + - `[EventChannelName ]`: Name of the event channel. + - `[EventSubscriptionName ]`: Name of the event subscription. + - `[Id ]`: Resource identity path + - `[Location ]`: Name of the location. + - `[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\'. + - `[PartnerDestinationName ]`: Name of the partner destination. + - `[PartnerNamespaceName ]`: Name of the partner namespace. + - `[PartnerRegistrationName ]`: Name of the partner registration. + - `[PartnerTopicName ]`: Name of the partner topic. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection connection. + - `[PrivateLinkResourceName ]`: The name of private link resource. + - `[ProviderNamespace ]`: Namespace of the provider of the topic. + - `[ResourceGroupName ]`: The name of the resource group within the partners subscription. + - `[ResourceName ]`: Name of the resource. + - `[ResourceTypeName ]`: Name of the resource type. + - `[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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + - `[SubscriptionId ]`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + - `[SystemTopicName ]`: Name of the system topic. + - `[TopicName ]`: Name of the domain topic. + - `[TopicTypeName ]`: Name of the topic type. + - `[VerifiedPartnerName ]`: Name of the verified partner. + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/Get-AzEventGridDomainTopicEventSubscriptionFullUrl.md b/swaggerci/eventgrid/docs/Get-AzEventGridDomainTopicEventSubscriptionFullUrl.md new file mode 100644 index 000000000000..71e8fc7f0997 --- /dev/null +++ b/swaggerci/eventgrid/docs/Get-AzEventGridDomainTopicEventSubscriptionFullUrl.md @@ -0,0 +1,258 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgriddomaintopiceventsubscriptionfullurl +schema: 2.0.0 +--- + +# Get-AzEventGridDomainTopicEventSubscriptionFullUrl + +## SYNOPSIS +Get the full endpoint URL for a nested event subscription for domain topic. + +## SYNTAX + +### Get (Default) +``` +Get-AzEventGridDomainTopicEventSubscriptionFullUrl -DomainName -EventSubscriptionName + -ResourceGroupName -TopicName [-SubscriptionId ] [-DefaultProfile ] + [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### GetViaIdentity +``` +Get-AzEventGridDomainTopicEventSubscriptionFullUrl -InputObject + [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Get the full endpoint URL for a nested event subscription for domain topic. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DomainName +Name of the top level domain. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EventSubscriptionName +Name of the event subscription. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription credentials that uniquely identify a Microsoft Azure subscription. +The subscription ID forms part of the URI for every service call. + +```yaml +Type: System.String[] +Parameter Sets: Get +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TopicName +Name of the domain topic. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity + +## OUTPUTS + +### System.String + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[ChannelName ]`: Name of the channel. + - `[DomainName ]`: Name of the domain. + - `[DomainTopicName ]`: Name of the topic. + - `[EventChannelName ]`: Name of the event channel. + - `[EventSubscriptionName ]`: Name of the event subscription. + - `[Id ]`: Resource identity path + - `[Location ]`: Name of the location. + - `[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\'. + - `[PartnerDestinationName ]`: Name of the partner destination. + - `[PartnerNamespaceName ]`: Name of the partner namespace. + - `[PartnerRegistrationName ]`: Name of the partner registration. + - `[PartnerTopicName ]`: Name of the partner topic. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection connection. + - `[PrivateLinkResourceName ]`: The name of private link resource. + - `[ProviderNamespace ]`: Namespace of the provider of the topic. + - `[ResourceGroupName ]`: The name of the resource group within the partners subscription. + - `[ResourceName ]`: Name of the resource. + - `[ResourceTypeName ]`: Name of the resource type. + - `[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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + - `[SubscriptionId ]`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + - `[SystemTopicName ]`: Name of the system topic. + - `[TopicName ]`: Name of the domain topic. + - `[TopicTypeName ]`: Name of the topic type. + - `[VerifiedPartnerName ]`: Name of the verified partner. + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/Get-AzEventGridEventChannel.md b/swaggerci/eventgrid/docs/Get-AzEventGridEventChannel.md new file mode 100644 index 000000000000..4798a9856671 --- /dev/null +++ b/swaggerci/eventgrid/docs/Get-AzEventGridEventChannel.md @@ -0,0 +1,255 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgrideventchannel +schema: 2.0.0 +--- + +# Get-AzEventGridEventChannel + +## SYNOPSIS +Get properties of an event channel. + +## SYNTAX + +### List (Default) +``` +Get-AzEventGridEventChannel -PartnerNamespaceName -ResourceGroupName + [-SubscriptionId ] [-Filter ] [-Top ] [-DefaultProfile ] [-PassThru] + [] +``` + +### Get +``` +Get-AzEventGridEventChannel -Name -PartnerNamespaceName -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [-PassThru] [] +``` + +### GetViaIdentity +``` +Get-AzEventGridEventChannel -InputObject [-DefaultProfile ] [-PassThru] + [] +``` + +## DESCRIPTION +Get properties of an event channel. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Filter +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'. + +```yaml +Type: System.String +Parameter Sets: List +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +Name of the event channel. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: EventChannelName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PartnerNamespaceName +Name of the partner namespace. + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription credentials that uniquely identify a Microsoft Azure subscription. +The subscription ID forms part of the URI for every service call. + +```yaml +Type: System.String[] +Parameter Sets: Get, List +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Top +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. + +```yaml +Type: System.Int32 +Parameter Sets: List +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannel + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[ChannelName ]`: Name of the channel. + - `[DomainName ]`: Name of the domain. + - `[DomainTopicName ]`: Name of the topic. + - `[EventChannelName ]`: Name of the event channel. + - `[EventSubscriptionName ]`: Name of the event subscription. + - `[Id ]`: Resource identity path + - `[Location ]`: Name of the location. + - `[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\'. + - `[PartnerDestinationName ]`: Name of the partner destination. + - `[PartnerNamespaceName ]`: Name of the partner namespace. + - `[PartnerRegistrationName ]`: Name of the partner registration. + - `[PartnerTopicName ]`: Name of the partner topic. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection connection. + - `[PrivateLinkResourceName ]`: The name of private link resource. + - `[ProviderNamespace ]`: Namespace of the provider of the topic. + - `[ResourceGroupName ]`: The name of the resource group within the partners subscription. + - `[ResourceName ]`: Name of the resource. + - `[ResourceTypeName ]`: Name of the resource type. + - `[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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + - `[SubscriptionId ]`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + - `[SystemTopicName ]`: Name of the system topic. + - `[TopicName ]`: Name of the domain topic. + - `[TopicTypeName ]`: Name of the topic type. + - `[VerifiedPartnerName ]`: Name of the verified partner. + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/Get-AzEventGridEventSubscription.md b/swaggerci/eventgrid/docs/Get-AzEventGridEventSubscription.md new file mode 100644 index 000000000000..daadf64a9f51 --- /dev/null +++ b/swaggerci/eventgrid/docs/Get-AzEventGridEventSubscription.md @@ -0,0 +1,339 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgrideventsubscription +schema: 2.0.0 +--- + +# Get-AzEventGridEventSubscription + +## SYNOPSIS +Get properties of an event subscription. + +## SYNTAX + +### Get (Default) +``` +Get-AzEventGridEventSubscription -Name -Scope [-DefaultProfile ] [-PassThru] + [] +``` + +### GetViaIdentity +``` +Get-AzEventGridEventSubscription -InputObject [-DefaultProfile ] [-PassThru] + [] +``` + +### List +``` +Get-AzEventGridEventSubscription -ProviderNamespace -ResourceGroupName + -ResourceName -ResourceTypeName [-SubscriptionId ] [-Filter ] + [-Top ] [-DefaultProfile ] [-PassThru] [] +``` + +### List1 +``` +Get-AzEventGridEventSubscription -DomainName -ResourceGroupName -TopicName + [-SubscriptionId ] [-Filter ] [-Top ] [-DefaultProfile ] [-PassThru] + [] +``` + +## DESCRIPTION +Get properties of an event subscription. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DomainName +Name of the top level domain. + +```yaml +Type: System.String +Parameter Sets: List1 +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Filter +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'. + +```yaml +Type: System.String +Parameter Sets: List, List1 +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +Name of the event subscription. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: EventSubscriptionName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ProviderNamespace +Namespace of the provider of the topic. + +```yaml +Type: System.String +Parameter Sets: List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. + +```yaml +Type: System.String +Parameter Sets: List, List1 +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceName +Name of the resource. + +```yaml +Type: System.String +Parameter Sets: List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceTypeName +Name of the resource type. + +```yaml +Type: System.String +Parameter Sets: List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription credentials that uniquely identify a Microsoft Azure subscription. +The subscription ID forms part of the URI for every service call. + +```yaml +Type: System.String[] +Parameter Sets: List, List1 +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Top +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. + +```yaml +Type: System.Int32 +Parameter Sets: List, List1 +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TopicName +Name of the domain topic. + +```yaml +Type: System.String +Parameter Sets: List1 +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[ChannelName ]`: Name of the channel. + - `[DomainName ]`: Name of the domain. + - `[DomainTopicName ]`: Name of the topic. + - `[EventChannelName ]`: Name of the event channel. + - `[EventSubscriptionName ]`: Name of the event subscription. + - `[Id ]`: Resource identity path + - `[Location ]`: Name of the location. + - `[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\'. + - `[PartnerDestinationName ]`: Name of the partner destination. + - `[PartnerNamespaceName ]`: Name of the partner namespace. + - `[PartnerRegistrationName ]`: Name of the partner registration. + - `[PartnerTopicName ]`: Name of the partner topic. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection connection. + - `[PrivateLinkResourceName ]`: The name of private link resource. + - `[ProviderNamespace ]`: Namespace of the provider of the topic. + - `[ResourceGroupName ]`: The name of the resource group within the partners subscription. + - `[ResourceName ]`: Name of the resource. + - `[ResourceTypeName ]`: Name of the resource type. + - `[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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + - `[SubscriptionId ]`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + - `[SystemTopicName ]`: Name of the system topic. + - `[TopicName ]`: Name of the domain topic. + - `[TopicTypeName ]`: Name of the topic type. + - `[VerifiedPartnerName ]`: Name of the verified partner. + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/Get-AzEventGridEventSubscriptionDeliveryAttribute.md b/swaggerci/eventgrid/docs/Get-AzEventGridEventSubscriptionDeliveryAttribute.md new file mode 100644 index 000000000000..ddac05d5dc4d --- /dev/null +++ b/swaggerci/eventgrid/docs/Get-AzEventGridEventSubscriptionDeliveryAttribute.md @@ -0,0 +1,213 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgrideventsubscriptiondeliveryattribute +schema: 2.0.0 +--- + +# Get-AzEventGridEventSubscriptionDeliveryAttribute + +## SYNOPSIS +Get all delivery attributes for an event subscription. + +## SYNTAX + +### Get (Default) +``` +Get-AzEventGridEventSubscriptionDeliveryAttribute -EventSubscriptionName -Scope + [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### GetViaIdentity +``` +Get-AzEventGridEventSubscriptionDeliveryAttribute -InputObject + [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Get all delivery attributes for an event subscription. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EventSubscriptionName +Name of the event subscription. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[ChannelName ]`: Name of the channel. + - `[DomainName ]`: Name of the domain. + - `[DomainTopicName ]`: Name of the topic. + - `[EventChannelName ]`: Name of the event channel. + - `[EventSubscriptionName ]`: Name of the event subscription. + - `[Id ]`: Resource identity path + - `[Location ]`: Name of the location. + - `[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\'. + - `[PartnerDestinationName ]`: Name of the partner destination. + - `[PartnerNamespaceName ]`: Name of the partner namespace. + - `[PartnerRegistrationName ]`: Name of the partner registration. + - `[PartnerTopicName ]`: Name of the partner topic. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection connection. + - `[PrivateLinkResourceName ]`: The name of private link resource. + - `[ProviderNamespace ]`: Namespace of the provider of the topic. + - `[ResourceGroupName ]`: The name of the resource group within the partners subscription. + - `[ResourceName ]`: Name of the resource. + - `[ResourceTypeName ]`: Name of the resource type. + - `[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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + - `[SubscriptionId ]`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + - `[SystemTopicName ]`: Name of the system topic. + - `[TopicName ]`: Name of the domain topic. + - `[TopicTypeName ]`: Name of the topic type. + - `[VerifiedPartnerName ]`: Name of the verified partner. + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/Get-AzEventGridEventSubscriptionFullUrl.md b/swaggerci/eventgrid/docs/Get-AzEventGridEventSubscriptionFullUrl.md new file mode 100644 index 000000000000..caada10389f0 --- /dev/null +++ b/swaggerci/eventgrid/docs/Get-AzEventGridEventSubscriptionFullUrl.md @@ -0,0 +1,213 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgrideventsubscriptionfullurl +schema: 2.0.0 +--- + +# Get-AzEventGridEventSubscriptionFullUrl + +## SYNOPSIS +Get the full endpoint URL for an event subscription. + +## SYNTAX + +### Get (Default) +``` +Get-AzEventGridEventSubscriptionFullUrl -EventSubscriptionName -Scope + [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### GetViaIdentity +``` +Get-AzEventGridEventSubscriptionFullUrl -InputObject [-DefaultProfile ] + [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Get the full endpoint URL for an event subscription. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EventSubscriptionName +Name of the event subscription. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity + +## OUTPUTS + +### System.String + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[ChannelName ]`: Name of the channel. + - `[DomainName ]`: Name of the domain. + - `[DomainTopicName ]`: Name of the topic. + - `[EventChannelName ]`: Name of the event channel. + - `[EventSubscriptionName ]`: Name of the event subscription. + - `[Id ]`: Resource identity path + - `[Location ]`: Name of the location. + - `[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\'. + - `[PartnerDestinationName ]`: Name of the partner destination. + - `[PartnerNamespaceName ]`: Name of the partner namespace. + - `[PartnerRegistrationName ]`: Name of the partner registration. + - `[PartnerTopicName ]`: Name of the partner topic. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection connection. + - `[PrivateLinkResourceName ]`: The name of private link resource. + - `[ProviderNamespace ]`: Namespace of the provider of the topic. + - `[ResourceGroupName ]`: The name of the resource group within the partners subscription. + - `[ResourceName ]`: Name of the resource. + - `[ResourceTypeName ]`: Name of the resource type. + - `[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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + - `[SubscriptionId ]`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + - `[SystemTopicName ]`: Name of the system topic. + - `[TopicName ]`: Name of the domain topic. + - `[TopicTypeName ]`: Name of the topic type. + - `[VerifiedPartnerName ]`: Name of the verified partner. + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/Get-AzEventGridEventSubscriptionGlobal.md b/swaggerci/eventgrid/docs/Get-AzEventGridEventSubscriptionGlobal.md new file mode 100644 index 000000000000..16d8a527597c --- /dev/null +++ b/swaggerci/eventgrid/docs/Get-AzEventGridEventSubscriptionGlobal.md @@ -0,0 +1,196 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgrideventsubscriptionglobal +schema: 2.0.0 +--- + +# Get-AzEventGridEventSubscriptionGlobal + +## SYNOPSIS +List all aggregated global event subscriptions under a specific Azure subscription. + +## SYNTAX + +### List (Default) +``` +Get-AzEventGridEventSubscriptionGlobal [-SubscriptionId ] [-Filter ] [-Top ] + [-DefaultProfile ] [-PassThru] [] +``` + +### List1 +``` +Get-AzEventGridEventSubscriptionGlobal -TopicTypeName [-SubscriptionId ] [-Filter ] + [-Top ] [-DefaultProfile ] [-PassThru] [] +``` + +### List2 +``` +Get-AzEventGridEventSubscriptionGlobal -ResourceGroupName [-SubscriptionId ] + [-Filter ] [-Top ] [-DefaultProfile ] [-PassThru] [] +``` + +### List3 +``` +Get-AzEventGridEventSubscriptionGlobal -ResourceGroupName -TopicTypeName + [-SubscriptionId ] [-Filter ] [-Top ] [-DefaultProfile ] [-PassThru] + [] +``` + +## DESCRIPTION +List all aggregated global event subscriptions under a specific Azure subscription. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Filter +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'. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. + +```yaml +Type: System.String +Parameter Sets: List2, List3 +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription credentials that uniquely identify a Microsoft Azure subscription. +The subscription ID forms part of the URI for every service call. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Top +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. + +```yaml +Type: System.Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TopicTypeName +Name of the topic type. + +```yaml +Type: System.String +Parameter Sets: List1, List3 +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/Get-AzEventGridEventSubscriptionRegional.md b/swaggerci/eventgrid/docs/Get-AzEventGridEventSubscriptionRegional.md new file mode 100644 index 000000000000..73af77053fad --- /dev/null +++ b/swaggerci/eventgrid/docs/Get-AzEventGridEventSubscriptionRegional.md @@ -0,0 +1,213 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgrideventsubscriptionregional +schema: 2.0.0 +--- + +# Get-AzEventGridEventSubscriptionRegional + +## SYNOPSIS +List all event subscriptions from the given location under a specific Azure subscription. + +## SYNTAX + +### List (Default) +``` +Get-AzEventGridEventSubscriptionRegional -Location [-SubscriptionId ] [-Filter ] + [-Top ] [-DefaultProfile ] [-PassThru] [] +``` + +### List1 +``` +Get-AzEventGridEventSubscriptionRegional -Location -ResourceGroupName + [-SubscriptionId ] [-Filter ] [-Top ] [-DefaultProfile ] [-PassThru] + [] +``` + +### List2 +``` +Get-AzEventGridEventSubscriptionRegional -Location -TopicTypeName + [-SubscriptionId ] [-Filter ] [-Top ] [-DefaultProfile ] [-PassThru] + [] +``` + +### List3 +``` +Get-AzEventGridEventSubscriptionRegional -Location -ResourceGroupName + -TopicTypeName [-SubscriptionId ] [-Filter ] [-Top ] + [-DefaultProfile ] [-PassThru] [] +``` + +## DESCRIPTION +List all event subscriptions from the given location under a specific Azure subscription. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Filter +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'. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Location +Name of the location. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. + +```yaml +Type: System.String +Parameter Sets: List1, List3 +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription credentials that uniquely identify a Microsoft Azure subscription. +The subscription ID forms part of the URI for every service call. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Top +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. + +```yaml +Type: System.Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TopicTypeName +Name of the topic type. + +```yaml +Type: System.String +Parameter Sets: List2, List3 +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/Get-AzEventGridExtensionTopic.md b/swaggerci/eventgrid/docs/Get-AzEventGridExtensionTopic.md new file mode 100644 index 000000000000..1633c705d042 --- /dev/null +++ b/swaggerci/eventgrid/docs/Get-AzEventGridExtensionTopic.md @@ -0,0 +1,166 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgridextensiontopic +schema: 2.0.0 +--- + +# Get-AzEventGridExtensionTopic + +## SYNOPSIS +Get the properties of an extension topic. + +## SYNTAX + +### Get (Default) +``` +Get-AzEventGridExtensionTopic -Scope [-DefaultProfile ] [-PassThru] [] +``` + +### GetViaIdentity +``` +Get-AzEventGridExtensionTopic -InputObject [-DefaultProfile ] [-PassThru] + [] +``` + +## DESCRIPTION +Get the properties of an extension topic. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for Azure resource. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtensionTopic + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[ChannelName ]`: Name of the channel. + - `[DomainName ]`: Name of the domain. + - `[DomainTopicName ]`: Name of the topic. + - `[EventChannelName ]`: Name of the event channel. + - `[EventSubscriptionName ]`: Name of the event subscription. + - `[Id ]`: Resource identity path + - `[Location ]`: Name of the location. + - `[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\'. + - `[PartnerDestinationName ]`: Name of the partner destination. + - `[PartnerNamespaceName ]`: Name of the partner namespace. + - `[PartnerRegistrationName ]`: Name of the partner registration. + - `[PartnerTopicName ]`: Name of the partner topic. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection connection. + - `[PrivateLinkResourceName ]`: The name of private link resource. + - `[ProviderNamespace ]`: Namespace of the provider of the topic. + - `[ResourceGroupName ]`: The name of the resource group within the partners subscription. + - `[ResourceName ]`: Name of the resource. + - `[ResourceTypeName ]`: Name of the resource type. + - `[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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + - `[SubscriptionId ]`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + - `[SystemTopicName ]`: Name of the system topic. + - `[TopicName ]`: Name of the domain topic. + - `[TopicTypeName ]`: Name of the topic type. + - `[VerifiedPartnerName ]`: Name of the verified partner. + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/Get-AzEventGridPartnerConfiguration.md b/swaggerci/eventgrid/docs/Get-AzEventGridPartnerConfiguration.md new file mode 100644 index 000000000000..30766be5d32b --- /dev/null +++ b/swaggerci/eventgrid/docs/Get-AzEventGridPartnerConfiguration.md @@ -0,0 +1,230 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgridpartnerconfiguration +schema: 2.0.0 +--- + +# Get-AzEventGridPartnerConfiguration + +## SYNOPSIS +Get properties of a partner configuration. + +## SYNTAX + +### List1 (Default) +``` +Get-AzEventGridPartnerConfiguration [-SubscriptionId ] [-Filter ] [-Top ] + [-DefaultProfile ] [-PassThru] [] +``` + +### Get +``` +Get-AzEventGridPartnerConfiguration -ResourceGroupName [-SubscriptionId ] + [-DefaultProfile ] [-PassThru] [] +``` + +### GetViaIdentity +``` +Get-AzEventGridPartnerConfiguration -InputObject [-DefaultProfile ] [-PassThru] + [] +``` + +### List +``` +Get-AzEventGridPartnerConfiguration -ResourceGroupName [-SubscriptionId ] + [-DefaultProfile ] [-PassThru] [] +``` + +## DESCRIPTION +Get properties of a partner configuration. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Filter +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'. + +```yaml +Type: System.String +Parameter Sets: List1 +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription credentials that uniquely identify a Microsoft Azure subscription. +The subscription ID forms part of the URI for every service call. + +```yaml +Type: System.String[] +Parameter Sets: Get, List, List1 +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Top +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. + +```yaml +Type: System.Int32 +Parameter Sets: List1 +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfiguration + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[ChannelName ]`: Name of the channel. + - `[DomainName ]`: Name of the domain. + - `[DomainTopicName ]`: Name of the topic. + - `[EventChannelName ]`: Name of the event channel. + - `[EventSubscriptionName ]`: Name of the event subscription. + - `[Id ]`: Resource identity path + - `[Location ]`: Name of the location. + - `[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\'. + - `[PartnerDestinationName ]`: Name of the partner destination. + - `[PartnerNamespaceName ]`: Name of the partner namespace. + - `[PartnerRegistrationName ]`: Name of the partner registration. + - `[PartnerTopicName ]`: Name of the partner topic. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection connection. + - `[PrivateLinkResourceName ]`: The name of private link resource. + - `[ProviderNamespace ]`: Namespace of the provider of the topic. + - `[ResourceGroupName ]`: The name of the resource group within the partners subscription. + - `[ResourceName ]`: Name of the resource. + - `[ResourceTypeName ]`: Name of the resource type. + - `[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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + - `[SubscriptionId ]`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + - `[SystemTopicName ]`: Name of the system topic. + - `[TopicName ]`: Name of the domain topic. + - `[TopicTypeName ]`: Name of the topic type. + - `[VerifiedPartnerName ]`: Name of the verified partner. + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/Get-AzEventGridPartnerDestination.md b/swaggerci/eventgrid/docs/Get-AzEventGridPartnerDestination.md new file mode 100644 index 000000000000..9a310ded5012 --- /dev/null +++ b/swaggerci/eventgrid/docs/Get-AzEventGridPartnerDestination.md @@ -0,0 +1,245 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgridpartnerdestination +schema: 2.0.0 +--- + +# Get-AzEventGridPartnerDestination + +## SYNOPSIS +Get properties of a partner destination. + +## SYNTAX + +### List (Default) +``` +Get-AzEventGridPartnerDestination [-SubscriptionId ] [-Filter ] [-Top ] + [-DefaultProfile ] [-PassThru] [] +``` + +### Get +``` +Get-AzEventGridPartnerDestination -Name -ResourceGroupName [-SubscriptionId ] + [-DefaultProfile ] [-PassThru] [] +``` + +### GetViaIdentity +``` +Get-AzEventGridPartnerDestination -InputObject [-DefaultProfile ] [-PassThru] + [] +``` + +### List1 +``` +Get-AzEventGridPartnerDestination -ResourceGroupName [-SubscriptionId ] [-Filter ] + [-Top ] [-DefaultProfile ] [-PassThru] [] +``` + +## DESCRIPTION +Get properties of a partner destination. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Filter +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'. + +```yaml +Type: System.String +Parameter Sets: List, List1 +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +Name of the partner destination. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: PartnerDestinationName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. + +```yaml +Type: System.String +Parameter Sets: Get, List1 +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription credentials that uniquely identify a Microsoft Azure subscription. +The subscription ID forms part of the URI for every service call. + +```yaml +Type: System.String[] +Parameter Sets: Get, List, List1 +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Top +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. + +```yaml +Type: System.Int32 +Parameter Sets: List, List1 +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestination + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[ChannelName ]`: Name of the channel. + - `[DomainName ]`: Name of the domain. + - `[DomainTopicName ]`: Name of the topic. + - `[EventChannelName ]`: Name of the event channel. + - `[EventSubscriptionName ]`: Name of the event subscription. + - `[Id ]`: Resource identity path + - `[Location ]`: Name of the location. + - `[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\'. + - `[PartnerDestinationName ]`: Name of the partner destination. + - `[PartnerNamespaceName ]`: Name of the partner namespace. + - `[PartnerRegistrationName ]`: Name of the partner registration. + - `[PartnerTopicName ]`: Name of the partner topic. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection connection. + - `[PrivateLinkResourceName ]`: The name of private link resource. + - `[ProviderNamespace ]`: Namespace of the provider of the topic. + - `[ResourceGroupName ]`: The name of the resource group within the partners subscription. + - `[ResourceName ]`: Name of the resource. + - `[ResourceTypeName ]`: Name of the resource type. + - `[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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + - `[SubscriptionId ]`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + - `[SystemTopicName ]`: Name of the system topic. + - `[TopicName ]`: Name of the domain topic. + - `[TopicTypeName ]`: Name of the topic type. + - `[VerifiedPartnerName ]`: Name of the verified partner. + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/Get-AzEventGridPartnerNamespace.md b/swaggerci/eventgrid/docs/Get-AzEventGridPartnerNamespace.md new file mode 100644 index 000000000000..5364fa4f800a --- /dev/null +++ b/swaggerci/eventgrid/docs/Get-AzEventGridPartnerNamespace.md @@ -0,0 +1,245 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgridpartnernamespace +schema: 2.0.0 +--- + +# Get-AzEventGridPartnerNamespace + +## SYNOPSIS +Get properties of a partner namespace. + +## SYNTAX + +### List (Default) +``` +Get-AzEventGridPartnerNamespace [-SubscriptionId ] [-Filter ] [-Top ] + [-DefaultProfile ] [-PassThru] [] +``` + +### Get +``` +Get-AzEventGridPartnerNamespace -Name -ResourceGroupName [-SubscriptionId ] + [-DefaultProfile ] [-PassThru] [] +``` + +### GetViaIdentity +``` +Get-AzEventGridPartnerNamespace -InputObject [-DefaultProfile ] [-PassThru] + [] +``` + +### List1 +``` +Get-AzEventGridPartnerNamespace -ResourceGroupName [-SubscriptionId ] [-Filter ] + [-Top ] [-DefaultProfile ] [-PassThru] [] +``` + +## DESCRIPTION +Get properties of a partner namespace. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Filter +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'. + +```yaml +Type: System.String +Parameter Sets: List, List1 +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +Name of the partner namespace. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: PartnerNamespaceName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. + +```yaml +Type: System.String +Parameter Sets: Get, List1 +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription credentials that uniquely identify a Microsoft Azure subscription. +The subscription ID forms part of the URI for every service call. + +```yaml +Type: System.String[] +Parameter Sets: Get, List, List1 +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Top +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. + +```yaml +Type: System.Int32 +Parameter Sets: List, List1 +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespace + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[ChannelName ]`: Name of the channel. + - `[DomainName ]`: Name of the domain. + - `[DomainTopicName ]`: Name of the topic. + - `[EventChannelName ]`: Name of the event channel. + - `[EventSubscriptionName ]`: Name of the event subscription. + - `[Id ]`: Resource identity path + - `[Location ]`: Name of the location. + - `[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\'. + - `[PartnerDestinationName ]`: Name of the partner destination. + - `[PartnerNamespaceName ]`: Name of the partner namespace. + - `[PartnerRegistrationName ]`: Name of the partner registration. + - `[PartnerTopicName ]`: Name of the partner topic. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection connection. + - `[PrivateLinkResourceName ]`: The name of private link resource. + - `[ProviderNamespace ]`: Namespace of the provider of the topic. + - `[ResourceGroupName ]`: The name of the resource group within the partners subscription. + - `[ResourceName ]`: Name of the resource. + - `[ResourceTypeName ]`: Name of the resource type. + - `[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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + - `[SubscriptionId ]`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + - `[SystemTopicName ]`: Name of the system topic. + - `[TopicName ]`: Name of the domain topic. + - `[TopicTypeName ]`: Name of the topic type. + - `[VerifiedPartnerName ]`: Name of the verified partner. + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/Get-AzEventGridPartnerNamespaceSharedAccessKey.md b/swaggerci/eventgrid/docs/Get-AzEventGridPartnerNamespaceSharedAccessKey.md new file mode 100644 index 000000000000..d9ee32b9322a --- /dev/null +++ b/swaggerci/eventgrid/docs/Get-AzEventGridPartnerNamespaceSharedAccessKey.md @@ -0,0 +1,171 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgridpartnernamespacesharedaccesskey +schema: 2.0.0 +--- + +# Get-AzEventGridPartnerNamespaceSharedAccessKey + +## SYNOPSIS +List the two keys used to publish to a partner namespace. + +## SYNTAX + +``` +Get-AzEventGridPartnerNamespaceSharedAccessKey -PartnerNamespaceName -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] + [] +``` + +## DESCRIPTION +List the two keys used to publish to a partner namespace. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PartnerNamespaceName +Name of the partner namespace. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription credentials that uniquely identify a Microsoft Azure subscription. +The subscription ID forms part of the URI for every service call. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceSharedAccessKeys + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/Get-AzEventGridPartnerRegistration.md b/swaggerci/eventgrid/docs/Get-AzEventGridPartnerRegistration.md new file mode 100644 index 000000000000..b944ef21ddcc --- /dev/null +++ b/swaggerci/eventgrid/docs/Get-AzEventGridPartnerRegistration.md @@ -0,0 +1,245 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgridpartnerregistration +schema: 2.0.0 +--- + +# Get-AzEventGridPartnerRegistration + +## SYNOPSIS +Gets a partner registration with the specified parameters. + +## SYNTAX + +### List (Default) +``` +Get-AzEventGridPartnerRegistration [-SubscriptionId ] [-Filter ] [-Top ] + [-DefaultProfile ] [-PassThru] [] +``` + +### Get +``` +Get-AzEventGridPartnerRegistration -Name -ResourceGroupName [-SubscriptionId ] + [-DefaultProfile ] [-PassThru] [] +``` + +### GetViaIdentity +``` +Get-AzEventGridPartnerRegistration -InputObject [-DefaultProfile ] [-PassThru] + [] +``` + +### List1 +``` +Get-AzEventGridPartnerRegistration -ResourceGroupName [-SubscriptionId ] [-Filter ] + [-Top ] [-DefaultProfile ] [-PassThru] [] +``` + +## DESCRIPTION +Gets a partner registration with the specified parameters. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Filter +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'. + +```yaml +Type: System.String +Parameter Sets: List, List1 +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +Name of the partner registration. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: PartnerRegistrationName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. + +```yaml +Type: System.String +Parameter Sets: Get, List1 +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription credentials that uniquely identify a Microsoft Azure subscription. +The subscription ID forms part of the URI for every service call. + +```yaml +Type: System.String[] +Parameter Sets: Get, List, List1 +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Top +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. + +```yaml +Type: System.Int32 +Parameter Sets: List, List1 +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistration + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[ChannelName ]`: Name of the channel. + - `[DomainName ]`: Name of the domain. + - `[DomainTopicName ]`: Name of the topic. + - `[EventChannelName ]`: Name of the event channel. + - `[EventSubscriptionName ]`: Name of the event subscription. + - `[Id ]`: Resource identity path + - `[Location ]`: Name of the location. + - `[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\'. + - `[PartnerDestinationName ]`: Name of the partner destination. + - `[PartnerNamespaceName ]`: Name of the partner namespace. + - `[PartnerRegistrationName ]`: Name of the partner registration. + - `[PartnerTopicName ]`: Name of the partner topic. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection connection. + - `[PrivateLinkResourceName ]`: The name of private link resource. + - `[ProviderNamespace ]`: Namespace of the provider of the topic. + - `[ResourceGroupName ]`: The name of the resource group within the partners subscription. + - `[ResourceName ]`: Name of the resource. + - `[ResourceTypeName ]`: Name of the resource type. + - `[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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + - `[SubscriptionId ]`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + - `[SystemTopicName ]`: Name of the system topic. + - `[TopicName ]`: Name of the domain topic. + - `[TopicTypeName ]`: Name of the topic type. + - `[VerifiedPartnerName ]`: Name of the verified partner. + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/Get-AzEventGridPartnerTopic.md b/swaggerci/eventgrid/docs/Get-AzEventGridPartnerTopic.md new file mode 100644 index 000000000000..22f0c79325bb --- /dev/null +++ b/swaggerci/eventgrid/docs/Get-AzEventGridPartnerTopic.md @@ -0,0 +1,245 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgridpartnertopic +schema: 2.0.0 +--- + +# Get-AzEventGridPartnerTopic + +## SYNOPSIS +Get properties of a partner topic. + +## SYNTAX + +### List (Default) +``` +Get-AzEventGridPartnerTopic [-SubscriptionId ] [-Filter ] [-Top ] + [-DefaultProfile ] [-PassThru] [] +``` + +### Get +``` +Get-AzEventGridPartnerTopic -Name -ResourceGroupName [-SubscriptionId ] + [-DefaultProfile ] [-PassThru] [] +``` + +### GetViaIdentity +``` +Get-AzEventGridPartnerTopic -InputObject [-DefaultProfile ] [-PassThru] + [] +``` + +### List1 +``` +Get-AzEventGridPartnerTopic -ResourceGroupName [-SubscriptionId ] [-Filter ] + [-Top ] [-DefaultProfile ] [-PassThru] [] +``` + +## DESCRIPTION +Get properties of a partner topic. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Filter +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'. + +```yaml +Type: System.String +Parameter Sets: List, List1 +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +Name of the partner topic. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: PartnerTopicName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. + +```yaml +Type: System.String +Parameter Sets: Get, List1 +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription credentials that uniquely identify a Microsoft Azure subscription. +The subscription ID forms part of the URI for every service call. + +```yaml +Type: System.String[] +Parameter Sets: Get, List, List1 +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Top +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. + +```yaml +Type: System.Int32 +Parameter Sets: List, List1 +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopic + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[ChannelName ]`: Name of the channel. + - `[DomainName ]`: Name of the domain. + - `[DomainTopicName ]`: Name of the topic. + - `[EventChannelName ]`: Name of the event channel. + - `[EventSubscriptionName ]`: Name of the event subscription. + - `[Id ]`: Resource identity path + - `[Location ]`: Name of the location. + - `[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\'. + - `[PartnerDestinationName ]`: Name of the partner destination. + - `[PartnerNamespaceName ]`: Name of the partner namespace. + - `[PartnerRegistrationName ]`: Name of the partner registration. + - `[PartnerTopicName ]`: Name of the partner topic. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection connection. + - `[PrivateLinkResourceName ]`: The name of private link resource. + - `[ProviderNamespace ]`: Namespace of the provider of the topic. + - `[ResourceGroupName ]`: The name of the resource group within the partners subscription. + - `[ResourceName ]`: Name of the resource. + - `[ResourceTypeName ]`: Name of the resource type. + - `[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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + - `[SubscriptionId ]`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + - `[SystemTopicName ]`: Name of the system topic. + - `[TopicName ]`: Name of the domain topic. + - `[TopicTypeName ]`: Name of the topic type. + - `[VerifiedPartnerName ]`: Name of the verified partner. + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/Get-AzEventGridPartnerTopicEventSubscription.md b/swaggerci/eventgrid/docs/Get-AzEventGridPartnerTopicEventSubscription.md new file mode 100644 index 000000000000..5721ab802ad7 --- /dev/null +++ b/swaggerci/eventgrid/docs/Get-AzEventGridPartnerTopicEventSubscription.md @@ -0,0 +1,257 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgridpartnertopiceventsubscription +schema: 2.0.0 +--- + +# Get-AzEventGridPartnerTopicEventSubscription + +## SYNOPSIS +Get properties of an event subscription of a partner topic. + +## SYNTAX + +### List (Default) +``` +Get-AzEventGridPartnerTopicEventSubscription -PartnerTopicName -ResourceGroupName + [-SubscriptionId ] [-Filter ] [-Top ] [-DefaultProfile ] [-PassThru] + [] +``` + +### Get +``` +Get-AzEventGridPartnerTopicEventSubscription -EventSubscriptionName -PartnerTopicName + -ResourceGroupName [-SubscriptionId ] [-DefaultProfile ] [-PassThru] + [] +``` + +### GetViaIdentity +``` +Get-AzEventGridPartnerTopicEventSubscription -InputObject [-DefaultProfile ] + [-PassThru] [] +``` + +## DESCRIPTION +Get properties of an event subscription of a partner topic. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -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. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Filter +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'. + +```yaml +Type: System.String +Parameter Sets: List +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -PartnerTopicName +Name of the partner topic. + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription credentials that uniquely identify a Microsoft Azure subscription. +The subscription ID forms part of the URI for every service call. + +```yaml +Type: System.String[] +Parameter Sets: Get, List +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Top +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. + +```yaml +Type: System.Int32 +Parameter Sets: List +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[ChannelName ]`: Name of the channel. + - `[DomainName ]`: Name of the domain. + - `[DomainTopicName ]`: Name of the topic. + - `[EventChannelName ]`: Name of the event channel. + - `[EventSubscriptionName ]`: Name of the event subscription. + - `[Id ]`: Resource identity path + - `[Location ]`: Name of the location. + - `[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\'. + - `[PartnerDestinationName ]`: Name of the partner destination. + - `[PartnerNamespaceName ]`: Name of the partner namespace. + - `[PartnerRegistrationName ]`: Name of the partner registration. + - `[PartnerTopicName ]`: Name of the partner topic. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection connection. + - `[PrivateLinkResourceName ]`: The name of private link resource. + - `[ProviderNamespace ]`: Namespace of the provider of the topic. + - `[ResourceGroupName ]`: The name of the resource group within the partners subscription. + - `[ResourceName ]`: Name of the resource. + - `[ResourceTypeName ]`: Name of the resource type. + - `[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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + - `[SubscriptionId ]`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + - `[SystemTopicName ]`: Name of the system topic. + - `[TopicName ]`: Name of the domain topic. + - `[TopicTypeName ]`: Name of the topic type. + - `[VerifiedPartnerName ]`: Name of the verified partner. + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/Get-AzEventGridPartnerTopicEventSubscriptionDeliveryAttribute.md b/swaggerci/eventgrid/docs/Get-AzEventGridPartnerTopicEventSubscriptionDeliveryAttribute.md new file mode 100644 index 000000000000..f22de4519031 --- /dev/null +++ b/swaggerci/eventgrid/docs/Get-AzEventGridPartnerTopicEventSubscriptionDeliveryAttribute.md @@ -0,0 +1,244 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgridpartnertopiceventsubscriptiondeliveryattribute +schema: 2.0.0 +--- + +# Get-AzEventGridPartnerTopicEventSubscriptionDeliveryAttribute + +## SYNOPSIS +Get all delivery attributes for an event subscription of a partner topic. + +## SYNTAX + +### Get (Default) +``` +Get-AzEventGridPartnerTopicEventSubscriptionDeliveryAttribute -EventSubscriptionName + -PartnerTopicName -ResourceGroupName [-SubscriptionId ] + [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### GetViaIdentity +``` +Get-AzEventGridPartnerTopicEventSubscriptionDeliveryAttribute -InputObject + [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Get all delivery attributes for an event subscription of a partner topic. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -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. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -PartnerTopicName +Name of the partner topic. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription credentials that uniquely identify a Microsoft Azure subscription. +The subscription ID forms part of the URI for every service call. + +```yaml +Type: System.String[] +Parameter Sets: Get +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[ChannelName ]`: Name of the channel. + - `[DomainName ]`: Name of the domain. + - `[DomainTopicName ]`: Name of the topic. + - `[EventChannelName ]`: Name of the event channel. + - `[EventSubscriptionName ]`: Name of the event subscription. + - `[Id ]`: Resource identity path + - `[Location ]`: Name of the location. + - `[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\'. + - `[PartnerDestinationName ]`: Name of the partner destination. + - `[PartnerNamespaceName ]`: Name of the partner namespace. + - `[PartnerRegistrationName ]`: Name of the partner registration. + - `[PartnerTopicName ]`: Name of the partner topic. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection connection. + - `[PrivateLinkResourceName ]`: The name of private link resource. + - `[ProviderNamespace ]`: Namespace of the provider of the topic. + - `[ResourceGroupName ]`: The name of the resource group within the partners subscription. + - `[ResourceName ]`: Name of the resource. + - `[ResourceTypeName ]`: Name of the resource type. + - `[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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + - `[SubscriptionId ]`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + - `[SystemTopicName ]`: Name of the system topic. + - `[TopicName ]`: Name of the domain topic. + - `[TopicTypeName ]`: Name of the topic type. + - `[VerifiedPartnerName ]`: Name of the verified partner. + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/Get-AzEventGridPartnerTopicEventSubscriptionFullUrl.md b/swaggerci/eventgrid/docs/Get-AzEventGridPartnerTopicEventSubscriptionFullUrl.md new file mode 100644 index 000000000000..9f84bce4a14d --- /dev/null +++ b/swaggerci/eventgrid/docs/Get-AzEventGridPartnerTopicEventSubscriptionFullUrl.md @@ -0,0 +1,244 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgridpartnertopiceventsubscriptionfullurl +schema: 2.0.0 +--- + +# Get-AzEventGridPartnerTopicEventSubscriptionFullUrl + +## SYNOPSIS +Get the full endpoint URL for an event subscription of a partner topic. + +## SYNTAX + +### Get (Default) +``` +Get-AzEventGridPartnerTopicEventSubscriptionFullUrl -EventSubscriptionName -PartnerTopicName + -ResourceGroupName [-SubscriptionId ] [-DefaultProfile ] [-PassThru] [-Confirm] + [-WhatIf] [] +``` + +### GetViaIdentity +``` +Get-AzEventGridPartnerTopicEventSubscriptionFullUrl -InputObject + [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Get the full endpoint URL for an event subscription of a partner topic. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -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. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -PartnerTopicName +Name of the partner topic. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription credentials that uniquely identify a Microsoft Azure subscription. +The subscription ID forms part of the URI for every service call. + +```yaml +Type: System.String[] +Parameter Sets: Get +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity + +## OUTPUTS + +### System.String + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[ChannelName ]`: Name of the channel. + - `[DomainName ]`: Name of the domain. + - `[DomainTopicName ]`: Name of the topic. + - `[EventChannelName ]`: Name of the event channel. + - `[EventSubscriptionName ]`: Name of the event subscription. + - `[Id ]`: Resource identity path + - `[Location ]`: Name of the location. + - `[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\'. + - `[PartnerDestinationName ]`: Name of the partner destination. + - `[PartnerNamespaceName ]`: Name of the partner namespace. + - `[PartnerRegistrationName ]`: Name of the partner registration. + - `[PartnerTopicName ]`: Name of the partner topic. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection connection. + - `[PrivateLinkResourceName ]`: The name of private link resource. + - `[ProviderNamespace ]`: Namespace of the provider of the topic. + - `[ResourceGroupName ]`: The name of the resource group within the partners subscription. + - `[ResourceName ]`: Name of the resource. + - `[ResourceTypeName ]`: Name of the resource type. + - `[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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + - `[SubscriptionId ]`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + - `[SystemTopicName ]`: Name of the system topic. + - `[TopicName ]`: Name of the domain topic. + - `[TopicTypeName ]`: Name of the topic type. + - `[VerifiedPartnerName ]`: Name of the verified partner. + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/Get-AzEventGridPrivateEndpointConnection.md b/swaggerci/eventgrid/docs/Get-AzEventGridPrivateEndpointConnection.md new file mode 100644 index 000000000000..db94b858a231 --- /dev/null +++ b/swaggerci/eventgrid/docs/Get-AzEventGridPrivateEndpointConnection.md @@ -0,0 +1,272 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgridprivateendpointconnection +schema: 2.0.0 +--- + +# Get-AzEventGridPrivateEndpointConnection + +## SYNOPSIS +Get a specific private endpoint connection under a topic, domain, or partner namespace. + +## SYNTAX + +### List (Default) +``` +Get-AzEventGridPrivateEndpointConnection -ParentName -ParentType + -ResourceGroupName [-SubscriptionId ] [-Filter ] [-Top ] + [-DefaultProfile ] [-PassThru] [] +``` + +### Get +``` +Get-AzEventGridPrivateEndpointConnection -Name -ParentName -ParentType + -ResourceGroupName [-SubscriptionId ] [-DefaultProfile ] [-PassThru] + [] +``` + +### GetViaIdentity +``` +Get-AzEventGridPrivateEndpointConnection -InputObject [-DefaultProfile ] + [-PassThru] [] +``` + +## DESCRIPTION +Get a specific private endpoint connection under a topic, domain, or partner namespace. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Filter +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'. + +```yaml +Type: System.String +Parameter Sets: List +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +The name of the private endpoint connection connection. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: PrivateEndpointConnectionName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ParentName +The name of the parent resource (namely, either, the topic name, domain name, or partner namespace name). + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ParentType +The type of the parent resource. +This can be either \'topics\', \'domains\', or \'partnerNamespaces\'. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ParentType +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription credentials that uniquely identify a Microsoft Azure subscription. +The subscription ID forms part of the URI for every service call. + +```yaml +Type: System.String[] +Parameter Sets: Get, List +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Top +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. + +```yaml +Type: System.Int32 +Parameter Sets: List +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnection + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[ChannelName ]`: Name of the channel. + - `[DomainName ]`: Name of the domain. + - `[DomainTopicName ]`: Name of the topic. + - `[EventChannelName ]`: Name of the event channel. + - `[EventSubscriptionName ]`: Name of the event subscription. + - `[Id ]`: Resource identity path + - `[Location ]`: Name of the location. + - `[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\'. + - `[PartnerDestinationName ]`: Name of the partner destination. + - `[PartnerNamespaceName ]`: Name of the partner namespace. + - `[PartnerRegistrationName ]`: Name of the partner registration. + - `[PartnerTopicName ]`: Name of the partner topic. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection connection. + - `[PrivateLinkResourceName ]`: The name of private link resource. + - `[ProviderNamespace ]`: Namespace of the provider of the topic. + - `[ResourceGroupName ]`: The name of the resource group within the partners subscription. + - `[ResourceName ]`: Name of the resource. + - `[ResourceTypeName ]`: Name of the resource type. + - `[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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + - `[SubscriptionId ]`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + - `[SystemTopicName ]`: Name of the system topic. + - `[TopicName ]`: Name of the domain topic. + - `[TopicTypeName ]`: Name of the topic type. + - `[VerifiedPartnerName ]`: Name of the verified partner. + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/Get-AzEventGridPrivateLinkResource.md b/swaggerci/eventgrid/docs/Get-AzEventGridPrivateLinkResource.md new file mode 100644 index 000000000000..1009eaf5d11c --- /dev/null +++ b/swaggerci/eventgrid/docs/Get-AzEventGridPrivateLinkResource.md @@ -0,0 +1,272 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgridprivatelinkresource +schema: 2.0.0 +--- + +# Get-AzEventGridPrivateLinkResource + +## SYNOPSIS +Get properties of a private link resource. + +## SYNTAX + +### List (Default) +``` +Get-AzEventGridPrivateLinkResource -ParentName -ParentType -ResourceGroupName + [-SubscriptionId ] [-Filter ] [-Top ] [-DefaultProfile ] [-PassThru] + [] +``` + +### Get +``` +Get-AzEventGridPrivateLinkResource -Name -ParentName -ParentType + -ResourceGroupName [-SubscriptionId ] [-DefaultProfile ] [-PassThru] + [] +``` + +### GetViaIdentity +``` +Get-AzEventGridPrivateLinkResource -InputObject [-DefaultProfile ] [-PassThru] + [] +``` + +## DESCRIPTION +Get properties of a private link resource. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Filter +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'. + +```yaml +Type: System.String +Parameter Sets: List +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +The name of private link resource. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: PrivateLinkResourceName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ParentName +The name of the parent resource (namely, either, the topic name, domain name, or partner namespace name). + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ParentType +The type of the parent resource. +This can be either \'topics\', \'domains\', or \'partnerNamespaces\'. + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription credentials that uniquely identify a Microsoft Azure subscription. +The subscription ID forms part of the URI for every service call. + +```yaml +Type: System.String[] +Parameter Sets: Get, List +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Top +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. + +```yaml +Type: System.Int32 +Parameter Sets: List +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResource + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[ChannelName ]`: Name of the channel. + - `[DomainName ]`: Name of the domain. + - `[DomainTopicName ]`: Name of the topic. + - `[EventChannelName ]`: Name of the event channel. + - `[EventSubscriptionName ]`: Name of the event subscription. + - `[Id ]`: Resource identity path + - `[Location ]`: Name of the location. + - `[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\'. + - `[PartnerDestinationName ]`: Name of the partner destination. + - `[PartnerNamespaceName ]`: Name of the partner namespace. + - `[PartnerRegistrationName ]`: Name of the partner registration. + - `[PartnerTopicName ]`: Name of the partner topic. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection connection. + - `[PrivateLinkResourceName ]`: The name of private link resource. + - `[ProviderNamespace ]`: Namespace of the provider of the topic. + - `[ResourceGroupName ]`: The name of the resource group within the partners subscription. + - `[ResourceName ]`: Name of the resource. + - `[ResourceTypeName ]`: Name of the resource type. + - `[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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + - `[SubscriptionId ]`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + - `[SystemTopicName ]`: Name of the system topic. + - `[TopicName ]`: Name of the domain topic. + - `[TopicTypeName ]`: Name of the topic type. + - `[VerifiedPartnerName ]`: Name of the verified partner. + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/Get-AzEventGridSystemTopic.md b/swaggerci/eventgrid/docs/Get-AzEventGridSystemTopic.md new file mode 100644 index 000000000000..c97c638a9960 --- /dev/null +++ b/swaggerci/eventgrid/docs/Get-AzEventGridSystemTopic.md @@ -0,0 +1,245 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgridsystemtopic +schema: 2.0.0 +--- + +# Get-AzEventGridSystemTopic + +## SYNOPSIS +Get properties of a system topic. + +## SYNTAX + +### List (Default) +``` +Get-AzEventGridSystemTopic [-SubscriptionId ] [-Filter ] [-Top ] + [-DefaultProfile ] [-PassThru] [] +``` + +### Get +``` +Get-AzEventGridSystemTopic -Name -ResourceGroupName [-SubscriptionId ] + [-DefaultProfile ] [-PassThru] [] +``` + +### GetViaIdentity +``` +Get-AzEventGridSystemTopic -InputObject [-DefaultProfile ] [-PassThru] + [] +``` + +### List1 +``` +Get-AzEventGridSystemTopic -ResourceGroupName [-SubscriptionId ] [-Filter ] + [-Top ] [-DefaultProfile ] [-PassThru] [] +``` + +## DESCRIPTION +Get properties of a system topic. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Filter +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'. + +```yaml +Type: System.String +Parameter Sets: List, List1 +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +Name of the system topic. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: SystemTopicName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. + +```yaml +Type: System.String +Parameter Sets: Get, List1 +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription credentials that uniquely identify a Microsoft Azure subscription. +The subscription ID forms part of the URI for every service call. + +```yaml +Type: System.String[] +Parameter Sets: Get, List, List1 +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Top +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. + +```yaml +Type: System.Int32 +Parameter Sets: List, List1 +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopic + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[ChannelName ]`: Name of the channel. + - `[DomainName ]`: Name of the domain. + - `[DomainTopicName ]`: Name of the topic. + - `[EventChannelName ]`: Name of the event channel. + - `[EventSubscriptionName ]`: Name of the event subscription. + - `[Id ]`: Resource identity path + - `[Location ]`: Name of the location. + - `[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\'. + - `[PartnerDestinationName ]`: Name of the partner destination. + - `[PartnerNamespaceName ]`: Name of the partner namespace. + - `[PartnerRegistrationName ]`: Name of the partner registration. + - `[PartnerTopicName ]`: Name of the partner topic. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection connection. + - `[PrivateLinkResourceName ]`: The name of private link resource. + - `[ProviderNamespace ]`: Namespace of the provider of the topic. + - `[ResourceGroupName ]`: The name of the resource group within the partners subscription. + - `[ResourceName ]`: Name of the resource. + - `[ResourceTypeName ]`: Name of the resource type. + - `[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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + - `[SubscriptionId ]`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + - `[SystemTopicName ]`: Name of the system topic. + - `[TopicName ]`: Name of the domain topic. + - `[TopicTypeName ]`: Name of the topic type. + - `[VerifiedPartnerName ]`: Name of the verified partner. + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/Get-AzEventGridSystemTopicEventSubscription.md b/swaggerci/eventgrid/docs/Get-AzEventGridSystemTopicEventSubscription.md new file mode 100644 index 000000000000..1ca08a45741d --- /dev/null +++ b/swaggerci/eventgrid/docs/Get-AzEventGridSystemTopicEventSubscription.md @@ -0,0 +1,257 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgridsystemtopiceventsubscription +schema: 2.0.0 +--- + +# Get-AzEventGridSystemTopicEventSubscription + +## SYNOPSIS +Get an event subscription. + +## SYNTAX + +### List (Default) +``` +Get-AzEventGridSystemTopicEventSubscription -ResourceGroupName -SystemTopicName + [-SubscriptionId ] [-Filter ] [-Top ] [-DefaultProfile ] [-PassThru] + [] +``` + +### Get +``` +Get-AzEventGridSystemTopicEventSubscription -EventSubscriptionName -ResourceGroupName + -SystemTopicName [-SubscriptionId ] [-DefaultProfile ] [-PassThru] + [] +``` + +### GetViaIdentity +``` +Get-AzEventGridSystemTopicEventSubscription -InputObject [-DefaultProfile ] + [-PassThru] [] +``` + +## DESCRIPTION +Get an event subscription. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -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. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Filter +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'. + +```yaml +Type: System.String +Parameter Sets: List +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription credentials that uniquely identify a Microsoft Azure subscription. +The subscription ID forms part of the URI for every service call. + +```yaml +Type: System.String[] +Parameter Sets: Get, List +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SystemTopicName +Name of the system topic. + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Top +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. + +```yaml +Type: System.Int32 +Parameter Sets: List +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[ChannelName ]`: Name of the channel. + - `[DomainName ]`: Name of the domain. + - `[DomainTopicName ]`: Name of the topic. + - `[EventChannelName ]`: Name of the event channel. + - `[EventSubscriptionName ]`: Name of the event subscription. + - `[Id ]`: Resource identity path + - `[Location ]`: Name of the location. + - `[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\'. + - `[PartnerDestinationName ]`: Name of the partner destination. + - `[PartnerNamespaceName ]`: Name of the partner namespace. + - `[PartnerRegistrationName ]`: Name of the partner registration. + - `[PartnerTopicName ]`: Name of the partner topic. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection connection. + - `[PrivateLinkResourceName ]`: The name of private link resource. + - `[ProviderNamespace ]`: Namespace of the provider of the topic. + - `[ResourceGroupName ]`: The name of the resource group within the partners subscription. + - `[ResourceName ]`: Name of the resource. + - `[ResourceTypeName ]`: Name of the resource type. + - `[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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + - `[SubscriptionId ]`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + - `[SystemTopicName ]`: Name of the system topic. + - `[TopicName ]`: Name of the domain topic. + - `[TopicTypeName ]`: Name of the topic type. + - `[VerifiedPartnerName ]`: Name of the verified partner. + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/Get-AzEventGridSystemTopicEventSubscriptionDeliveryAttribute.md b/swaggerci/eventgrid/docs/Get-AzEventGridSystemTopicEventSubscriptionDeliveryAttribute.md new file mode 100644 index 000000000000..59771a471197 --- /dev/null +++ b/swaggerci/eventgrid/docs/Get-AzEventGridSystemTopicEventSubscriptionDeliveryAttribute.md @@ -0,0 +1,244 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgridsystemtopiceventsubscriptiondeliveryattribute +schema: 2.0.0 +--- + +# Get-AzEventGridSystemTopicEventSubscriptionDeliveryAttribute + +## SYNOPSIS +Get all delivery attributes for an event subscription. + +## SYNTAX + +### Get (Default) +``` +Get-AzEventGridSystemTopicEventSubscriptionDeliveryAttribute -EventSubscriptionName + -ResourceGroupName -SystemTopicName [-SubscriptionId ] + [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### GetViaIdentity +``` +Get-AzEventGridSystemTopicEventSubscriptionDeliveryAttribute -InputObject + [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Get all delivery attributes for an event subscription. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -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. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription credentials that uniquely identify a Microsoft Azure subscription. +The subscription ID forms part of the URI for every service call. + +```yaml +Type: System.String[] +Parameter Sets: Get +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SystemTopicName +Name of the system topic. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[ChannelName ]`: Name of the channel. + - `[DomainName ]`: Name of the domain. + - `[DomainTopicName ]`: Name of the topic. + - `[EventChannelName ]`: Name of the event channel. + - `[EventSubscriptionName ]`: Name of the event subscription. + - `[Id ]`: Resource identity path + - `[Location ]`: Name of the location. + - `[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\'. + - `[PartnerDestinationName ]`: Name of the partner destination. + - `[PartnerNamespaceName ]`: Name of the partner namespace. + - `[PartnerRegistrationName ]`: Name of the partner registration. + - `[PartnerTopicName ]`: Name of the partner topic. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection connection. + - `[PrivateLinkResourceName ]`: The name of private link resource. + - `[ProviderNamespace ]`: Namespace of the provider of the topic. + - `[ResourceGroupName ]`: The name of the resource group within the partners subscription. + - `[ResourceName ]`: Name of the resource. + - `[ResourceTypeName ]`: Name of the resource type. + - `[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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + - `[SubscriptionId ]`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + - `[SystemTopicName ]`: Name of the system topic. + - `[TopicName ]`: Name of the domain topic. + - `[TopicTypeName ]`: Name of the topic type. + - `[VerifiedPartnerName ]`: Name of the verified partner. + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/Get-AzEventGridSystemTopicEventSubscriptionFullUrl.md b/swaggerci/eventgrid/docs/Get-AzEventGridSystemTopicEventSubscriptionFullUrl.md new file mode 100644 index 000000000000..662a1ae5f7a4 --- /dev/null +++ b/swaggerci/eventgrid/docs/Get-AzEventGridSystemTopicEventSubscriptionFullUrl.md @@ -0,0 +1,244 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgridsystemtopiceventsubscriptionfullurl +schema: 2.0.0 +--- + +# Get-AzEventGridSystemTopicEventSubscriptionFullUrl + +## SYNOPSIS +Get the full endpoint URL for an event subscription of a system topic. + +## SYNTAX + +### Get (Default) +``` +Get-AzEventGridSystemTopicEventSubscriptionFullUrl -EventSubscriptionName -ResourceGroupName + -SystemTopicName [-SubscriptionId ] [-DefaultProfile ] [-PassThru] [-Confirm] + [-WhatIf] [] +``` + +### GetViaIdentity +``` +Get-AzEventGridSystemTopicEventSubscriptionFullUrl -InputObject + [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Get the full endpoint URL for an event subscription of a system topic. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -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. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription credentials that uniquely identify a Microsoft Azure subscription. +The subscription ID forms part of the URI for every service call. + +```yaml +Type: System.String[] +Parameter Sets: Get +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SystemTopicName +Name of the system topic. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity + +## OUTPUTS + +### System.String + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[ChannelName ]`: Name of the channel. + - `[DomainName ]`: Name of the domain. + - `[DomainTopicName ]`: Name of the topic. + - `[EventChannelName ]`: Name of the event channel. + - `[EventSubscriptionName ]`: Name of the event subscription. + - `[Id ]`: Resource identity path + - `[Location ]`: Name of the location. + - `[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\'. + - `[PartnerDestinationName ]`: Name of the partner destination. + - `[PartnerNamespaceName ]`: Name of the partner namespace. + - `[PartnerRegistrationName ]`: Name of the partner registration. + - `[PartnerTopicName ]`: Name of the partner topic. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection connection. + - `[PrivateLinkResourceName ]`: The name of private link resource. + - `[ProviderNamespace ]`: Namespace of the provider of the topic. + - `[ResourceGroupName ]`: The name of the resource group within the partners subscription. + - `[ResourceName ]`: Name of the resource. + - `[ResourceTypeName ]`: Name of the resource type. + - `[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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + - `[SubscriptionId ]`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + - `[SystemTopicName ]`: Name of the system topic. + - `[TopicName ]`: Name of the domain topic. + - `[TopicTypeName ]`: Name of the topic type. + - `[VerifiedPartnerName ]`: Name of the verified partner. + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/Get-AzEventGridTopic.md b/swaggerci/eventgrid/docs/Get-AzEventGridTopic.md new file mode 100644 index 000000000000..d6c445fd06ff --- /dev/null +++ b/swaggerci/eventgrid/docs/Get-AzEventGridTopic.md @@ -0,0 +1,245 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgridtopic +schema: 2.0.0 +--- + +# Get-AzEventGridTopic + +## SYNOPSIS +Get properties of a topic. + +## SYNTAX + +### List (Default) +``` +Get-AzEventGridTopic [-SubscriptionId ] [-Filter ] [-Top ] + [-DefaultProfile ] [-PassThru] [] +``` + +### Get +``` +Get-AzEventGridTopic -Name -ResourceGroupName [-SubscriptionId ] + [-DefaultProfile ] [-PassThru] [] +``` + +### GetViaIdentity +``` +Get-AzEventGridTopic -InputObject [-DefaultProfile ] [-PassThru] + [] +``` + +### List1 +``` +Get-AzEventGridTopic -ResourceGroupName [-SubscriptionId ] [-Filter ] + [-Top ] [-DefaultProfile ] [-PassThru] [] +``` + +## DESCRIPTION +Get properties of a topic. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Filter +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'. + +```yaml +Type: System.String +Parameter Sets: List, List1 +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +Name of the topic. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: TopicName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. + +```yaml +Type: System.String +Parameter Sets: Get, List1 +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription credentials that uniquely identify a Microsoft Azure subscription. +The subscription ID forms part of the URI for every service call. + +```yaml +Type: System.String[] +Parameter Sets: Get, List, List1 +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Top +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. + +```yaml +Type: System.Int32 +Parameter Sets: List, List1 +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopic + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[ChannelName ]`: Name of the channel. + - `[DomainName ]`: Name of the domain. + - `[DomainTopicName ]`: Name of the topic. + - `[EventChannelName ]`: Name of the event channel. + - `[EventSubscriptionName ]`: Name of the event subscription. + - `[Id ]`: Resource identity path + - `[Location ]`: Name of the location. + - `[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\'. + - `[PartnerDestinationName ]`: Name of the partner destination. + - `[PartnerNamespaceName ]`: Name of the partner namespace. + - `[PartnerRegistrationName ]`: Name of the partner registration. + - `[PartnerTopicName ]`: Name of the partner topic. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection connection. + - `[PrivateLinkResourceName ]`: The name of private link resource. + - `[ProviderNamespace ]`: Namespace of the provider of the topic. + - `[ResourceGroupName ]`: The name of the resource group within the partners subscription. + - `[ResourceName ]`: Name of the resource. + - `[ResourceTypeName ]`: Name of the resource type. + - `[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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + - `[SubscriptionId ]`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + - `[SystemTopicName ]`: Name of the system topic. + - `[TopicName ]`: Name of the domain topic. + - `[TopicTypeName ]`: Name of the topic type. + - `[VerifiedPartnerName ]`: Name of the verified partner. + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/Get-AzEventGridTopicEventSubscription.md b/swaggerci/eventgrid/docs/Get-AzEventGridTopicEventSubscription.md new file mode 100644 index 000000000000..525777d35563 --- /dev/null +++ b/swaggerci/eventgrid/docs/Get-AzEventGridTopicEventSubscription.md @@ -0,0 +1,257 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgridtopiceventsubscription +schema: 2.0.0 +--- + +# Get-AzEventGridTopicEventSubscription + +## SYNOPSIS +Get properties of an event subscription of a topic. + +## SYNTAX + +### List (Default) +``` +Get-AzEventGridTopicEventSubscription -ResourceGroupName -TopicName + [-SubscriptionId ] [-Filter ] [-Top ] [-DefaultProfile ] [-PassThru] + [] +``` + +### Get +``` +Get-AzEventGridTopicEventSubscription -EventSubscriptionName -ResourceGroupName + -TopicName [-SubscriptionId ] [-DefaultProfile ] [-PassThru] + [] +``` + +### GetViaIdentity +``` +Get-AzEventGridTopicEventSubscription -InputObject [-DefaultProfile ] + [-PassThru] [] +``` + +## DESCRIPTION +Get properties of an event subscription of a topic. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -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. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Filter +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'. + +```yaml +Type: System.String +Parameter Sets: List +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription credentials that uniquely identify a Microsoft Azure subscription. +The subscription ID forms part of the URI for every service call. + +```yaml +Type: System.String[] +Parameter Sets: Get, List +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Top +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. + +```yaml +Type: System.Int32 +Parameter Sets: List +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TopicName +Name of the partner topic. + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[ChannelName ]`: Name of the channel. + - `[DomainName ]`: Name of the domain. + - `[DomainTopicName ]`: Name of the topic. + - `[EventChannelName ]`: Name of the event channel. + - `[EventSubscriptionName ]`: Name of the event subscription. + - `[Id ]`: Resource identity path + - `[Location ]`: Name of the location. + - `[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\'. + - `[PartnerDestinationName ]`: Name of the partner destination. + - `[PartnerNamespaceName ]`: Name of the partner namespace. + - `[PartnerRegistrationName ]`: Name of the partner registration. + - `[PartnerTopicName ]`: Name of the partner topic. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection connection. + - `[PrivateLinkResourceName ]`: The name of private link resource. + - `[ProviderNamespace ]`: Namespace of the provider of the topic. + - `[ResourceGroupName ]`: The name of the resource group within the partners subscription. + - `[ResourceName ]`: Name of the resource. + - `[ResourceTypeName ]`: Name of the resource type. + - `[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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + - `[SubscriptionId ]`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + - `[SystemTopicName ]`: Name of the system topic. + - `[TopicName ]`: Name of the domain topic. + - `[TopicTypeName ]`: Name of the topic type. + - `[VerifiedPartnerName ]`: Name of the verified partner. + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/Get-AzEventGridTopicEventSubscriptionDeliveryAttribute.md b/swaggerci/eventgrid/docs/Get-AzEventGridTopicEventSubscriptionDeliveryAttribute.md new file mode 100644 index 000000000000..419e08200e31 --- /dev/null +++ b/swaggerci/eventgrid/docs/Get-AzEventGridTopicEventSubscriptionDeliveryAttribute.md @@ -0,0 +1,243 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgridtopiceventsubscriptiondeliveryattribute +schema: 2.0.0 +--- + +# Get-AzEventGridTopicEventSubscriptionDeliveryAttribute + +## SYNOPSIS +Get all delivery attributes for an event subscription for topic. + +## SYNTAX + +### Get (Default) +``` +Get-AzEventGridTopicEventSubscriptionDeliveryAttribute -EventSubscriptionName + -ResourceGroupName -TopicName [-SubscriptionId ] [-DefaultProfile ] + [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### GetViaIdentity +``` +Get-AzEventGridTopicEventSubscriptionDeliveryAttribute -InputObject + [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Get all delivery attributes for an event subscription for topic. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EventSubscriptionName +Name of the event subscription. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription credentials that uniquely identify a Microsoft Azure subscription. +The subscription ID forms part of the URI for every service call. + +```yaml +Type: System.String[] +Parameter Sets: Get +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TopicName +Name of the domain topic. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[ChannelName ]`: Name of the channel. + - `[DomainName ]`: Name of the domain. + - `[DomainTopicName ]`: Name of the topic. + - `[EventChannelName ]`: Name of the event channel. + - `[EventSubscriptionName ]`: Name of the event subscription. + - `[Id ]`: Resource identity path + - `[Location ]`: Name of the location. + - `[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\'. + - `[PartnerDestinationName ]`: Name of the partner destination. + - `[PartnerNamespaceName ]`: Name of the partner namespace. + - `[PartnerRegistrationName ]`: Name of the partner registration. + - `[PartnerTopicName ]`: Name of the partner topic. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection connection. + - `[PrivateLinkResourceName ]`: The name of private link resource. + - `[ProviderNamespace ]`: Namespace of the provider of the topic. + - `[ResourceGroupName ]`: The name of the resource group within the partners subscription. + - `[ResourceName ]`: Name of the resource. + - `[ResourceTypeName ]`: Name of the resource type. + - `[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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + - `[SubscriptionId ]`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + - `[SystemTopicName ]`: Name of the system topic. + - `[TopicName ]`: Name of the domain topic. + - `[TopicTypeName ]`: Name of the topic type. + - `[VerifiedPartnerName ]`: Name of the verified partner. + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/Get-AzEventGridTopicEventSubscriptionFullUrl.md b/swaggerci/eventgrid/docs/Get-AzEventGridTopicEventSubscriptionFullUrl.md new file mode 100644 index 000000000000..6e0fd51013fa --- /dev/null +++ b/swaggerci/eventgrid/docs/Get-AzEventGridTopicEventSubscriptionFullUrl.md @@ -0,0 +1,243 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgridtopiceventsubscriptionfullurl +schema: 2.0.0 +--- + +# Get-AzEventGridTopicEventSubscriptionFullUrl + +## SYNOPSIS +Get the full endpoint URL for an event subscription for topic. + +## SYNTAX + +### Get (Default) +``` +Get-AzEventGridTopicEventSubscriptionFullUrl -EventSubscriptionName -ResourceGroupName + -TopicName [-SubscriptionId ] [-DefaultProfile ] [-PassThru] [-Confirm] + [-WhatIf] [] +``` + +### GetViaIdentity +``` +Get-AzEventGridTopicEventSubscriptionFullUrl -InputObject [-DefaultProfile ] + [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Get the full endpoint URL for an event subscription for topic. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EventSubscriptionName +Name of the event subscription. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription credentials that uniquely identify a Microsoft Azure subscription. +The subscription ID forms part of the URI for every service call. + +```yaml +Type: System.String[] +Parameter Sets: Get +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TopicName +Name of the domain topic. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity + +## OUTPUTS + +### System.String + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[ChannelName ]`: Name of the channel. + - `[DomainName ]`: Name of the domain. + - `[DomainTopicName ]`: Name of the topic. + - `[EventChannelName ]`: Name of the event channel. + - `[EventSubscriptionName ]`: Name of the event subscription. + - `[Id ]`: Resource identity path + - `[Location ]`: Name of the location. + - `[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\'. + - `[PartnerDestinationName ]`: Name of the partner destination. + - `[PartnerNamespaceName ]`: Name of the partner namespace. + - `[PartnerRegistrationName ]`: Name of the partner registration. + - `[PartnerTopicName ]`: Name of the partner topic. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection connection. + - `[PrivateLinkResourceName ]`: The name of private link resource. + - `[ProviderNamespace ]`: Namespace of the provider of the topic. + - `[ResourceGroupName ]`: The name of the resource group within the partners subscription. + - `[ResourceName ]`: Name of the resource. + - `[ResourceTypeName ]`: Name of the resource type. + - `[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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + - `[SubscriptionId ]`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + - `[SystemTopicName ]`: Name of the system topic. + - `[TopicName ]`: Name of the domain topic. + - `[TopicTypeName ]`: Name of the topic type. + - `[VerifiedPartnerName ]`: Name of the verified partner. + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/Get-AzEventGridTopicEventType.md b/swaggerci/eventgrid/docs/Get-AzEventGridTopicEventType.md new file mode 100644 index 000000000000..0b508997fbaa --- /dev/null +++ b/swaggerci/eventgrid/docs/Get-AzEventGridTopicEventType.md @@ -0,0 +1,170 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgridtopiceventtype +schema: 2.0.0 +--- + +# Get-AzEventGridTopicEventType + +## SYNOPSIS +List event types for a topic. + +## SYNTAX + +``` +Get-AzEventGridTopicEventType -ProviderNamespace -ResourceGroupName -ResourceName + -ResourceTypeName [-SubscriptionId ] [-DefaultProfile ] [-PassThru] + [] +``` + +## DESCRIPTION +List event types for a topic. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ProviderNamespace +Namespace of the provider of the topic. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceName +Name of the topic. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceTypeName +Name of the topic type. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription credentials that uniquely identify a Microsoft Azure subscription. +The subscription ID forms part of the URI for every service call. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventType + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/Get-AzEventGridTopicSharedAccessKey.md b/swaggerci/eventgrid/docs/Get-AzEventGridTopicSharedAccessKey.md new file mode 100644 index 000000000000..1d25ca36d62b --- /dev/null +++ b/swaggerci/eventgrid/docs/Get-AzEventGridTopicSharedAccessKey.md @@ -0,0 +1,171 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgridtopicsharedaccesskey +schema: 2.0.0 +--- + +# Get-AzEventGridTopicSharedAccessKey + +## SYNOPSIS +List the two keys used to publish to a topic. + +## SYNTAX + +``` +Get-AzEventGridTopicSharedAccessKey -ResourceGroupName -TopicName + [-SubscriptionId ] [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] + [] +``` + +## DESCRIPTION +List the two keys used to publish to a topic. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription credentials that uniquely identify a Microsoft Azure subscription. +The subscription ID forms part of the URI for every service call. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TopicName +Name of the topic. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicSharedAccessKeys + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/Get-AzEventGridTopicType.md b/swaggerci/eventgrid/docs/Get-AzEventGridTopicType.md new file mode 100644 index 000000000000..ed64f7fb34a6 --- /dev/null +++ b/swaggerci/eventgrid/docs/Get-AzEventGridTopicType.md @@ -0,0 +1,169 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgridtopictype +schema: 2.0.0 +--- + +# Get-AzEventGridTopicType + +## SYNOPSIS +Get information about a topic type. + +## SYNTAX + +### List (Default) +``` +Get-AzEventGridTopicType [-DefaultProfile ] [-PassThru] [] +``` + +### Get +``` +Get-AzEventGridTopicType -Name [-DefaultProfile ] [-PassThru] [] +``` + +### GetViaIdentity +``` +Get-AzEventGridTopicType -InputObject [-DefaultProfile ] [-PassThru] + [] +``` + +## DESCRIPTION +Get information about a topic type. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +Name of the topic type. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: TopicTypeName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypeInfo + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[ChannelName ]`: Name of the channel. + - `[DomainName ]`: Name of the domain. + - `[DomainTopicName ]`: Name of the topic. + - `[EventChannelName ]`: Name of the event channel. + - `[EventSubscriptionName ]`: Name of the event subscription. + - `[Id ]`: Resource identity path + - `[Location ]`: Name of the location. + - `[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\'. + - `[PartnerDestinationName ]`: Name of the partner destination. + - `[PartnerNamespaceName ]`: Name of the partner namespace. + - `[PartnerRegistrationName ]`: Name of the partner registration. + - `[PartnerTopicName ]`: Name of the partner topic. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection connection. + - `[PrivateLinkResourceName ]`: The name of private link resource. + - `[ProviderNamespace ]`: Namespace of the provider of the topic. + - `[ResourceGroupName ]`: The name of the resource group within the partners subscription. + - `[ResourceName ]`: Name of the resource. + - `[ResourceTypeName ]`: Name of the resource type. + - `[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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + - `[SubscriptionId ]`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + - `[SystemTopicName ]`: Name of the system topic. + - `[TopicName ]`: Name of the domain topic. + - `[TopicTypeName ]`: Name of the topic type. + - `[VerifiedPartnerName ]`: Name of the verified partner. + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/Get-AzEventGridTopicTypeEventType.md b/swaggerci/eventgrid/docs/Get-AzEventGridTopicTypeEventType.md new file mode 100644 index 000000000000..99ab477ff20f --- /dev/null +++ b/swaggerci/eventgrid/docs/Get-AzEventGridTopicTypeEventType.md @@ -0,0 +1,108 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgridtopictypeeventtype +schema: 2.0.0 +--- + +# Get-AzEventGridTopicTypeEventType + +## SYNOPSIS +List event types for a topic type. + +## SYNTAX + +``` +Get-AzEventGridTopicTypeEventType -TopicTypeName [-DefaultProfile ] [-PassThru] + [] +``` + +## DESCRIPTION +List event types for a topic type. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TopicTypeName +Name of the topic type. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventType + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/Get-AzEventGridVerifiedPartner.md b/swaggerci/eventgrid/docs/Get-AzEventGridVerifiedPartner.md new file mode 100644 index 000000000000..1d67380eca64 --- /dev/null +++ b/swaggerci/eventgrid/docs/Get-AzEventGridVerifiedPartner.md @@ -0,0 +1,207 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgridverifiedpartner +schema: 2.0.0 +--- + +# Get-AzEventGridVerifiedPartner + +## SYNOPSIS +Get properties of a verified partner. + +## SYNTAX + +### List (Default) +``` +Get-AzEventGridVerifiedPartner [-Filter ] [-Top ] [-DefaultProfile ] [-PassThru] + [] +``` + +### Get +``` +Get-AzEventGridVerifiedPartner -Name [-DefaultProfile ] [-PassThru] [] +``` + +### GetViaIdentity +``` +Get-AzEventGridVerifiedPartner -InputObject [-DefaultProfile ] [-PassThru] + [] +``` + +## DESCRIPTION +Get properties of a verified partner. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Filter +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'. + +```yaml +Type: System.String +Parameter Sets: List +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +Name of the verified partner. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: VerifiedPartnerName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Top +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. + +```yaml +Type: System.Int32 +Parameter Sets: List +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartner + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[ChannelName ]`: Name of the channel. + - `[DomainName ]`: Name of the domain. + - `[DomainTopicName ]`: Name of the topic. + - `[EventChannelName ]`: Name of the event channel. + - `[EventSubscriptionName ]`: Name of the event subscription. + - `[Id ]`: Resource identity path + - `[Location ]`: Name of the location. + - `[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\'. + - `[PartnerDestinationName ]`: Name of the partner destination. + - `[PartnerNamespaceName ]`: Name of the partner namespace. + - `[PartnerRegistrationName ]`: Name of the partner registration. + - `[PartnerTopicName ]`: Name of the partner topic. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection connection. + - `[PrivateLinkResourceName ]`: The name of private link resource. + - `[ProviderNamespace ]`: Namespace of the provider of the topic. + - `[ResourceGroupName ]`: The name of the resource group within the partners subscription. + - `[ResourceName ]`: Name of the resource. + - `[ResourceTypeName ]`: Name of the resource type. + - `[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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + - `[SubscriptionId ]`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + - `[SystemTopicName ]`: Name of the system topic. + - `[TopicName ]`: Name of the domain topic. + - `[TopicTypeName ]`: Name of the topic type. + - `[VerifiedPartnerName ]`: Name of the verified partner. + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/Grant-AzEventGridPartnerConfigurationPartner.md b/swaggerci/eventgrid/docs/Grant-AzEventGridPartnerConfigurationPartner.md new file mode 100644 index 000000000000..9eda8871b705 --- /dev/null +++ b/swaggerci/eventgrid/docs/Grant-AzEventGridPartnerConfigurationPartner.md @@ -0,0 +1,298 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/grant-azeventgridpartnerconfigurationpartner +schema: 2.0.0 +--- + +# Grant-AzEventGridPartnerConfigurationPartner + +## SYNOPSIS +Authorize a single partner either by partner registration immutable Id or by partner name. + +## SYNTAX + +### AuthorizeExpanded (Default) +``` +Grant-AzEventGridPartnerConfigurationPartner -ResourceGroupName [-SubscriptionId ] + [-AuthorizationExpirationTimeInUtc ] [-PartnerName ] + [-PartnerRegistrationImmutableId ] [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] + [] +``` + +### Authorize +``` +Grant-AzEventGridPartnerConfigurationPartner -ResourceGroupName -PartnerInfo + [-SubscriptionId ] [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### AuthorizeViaIdentity +``` +Grant-AzEventGridPartnerConfigurationPartner -InputObject -PartnerInfo + [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### AuthorizeViaIdentityExpanded +``` +Grant-AzEventGridPartnerConfigurationPartner -InputObject + [-AuthorizationExpirationTimeInUtc ] [-PartnerName ] + [-PartnerRegistrationImmutableId ] [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] + [] +``` + +## DESCRIPTION +Authorize a single partner either by partner registration immutable Id or by partner name. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AuthorizationExpirationTimeInUtc +Expiration time of the partner authorization. +If this timer expires, any request from this partner to create, update or delete resources in subscriber'scontext will fail. +If specified, the allowed values are between 1 to the value of defaultMaximumExpirationTimeInDays specified in PartnerConfiguration.If not specified, the default value will be the value of defaultMaximumExpirationTimeInDays specified in PartnerConfiguration or 7 if this value is not specified. + +```yaml +Type: System.DateTime +Parameter Sets: AuthorizeExpanded, AuthorizeViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +Parameter Sets: AuthorizeViaIdentity, AuthorizeViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -PartnerInfo +Information about the partner. +To construct, see NOTES section for PARTNERINFO properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartner +Parameter Sets: Authorize, AuthorizeViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -PartnerName +The partner name. + +```yaml +Type: System.String +Parameter Sets: AuthorizeExpanded, AuthorizeViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PartnerRegistrationImmutableId +The immutableId of the corresponding partner registration. + +```yaml +Type: System.String +Parameter Sets: AuthorizeExpanded, AuthorizeViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. + +```yaml +Type: System.String +Parameter Sets: Authorize, AuthorizeExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription credentials that uniquely identify a Microsoft Azure subscription. +The subscription ID forms part of the URI for every service call. + +```yaml +Type: System.String +Parameter Sets: Authorize, AuthorizeExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartner + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfiguration + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[ChannelName ]`: Name of the channel. + - `[DomainName ]`: Name of the domain. + - `[DomainTopicName ]`: Name of the topic. + - `[EventChannelName ]`: Name of the event channel. + - `[EventSubscriptionName ]`: Name of the event subscription. + - `[Id ]`: Resource identity path + - `[Location ]`: Name of the location. + - `[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\'. + - `[PartnerDestinationName ]`: Name of the partner destination. + - `[PartnerNamespaceName ]`: Name of the partner namespace. + - `[PartnerRegistrationName ]`: Name of the partner registration. + - `[PartnerTopicName ]`: Name of the partner topic. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection connection. + - `[PrivateLinkResourceName ]`: The name of private link resource. + - `[ProviderNamespace ]`: Namespace of the provider of the topic. + - `[ResourceGroupName ]`: The name of the resource group within the partners subscription. + - `[ResourceName ]`: Name of the resource. + - `[ResourceTypeName ]`: Name of the resource type. + - `[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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + - `[SubscriptionId ]`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + - `[SystemTopicName ]`: Name of the system topic. + - `[TopicName ]`: Name of the domain topic. + - `[TopicTypeName ]`: Name of the topic type. + - `[VerifiedPartnerName ]`: Name of the verified partner. + +PARTNERINFO : Information about the partner. + - `[AuthorizationExpirationTimeInUtc ]`: Expiration time of the partner authorization. If this timer expires, any request from this partner to create, update or delete resources in subscriber's context will fail. If specified, the allowed values are between 1 to the value of defaultMaximumExpirationTimeInDays specified in PartnerConfiguration. If not specified, the default value will be the value of defaultMaximumExpirationTimeInDays specified in PartnerConfiguration or 7 if this value is not specified. + - `[Name ]`: The partner name. + - `[RegistrationImmutableId ]`: The immutableId of the corresponding partner registration. + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/Initialize-AzEventGridPartnerDestination.md b/swaggerci/eventgrid/docs/Initialize-AzEventGridPartnerDestination.md new file mode 100644 index 000000000000..497b88c3ab22 --- /dev/null +++ b/swaggerci/eventgrid/docs/Initialize-AzEventGridPartnerDestination.md @@ -0,0 +1,227 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/initialize-azeventgridpartnerdestination +schema: 2.0.0 +--- + +# Initialize-AzEventGridPartnerDestination + +## SYNOPSIS +Activate a newly created partner destination. + +## SYNTAX + +### Activate (Default) +``` +Initialize-AzEventGridPartnerDestination -Name -ResourceGroupName [-SubscriptionId ] + [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### ActivateViaIdentity +``` +Initialize-AzEventGridPartnerDestination -InputObject [-DefaultProfile ] + [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Activate a newly created partner destination. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +Parameter Sets: ActivateViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +Name of the partner destination. + +```yaml +Type: System.String +Parameter Sets: Activate +Aliases: PartnerDestinationName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. + +```yaml +Type: System.String +Parameter Sets: Activate +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription credentials that uniquely identify a Microsoft Azure subscription. +The subscription ID forms part of the URI for every service call. + +```yaml +Type: System.String +Parameter Sets: Activate +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestination + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[ChannelName ]`: Name of the channel. + - `[DomainName ]`: Name of the domain. + - `[DomainTopicName ]`: Name of the topic. + - `[EventChannelName ]`: Name of the event channel. + - `[EventSubscriptionName ]`: Name of the event subscription. + - `[Id ]`: Resource identity path + - `[Location ]`: Name of the location. + - `[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\'. + - `[PartnerDestinationName ]`: Name of the partner destination. + - `[PartnerNamespaceName ]`: Name of the partner namespace. + - `[PartnerRegistrationName ]`: Name of the partner registration. + - `[PartnerTopicName ]`: Name of the partner topic. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection connection. + - `[PrivateLinkResourceName ]`: The name of private link resource. + - `[ProviderNamespace ]`: Namespace of the provider of the topic. + - `[ResourceGroupName ]`: The name of the resource group within the partners subscription. + - `[ResourceName ]`: Name of the resource. + - `[ResourceTypeName ]`: Name of the resource type. + - `[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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + - `[SubscriptionId ]`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + - `[SystemTopicName ]`: Name of the system topic. + - `[TopicName ]`: Name of the domain topic. + - `[TopicTypeName ]`: Name of the topic type. + - `[VerifiedPartnerName ]`: Name of the verified partner. + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/Initialize-AzEventGridPartnerTopic.md b/swaggerci/eventgrid/docs/Initialize-AzEventGridPartnerTopic.md new file mode 100644 index 000000000000..58d78e53dca5 --- /dev/null +++ b/swaggerci/eventgrid/docs/Initialize-AzEventGridPartnerTopic.md @@ -0,0 +1,227 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/initialize-azeventgridpartnertopic +schema: 2.0.0 +--- + +# Initialize-AzEventGridPartnerTopic + +## SYNOPSIS +Activate a newly created partner topic. + +## SYNTAX + +### Activate (Default) +``` +Initialize-AzEventGridPartnerTopic -Name -ResourceGroupName [-SubscriptionId ] + [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### ActivateViaIdentity +``` +Initialize-AzEventGridPartnerTopic -InputObject [-DefaultProfile ] [-PassThru] + [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Activate a newly created partner topic. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +Parameter Sets: ActivateViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +Name of the partner topic. + +```yaml +Type: System.String +Parameter Sets: Activate +Aliases: PartnerTopicName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. + +```yaml +Type: System.String +Parameter Sets: Activate +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription credentials that uniquely identify a Microsoft Azure subscription. +The subscription ID forms part of the URI for every service call. + +```yaml +Type: System.String +Parameter Sets: Activate +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopic + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[ChannelName ]`: Name of the channel. + - `[DomainName ]`: Name of the domain. + - `[DomainTopicName ]`: Name of the topic. + - `[EventChannelName ]`: Name of the event channel. + - `[EventSubscriptionName ]`: Name of the event subscription. + - `[Id ]`: Resource identity path + - `[Location ]`: Name of the location. + - `[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\'. + - `[PartnerDestinationName ]`: Name of the partner destination. + - `[PartnerNamespaceName ]`: Name of the partner namespace. + - `[PartnerRegistrationName ]`: Name of the partner registration. + - `[PartnerTopicName ]`: Name of the partner topic. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection connection. + - `[PrivateLinkResourceName ]`: The name of private link resource. + - `[ProviderNamespace ]`: Namespace of the provider of the topic. + - `[ResourceGroupName ]`: The name of the resource group within the partners subscription. + - `[ResourceName ]`: Name of the resource. + - `[ResourceTypeName ]`: Name of the resource type. + - `[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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + - `[SubscriptionId ]`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + - `[SystemTopicName ]`: Name of the system topic. + - `[TopicName ]`: Name of the domain topic. + - `[TopicTypeName ]`: Name of the topic type. + - `[VerifiedPartnerName ]`: Name of the verified partner. + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/Invoke-AzEventGridDeactivatePartnerTopic.md b/swaggerci/eventgrid/docs/Invoke-AzEventGridDeactivatePartnerTopic.md new file mode 100644 index 000000000000..dc47fb94f32b --- /dev/null +++ b/swaggerci/eventgrid/docs/Invoke-AzEventGridDeactivatePartnerTopic.md @@ -0,0 +1,227 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/invoke-azeventgriddeactivatepartnertopic +schema: 2.0.0 +--- + +# Invoke-AzEventGridDeactivatePartnerTopic + +## SYNOPSIS +Deactivate specific partner topic. + +## SYNTAX + +### Deactivate (Default) +``` +Invoke-AzEventGridDeactivatePartnerTopic -PartnerTopicName -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### DeactivateViaIdentity +``` +Invoke-AzEventGridDeactivatePartnerTopic -InputObject [-DefaultProfile ] + [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Deactivate specific partner topic. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +Parameter Sets: DeactivateViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -PartnerTopicName +Name of the partner topic. + +```yaml +Type: System.String +Parameter Sets: Deactivate +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. + +```yaml +Type: System.String +Parameter Sets: Deactivate +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription credentials that uniquely identify a Microsoft Azure subscription. +The subscription ID forms part of the URI for every service call. + +```yaml +Type: System.String +Parameter Sets: Deactivate +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopic + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[ChannelName ]`: Name of the channel. + - `[DomainName ]`: Name of the domain. + - `[DomainTopicName ]`: Name of the topic. + - `[EventChannelName ]`: Name of the event channel. + - `[EventSubscriptionName ]`: Name of the event subscription. + - `[Id ]`: Resource identity path + - `[Location ]`: Name of the location. + - `[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\'. + - `[PartnerDestinationName ]`: Name of the partner destination. + - `[PartnerNamespaceName ]`: Name of the partner namespace. + - `[PartnerRegistrationName ]`: Name of the partner registration. + - `[PartnerTopicName ]`: Name of the partner topic. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection connection. + - `[PrivateLinkResourceName ]`: The name of private link resource. + - `[ProviderNamespace ]`: Namespace of the provider of the topic. + - `[ResourceGroupName ]`: The name of the resource group within the partners subscription. + - `[ResourceName ]`: Name of the resource. + - `[ResourceTypeName ]`: Name of the resource type. + - `[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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + - `[SubscriptionId ]`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + - `[SystemTopicName ]`: Name of the system topic. + - `[TopicName ]`: Name of the domain topic. + - `[TopicTypeName ]`: Name of the topic type. + - `[VerifiedPartnerName ]`: Name of the verified partner. + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/Invoke-AzEventGridPartnerConfigurationUnauthorize.md b/swaggerci/eventgrid/docs/Invoke-AzEventGridPartnerConfigurationUnauthorize.md new file mode 100644 index 000000000000..19d9427c40cd --- /dev/null +++ b/swaggerci/eventgrid/docs/Invoke-AzEventGridPartnerConfigurationUnauthorize.md @@ -0,0 +1,298 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/invoke-azeventgridpartnerconfigurationunauthorize +schema: 2.0.0 +--- + +# Invoke-AzEventGridPartnerConfigurationUnauthorize + +## SYNOPSIS +Unauthorize a single partner either by partner registration immutable Id or by partner name. + +## SYNTAX + +### PartnerExpanded (Default) +``` +Invoke-AzEventGridPartnerConfigurationUnauthorize -ResourceGroupName [-SubscriptionId ] + [-AuthorizationExpirationTimeInUtc ] [-PartnerName ] + [-PartnerRegistrationImmutableId ] [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] + [] +``` + +### Partner +``` +Invoke-AzEventGridPartnerConfigurationUnauthorize -ResourceGroupName -PartnerInfo + [-SubscriptionId ] [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### PartnerViaIdentity +``` +Invoke-AzEventGridPartnerConfigurationUnauthorize -InputObject -PartnerInfo + [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### PartnerViaIdentityExpanded +``` +Invoke-AzEventGridPartnerConfigurationUnauthorize -InputObject + [-AuthorizationExpirationTimeInUtc ] [-PartnerName ] + [-PartnerRegistrationImmutableId ] [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] + [] +``` + +## DESCRIPTION +Unauthorize a single partner either by partner registration immutable Id or by partner name. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AuthorizationExpirationTimeInUtc +Expiration time of the partner authorization. +If this timer expires, any request from this partner to create, update or delete resources in subscriber'scontext will fail. +If specified, the allowed values are between 1 to the value of defaultMaximumExpirationTimeInDays specified in PartnerConfiguration.If not specified, the default value will be the value of defaultMaximumExpirationTimeInDays specified in PartnerConfiguration or 7 if this value is not specified. + +```yaml +Type: System.DateTime +Parameter Sets: PartnerExpanded, PartnerViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +Parameter Sets: PartnerViaIdentity, PartnerViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -PartnerInfo +Information about the partner. +To construct, see NOTES section for PARTNERINFO properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartner +Parameter Sets: Partner, PartnerViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -PartnerName +The partner name. + +```yaml +Type: System.String +Parameter Sets: PartnerExpanded, PartnerViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PartnerRegistrationImmutableId +The immutableId of the corresponding partner registration. + +```yaml +Type: System.String +Parameter Sets: PartnerExpanded, PartnerViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. + +```yaml +Type: System.String +Parameter Sets: Partner, PartnerExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription credentials that uniquely identify a Microsoft Azure subscription. +The subscription ID forms part of the URI for every service call. + +```yaml +Type: System.String +Parameter Sets: Partner, PartnerExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartner + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfiguration + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[ChannelName ]`: Name of the channel. + - `[DomainName ]`: Name of the domain. + - `[DomainTopicName ]`: Name of the topic. + - `[EventChannelName ]`: Name of the event channel. + - `[EventSubscriptionName ]`: Name of the event subscription. + - `[Id ]`: Resource identity path + - `[Location ]`: Name of the location. + - `[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\'. + - `[PartnerDestinationName ]`: Name of the partner destination. + - `[PartnerNamespaceName ]`: Name of the partner namespace. + - `[PartnerRegistrationName ]`: Name of the partner registration. + - `[PartnerTopicName ]`: Name of the partner topic. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection connection. + - `[PrivateLinkResourceName ]`: The name of private link resource. + - `[ProviderNamespace ]`: Namespace of the provider of the topic. + - `[ResourceGroupName ]`: The name of the resource group within the partners subscription. + - `[ResourceName ]`: Name of the resource. + - `[ResourceTypeName ]`: Name of the resource type. + - `[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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + - `[SubscriptionId ]`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + - `[SystemTopicName ]`: Name of the system topic. + - `[TopicName ]`: Name of the domain topic. + - `[TopicTypeName ]`: Name of the topic type. + - `[VerifiedPartnerName ]`: Name of the verified partner. + +PARTNERINFO : Information about the partner. + - `[AuthorizationExpirationTimeInUtc ]`: Expiration time of the partner authorization. If this timer expires, any request from this partner to create, update or delete resources in subscriber's context will fail. If specified, the allowed values are between 1 to the value of defaultMaximumExpirationTimeInDays specified in PartnerConfiguration. If not specified, the default value will be the value of defaultMaximumExpirationTimeInDays specified in PartnerConfiguration or 7 if this value is not specified. + - `[Name ]`: The partner name. + - `[RegistrationImmutableId ]`: The immutableId of the corresponding partner registration. + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/New-AzEventGridChannel.md b/swaggerci/eventgrid/docs/New-AzEventGridChannel.md new file mode 100644 index 000000000000..c2084902bcb0 --- /dev/null +++ b/swaggerci/eventgrid/docs/New-AzEventGridChannel.md @@ -0,0 +1,452 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/new-azeventgridchannel +schema: 2.0.0 +--- + +# New-AzEventGridChannel + +## SYNOPSIS +Synchronously creates or updates a new channel with the specified parameters. + +## SYNTAX + +``` +New-AzEventGridChannel -Name -PartnerNamespaceName -ResourceGroupName + [-SubscriptionId ] [-ChannelType ] [-EventTypeInfoInlineEventType ] + [-EventTypeInfoKind ] [-ExpirationTimeIfNotActivatedUtc ] + [-MessageForActivation ] [-PartnerDestinationInfoAzureSubscriptionId ] + [-PartnerDestinationInfoEndpointServiceContext ] [-PartnerDestinationInfoName ] + [-PartnerDestinationInfoResourceGroupName ] + [-PartnerDestinationInfoResourceMoveChangeHistory ] + [-PartnerTopicInfoAzureSubscriptionId ] [-PartnerTopicInfoName ] + [-PartnerTopicInfoResourceGroupName ] [-PartnerTopicInfoSource ] + [-ProvisioningState ] [-ReadinessState ] + [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Synchronously creates or updates a new channel with the specified parameters. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -ChannelType +The type of the event channel which represents the direction flow of events. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ChannelType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EventTypeInfoInlineEventType +A collection of inline event types for the resource. +The inline event type keys are of type string which represents the name of the event.An example of a valid inline event name is "Contoso.OrderCreated".The inline event type values are of type InlineEventProperties and will contain additional information for every inline event type. + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EventTypeInfoKind +The kind of event type used. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ExpirationTimeIfNotActivatedUtc +Expiration time of the channel. +If this timer expires while the corresponding partner topic is never activated,the channel and corresponding partner topic are deleted. + +```yaml +Type: System.DateTime +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -MessageForActivation +Context or helpful message that can be used during the approval process by the subscriber. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +Name of the channel. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: ChannelName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PartnerDestinationInfoAzureSubscriptionId +Azure subscription ID of the subscriber. +The partner destination associated with the channel will becreated under this Azure subscription. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PartnerDestinationInfoEndpointServiceContext +Additional context of the partner destination endpoint. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PartnerDestinationInfoName +Name of the partner destination associated with the channel. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PartnerDestinationInfoResourceGroupName +Azure Resource Group of the subscriber. +The partner destination associated with the channel will becreated under this resource group. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PartnerDestinationInfoResourceMoveChangeHistory +Change history of the resource move. +To construct, see NOTES section for PARTNERDESTINATIONINFORESOURCEMOVECHANGEHISTORY properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceMoveChangeHistory[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PartnerNamespaceName +Name of the partner namespace. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PartnerTopicInfoAzureSubscriptionId +Azure subscription ID of the subscriber. +The partner topic associated with the channel will becreated under this Azure subscription. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PartnerTopicInfoName +Name of the partner topic associated with the channel. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PartnerTopicInfoResourceGroupName +Azure Resource Group of the subscriber. +The partner topic associated with the channel will becreated under this resource group. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PartnerTopicInfoSource +The source information is provided by the publisher to determine the scope or context from which the eventsare originating. +This information can be used by the subscriber during the approval process of thecreated partner topic. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ProvisioningState +Provisioning state of the channel. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ChannelProvisioningState +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ReadinessState +The readiness state of the corresponding partner topic. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ReadinessState +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the partners subscription. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription credentials that uniquely identify a Microsoft Azure subscription. +The subscription ID forms part of the URI for every service call. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannel + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +PARTNERDESTINATIONINFORESOURCEMOVECHANGEHISTORY : Change history of the resource move. + - `[AzureSubscriptionId ]`: Azure subscription ID of the resource. + - `[ChangedTimeUtc ]`: UTC timestamp of when the resource was changed. + - `[ResourceGroupName ]`: Azure Resource Group of the resource. + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/New-AzEventGridDomain.md b/swaggerci/eventgrid/docs/New-AzEventGridDomain.md new file mode 100644 index 000000000000..4836d57e2477 --- /dev/null +++ b/swaggerci/eventgrid/docs/New-AzEventGridDomain.md @@ -0,0 +1,440 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/new-azeventgriddomain +schema: 2.0.0 +--- + +# New-AzEventGridDomain + +## SYNOPSIS +Asynchronously creates or updates a new domain with the specified parameters. + +## SYNTAX + +``` +New-AzEventGridDomain -Name -ResourceGroupName -Location [-SubscriptionId ] + [-AutoCreateTopicWithFirstSubscription] [-AutoDeleteTopicWithLastSubscription] + [-DataResidencyBoundary ] [-DisableLocalAuth] [-IdentityPrincipalId ] + [-IdentityTenantId ] [-IdentityType ] [-IdentityUserAssignedIdentity ] + [-InboundIPRule ] [-InputSchema ] [-PublicNetworkAccess ] + [-SkuName ] [-Tag ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] + [-WhatIf] [] +``` + +## DESCRIPTION +Asynchronously creates or updates a new domain with the specified parameters. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AutoCreateTopicWithFirstSubscription +This Boolean is used to specify the creation mechanism for 'all' the Event Grid Domain Topics associated with this Event Grid Domain resource.In this context, creation of domain topic can be auto-managed (when true) or self-managed (when false). +The default value for this property is true.When this property is null or set to true, Event Grid is responsible of automatically creating the domain topic when the first event subscription iscreated at the scope of the domain topic. +If this property is set to false, then creating the first event subscription will require creating a domain topicby the user. +The self-management mode can be used if the user wants full control of when the domain topic is created, while auto-managed mode provides theflexibility to perform less operations and manage fewer resources by the user. +Also, note that in auto-managed creation mode, user is allowed to create thedomain topic on demand if needed. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AutoDeleteTopicWithLastSubscription +This Boolean is used to specify the deletion mechanism for 'all' the Event Grid Domain Topics associated with this Event Grid Domain resource.In this context, deletion of domain topic can be auto-managed (when true) or self-managed (when false). +The default value for this property is true.When this property is set to true, Event Grid is responsible of automatically deleting the domain topic when the last event subscription at the scopeof the domain topic is deleted. +If this property is set to false, then the user needs to manually delete the domain topic when it is no longer needed(e.g., when last event subscription is deleted and the resource needs to be cleaned up). +The self-management mode can be used if the user wants fullcontrol of when the domain topic needs to be deleted, while auto-managed mode provides the flexibility to perform less operations and manage fewerresources by the user. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DataResidencyBoundary +Data Residency Boundary of the resource. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DisableLocalAuth +This boolean is used to enable or disable local auth. +Default value is false. +When the property is set to true, only AAD token will be used to authenticate if user is allowed to publish to the domain. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IdentityPrincipalId +The principal ID of resource identity. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IdentityTenantId +The tenant ID of resource. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IdentityType +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. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IdentityUserAssignedIdentity +The list of user identities associated with the resource. +The user identity dictionary key references will be ARM resource ids in the form:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.This property is currently not used and reserved for future usage. + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InboundIPRule +This can be used to restrict traffic from specific IPs instead of all IPs. +Note: These are considered only if PublicNetworkAccess is enabled. +To construct, see NOTES section for INBOUNDIPRULE properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputSchema +This determines the format that Event Grid should expect for incoming events published to the Event Grid Domain Resource. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.InputSchema +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Location +Location of the resource. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +Name of the domain. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: DomainName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PublicNetworkAccess +This determines if traffic is allowed over public network. +By default it is enabled.You can further restrict to specific IPs by configuring \ + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SkuName +The Sku name of the resource. +The possible values are: Basic or Premium. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription credentials that uniquely identify a Microsoft Azure subscription. +The subscription ID forms part of the URI for every service call. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Tag +Tags of the resource. + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INBOUNDIPRULE : This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess is enabled. + - `[Action ]`: Action to perform based on the match or no match of the IpMask. + - `[IPMask ]`: IP Address in CIDR notation e.g., 10.0.0.0/8. + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/New-AzEventGridDomainEventSubscription.md b/swaggerci/eventgrid/docs/New-AzEventGridDomainEventSubscription.md new file mode 100644 index 000000000000..35ec7cb7c568 --- /dev/null +++ b/swaggerci/eventgrid/docs/New-AzEventGridDomainEventSubscription.md @@ -0,0 +1,497 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/new-azeventgriddomaineventsubscription +schema: 2.0.0 +--- + +# New-AzEventGridDomainEventSubscription + +## SYNOPSIS +Asynchronously creates a new event subscription or updates an existing event subscription. + +## SYNTAX + +``` +New-AzEventGridDomainEventSubscription -DomainName -EventSubscriptionName + -ResourceGroupName [-SubscriptionId ] + [-DeadLetterWithResourceIdentityType ] + [-DeadLetterWithResourceIdentityUserAssignedIdentity ] + [-DeliveryWithResourceIdentityDestinationEndpointType ] + [-DeliveryWithResourceIdentityType ] + [-DeliveryWithResourceIdentityUserAssignedIdentity ] [-EndpointType ] + [-EventDeliverySchema ] [-ExpirationTimeUtc ] + [-FilterAdvancedFilter ] [-FilterEnableAdvancedFilteringOnArray] + [-FilterIncludedEventType ] [-FilterIsSubjectCaseSensitive] [-FilterSubjectBeginsWith ] + [-FilterSubjectEndsWith ] [-Label ] [-RetryPolicyEventTimeToLiveInMinute ] + [-RetryPolicyMaxDeliveryAttempt ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] + [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Asynchronously creates a new event subscription or updates an existing event subscription. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeadLetterWithResourceIdentityType +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. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeadLetterWithResourceIdentityUserAssignedIdentity +The user identity associated with the resource. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeliveryWithResourceIdentityDestinationEndpointType +Type of the endpoint for the event subscription destination. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeliveryWithResourceIdentityType +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. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeliveryWithResourceIdentityUserAssignedIdentity +The user identity associated with the resource. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DomainName +Name of the domain topic. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EndpointType +Type of the endpoint for the event subscription destination. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EventDeliverySchema +The event delivery schema for the event subscription. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -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. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ExpirationTimeUtc +Expiration time of the event subscription. + +```yaml +Type: System.DateTime +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FilterAdvancedFilter +An array of advanced filters that are used for filtering event subscriptions. +To construct, see NOTES section for FILTERADVANCEDFILTER properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FilterEnableAdvancedFilteringOnArray +Allows advanced filters to be evaluated against an array of values instead of expecting a singular value. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FilterIncludedEventType +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. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FilterIsSubjectCaseSensitive +Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filtershould be compared in a case sensitive manner. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FilterSubjectBeginsWith +An optional string to filter events for an event subscription based on a resource path prefix.The format of this depends on the publisher of the events.Wildcard characters are not supported in this path. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FilterSubjectEndsWith +An optional string to filter events for an event subscription based on a resource path suffix.Wildcard characters are not supported in this path. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Label +List of user defined labels. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -RetryPolicyEventTimeToLiveInMinute +Time To Live (in minutes) for events. + +```yaml +Type: System.Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -RetryPolicyMaxDeliveryAttempt +Maximum number of delivery retry attempts for events. + +```yaml +Type: System.Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription credentials that uniquely identify a Microsoft Azure subscription. +The subscription ID forms part of the URI for every service call. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +FILTERADVANCEDFILTER : An array of advanced filters that are used for filtering event subscriptions. + - `OperatorType `: The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. + - `[Key ]`: The field/property in the event based on which you want to filter. + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/New-AzEventGridDomainKey.md b/swaggerci/eventgrid/docs/New-AzEventGridDomainKey.md new file mode 100644 index 000000000000..7c9e018686d6 --- /dev/null +++ b/swaggerci/eventgrid/docs/New-AzEventGridDomainKey.md @@ -0,0 +1,276 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/new-azeventgriddomainkey +schema: 2.0.0 +--- + +# New-AzEventGridDomainKey + +## SYNOPSIS +Regenerate a shared access key for a domain. + +## SYNTAX + +### RegenerateExpanded (Default) +``` +New-AzEventGridDomainKey -DomainName -ResourceGroupName -KeyName + [-SubscriptionId ] [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### Regenerate +``` +New-AzEventGridDomainKey -DomainName -ResourceGroupName + -RegenerateKeyRequest [-SubscriptionId ] [-DefaultProfile ] + [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### RegenerateViaIdentity +``` +New-AzEventGridDomainKey -InputObject -RegenerateKeyRequest + [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### RegenerateViaIdentityExpanded +``` +New-AzEventGridDomainKey -InputObject -KeyName [-DefaultProfile ] + [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Regenerate a shared access key for a domain. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DomainName +Name of the domain. + +```yaml +Type: System.String +Parameter Sets: Regenerate, RegenerateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +Parameter Sets: RegenerateViaIdentity, RegenerateViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -KeyName +Key name to regenerate key1 or key2. + +```yaml +Type: System.String +Parameter Sets: RegenerateExpanded, RegenerateViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -RegenerateKeyRequest +Domain regenerate share access key request. +To construct, see NOTES section for REGENERATEKEYREQUEST properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainRegenerateKeyRequest +Parameter Sets: Regenerate, RegenerateViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. + +```yaml +Type: System.String +Parameter Sets: Regenerate, RegenerateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription credentials that uniquely identify a Microsoft Azure subscription. +The subscription ID forms part of the URI for every service call. + +```yaml +Type: System.String +Parameter Sets: Regenerate, RegenerateExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainRegenerateKeyRequest + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainSharedAccessKeys + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[ChannelName ]`: Name of the channel. + - `[DomainName ]`: Name of the domain. + - `[DomainTopicName ]`: Name of the topic. + - `[EventChannelName ]`: Name of the event channel. + - `[EventSubscriptionName ]`: Name of the event subscription. + - `[Id ]`: Resource identity path + - `[Location ]`: Name of the location. + - `[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\'. + - `[PartnerDestinationName ]`: Name of the partner destination. + - `[PartnerNamespaceName ]`: Name of the partner namespace. + - `[PartnerRegistrationName ]`: Name of the partner registration. + - `[PartnerTopicName ]`: Name of the partner topic. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection connection. + - `[PrivateLinkResourceName ]`: The name of private link resource. + - `[ProviderNamespace ]`: Namespace of the provider of the topic. + - `[ResourceGroupName ]`: The name of the resource group within the partners subscription. + - `[ResourceName ]`: Name of the resource. + - `[ResourceTypeName ]`: Name of the resource type. + - `[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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + - `[SubscriptionId ]`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + - `[SystemTopicName ]`: Name of the system topic. + - `[TopicName ]`: Name of the domain topic. + - `[TopicTypeName ]`: Name of the topic type. + - `[VerifiedPartnerName ]`: Name of the verified partner. + +REGENERATEKEYREQUEST : Domain regenerate share access key request. + - `KeyName `: Key name to regenerate key1 or key2. + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/New-AzEventGridDomainTopicEventSubscription.md b/swaggerci/eventgrid/docs/New-AzEventGridDomainTopicEventSubscription.md new file mode 100644 index 000000000000..30d0da8d87fe --- /dev/null +++ b/swaggerci/eventgrid/docs/New-AzEventGridDomainTopicEventSubscription.md @@ -0,0 +1,512 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/new-azeventgriddomaintopiceventsubscription +schema: 2.0.0 +--- + +# New-AzEventGridDomainTopicEventSubscription + +## SYNOPSIS +Asynchronously creates a new event subscription or updates an existing event subscription. + +## SYNTAX + +``` +New-AzEventGridDomainTopicEventSubscription -DomainName -EventSubscriptionName + -ResourceGroupName -TopicName [-SubscriptionId ] + [-DeadLetterWithResourceIdentityType ] + [-DeadLetterWithResourceIdentityUserAssignedIdentity ] + [-DeliveryWithResourceIdentityDestinationEndpointType ] + [-DeliveryWithResourceIdentityType ] + [-DeliveryWithResourceIdentityUserAssignedIdentity ] [-EndpointType ] + [-EventDeliverySchema ] [-ExpirationTimeUtc ] + [-FilterAdvancedFilter ] [-FilterEnableAdvancedFilteringOnArray] + [-FilterIncludedEventType ] [-FilterIsSubjectCaseSensitive] [-FilterSubjectBeginsWith ] + [-FilterSubjectEndsWith ] [-Label ] [-RetryPolicyEventTimeToLiveInMinute ] + [-RetryPolicyMaxDeliveryAttempt ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] + [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Asynchronously creates a new event subscription or updates an existing event subscription. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeadLetterWithResourceIdentityType +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. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeadLetterWithResourceIdentityUserAssignedIdentity +The user identity associated with the resource. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeliveryWithResourceIdentityDestinationEndpointType +Type of the endpoint for the event subscription destination. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeliveryWithResourceIdentityType +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. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeliveryWithResourceIdentityUserAssignedIdentity +The user identity associated with the resource. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DomainName +Name of the top level domain. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EndpointType +Type of the endpoint for the event subscription destination. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EventDeliverySchema +The event delivery schema for the event subscription. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -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. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ExpirationTimeUtc +Expiration time of the event subscription. + +```yaml +Type: System.DateTime +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FilterAdvancedFilter +An array of advanced filters that are used for filtering event subscriptions. +To construct, see NOTES section for FILTERADVANCEDFILTER properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FilterEnableAdvancedFilteringOnArray +Allows advanced filters to be evaluated against an array of values instead of expecting a singular value. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FilterIncludedEventType +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. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FilterIsSubjectCaseSensitive +Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filtershould be compared in a case sensitive manner. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FilterSubjectBeginsWith +An optional string to filter events for an event subscription based on a resource path prefix.The format of this depends on the publisher of the events.Wildcard characters are not supported in this path. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FilterSubjectEndsWith +An optional string to filter events for an event subscription based on a resource path suffix.Wildcard characters are not supported in this path. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Label +List of user defined labels. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -RetryPolicyEventTimeToLiveInMinute +Time To Live (in minutes) for events. + +```yaml +Type: System.Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -RetryPolicyMaxDeliveryAttempt +Maximum number of delivery retry attempts for events. + +```yaml +Type: System.Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription credentials that uniquely identify a Microsoft Azure subscription. +The subscription ID forms part of the URI for every service call. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TopicName +Name of the domain topic. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +FILTERADVANCEDFILTER : An array of advanced filters that are used for filtering event subscriptions. + - `OperatorType `: The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. + - `[Key ]`: The field/property in the event based on which you want to filter. + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/New-AzEventGridEventChannel.md b/swaggerci/eventgrid/docs/New-AzEventGridEventChannel.md new file mode 100644 index 000000000000..79af38db04fb --- /dev/null +++ b/swaggerci/eventgrid/docs/New-AzEventGridEventChannel.md @@ -0,0 +1,324 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/new-azeventgrideventchannel +schema: 2.0.0 +--- + +# New-AzEventGridEventChannel + +## SYNOPSIS +Asynchronously creates a new event channel with the specified parameters. + +## SYNTAX + +``` +New-AzEventGridEventChannel -Name -PartnerNamespaceName -ResourceGroupName + [-SubscriptionId ] [-DestinationAzureSubscriptionId ] [-DestinationPartnerTopicName ] + [-DestinationResourceGroup ] [-EventChannelSource ] + [-ExpirationTimeIfNotActivatedUtc ] [-FilterAdvancedFilter ] + [-FilterEnableAdvancedFilteringOnArray] [-PartnerTopicFriendlyDescription ] + [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Asynchronously creates a new event channel with the specified parameters. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DestinationAzureSubscriptionId +Azure subscription ID of the customer creating the event channel. +The partner topicassociated with the event channel will be created under this Azure subscription. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DestinationPartnerTopicName +Name of the partner topic associated with the event channel. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DestinationResourceGroup +Azure Resource Group of the customer creating the event channel. +The partner topicassociated with the event channel will be created under this resource group. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EventChannelSource +The identifier of the resource that's the source of the events.This represents a unique resource in the partner's resource model. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ExpirationTimeIfNotActivatedUtc +Expiration time of the event channel. +If this timer expires while the corresponding partner topic is never activated,the event channel and corresponding partner topic are deleted. + +```yaml +Type: System.DateTime +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FilterAdvancedFilter +An array of advanced filters that are used for filtering event channels. +To construct, see NOTES section for FILTERADVANCEDFILTER properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FilterEnableAdvancedFilteringOnArray +Allows advanced filters to be evaluated against an array of values instead of expecting a singular value. +The default value is either false or null. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +Name of the event channel. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: EventChannelName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PartnerNamespaceName +Name of the partner namespace. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PartnerTopicFriendlyDescription +Friendly description about the topic. +This can be set by the publisher/partner to show custom description for the customer partner topic.This will be helpful to remove any ambiguity of the origin of creation of the partner topic for the customer. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription credentials that uniquely identify a Microsoft Azure subscription. +The subscription ID forms part of the URI for every service call. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannel + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +FILTERADVANCEDFILTER : An array of advanced filters that are used for filtering event channels. + - `OperatorType `: The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. + - `[Key ]`: The field/property in the event based on which you want to filter. + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/New-AzEventGridEventSubscription.md b/swaggerci/eventgrid/docs/New-AzEventGridEventSubscription.md new file mode 100644 index 000000000000..df737cccc73b --- /dev/null +++ b/swaggerci/eventgrid/docs/New-AzEventGridEventSubscription.md @@ -0,0 +1,467 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/new-azeventgrideventsubscription +schema: 2.0.0 +--- + +# New-AzEventGridEventSubscription + +## SYNOPSIS +Asynchronously creates a new event subscription or updates an existing event subscription based on the specified scope. + +## SYNTAX + +``` +New-AzEventGridEventSubscription -Name -Scope + [-DeadLetterWithResourceIdentityType ] + [-DeadLetterWithResourceIdentityUserAssignedIdentity ] + [-DeliveryWithResourceIdentityDestinationEndpointType ] + [-DeliveryWithResourceIdentityType ] + [-DeliveryWithResourceIdentityUserAssignedIdentity ] [-EndpointType ] + [-EventDeliverySchema ] [-ExpirationTimeUtc ] + [-FilterAdvancedFilter ] [-FilterEnableAdvancedFilteringOnArray] + [-FilterIncludedEventType ] [-FilterIsSubjectCaseSensitive] [-FilterSubjectBeginsWith ] + [-FilterSubjectEndsWith ] [-Label ] [-RetryPolicyEventTimeToLiveInMinute ] + [-RetryPolicyMaxDeliveryAttempt ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] + [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Asynchronously creates a new event subscription or updates an existing event subscription based on the specified scope. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeadLetterWithResourceIdentityType +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. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeadLetterWithResourceIdentityUserAssignedIdentity +The user identity associated with the resource. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeliveryWithResourceIdentityDestinationEndpointType +Type of the endpoint for the event subscription destination. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeliveryWithResourceIdentityType +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. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeliveryWithResourceIdentityUserAssignedIdentity +The user identity associated with the resource. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EndpointType +Type of the endpoint for the event subscription destination. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EventDeliverySchema +The event delivery schema for the event subscription. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ExpirationTimeUtc +Expiration time of the event subscription. + +```yaml +Type: System.DateTime +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FilterAdvancedFilter +An array of advanced filters that are used for filtering event subscriptions. +To construct, see NOTES section for FILTERADVANCEDFILTER properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FilterEnableAdvancedFilteringOnArray +Allows advanced filters to be evaluated against an array of values instead of expecting a singular value. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FilterIncludedEventType +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. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FilterIsSubjectCaseSensitive +Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filtershould be compared in a case sensitive manner. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FilterSubjectBeginsWith +An optional string to filter events for an event subscription based on a resource path prefix.The format of this depends on the publisher of the events.Wildcard characters are not supported in this path. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FilterSubjectEndsWith +An optional string to filter events for an event subscription based on a resource path suffix.Wildcard characters are not supported in this path. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Label +List of user defined labels. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +Name of the event subscription. +Event subscription names must be between 3 and 64 characters in length and should use alphanumeric letters only. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: EventSubscriptionName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -RetryPolicyEventTimeToLiveInMinute +Time To Live (in minutes) for events. + +```yaml +Type: System.Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -RetryPolicyMaxDeliveryAttempt +Maximum number of delivery retry attempts for events. + +```yaml +Type: System.Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +FILTERADVANCEDFILTER : An array of advanced filters that are used for filtering event subscriptions. + - `OperatorType `: The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. + - `[Key ]`: The field/property in the event based on which you want to filter. + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/New-AzEventGridPartnerConfiguration.md b/swaggerci/eventgrid/docs/New-AzEventGridPartnerConfiguration.md new file mode 100644 index 000000000000..c820c0509a4e --- /dev/null +++ b/swaggerci/eventgrid/docs/New-AzEventGridPartnerConfiguration.md @@ -0,0 +1,276 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/new-azeventgridpartnerconfiguration +schema: 2.0.0 +--- + +# New-AzEventGridPartnerConfiguration + +## SYNOPSIS +Synchronously creates or updates a partner configuration with the specified parameters. + +## SYNTAX + +``` +New-AzEventGridPartnerConfiguration -ResourceGroupName [-SubscriptionId ] + [-Location ] [-PartnerAuthorizationAuthorizedPartnersList ] + [-PartnerAuthorizationDefaultMaximumExpirationTimeInDay ] + [-ProvisioningState ] [-Tag ] [-DefaultProfile ] + [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Synchronously creates or updates a partner configuration with the specified parameters. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Location +Location of the resource. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PartnerAuthorizationAuthorizedPartnersList +The list of authorized partners. +To construct, see NOTES section for PARTNERAUTHORIZATIONAUTHORIZEDPARTNERSLIST properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartner[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PartnerAuthorizationDefaultMaximumExpirationTimeInDay +Time used to validate the authorization expiration time for each authorized partner. +If DefaultMaximumExpirationTimeInDays isnot specified, the default is 7 days. +Otherwise, allowed values are between 1 and 365 days. + +```yaml +Type: System.Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ProvisioningState +Provisioning state of the partner configuration. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerConfigurationProvisioningState +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription credentials that uniquely identify a Microsoft Azure subscription. +The subscription ID forms part of the URI for every service call. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Tag +Tags of the resource. + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfiguration + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +PARTNERAUTHORIZATIONAUTHORIZEDPARTNERSLIST : The list of authorized partners. + - `[AuthorizationExpirationTimeInUtc ]`: Expiration time of the partner authorization. If this timer expires, any request from this partner to create, update or delete resources in subscriber's context will fail. If specified, the allowed values are between 1 to the value of defaultMaximumExpirationTimeInDays specified in PartnerConfiguration. If not specified, the default value will be the value of defaultMaximumExpirationTimeInDays specified in PartnerConfiguration or 7 if this value is not specified. + - `[Name ]`: The partner name. + - `[RegistrationImmutableId ]`: The immutableId of the corresponding partner registration. + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/New-AzEventGridPartnerDestination.md b/swaggerci/eventgrid/docs/New-AzEventGridPartnerDestination.md new file mode 100644 index 000000000000..28d1c23a2a36 --- /dev/null +++ b/swaggerci/eventgrid/docs/New-AzEventGridPartnerDestination.md @@ -0,0 +1,310 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/new-azeventgridpartnerdestination +schema: 2.0.0 +--- + +# New-AzEventGridPartnerDestination + +## SYNOPSIS +Asynchronously creates a new partner destination with the specified parameters. + +## SYNTAX + +``` +New-AzEventGridPartnerDestination -Name -ResourceGroupName -Location + [-SubscriptionId ] [-ActivationState ] [-EndpointBaseUrl ] + [-EndpointServiceContext ] [-ExpirationTimeIfNotActivatedUtc ] + [-MessageForActivation ] [-PartnerRegistrationImmutableId ] + [-ProvisioningState ] [-Tag ] [-DefaultProfile ] + [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Asynchronously creates a new partner destination with the specified parameters. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -ActivationState +Activation state of the partner destination. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerDestinationActivationState +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EndpointBaseUrl +Endpoint Base URL of the partner destination + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EndpointServiceContext +Endpoint context associated with this partner destination. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ExpirationTimeIfNotActivatedUtc +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. + +```yaml +Type: System.DateTime +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Location +Location of the resource. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -MessageForActivation +Context or helpful message that can be used during the approval process. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +Name of the partner destination. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: PartnerDestinationName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PartnerRegistrationImmutableId +The immutable Id of the corresponding partner registration. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ProvisioningState +Provisioning state of the partner destination. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerDestinationProvisioningState +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription credentials that uniquely identify a Microsoft Azure subscription. +The subscription ID forms part of the URI for every service call. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Tag +Tags of the resource. + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestination + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/New-AzEventGridPartnerNamespace.md b/swaggerci/eventgrid/docs/New-AzEventGridPartnerNamespace.md new file mode 100644 index 000000000000..a947b85e8a95 --- /dev/null +++ b/swaggerci/eventgrid/docs/New-AzEventGridPartnerNamespace.md @@ -0,0 +1,324 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/new-azeventgridpartnernamespace +schema: 2.0.0 +--- + +# New-AzEventGridPartnerNamespace + +## SYNOPSIS +Asynchronously creates a new partner namespace with the specified parameters. + +## SYNTAX + +``` +New-AzEventGridPartnerNamespace -Name -ResourceGroupName -Location + [-SubscriptionId ] [-DisableLocalAuth] [-InboundIPRule ] + [-PartnerRegistrationFullyQualifiedId ] [-PartnerTopicRoutingMode ] + [-PublicNetworkAccess ] [-Tag ] [-DefaultProfile ] [-AsJob] + [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Asynchronously creates a new partner namespace with the specified parameters. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DisableLocalAuth +This boolean is used to enable or disable local auth. +Default value is false. +When the property is set to true, only AAD token will be used to authenticate if user is allowed to publish to the partner namespace. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InboundIPRule +This can be used to restrict traffic from specific IPs instead of all IPs. +Note: These are considered only if PublicNetworkAccess is enabled. +To construct, see NOTES section for INBOUNDIPRULE properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Location +Location of the resource. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +Name of the partner namespace. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: PartnerNamespaceName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PartnerRegistrationFullyQualifiedId +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}. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PartnerTopicRoutingMode +This determines if events published to this partner namespace should use the source attribute in the event payloador use the channel name in the header when matching to the partner topic. +If none is specified, source attribute routing will be used to match the partner topic. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicRoutingMode +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PublicNetworkAccess +This determines if traffic is allowed over public network. +By default it is enabled.You can further restrict to specific IPs by configuring \ + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription credentials that uniquely identify a Microsoft Azure subscription. +The subscription ID forms part of the URI for every service call. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Tag +Tags of the resource. + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INBOUNDIPRULE : This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess is enabled. + - `[Action ]`: Action to perform based on the match or no match of the IpMask. + - `[IPMask ]`: IP Address in CIDR notation e.g., 10.0.0.0/8. + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/New-AzEventGridPartnerNamespaceKey.md b/swaggerci/eventgrid/docs/New-AzEventGridPartnerNamespaceKey.md new file mode 100644 index 000000000000..690c0baf611a --- /dev/null +++ b/swaggerci/eventgrid/docs/New-AzEventGridPartnerNamespaceKey.md @@ -0,0 +1,278 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/new-azeventgridpartnernamespacekey +schema: 2.0.0 +--- + +# New-AzEventGridPartnerNamespaceKey + +## SYNOPSIS +Regenerate a shared access key for a partner namespace. + +## SYNTAX + +### RegenerateExpanded (Default) +``` +New-AzEventGridPartnerNamespaceKey -PartnerNamespaceName -ResourceGroupName + -KeyName [-SubscriptionId ] [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] + [] +``` + +### Regenerate +``` +New-AzEventGridPartnerNamespaceKey -PartnerNamespaceName -ResourceGroupName + -RegenerateKeyRequest [-SubscriptionId ] + [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### RegenerateViaIdentity +``` +New-AzEventGridPartnerNamespaceKey -InputObject + -RegenerateKeyRequest [-DefaultProfile ] [-PassThru] + [-Confirm] [-WhatIf] [] +``` + +### RegenerateViaIdentityExpanded +``` +New-AzEventGridPartnerNamespaceKey -InputObject -KeyName + [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Regenerate a shared access key for a partner namespace. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +Parameter Sets: RegenerateViaIdentity, RegenerateViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -KeyName +Key name to regenerate (key1 or key2). + +```yaml +Type: System.String +Parameter Sets: RegenerateExpanded, RegenerateViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PartnerNamespaceName +Name of the partner namespace. + +```yaml +Type: System.String +Parameter Sets: Regenerate, RegenerateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -RegenerateKeyRequest +PartnerNamespace regenerate shared access key request. +To construct, see NOTES section for REGENERATEKEYREQUEST properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceRegenerateKeyRequest +Parameter Sets: Regenerate, RegenerateViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. + +```yaml +Type: System.String +Parameter Sets: Regenerate, RegenerateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription credentials that uniquely identify a Microsoft Azure subscription. +The subscription ID forms part of the URI for every service call. + +```yaml +Type: System.String +Parameter Sets: Regenerate, RegenerateExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceRegenerateKeyRequest + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceSharedAccessKeys + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[ChannelName ]`: Name of the channel. + - `[DomainName ]`: Name of the domain. + - `[DomainTopicName ]`: Name of the topic. + - `[EventChannelName ]`: Name of the event channel. + - `[EventSubscriptionName ]`: Name of the event subscription. + - `[Id ]`: Resource identity path + - `[Location ]`: Name of the location. + - `[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\'. + - `[PartnerDestinationName ]`: Name of the partner destination. + - `[PartnerNamespaceName ]`: Name of the partner namespace. + - `[PartnerRegistrationName ]`: Name of the partner registration. + - `[PartnerTopicName ]`: Name of the partner topic. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection connection. + - `[PrivateLinkResourceName ]`: The name of private link resource. + - `[ProviderNamespace ]`: Namespace of the provider of the topic. + - `[ResourceGroupName ]`: The name of the resource group within the partners subscription. + - `[ResourceName ]`: Name of the resource. + - `[ResourceTypeName ]`: Name of the resource type. + - `[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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + - `[SubscriptionId ]`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + - `[SystemTopicName ]`: Name of the system topic. + - `[TopicName ]`: Name of the domain topic. + - `[TopicTypeName ]`: Name of the topic type. + - `[VerifiedPartnerName ]`: Name of the verified partner. + +REGENERATEKEYREQUEST : PartnerNamespace regenerate shared access key request. + - `KeyName `: Key name to regenerate (key1 or key2). + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/New-AzEventGridPartnerRegistration.md b/swaggerci/eventgrid/docs/New-AzEventGridPartnerRegistration.md new file mode 100644 index 000000000000..bb0ceea1ae54 --- /dev/null +++ b/swaggerci/eventgrid/docs/New-AzEventGridPartnerRegistration.md @@ -0,0 +1,441 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/new-azeventgridpartnerregistration +schema: 2.0.0 +--- + +# New-AzEventGridPartnerRegistration + +## SYNOPSIS +Creates a new partner registration with the specified parameters. + +## SYNTAX + +``` +New-AzEventGridPartnerRegistration -Name -ResourceGroupName -Location + [-SubscriptionId ] [-AuthorizedAzureSubscriptionId ] [-CustomerServiceUri ] + [-LogoUri ] [-LongDescription ] [-PartnerCustomerServiceExtension ] + [-PartnerCustomerServiceNumber ] [-PartnerName ] [-PartnerRegistrationImmutableId ] + [-PartnerResourceTypeDescription ] [-PartnerResourceTypeDisplayName ] + [-PartnerResourceTypeName ] [-SetupUri ] [-Tag ] + [-VisibilityState ] [-DefaultProfile ] [-AsJob] [-NoWait] + [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Creates a new partner registration with the specified parameters. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AuthorizedAzureSubscriptionId +List of Azure subscription Ids that are authorized to create a partner namespaceassociated with this partner registration. +This is an optional property. +Creatingpartner namespaces is always permitted under the same Azure subscription as the one usedfor creating the partner registration. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -CustomerServiceUri +The extension of the customer service URI of the publisher. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Location +Location of the resource. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -LogoUri +URI of the logo. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -LongDescription +Long description for the custom scenarios and integration to be displayed in the portal if needed.Length of this description should not exceed 2048 characters. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +Name of the partner registration. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: PartnerRegistrationName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PartnerCustomerServiceExtension +The extension of the customer service number of the publisher. +Only digits are allowed and number of digits should not exceed 10. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PartnerCustomerServiceNumber +The customer service number of the publisher. +The expected phone format should start with a '+' sign followed by the country code. +The remaining digits are then followed. +Only digits and spaces are allowed and itslength cannot exceed 16 digits including country code. +Examples of valid phone numbers are: +1 515 123 4567 and+966 7 5115 2471. +Examples of invalid phone numbers are: +1 (515) 123-4567, 1 515 123 4567 and +966 121 5115 24 7 551 1234 43 + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PartnerName +Official name of the partner name. +For example: "Contoso". + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PartnerRegistrationImmutableId +The immutableId of the corresponding partner registration. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PartnerResourceTypeDescription +Short description of the partner resource type. +The length of this description should not exceed 256 characters. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PartnerResourceTypeDisplayName +Display name of the partner resource type. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PartnerResourceTypeName +Name of the partner resource type. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SetupUri +URI of the partner website that can be used by Azure customers to setup Event Gridintegration on an event source. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription credentials that uniquely identify a Microsoft Azure subscription. +The subscription ID forms part of the URI for every service call. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Tag +Tags of the resource. + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -VisibilityState +Visibility state of the partner registration. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerRegistrationVisibilityState +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistration + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/New-AzEventGridPartnerTopic.md b/swaggerci/eventgrid/docs/New-AzEventGridPartnerTopic.md new file mode 100644 index 000000000000..0d695ef132ca --- /dev/null +++ b/swaggerci/eventgrid/docs/New-AzEventGridPartnerTopic.md @@ -0,0 +1,392 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/new-azeventgridpartnertopic +schema: 2.0.0 +--- + +# New-AzEventGridPartnerTopic + +## SYNOPSIS +Asynchronously creates a new partner topic with the specified parameters. + +## SYNTAX + +``` +New-AzEventGridPartnerTopic -Name -ResourceGroupName -Location + [-SubscriptionId ] [-ActivationState ] + [-EventTypeInfoInlineEventType ] [-EventTypeInfoKind ] + [-ExpirationTimeIfNotActivatedUtc ] [-IdentityPrincipalId ] [-IdentityTenantId ] + [-IdentityType ] [-IdentityUserAssignedIdentity ] [-MessageForActivation ] + [-PartnerRegistrationImmutableId ] [-PartnerTopicFriendlyDescription ] [-Source ] + [-Tag ] [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Asynchronously creates a new partner topic with the specified parameters. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -ActivationState +Activation state of the partner topic. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicActivationState +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EventTypeInfoInlineEventType +A collection of inline event types for the resource. +The inline event type keys are of type string which represents the name of the event.An example of a valid inline event name is "Contoso.OrderCreated".The inline event type values are of type InlineEventProperties and will contain additional information for every inline event type. + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EventTypeInfoKind +The kind of event type used. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ExpirationTimeIfNotActivatedUtc +Expiration time of the partner topic. +If this timer expires while the partner topic is still never activated,the partner topic and corresponding event channel are deleted. + +```yaml +Type: System.DateTime +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IdentityPrincipalId +The principal ID of resource identity. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IdentityTenantId +The tenant ID of resource. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IdentityType +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. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IdentityUserAssignedIdentity +The list of user identities associated with the resource. +The user identity dictionary key references will be ARM resource ids in the form:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.This property is currently not used and reserved for future usage. + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Location +Location of the resource. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -MessageForActivation +Context or helpful message that can be used during the approval process by the subscriber. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +Name of the partner topic. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: PartnerTopicName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PartnerRegistrationImmutableId +The immutableId of the corresponding partner registration. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PartnerTopicFriendlyDescription +Friendly description about the topic. +This can be set by the publisher/partner to show custom description for the customer partner topic.This will be helpful to remove any ambiguity of the origin of creation of the partner topic for the customer. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Source +Source associated with this partner topic. +This represents a unique partner resource. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription credentials that uniquely identify a Microsoft Azure subscription. +The subscription ID forms part of the URI for every service call. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Tag +Tags of the resource. + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopic + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/New-AzEventGridPartnerTopicEventSubscription.md b/swaggerci/eventgrid/docs/New-AzEventGridPartnerTopicEventSubscription.md new file mode 100644 index 000000000000..243f487514ba --- /dev/null +++ b/swaggerci/eventgrid/docs/New-AzEventGridPartnerTopicEventSubscription.md @@ -0,0 +1,499 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/new-azeventgridpartnertopiceventsubscription +schema: 2.0.0 +--- + +# New-AzEventGridPartnerTopicEventSubscription + +## SYNOPSIS +Asynchronously creates or updates an event subscription of a partner topic with the specified parameters. +Existing event subscriptions will be updated with this API. + +## SYNTAX + +``` +New-AzEventGridPartnerTopicEventSubscription -EventSubscriptionName -PartnerTopicName + -ResourceGroupName [-SubscriptionId ] + [-DeadLetterWithResourceIdentityType ] + [-DeadLetterWithResourceIdentityUserAssignedIdentity ] + [-DeliveryWithResourceIdentityDestinationEndpointType ] + [-DeliveryWithResourceIdentityType ] + [-DeliveryWithResourceIdentityUserAssignedIdentity ] [-EndpointType ] + [-EventDeliverySchema ] [-ExpirationTimeUtc ] + [-FilterAdvancedFilter ] [-FilterEnableAdvancedFilteringOnArray] + [-FilterIncludedEventType ] [-FilterIsSubjectCaseSensitive] [-FilterSubjectBeginsWith ] + [-FilterSubjectEndsWith ] [-Label ] [-RetryPolicyEventTimeToLiveInMinute ] + [-RetryPolicyMaxDeliveryAttempt ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] + [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Asynchronously creates or updates an event subscription of a partner topic with the specified parameters. +Existing event subscriptions will be updated with this API. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeadLetterWithResourceIdentityType +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. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeadLetterWithResourceIdentityUserAssignedIdentity +The user identity associated with the resource. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeliveryWithResourceIdentityDestinationEndpointType +Type of the endpoint for the event subscription destination. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeliveryWithResourceIdentityType +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. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeliveryWithResourceIdentityUserAssignedIdentity +The user identity associated with the resource. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EndpointType +Type of the endpoint for the event subscription destination. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EventDeliverySchema +The event delivery schema for the event subscription. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -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. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ExpirationTimeUtc +Expiration time of the event subscription. + +```yaml +Type: System.DateTime +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FilterAdvancedFilter +An array of advanced filters that are used for filtering event subscriptions. +To construct, see NOTES section for FILTERADVANCEDFILTER properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FilterEnableAdvancedFilteringOnArray +Allows advanced filters to be evaluated against an array of values instead of expecting a singular value. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FilterIncludedEventType +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. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FilterIsSubjectCaseSensitive +Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filtershould be compared in a case sensitive manner. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FilterSubjectBeginsWith +An optional string to filter events for an event subscription based on a resource path prefix.The format of this depends on the publisher of the events.Wildcard characters are not supported in this path. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FilterSubjectEndsWith +An optional string to filter events for an event subscription based on a resource path suffix.Wildcard characters are not supported in this path. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Label +List of user defined labels. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PartnerTopicName +Name of the partner topic. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -RetryPolicyEventTimeToLiveInMinute +Time To Live (in minutes) for events. + +```yaml +Type: System.Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -RetryPolicyMaxDeliveryAttempt +Maximum number of delivery retry attempts for events. + +```yaml +Type: System.Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription credentials that uniquely identify a Microsoft Azure subscription. +The subscription ID forms part of the URI for every service call. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +FILTERADVANCEDFILTER : An array of advanced filters that are used for filtering event subscriptions. + - `OperatorType `: The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. + - `[Key ]`: The field/property in the event based on which you want to filter. + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/New-AzEventGridSystemTopic.md b/swaggerci/eventgrid/docs/New-AzEventGridSystemTopic.md new file mode 100644 index 000000000000..41f9c34cfc90 --- /dev/null +++ b/swaggerci/eventgrid/docs/New-AzEventGridSystemTopic.md @@ -0,0 +1,326 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/new-azeventgridsystemtopic +schema: 2.0.0 +--- + +# New-AzEventGridSystemTopic + +## SYNOPSIS +Asynchronously creates a new system topic with the specified parameters. + +## SYNTAX + +``` +New-AzEventGridSystemTopic -Name -ResourceGroupName -Location + [-SubscriptionId ] [-IdentityPrincipalId ] [-IdentityTenantId ] + [-IdentityType ] [-IdentityUserAssignedIdentity ] [-Source ] + [-Tag ] [-TopicType ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] + [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Asynchronously creates a new system topic with the specified parameters. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IdentityPrincipalId +The principal ID of resource identity. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IdentityTenantId +The tenant ID of resource. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IdentityType +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. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IdentityUserAssignedIdentity +The list of user identities associated with the resource. +The user identity dictionary key references will be ARM resource ids in the form:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.This property is currently not used and reserved for future usage. + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Location +Location of the resource. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +Name of the system topic. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: SystemTopicName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Source +Source for the system topic. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription credentials that uniquely identify a Microsoft Azure subscription. +The subscription ID forms part of the URI for every service call. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Tag +Tags of the resource. + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TopicType +TopicType for the system topic. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopic + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/New-AzEventGridSystemTopicEventSubscription.md b/swaggerci/eventgrid/docs/New-AzEventGridSystemTopicEventSubscription.md new file mode 100644 index 000000000000..398a9ad8e4b4 --- /dev/null +++ b/swaggerci/eventgrid/docs/New-AzEventGridSystemTopicEventSubscription.md @@ -0,0 +1,499 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/new-azeventgridsystemtopiceventsubscription +schema: 2.0.0 +--- + +# New-AzEventGridSystemTopicEventSubscription + +## SYNOPSIS +Asynchronously creates or updates an event subscription with the specified parameters. +Existing event subscriptions will be updated with this API. + +## SYNTAX + +``` +New-AzEventGridSystemTopicEventSubscription -EventSubscriptionName -ResourceGroupName + -SystemTopicName [-SubscriptionId ] + [-DeadLetterWithResourceIdentityType ] + [-DeadLetterWithResourceIdentityUserAssignedIdentity ] + [-DeliveryWithResourceIdentityDestinationEndpointType ] + [-DeliveryWithResourceIdentityType ] + [-DeliveryWithResourceIdentityUserAssignedIdentity ] [-EndpointType ] + [-EventDeliverySchema ] [-ExpirationTimeUtc ] + [-FilterAdvancedFilter ] [-FilterEnableAdvancedFilteringOnArray] + [-FilterIncludedEventType ] [-FilterIsSubjectCaseSensitive] [-FilterSubjectBeginsWith ] + [-FilterSubjectEndsWith ] [-Label ] [-RetryPolicyEventTimeToLiveInMinute ] + [-RetryPolicyMaxDeliveryAttempt ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] + [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Asynchronously creates or updates an event subscription with the specified parameters. +Existing event subscriptions will be updated with this API. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeadLetterWithResourceIdentityType +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. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeadLetterWithResourceIdentityUserAssignedIdentity +The user identity associated with the resource. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeliveryWithResourceIdentityDestinationEndpointType +Type of the endpoint for the event subscription destination. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeliveryWithResourceIdentityType +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. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeliveryWithResourceIdentityUserAssignedIdentity +The user identity associated with the resource. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EndpointType +Type of the endpoint for the event subscription destination. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EventDeliverySchema +The event delivery schema for the event subscription. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -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. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ExpirationTimeUtc +Expiration time of the event subscription. + +```yaml +Type: System.DateTime +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FilterAdvancedFilter +An array of advanced filters that are used for filtering event subscriptions. +To construct, see NOTES section for FILTERADVANCEDFILTER properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FilterEnableAdvancedFilteringOnArray +Allows advanced filters to be evaluated against an array of values instead of expecting a singular value. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FilterIncludedEventType +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. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FilterIsSubjectCaseSensitive +Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filtershould be compared in a case sensitive manner. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FilterSubjectBeginsWith +An optional string to filter events for an event subscription based on a resource path prefix.The format of this depends on the publisher of the events.Wildcard characters are not supported in this path. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FilterSubjectEndsWith +An optional string to filter events for an event subscription based on a resource path suffix.Wildcard characters are not supported in this path. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Label +List of user defined labels. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -RetryPolicyEventTimeToLiveInMinute +Time To Live (in minutes) for events. + +```yaml +Type: System.Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -RetryPolicyMaxDeliveryAttempt +Maximum number of delivery retry attempts for events. + +```yaml +Type: System.Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription credentials that uniquely identify a Microsoft Azure subscription. +The subscription ID forms part of the URI for every service call. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SystemTopicName +Name of the system topic. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +FILTERADVANCEDFILTER : An array of advanced filters that are used for filtering event subscriptions. + - `OperatorType `: The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. + - `[Key ]`: The field/property in the event based on which you want to filter. + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/New-AzEventGridTopic.md b/swaggerci/eventgrid/docs/New-AzEventGridTopic.md new file mode 100644 index 000000000000..eaae02c3e85b --- /dev/null +++ b/swaggerci/eventgrid/docs/New-AzEventGridTopic.md @@ -0,0 +1,449 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/new-azeventgridtopic +schema: 2.0.0 +--- + +# New-AzEventGridTopic + +## SYNOPSIS +Asynchronously creates a new topic with the specified parameters. + +## SYNTAX + +``` +New-AzEventGridTopic -Name -ResourceGroupName -Location [-SubscriptionId ] + [-DataResidencyBoundary ] [-DisableLocalAuth] [-ExtendedLocationName ] + [-ExtendedLocationType ] [-IdentityPrincipalId ] [-IdentityTenantId ] + [-IdentityType ] [-IdentityUserAssignedIdentity ] + [-InboundIPRule ] [-InputSchema ] [-Kind ] + [-PublicNetworkAccess ] [-SkuName ] [-Tag ] [-DefaultProfile ] + [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Asynchronously creates a new topic with the specified parameters. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DataResidencyBoundary +Data Residency Boundary of the resource. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DisableLocalAuth +This boolean is used to enable or disable local auth. +Default value is false. +When the property is set to true, only AAD token will be used to authenticate if user is allowed to publish to the topic. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ExtendedLocationName +Fully qualified name of the extended location. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ExtendedLocationType +Type of the extended location. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IdentityPrincipalId +The principal ID of resource identity. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IdentityTenantId +The tenant ID of resource. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IdentityType +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. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IdentityUserAssignedIdentity +The list of user identities associated with the resource. +The user identity dictionary key references will be ARM resource ids in the form:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.This property is currently not used and reserved for future usage. + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InboundIPRule +This can be used to restrict traffic from specific IPs instead of all IPs. +Note: These are considered only if PublicNetworkAccess is enabled. +To construct, see NOTES section for INBOUNDIPRULE properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputSchema +This determines the format that Event Grid should expect for incoming events published to the topic. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.InputSchema +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Kind +Kind of the resource. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceKind +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Location +Location of the resource. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +Name of the topic. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: TopicName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PublicNetworkAccess +This determines if traffic is allowed over public network. +By default it is enabled. +You can further restrict to specific IPs by configuring \ + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SkuName +The Sku name of the resource. +The possible values are: Basic or Premium. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription credentials that uniquely identify a Microsoft Azure subscription. +The subscription ID forms part of the URI for every service call. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Tag +Tags of the resource. + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INBOUNDIPRULE : This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess is enabled. + - `[Action ]`: Action to perform based on the match or no match of the IpMask. + - `[IPMask ]`: IP Address in CIDR notation e.g., 10.0.0.0/8. + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/New-AzEventGridTopicEventSubscription.md b/swaggerci/eventgrid/docs/New-AzEventGridTopicEventSubscription.md new file mode 100644 index 000000000000..279f7e637ba0 --- /dev/null +++ b/swaggerci/eventgrid/docs/New-AzEventGridTopicEventSubscription.md @@ -0,0 +1,497 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/new-azeventgridtopiceventsubscription +schema: 2.0.0 +--- + +# New-AzEventGridTopicEventSubscription + +## SYNOPSIS +Asynchronously creates a new event subscription or updates an existing event subscription. + +## SYNTAX + +``` +New-AzEventGridTopicEventSubscription -EventSubscriptionName -ResourceGroupName + -TopicName [-SubscriptionId ] + [-DeadLetterWithResourceIdentityType ] + [-DeadLetterWithResourceIdentityUserAssignedIdentity ] + [-DeliveryWithResourceIdentityDestinationEndpointType ] + [-DeliveryWithResourceIdentityType ] + [-DeliveryWithResourceIdentityUserAssignedIdentity ] [-EndpointType ] + [-EventDeliverySchema ] [-ExpirationTimeUtc ] + [-FilterAdvancedFilter ] [-FilterEnableAdvancedFilteringOnArray] + [-FilterIncludedEventType ] [-FilterIsSubjectCaseSensitive] [-FilterSubjectBeginsWith ] + [-FilterSubjectEndsWith ] [-Label ] [-RetryPolicyEventTimeToLiveInMinute ] + [-RetryPolicyMaxDeliveryAttempt ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] + [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Asynchronously creates a new event subscription or updates an existing event subscription. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeadLetterWithResourceIdentityType +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. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeadLetterWithResourceIdentityUserAssignedIdentity +The user identity associated with the resource. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeliveryWithResourceIdentityDestinationEndpointType +Type of the endpoint for the event subscription destination. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeliveryWithResourceIdentityType +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. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeliveryWithResourceIdentityUserAssignedIdentity +The user identity associated with the resource. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EndpointType +Type of the endpoint for the event subscription destination. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EventDeliverySchema +The event delivery schema for the event subscription. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -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. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ExpirationTimeUtc +Expiration time of the event subscription. + +```yaml +Type: System.DateTime +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FilterAdvancedFilter +An array of advanced filters that are used for filtering event subscriptions. +To construct, see NOTES section for FILTERADVANCEDFILTER properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FilterEnableAdvancedFilteringOnArray +Allows advanced filters to be evaluated against an array of values instead of expecting a singular value. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FilterIncludedEventType +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. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FilterIsSubjectCaseSensitive +Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filtershould be compared in a case sensitive manner. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FilterSubjectBeginsWith +An optional string to filter events for an event subscription based on a resource path prefix.The format of this depends on the publisher of the events.Wildcard characters are not supported in this path. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FilterSubjectEndsWith +An optional string to filter events for an event subscription based on a resource path suffix.Wildcard characters are not supported in this path. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Label +List of user defined labels. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -RetryPolicyEventTimeToLiveInMinute +Time To Live (in minutes) for events. + +```yaml +Type: System.Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -RetryPolicyMaxDeliveryAttempt +Maximum number of delivery retry attempts for events. + +```yaml +Type: System.Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription credentials that uniquely identify a Microsoft Azure subscription. +The subscription ID forms part of the URI for every service call. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TopicName +Name of the domain topic. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +FILTERADVANCEDFILTER : An array of advanced filters that are used for filtering event subscriptions. + - `OperatorType `: The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. + - `[Key ]`: The field/property in the event based on which you want to filter. + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/New-AzEventGridTopicKey.md b/swaggerci/eventgrid/docs/New-AzEventGridTopicKey.md new file mode 100644 index 000000000000..fb33cbd877f2 --- /dev/null +++ b/swaggerci/eventgrid/docs/New-AzEventGridTopicKey.md @@ -0,0 +1,307 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/new-azeventgridtopickey +schema: 2.0.0 +--- + +# New-AzEventGridTopicKey + +## SYNOPSIS +Regenerate a shared access key for a topic. + +## SYNTAX + +### RegenerateExpanded (Default) +``` +New-AzEventGridTopicKey -ResourceGroupName -TopicName -KeyName + [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] + [] +``` + +### Regenerate +``` +New-AzEventGridTopicKey -ResourceGroupName -TopicName + -RegenerateKeyRequest [-SubscriptionId ] [-DefaultProfile ] + [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### RegenerateViaIdentity +``` +New-AzEventGridTopicKey -InputObject -RegenerateKeyRequest + [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### RegenerateViaIdentityExpanded +``` +New-AzEventGridTopicKey -InputObject -KeyName [-DefaultProfile ] + [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Regenerate a shared access key for a topic. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +Parameter Sets: RegenerateViaIdentity, RegenerateViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -KeyName +Key name to regenerate key1 or key2 + +```yaml +Type: System.String +Parameter Sets: RegenerateExpanded, RegenerateViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -RegenerateKeyRequest +Topic regenerate share access key request +To construct, see NOTES section for REGENERATEKEYREQUEST properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicRegenerateKeyRequest +Parameter Sets: Regenerate, RegenerateViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. + +```yaml +Type: System.String +Parameter Sets: Regenerate, RegenerateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription credentials that uniquely identify a Microsoft Azure subscription. +The subscription ID forms part of the URI for every service call. + +```yaml +Type: System.String +Parameter Sets: Regenerate, RegenerateExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TopicName +Name of the topic. + +```yaml +Type: System.String +Parameter Sets: Regenerate, RegenerateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicRegenerateKeyRequest + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicSharedAccessKeys + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[ChannelName ]`: Name of the channel. + - `[DomainName ]`: Name of the domain. + - `[DomainTopicName ]`: Name of the topic. + - `[EventChannelName ]`: Name of the event channel. + - `[EventSubscriptionName ]`: Name of the event subscription. + - `[Id ]`: Resource identity path + - `[Location ]`: Name of the location. + - `[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\'. + - `[PartnerDestinationName ]`: Name of the partner destination. + - `[PartnerNamespaceName ]`: Name of the partner namespace. + - `[PartnerRegistrationName ]`: Name of the partner registration. + - `[PartnerTopicName ]`: Name of the partner topic. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection connection. + - `[PrivateLinkResourceName ]`: The name of private link resource. + - `[ProviderNamespace ]`: Namespace of the provider of the topic. + - `[ResourceGroupName ]`: The name of the resource group within the partners subscription. + - `[ResourceName ]`: Name of the resource. + - `[ResourceTypeName ]`: Name of the resource type. + - `[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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + - `[SubscriptionId ]`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + - `[SystemTopicName ]`: Name of the system topic. + - `[TopicName ]`: Name of the domain topic. + - `[TopicTypeName ]`: Name of the topic type. + - `[VerifiedPartnerName ]`: Name of the verified partner. + +REGENERATEKEYREQUEST : Topic regenerate share access key request + - `KeyName `: Key name to regenerate key1 or key2 + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/README.md b/swaggerci/eventgrid/docs/README.md new file mode 100644 index 000000000000..4dba8efda8f9 --- /dev/null +++ b/swaggerci/eventgrid/docs/README.md @@ -0,0 +1,11 @@ +# Docs +This directory contains the documentation of the cmdlets for the `Az.EventGrid` module. To run documentation generation, use the `generate-help.ps1` script at the root module folder. Files in this folder will *always be overridden on regeneration*. To update documentation examples, please use the `../examples` folder. + +## Info +- Modifiable: no +- Generated: all +- Committed: yes +- Packaged: yes + +## Details +The process of documentation generation loads `Az.EventGrid` and analyzes the exported cmdlets from the module. It recognizes the [help comments](https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_comment_based_help) that are generated into the scripts in the `../exports` folder. Additionally, when writing custom cmdlets in the `../custom` folder, you can use the help comments syntax, which decorate the exported scripts at build-time. The documentation examples are taken from the `../examples` folder. \ No newline at end of file diff --git a/swaggerci/eventgrid/docs/Remove-AzEventGridChannel.md b/swaggerci/eventgrid/docs/Remove-AzEventGridChannel.md new file mode 100644 index 000000000000..51db6611eb11 --- /dev/null +++ b/swaggerci/eventgrid/docs/Remove-AzEventGridChannel.md @@ -0,0 +1,273 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/remove-azeventgridchannel +schema: 2.0.0 +--- + +# Remove-AzEventGridChannel + +## SYNOPSIS +Delete an existing channel. + +## SYNTAX + +### Delete (Default) +``` +Remove-AzEventGridChannel -Name -PartnerNamespaceName -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] + [] +``` + +### DeleteViaIdentity +``` +Remove-AzEventGridChannel -InputObject [-DefaultProfile ] [-AsJob] [-NoWait] + [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Delete an existing channel. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +Parameter Sets: DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +Name of the channel. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: ChannelName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PartnerNamespaceName +Name of the partner namespace. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the partners subscription. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription credentials that uniquely identify a Microsoft Azure subscription. +The subscription ID forms part of the URI for every service call. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[ChannelName ]`: Name of the channel. + - `[DomainName ]`: Name of the domain. + - `[DomainTopicName ]`: Name of the topic. + - `[EventChannelName ]`: Name of the event channel. + - `[EventSubscriptionName ]`: Name of the event subscription. + - `[Id ]`: Resource identity path + - `[Location ]`: Name of the location. + - `[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\'. + - `[PartnerDestinationName ]`: Name of the partner destination. + - `[PartnerNamespaceName ]`: Name of the partner namespace. + - `[PartnerRegistrationName ]`: Name of the partner registration. + - `[PartnerTopicName ]`: Name of the partner topic. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection connection. + - `[PrivateLinkResourceName ]`: The name of private link resource. + - `[ProviderNamespace ]`: Namespace of the provider of the topic. + - `[ResourceGroupName ]`: The name of the resource group within the partners subscription. + - `[ResourceName ]`: Name of the resource. + - `[ResourceTypeName ]`: Name of the resource type. + - `[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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + - `[SubscriptionId ]`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + - `[SystemTopicName ]`: Name of the system topic. + - `[TopicName ]`: Name of the domain topic. + - `[TopicTypeName ]`: Name of the topic type. + - `[VerifiedPartnerName ]`: Name of the verified partner. + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/Remove-AzEventGridDomain.md b/swaggerci/eventgrid/docs/Remove-AzEventGridDomain.md new file mode 100644 index 000000000000..ed0a1ef0bfe0 --- /dev/null +++ b/swaggerci/eventgrid/docs/Remove-AzEventGridDomain.md @@ -0,0 +1,257 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/remove-azeventgriddomain +schema: 2.0.0 +--- + +# Remove-AzEventGridDomain + +## SYNOPSIS +Delete existing domain. + +## SYNTAX + +### Delete (Default) +``` +Remove-AzEventGridDomain -Name -ResourceGroupName [-SubscriptionId ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### DeleteViaIdentity +``` +Remove-AzEventGridDomain -InputObject [-DefaultProfile ] [-AsJob] [-NoWait] + [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Delete existing domain. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +Parameter Sets: DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +Name of the domain. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: DomainName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription credentials that uniquely identify a Microsoft Azure subscription. +The subscription ID forms part of the URI for every service call. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[ChannelName ]`: Name of the channel. + - `[DomainName ]`: Name of the domain. + - `[DomainTopicName ]`: Name of the topic. + - `[EventChannelName ]`: Name of the event channel. + - `[EventSubscriptionName ]`: Name of the event subscription. + - `[Id ]`: Resource identity path + - `[Location ]`: Name of the location. + - `[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\'. + - `[PartnerDestinationName ]`: Name of the partner destination. + - `[PartnerNamespaceName ]`: Name of the partner namespace. + - `[PartnerRegistrationName ]`: Name of the partner registration. + - `[PartnerTopicName ]`: Name of the partner topic. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection connection. + - `[PrivateLinkResourceName ]`: The name of private link resource. + - `[ProviderNamespace ]`: Namespace of the provider of the topic. + - `[ResourceGroupName ]`: The name of the resource group within the partners subscription. + - `[ResourceName ]`: Name of the resource. + - `[ResourceTypeName ]`: Name of the resource type. + - `[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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + - `[SubscriptionId ]`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + - `[SystemTopicName ]`: Name of the system topic. + - `[TopicName ]`: Name of the domain topic. + - `[TopicTypeName ]`: Name of the topic type. + - `[VerifiedPartnerName ]`: Name of the verified partner. + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/Remove-AzEventGridDomainEventSubscription.md b/swaggerci/eventgrid/docs/Remove-AzEventGridDomainEventSubscription.md new file mode 100644 index 000000000000..7eb4d2d7cfbc --- /dev/null +++ b/swaggerci/eventgrid/docs/Remove-AzEventGridDomainEventSubscription.md @@ -0,0 +1,274 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/remove-azeventgriddomaineventsubscription +schema: 2.0.0 +--- + +# Remove-AzEventGridDomainEventSubscription + +## SYNOPSIS +Delete an existing event subscription for a domain. + +## SYNTAX + +### Delete (Default) +``` +Remove-AzEventGridDomainEventSubscription -DomainName -EventSubscriptionName + -ResourceGroupName [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] + [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### DeleteViaIdentity +``` +Remove-AzEventGridDomainEventSubscription -InputObject [-DefaultProfile ] + [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Delete an existing event subscription for a domain. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DomainName +Name of the domain. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EventSubscriptionName +Name of the event subscription to be deleted. +Event subscription names must be between 3 and 100 characters in length and use alphanumeric letters only. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +Parameter Sets: DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription credentials that uniquely identify a Microsoft Azure subscription. +The subscription ID forms part of the URI for every service call. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[ChannelName ]`: Name of the channel. + - `[DomainName ]`: Name of the domain. + - `[DomainTopicName ]`: Name of the topic. + - `[EventChannelName ]`: Name of the event channel. + - `[EventSubscriptionName ]`: Name of the event subscription. + - `[Id ]`: Resource identity path + - `[Location ]`: Name of the location. + - `[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\'. + - `[PartnerDestinationName ]`: Name of the partner destination. + - `[PartnerNamespaceName ]`: Name of the partner namespace. + - `[PartnerRegistrationName ]`: Name of the partner registration. + - `[PartnerTopicName ]`: Name of the partner topic. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection connection. + - `[PrivateLinkResourceName ]`: The name of private link resource. + - `[ProviderNamespace ]`: Namespace of the provider of the topic. + - `[ResourceGroupName ]`: The name of the resource group within the partners subscription. + - `[ResourceName ]`: Name of the resource. + - `[ResourceTypeName ]`: Name of the resource type. + - `[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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + - `[SubscriptionId ]`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + - `[SystemTopicName ]`: Name of the system topic. + - `[TopicName ]`: Name of the domain topic. + - `[TopicTypeName ]`: Name of the topic type. + - `[VerifiedPartnerName ]`: Name of the verified partner. + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/Remove-AzEventGridDomainTopic.md b/swaggerci/eventgrid/docs/Remove-AzEventGridDomainTopic.md new file mode 100644 index 000000000000..b05fc2966e04 --- /dev/null +++ b/swaggerci/eventgrid/docs/Remove-AzEventGridDomainTopic.md @@ -0,0 +1,273 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/remove-azeventgriddomaintopic +schema: 2.0.0 +--- + +# Remove-AzEventGridDomainTopic + +## SYNOPSIS +Delete existing domain topic. + +## SYNTAX + +### Delete (Default) +``` +Remove-AzEventGridDomainTopic -DomainName -Name -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] + [] +``` + +### DeleteViaIdentity +``` +Remove-AzEventGridDomainTopic -InputObject [-DefaultProfile ] [-AsJob] + [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Delete existing domain topic. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DomainName +Name of the domain. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +Parameter Sets: DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +Name of the domain topic. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: DomainTopicName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription credentials that uniquely identify a Microsoft Azure subscription. +The subscription ID forms part of the URI for every service call. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[ChannelName ]`: Name of the channel. + - `[DomainName ]`: Name of the domain. + - `[DomainTopicName ]`: Name of the topic. + - `[EventChannelName ]`: Name of the event channel. + - `[EventSubscriptionName ]`: Name of the event subscription. + - `[Id ]`: Resource identity path + - `[Location ]`: Name of the location. + - `[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\'. + - `[PartnerDestinationName ]`: Name of the partner destination. + - `[PartnerNamespaceName ]`: Name of the partner namespace. + - `[PartnerRegistrationName ]`: Name of the partner registration. + - `[PartnerTopicName ]`: Name of the partner topic. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection connection. + - `[PrivateLinkResourceName ]`: The name of private link resource. + - `[ProviderNamespace ]`: Namespace of the provider of the topic. + - `[ResourceGroupName ]`: The name of the resource group within the partners subscription. + - `[ResourceName ]`: Name of the resource. + - `[ResourceTypeName ]`: Name of the resource type. + - `[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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + - `[SubscriptionId ]`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + - `[SystemTopicName ]`: Name of the system topic. + - `[TopicName ]`: Name of the domain topic. + - `[TopicTypeName ]`: Name of the topic type. + - `[VerifiedPartnerName ]`: Name of the verified partner. + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/Remove-AzEventGridDomainTopicEventSubscription.md b/swaggerci/eventgrid/docs/Remove-AzEventGridDomainTopicEventSubscription.md new file mode 100644 index 000000000000..49ed4e3d97af --- /dev/null +++ b/swaggerci/eventgrid/docs/Remove-AzEventGridDomainTopicEventSubscription.md @@ -0,0 +1,289 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/remove-azeventgriddomaintopiceventsubscription +schema: 2.0.0 +--- + +# Remove-AzEventGridDomainTopicEventSubscription + +## SYNOPSIS +Delete a nested existing event subscription for a domain topic. + +## SYNTAX + +### Delete (Default) +``` +Remove-AzEventGridDomainTopicEventSubscription -DomainName -EventSubscriptionName + -ResourceGroupName -TopicName [-SubscriptionId ] [-DefaultProfile ] + [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### DeleteViaIdentity +``` +Remove-AzEventGridDomainTopicEventSubscription -InputObject [-DefaultProfile ] + [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Delete a nested existing event subscription for a domain topic. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DomainName +Name of the top level domain. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EventSubscriptionName +Name of the event subscription to be deleted. +Event subscription names must be between 3 and 100 characters in length and use alphanumeric letters only. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +Parameter Sets: DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription credentials that uniquely identify a Microsoft Azure subscription. +The subscription ID forms part of the URI for every service call. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TopicName +Name of the domain topic. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[ChannelName ]`: Name of the channel. + - `[DomainName ]`: Name of the domain. + - `[DomainTopicName ]`: Name of the topic. + - `[EventChannelName ]`: Name of the event channel. + - `[EventSubscriptionName ]`: Name of the event subscription. + - `[Id ]`: Resource identity path + - `[Location ]`: Name of the location. + - `[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\'. + - `[PartnerDestinationName ]`: Name of the partner destination. + - `[PartnerNamespaceName ]`: Name of the partner namespace. + - `[PartnerRegistrationName ]`: Name of the partner registration. + - `[PartnerTopicName ]`: Name of the partner topic. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection connection. + - `[PrivateLinkResourceName ]`: The name of private link resource. + - `[ProviderNamespace ]`: Namespace of the provider of the topic. + - `[ResourceGroupName ]`: The name of the resource group within the partners subscription. + - `[ResourceName ]`: Name of the resource. + - `[ResourceTypeName ]`: Name of the resource type. + - `[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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + - `[SubscriptionId ]`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + - `[SystemTopicName ]`: Name of the system topic. + - `[TopicName ]`: Name of the domain topic. + - `[TopicTypeName ]`: Name of the topic type. + - `[VerifiedPartnerName ]`: Name of the verified partner. + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/Remove-AzEventGridEventChannel.md b/swaggerci/eventgrid/docs/Remove-AzEventGridEventChannel.md new file mode 100644 index 000000000000..11224b097aeb --- /dev/null +++ b/swaggerci/eventgrid/docs/Remove-AzEventGridEventChannel.md @@ -0,0 +1,273 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/remove-azeventgrideventchannel +schema: 2.0.0 +--- + +# Remove-AzEventGridEventChannel + +## SYNOPSIS +Delete existing event channel. + +## SYNTAX + +### Delete (Default) +``` +Remove-AzEventGridEventChannel -Name -PartnerNamespaceName -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] + [] +``` + +### DeleteViaIdentity +``` +Remove-AzEventGridEventChannel -InputObject [-DefaultProfile ] [-AsJob] + [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Delete existing event channel. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +Parameter Sets: DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +Name of the event channel. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: EventChannelName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PartnerNamespaceName +Name of the partner namespace. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription credentials that uniquely identify a Microsoft Azure subscription. +The subscription ID forms part of the URI for every service call. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[ChannelName ]`: Name of the channel. + - `[DomainName ]`: Name of the domain. + - `[DomainTopicName ]`: Name of the topic. + - `[EventChannelName ]`: Name of the event channel. + - `[EventSubscriptionName ]`: Name of the event subscription. + - `[Id ]`: Resource identity path + - `[Location ]`: Name of the location. + - `[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\'. + - `[PartnerDestinationName ]`: Name of the partner destination. + - `[PartnerNamespaceName ]`: Name of the partner namespace. + - `[PartnerRegistrationName ]`: Name of the partner registration. + - `[PartnerTopicName ]`: Name of the partner topic. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection connection. + - `[PrivateLinkResourceName ]`: The name of private link resource. + - `[ProviderNamespace ]`: Namespace of the provider of the topic. + - `[ResourceGroupName ]`: The name of the resource group within the partners subscription. + - `[ResourceName ]`: Name of the resource. + - `[ResourceTypeName ]`: Name of the resource type. + - `[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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + - `[SubscriptionId ]`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + - `[SystemTopicName ]`: Name of the system topic. + - `[TopicName ]`: Name of the domain topic. + - `[TopicTypeName ]`: Name of the topic type. + - `[VerifiedPartnerName ]`: Name of the verified partner. + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/Remove-AzEventGridEventSubscription.md b/swaggerci/eventgrid/docs/Remove-AzEventGridEventSubscription.md new file mode 100644 index 000000000000..6221d3439ef6 --- /dev/null +++ b/swaggerci/eventgrid/docs/Remove-AzEventGridEventSubscription.md @@ -0,0 +1,243 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/remove-azeventgrideventsubscription +schema: 2.0.0 +--- + +# Remove-AzEventGridEventSubscription + +## SYNOPSIS +Delete an existing event subscription. + +## SYNTAX + +### Delete (Default) +``` +Remove-AzEventGridEventSubscription -Name -Scope [-DefaultProfile ] [-AsJob] + [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### DeleteViaIdentity +``` +Remove-AzEventGridEventSubscription -InputObject [-DefaultProfile ] [-AsJob] + [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Delete an existing event subscription. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +Parameter Sets: DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +Name of the event subscription. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: EventSubscriptionName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[ChannelName ]`: Name of the channel. + - `[DomainName ]`: Name of the domain. + - `[DomainTopicName ]`: Name of the topic. + - `[EventChannelName ]`: Name of the event channel. + - `[EventSubscriptionName ]`: Name of the event subscription. + - `[Id ]`: Resource identity path + - `[Location ]`: Name of the location. + - `[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\'. + - `[PartnerDestinationName ]`: Name of the partner destination. + - `[PartnerNamespaceName ]`: Name of the partner namespace. + - `[PartnerRegistrationName ]`: Name of the partner registration. + - `[PartnerTopicName ]`: Name of the partner topic. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection connection. + - `[PrivateLinkResourceName ]`: The name of private link resource. + - `[ProviderNamespace ]`: Namespace of the provider of the topic. + - `[ResourceGroupName ]`: The name of the resource group within the partners subscription. + - `[ResourceName ]`: Name of the resource. + - `[ResourceTypeName ]`: Name of the resource type. + - `[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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + - `[SubscriptionId ]`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + - `[SystemTopicName ]`: Name of the system topic. + - `[TopicName ]`: Name of the domain topic. + - `[TopicTypeName ]`: Name of the topic type. + - `[VerifiedPartnerName ]`: Name of the verified partner. + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/Remove-AzEventGridPartnerConfiguration.md b/swaggerci/eventgrid/docs/Remove-AzEventGridPartnerConfiguration.md new file mode 100644 index 000000000000..8d0ceb488f14 --- /dev/null +++ b/swaggerci/eventgrid/docs/Remove-AzEventGridPartnerConfiguration.md @@ -0,0 +1,242 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/remove-azeventgridpartnerconfiguration +schema: 2.0.0 +--- + +# Remove-AzEventGridPartnerConfiguration + +## SYNOPSIS +Delete existing partner configuration. + +## SYNTAX + +### Delete (Default) +``` +Remove-AzEventGridPartnerConfiguration -ResourceGroupName [-SubscriptionId ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### DeleteViaIdentity +``` +Remove-AzEventGridPartnerConfiguration -InputObject [-DefaultProfile ] [-AsJob] + [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Delete existing partner configuration. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +Parameter Sets: DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription credentials that uniquely identify a Microsoft Azure subscription. +The subscription ID forms part of the URI for every service call. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[ChannelName ]`: Name of the channel. + - `[DomainName ]`: Name of the domain. + - `[DomainTopicName ]`: Name of the topic. + - `[EventChannelName ]`: Name of the event channel. + - `[EventSubscriptionName ]`: Name of the event subscription. + - `[Id ]`: Resource identity path + - `[Location ]`: Name of the location. + - `[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\'. + - `[PartnerDestinationName ]`: Name of the partner destination. + - `[PartnerNamespaceName ]`: Name of the partner namespace. + - `[PartnerRegistrationName ]`: Name of the partner registration. + - `[PartnerTopicName ]`: Name of the partner topic. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection connection. + - `[PrivateLinkResourceName ]`: The name of private link resource. + - `[ProviderNamespace ]`: Namespace of the provider of the topic. + - `[ResourceGroupName ]`: The name of the resource group within the partners subscription. + - `[ResourceName ]`: Name of the resource. + - `[ResourceTypeName ]`: Name of the resource type. + - `[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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + - `[SubscriptionId ]`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + - `[SystemTopicName ]`: Name of the system topic. + - `[TopicName ]`: Name of the domain topic. + - `[TopicTypeName ]`: Name of the topic type. + - `[VerifiedPartnerName ]`: Name of the verified partner. + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/Remove-AzEventGridPartnerDestination.md b/swaggerci/eventgrid/docs/Remove-AzEventGridPartnerDestination.md new file mode 100644 index 000000000000..91f167336efb --- /dev/null +++ b/swaggerci/eventgrid/docs/Remove-AzEventGridPartnerDestination.md @@ -0,0 +1,257 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/remove-azeventgridpartnerdestination +schema: 2.0.0 +--- + +# Remove-AzEventGridPartnerDestination + +## SYNOPSIS +Delete existing partner destination. + +## SYNTAX + +### Delete (Default) +``` +Remove-AzEventGridPartnerDestination -Name -ResourceGroupName [-SubscriptionId ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### DeleteViaIdentity +``` +Remove-AzEventGridPartnerDestination -InputObject [-DefaultProfile ] [-AsJob] + [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Delete existing partner destination. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +Parameter Sets: DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +Name of the partner destination. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: PartnerDestinationName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription credentials that uniquely identify a Microsoft Azure subscription. +The subscription ID forms part of the URI for every service call. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[ChannelName ]`: Name of the channel. + - `[DomainName ]`: Name of the domain. + - `[DomainTopicName ]`: Name of the topic. + - `[EventChannelName ]`: Name of the event channel. + - `[EventSubscriptionName ]`: Name of the event subscription. + - `[Id ]`: Resource identity path + - `[Location ]`: Name of the location. + - `[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\'. + - `[PartnerDestinationName ]`: Name of the partner destination. + - `[PartnerNamespaceName ]`: Name of the partner namespace. + - `[PartnerRegistrationName ]`: Name of the partner registration. + - `[PartnerTopicName ]`: Name of the partner topic. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection connection. + - `[PrivateLinkResourceName ]`: The name of private link resource. + - `[ProviderNamespace ]`: Namespace of the provider of the topic. + - `[ResourceGroupName ]`: The name of the resource group within the partners subscription. + - `[ResourceName ]`: Name of the resource. + - `[ResourceTypeName ]`: Name of the resource type. + - `[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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + - `[SubscriptionId ]`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + - `[SystemTopicName ]`: Name of the system topic. + - `[TopicName ]`: Name of the domain topic. + - `[TopicTypeName ]`: Name of the topic type. + - `[VerifiedPartnerName ]`: Name of the verified partner. + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/Remove-AzEventGridPartnerNamespace.md b/swaggerci/eventgrid/docs/Remove-AzEventGridPartnerNamespace.md new file mode 100644 index 000000000000..7cc129e9c173 --- /dev/null +++ b/swaggerci/eventgrid/docs/Remove-AzEventGridPartnerNamespace.md @@ -0,0 +1,257 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/remove-azeventgridpartnernamespace +schema: 2.0.0 +--- + +# Remove-AzEventGridPartnerNamespace + +## SYNOPSIS +Delete existing partner namespace. + +## SYNTAX + +### Delete (Default) +``` +Remove-AzEventGridPartnerNamespace -Name -ResourceGroupName [-SubscriptionId ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### DeleteViaIdentity +``` +Remove-AzEventGridPartnerNamespace -InputObject [-DefaultProfile ] [-AsJob] + [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Delete existing partner namespace. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +Parameter Sets: DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +Name of the partner namespace. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: PartnerNamespaceName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription credentials that uniquely identify a Microsoft Azure subscription. +The subscription ID forms part of the URI for every service call. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[ChannelName ]`: Name of the channel. + - `[DomainName ]`: Name of the domain. + - `[DomainTopicName ]`: Name of the topic. + - `[EventChannelName ]`: Name of the event channel. + - `[EventSubscriptionName ]`: Name of the event subscription. + - `[Id ]`: Resource identity path + - `[Location ]`: Name of the location. + - `[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\'. + - `[PartnerDestinationName ]`: Name of the partner destination. + - `[PartnerNamespaceName ]`: Name of the partner namespace. + - `[PartnerRegistrationName ]`: Name of the partner registration. + - `[PartnerTopicName ]`: Name of the partner topic. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection connection. + - `[PrivateLinkResourceName ]`: The name of private link resource. + - `[ProviderNamespace ]`: Namespace of the provider of the topic. + - `[ResourceGroupName ]`: The name of the resource group within the partners subscription. + - `[ResourceName ]`: Name of the resource. + - `[ResourceTypeName ]`: Name of the resource type. + - `[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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + - `[SubscriptionId ]`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + - `[SystemTopicName ]`: Name of the system topic. + - `[TopicName ]`: Name of the domain topic. + - `[TopicTypeName ]`: Name of the topic type. + - `[VerifiedPartnerName ]`: Name of the verified partner. + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/Remove-AzEventGridPartnerRegistration.md b/swaggerci/eventgrid/docs/Remove-AzEventGridPartnerRegistration.md new file mode 100644 index 000000000000..e01f03fe032e --- /dev/null +++ b/swaggerci/eventgrid/docs/Remove-AzEventGridPartnerRegistration.md @@ -0,0 +1,257 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/remove-azeventgridpartnerregistration +schema: 2.0.0 +--- + +# Remove-AzEventGridPartnerRegistration + +## SYNOPSIS +Deletes a partner registration with the specified parameters. + +## SYNTAX + +### Delete (Default) +``` +Remove-AzEventGridPartnerRegistration -Name -ResourceGroupName [-SubscriptionId ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### DeleteViaIdentity +``` +Remove-AzEventGridPartnerRegistration -InputObject [-DefaultProfile ] [-AsJob] + [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Deletes a partner registration with the specified parameters. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +Parameter Sets: DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +Name of the partner registration. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: PartnerRegistrationName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription credentials that uniquely identify a Microsoft Azure subscription. +The subscription ID forms part of the URI for every service call. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[ChannelName ]`: Name of the channel. + - `[DomainName ]`: Name of the domain. + - `[DomainTopicName ]`: Name of the topic. + - `[EventChannelName ]`: Name of the event channel. + - `[EventSubscriptionName ]`: Name of the event subscription. + - `[Id ]`: Resource identity path + - `[Location ]`: Name of the location. + - `[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\'. + - `[PartnerDestinationName ]`: Name of the partner destination. + - `[PartnerNamespaceName ]`: Name of the partner namespace. + - `[PartnerRegistrationName ]`: Name of the partner registration. + - `[PartnerTopicName ]`: Name of the partner topic. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection connection. + - `[PrivateLinkResourceName ]`: The name of private link resource. + - `[ProviderNamespace ]`: Namespace of the provider of the topic. + - `[ResourceGroupName ]`: The name of the resource group within the partners subscription. + - `[ResourceName ]`: Name of the resource. + - `[ResourceTypeName ]`: Name of the resource type. + - `[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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + - `[SubscriptionId ]`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + - `[SystemTopicName ]`: Name of the system topic. + - `[TopicName ]`: Name of the domain topic. + - `[TopicTypeName ]`: Name of the topic type. + - `[VerifiedPartnerName ]`: Name of the verified partner. + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/Remove-AzEventGridPartnerTopic.md b/swaggerci/eventgrid/docs/Remove-AzEventGridPartnerTopic.md new file mode 100644 index 000000000000..a511abe6c61f --- /dev/null +++ b/swaggerci/eventgrid/docs/Remove-AzEventGridPartnerTopic.md @@ -0,0 +1,257 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/remove-azeventgridpartnertopic +schema: 2.0.0 +--- + +# Remove-AzEventGridPartnerTopic + +## SYNOPSIS +Delete existing partner topic. + +## SYNTAX + +### Delete (Default) +``` +Remove-AzEventGridPartnerTopic -Name -ResourceGroupName [-SubscriptionId ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### DeleteViaIdentity +``` +Remove-AzEventGridPartnerTopic -InputObject [-DefaultProfile ] [-AsJob] + [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Delete existing partner topic. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +Parameter Sets: DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +Name of the partner topic. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: PartnerTopicName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription credentials that uniquely identify a Microsoft Azure subscription. +The subscription ID forms part of the URI for every service call. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[ChannelName ]`: Name of the channel. + - `[DomainName ]`: Name of the domain. + - `[DomainTopicName ]`: Name of the topic. + - `[EventChannelName ]`: Name of the event channel. + - `[EventSubscriptionName ]`: Name of the event subscription. + - `[Id ]`: Resource identity path + - `[Location ]`: Name of the location. + - `[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\'. + - `[PartnerDestinationName ]`: Name of the partner destination. + - `[PartnerNamespaceName ]`: Name of the partner namespace. + - `[PartnerRegistrationName ]`: Name of the partner registration. + - `[PartnerTopicName ]`: Name of the partner topic. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection connection. + - `[PrivateLinkResourceName ]`: The name of private link resource. + - `[ProviderNamespace ]`: Namespace of the provider of the topic. + - `[ResourceGroupName ]`: The name of the resource group within the partners subscription. + - `[ResourceName ]`: Name of the resource. + - `[ResourceTypeName ]`: Name of the resource type. + - `[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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + - `[SubscriptionId ]`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + - `[SystemTopicName ]`: Name of the system topic. + - `[TopicName ]`: Name of the domain topic. + - `[TopicTypeName ]`: Name of the topic type. + - `[VerifiedPartnerName ]`: Name of the verified partner. + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/Remove-AzEventGridPartnerTopicEventSubscription.md b/swaggerci/eventgrid/docs/Remove-AzEventGridPartnerTopicEventSubscription.md new file mode 100644 index 000000000000..ee190f560694 --- /dev/null +++ b/swaggerci/eventgrid/docs/Remove-AzEventGridPartnerTopicEventSubscription.md @@ -0,0 +1,274 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/remove-azeventgridpartnertopiceventsubscription +schema: 2.0.0 +--- + +# Remove-AzEventGridPartnerTopicEventSubscription + +## SYNOPSIS +Delete an existing event subscription of a partner topic. + +## SYNTAX + +### Delete (Default) +``` +Remove-AzEventGridPartnerTopicEventSubscription -EventSubscriptionName -PartnerTopicName + -ResourceGroupName [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] + [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### DeleteViaIdentity +``` +Remove-AzEventGridPartnerTopicEventSubscription -InputObject [-DefaultProfile ] + [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Delete an existing event subscription of a partner topic. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -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. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +Parameter Sets: DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PartnerTopicName +Name of the partner topic. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription credentials that uniquely identify a Microsoft Azure subscription. +The subscription ID forms part of the URI for every service call. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[ChannelName ]`: Name of the channel. + - `[DomainName ]`: Name of the domain. + - `[DomainTopicName ]`: Name of the topic. + - `[EventChannelName ]`: Name of the event channel. + - `[EventSubscriptionName ]`: Name of the event subscription. + - `[Id ]`: Resource identity path + - `[Location ]`: Name of the location. + - `[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\'. + - `[PartnerDestinationName ]`: Name of the partner destination. + - `[PartnerNamespaceName ]`: Name of the partner namespace. + - `[PartnerRegistrationName ]`: Name of the partner registration. + - `[PartnerTopicName ]`: Name of the partner topic. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection connection. + - `[PrivateLinkResourceName ]`: The name of private link resource. + - `[ProviderNamespace ]`: Namespace of the provider of the topic. + - `[ResourceGroupName ]`: The name of the resource group within the partners subscription. + - `[ResourceName ]`: Name of the resource. + - `[ResourceTypeName ]`: Name of the resource type. + - `[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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + - `[SubscriptionId ]`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + - `[SystemTopicName ]`: Name of the system topic. + - `[TopicName ]`: Name of the domain topic. + - `[TopicTypeName ]`: Name of the topic type. + - `[VerifiedPartnerName ]`: Name of the verified partner. + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/Remove-AzEventGridPrivateEndpointConnection.md b/swaggerci/eventgrid/docs/Remove-AzEventGridPrivateEndpointConnection.md new file mode 100644 index 000000000000..ab717673aa1b --- /dev/null +++ b/swaggerci/eventgrid/docs/Remove-AzEventGridPrivateEndpointConnection.md @@ -0,0 +1,289 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/remove-azeventgridprivateendpointconnection +schema: 2.0.0 +--- + +# Remove-AzEventGridPrivateEndpointConnection + +## SYNOPSIS +Delete a specific private endpoint connection under a topic, domain, or partner namespace. + +## SYNTAX + +### Delete (Default) +``` +Remove-AzEventGridPrivateEndpointConnection -Name -ParentName -ParentType + -ResourceGroupName [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] + [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### DeleteViaIdentity +``` +Remove-AzEventGridPrivateEndpointConnection -InputObject [-DefaultProfile ] + [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Delete a specific private endpoint connection under a topic, domain, or partner namespace. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +Parameter Sets: DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +The name of the private endpoint connection connection. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: PrivateEndpointConnectionName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ParentName +The name of the parent resource (namely, either, the topic name, domain name, or partner namespace name). + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ParentType +The type of the parent resource. +This can be either \'topics\', \'domains\', or \'partnerNamespaces\'. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ParentType +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription credentials that uniquely identify a Microsoft Azure subscription. +The subscription ID forms part of the URI for every service call. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[ChannelName ]`: Name of the channel. + - `[DomainName ]`: Name of the domain. + - `[DomainTopicName ]`: Name of the topic. + - `[EventChannelName ]`: Name of the event channel. + - `[EventSubscriptionName ]`: Name of the event subscription. + - `[Id ]`: Resource identity path + - `[Location ]`: Name of the location. + - `[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\'. + - `[PartnerDestinationName ]`: Name of the partner destination. + - `[PartnerNamespaceName ]`: Name of the partner namespace. + - `[PartnerRegistrationName ]`: Name of the partner registration. + - `[PartnerTopicName ]`: Name of the partner topic. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection connection. + - `[PrivateLinkResourceName ]`: The name of private link resource. + - `[ProviderNamespace ]`: Namespace of the provider of the topic. + - `[ResourceGroupName ]`: The name of the resource group within the partners subscription. + - `[ResourceName ]`: Name of the resource. + - `[ResourceTypeName ]`: Name of the resource type. + - `[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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + - `[SubscriptionId ]`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + - `[SystemTopicName ]`: Name of the system topic. + - `[TopicName ]`: Name of the domain topic. + - `[TopicTypeName ]`: Name of the topic type. + - `[VerifiedPartnerName ]`: Name of the verified partner. + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/Remove-AzEventGridSystemTopic.md b/swaggerci/eventgrid/docs/Remove-AzEventGridSystemTopic.md new file mode 100644 index 000000000000..e49f1563dfed --- /dev/null +++ b/swaggerci/eventgrid/docs/Remove-AzEventGridSystemTopic.md @@ -0,0 +1,257 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/remove-azeventgridsystemtopic +schema: 2.0.0 +--- + +# Remove-AzEventGridSystemTopic + +## SYNOPSIS +Delete existing system topic. + +## SYNTAX + +### Delete (Default) +``` +Remove-AzEventGridSystemTopic -Name -ResourceGroupName [-SubscriptionId ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### DeleteViaIdentity +``` +Remove-AzEventGridSystemTopic -InputObject [-DefaultProfile ] [-AsJob] + [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Delete existing system topic. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +Parameter Sets: DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +Name of the system topic. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: SystemTopicName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription credentials that uniquely identify a Microsoft Azure subscription. +The subscription ID forms part of the URI for every service call. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[ChannelName ]`: Name of the channel. + - `[DomainName ]`: Name of the domain. + - `[DomainTopicName ]`: Name of the topic. + - `[EventChannelName ]`: Name of the event channel. + - `[EventSubscriptionName ]`: Name of the event subscription. + - `[Id ]`: Resource identity path + - `[Location ]`: Name of the location. + - `[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\'. + - `[PartnerDestinationName ]`: Name of the partner destination. + - `[PartnerNamespaceName ]`: Name of the partner namespace. + - `[PartnerRegistrationName ]`: Name of the partner registration. + - `[PartnerTopicName ]`: Name of the partner topic. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection connection. + - `[PrivateLinkResourceName ]`: The name of private link resource. + - `[ProviderNamespace ]`: Namespace of the provider of the topic. + - `[ResourceGroupName ]`: The name of the resource group within the partners subscription. + - `[ResourceName ]`: Name of the resource. + - `[ResourceTypeName ]`: Name of the resource type. + - `[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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + - `[SubscriptionId ]`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + - `[SystemTopicName ]`: Name of the system topic. + - `[TopicName ]`: Name of the domain topic. + - `[TopicTypeName ]`: Name of the topic type. + - `[VerifiedPartnerName ]`: Name of the verified partner. + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/Remove-AzEventGridSystemTopicEventSubscription.md b/swaggerci/eventgrid/docs/Remove-AzEventGridSystemTopicEventSubscription.md new file mode 100644 index 000000000000..46d57a676bb1 --- /dev/null +++ b/swaggerci/eventgrid/docs/Remove-AzEventGridSystemTopicEventSubscription.md @@ -0,0 +1,274 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/remove-azeventgridsystemtopiceventsubscription +schema: 2.0.0 +--- + +# Remove-AzEventGridSystemTopicEventSubscription + +## SYNOPSIS +Delete an existing event subscription of a system topic. + +## SYNTAX + +### Delete (Default) +``` +Remove-AzEventGridSystemTopicEventSubscription -EventSubscriptionName -ResourceGroupName + -SystemTopicName [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] + [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### DeleteViaIdentity +``` +Remove-AzEventGridSystemTopicEventSubscription -InputObject [-DefaultProfile ] + [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Delete an existing event subscription of a system topic. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -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. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +Parameter Sets: DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription credentials that uniquely identify a Microsoft Azure subscription. +The subscription ID forms part of the URI for every service call. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SystemTopicName +Name of the system topic. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[ChannelName ]`: Name of the channel. + - `[DomainName ]`: Name of the domain. + - `[DomainTopicName ]`: Name of the topic. + - `[EventChannelName ]`: Name of the event channel. + - `[EventSubscriptionName ]`: Name of the event subscription. + - `[Id ]`: Resource identity path + - `[Location ]`: Name of the location. + - `[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\'. + - `[PartnerDestinationName ]`: Name of the partner destination. + - `[PartnerNamespaceName ]`: Name of the partner namespace. + - `[PartnerRegistrationName ]`: Name of the partner registration. + - `[PartnerTopicName ]`: Name of the partner topic. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection connection. + - `[PrivateLinkResourceName ]`: The name of private link resource. + - `[ProviderNamespace ]`: Namespace of the provider of the topic. + - `[ResourceGroupName ]`: The name of the resource group within the partners subscription. + - `[ResourceName ]`: Name of the resource. + - `[ResourceTypeName ]`: Name of the resource type. + - `[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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + - `[SubscriptionId ]`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + - `[SystemTopicName ]`: Name of the system topic. + - `[TopicName ]`: Name of the domain topic. + - `[TopicTypeName ]`: Name of the topic type. + - `[VerifiedPartnerName ]`: Name of the verified partner. + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/Remove-AzEventGridTopic.md b/swaggerci/eventgrid/docs/Remove-AzEventGridTopic.md new file mode 100644 index 000000000000..7534f002eed3 --- /dev/null +++ b/swaggerci/eventgrid/docs/Remove-AzEventGridTopic.md @@ -0,0 +1,257 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/remove-azeventgridtopic +schema: 2.0.0 +--- + +# Remove-AzEventGridTopic + +## SYNOPSIS +Delete existing topic. + +## SYNTAX + +### Delete (Default) +``` +Remove-AzEventGridTopic -Name -ResourceGroupName [-SubscriptionId ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### DeleteViaIdentity +``` +Remove-AzEventGridTopic -InputObject [-DefaultProfile ] [-AsJob] [-NoWait] + [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Delete existing topic. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +Parameter Sets: DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +Name of the topic. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: TopicName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription credentials that uniquely identify a Microsoft Azure subscription. +The subscription ID forms part of the URI for every service call. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[ChannelName ]`: Name of the channel. + - `[DomainName ]`: Name of the domain. + - `[DomainTopicName ]`: Name of the topic. + - `[EventChannelName ]`: Name of the event channel. + - `[EventSubscriptionName ]`: Name of the event subscription. + - `[Id ]`: Resource identity path + - `[Location ]`: Name of the location. + - `[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\'. + - `[PartnerDestinationName ]`: Name of the partner destination. + - `[PartnerNamespaceName ]`: Name of the partner namespace. + - `[PartnerRegistrationName ]`: Name of the partner registration. + - `[PartnerTopicName ]`: Name of the partner topic. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection connection. + - `[PrivateLinkResourceName ]`: The name of private link resource. + - `[ProviderNamespace ]`: Namespace of the provider of the topic. + - `[ResourceGroupName ]`: The name of the resource group within the partners subscription. + - `[ResourceName ]`: Name of the resource. + - `[ResourceTypeName ]`: Name of the resource type. + - `[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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + - `[SubscriptionId ]`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + - `[SystemTopicName ]`: Name of the system topic. + - `[TopicName ]`: Name of the domain topic. + - `[TopicTypeName ]`: Name of the topic type. + - `[VerifiedPartnerName ]`: Name of the verified partner. + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/Remove-AzEventGridTopicEventSubscription.md b/swaggerci/eventgrid/docs/Remove-AzEventGridTopicEventSubscription.md new file mode 100644 index 000000000000..86840dd84406 --- /dev/null +++ b/swaggerci/eventgrid/docs/Remove-AzEventGridTopicEventSubscription.md @@ -0,0 +1,274 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/remove-azeventgridtopiceventsubscription +schema: 2.0.0 +--- + +# Remove-AzEventGridTopicEventSubscription + +## SYNOPSIS +Delete an existing event subscription for a topic. + +## SYNTAX + +### Delete (Default) +``` +Remove-AzEventGridTopicEventSubscription -EventSubscriptionName -ResourceGroupName + -TopicName [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] + [-Confirm] [-WhatIf] [] +``` + +### DeleteViaIdentity +``` +Remove-AzEventGridTopicEventSubscription -InputObject [-DefaultProfile ] + [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Delete an existing event subscription for a topic. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EventSubscriptionName +Name of the event subscription to be deleted. +Event subscription names must be between 3 and 100 characters in length and use alphanumeric letters only. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +Parameter Sets: DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription credentials that uniquely identify a Microsoft Azure subscription. +The subscription ID forms part of the URI for every service call. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TopicName +Name of the topic. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[ChannelName ]`: Name of the channel. + - `[DomainName ]`: Name of the domain. + - `[DomainTopicName ]`: Name of the topic. + - `[EventChannelName ]`: Name of the event channel. + - `[EventSubscriptionName ]`: Name of the event subscription. + - `[Id ]`: Resource identity path + - `[Location ]`: Name of the location. + - `[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\'. + - `[PartnerDestinationName ]`: Name of the partner destination. + - `[PartnerNamespaceName ]`: Name of the partner namespace. + - `[PartnerRegistrationName ]`: Name of the partner registration. + - `[PartnerTopicName ]`: Name of the partner topic. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection connection. + - `[PrivateLinkResourceName ]`: The name of private link resource. + - `[ProviderNamespace ]`: Namespace of the provider of the topic. + - `[ResourceGroupName ]`: The name of the resource group within the partners subscription. + - `[ResourceName ]`: Name of the resource. + - `[ResourceTypeName ]`: Name of the resource type. + - `[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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + - `[SubscriptionId ]`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + - `[SystemTopicName ]`: Name of the system topic. + - `[TopicName ]`: Name of the domain topic. + - `[TopicTypeName ]`: Name of the topic type. + - `[VerifiedPartnerName ]`: Name of the verified partner. + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/Update-AzEventGridChannel.md b/swaggerci/eventgrid/docs/Update-AzEventGridChannel.md new file mode 100644 index 000000000000..73e00bc6f53d --- /dev/null +++ b/swaggerci/eventgrid/docs/Update-AzEventGridChannel.md @@ -0,0 +1,292 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/update-azeventgridchannel +schema: 2.0.0 +--- + +# Update-AzEventGridChannel + +## SYNOPSIS +Synchronously updates a channel with the specified parameters. + +## SYNTAX + +### UpdateExpanded (Default) +``` +Update-AzEventGridChannel -Name -PartnerNamespaceName -ResourceGroupName + [-SubscriptionId ] [-EventTypeInfoInlineEventType ] + [-EventTypeInfoKind ] [-ExpirationTimeIfNotActivatedUtc ] + [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### UpdateViaIdentityExpanded +``` +Update-AzEventGridChannel -InputObject [-EventTypeInfoInlineEventType ] + [-EventTypeInfoKind ] [-ExpirationTimeIfNotActivatedUtc ] + [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Synchronously updates a channel with the specified parameters. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EventTypeInfoInlineEventType +A collection of inline event types for the resource. +The inline event type keys are of type string which represents the name of the event.An example of a valid inline event name is "Contoso.OrderCreated".The inline event type values are of type InlineEventProperties and will contain additional information for every inline event type. + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EventTypeInfoKind +The kind of event type used. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ExpirationTimeIfNotActivatedUtc +Expiration time of the event channel. +If this timer expires while the corresponding partner topic or partner destination is never activated,the channel and corresponding partner topic or partner destination are deleted. + +```yaml +Type: System.DateTime +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +Parameter Sets: UpdateViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +Name of the channel. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: ChannelName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PartnerNamespaceName +Name of the partner namespace. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the partners subscription. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription credentials that uniquely identify a Microsoft Azure subscription. +The subscription ID forms part of the URI for every service call. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[ChannelName ]`: Name of the channel. + - `[DomainName ]`: Name of the domain. + - `[DomainTopicName ]`: Name of the topic. + - `[EventChannelName ]`: Name of the event channel. + - `[EventSubscriptionName ]`: Name of the event subscription. + - `[Id ]`: Resource identity path + - `[Location ]`: Name of the location. + - `[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\'. + - `[PartnerDestinationName ]`: Name of the partner destination. + - `[PartnerNamespaceName ]`: Name of the partner namespace. + - `[PartnerRegistrationName ]`: Name of the partner registration. + - `[PartnerTopicName ]`: Name of the partner topic. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection connection. + - `[PrivateLinkResourceName ]`: The name of private link resource. + - `[ProviderNamespace ]`: Namespace of the provider of the topic. + - `[ResourceGroupName ]`: The name of the resource group within the partners subscription. + - `[ResourceName ]`: Name of the resource. + - `[ResourceTypeName ]`: Name of the resource type. + - `[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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + - `[SubscriptionId ]`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + - `[SystemTopicName ]`: Name of the system topic. + - `[TopicName ]`: Name of the domain topic. + - `[TopicTypeName ]`: Name of the topic type. + - `[VerifiedPartnerName ]`: Name of the verified partner. + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/Update-AzEventGridDomain.md b/swaggerci/eventgrid/docs/Update-AzEventGridDomain.md new file mode 100644 index 000000000000..c6efe3c556af --- /dev/null +++ b/swaggerci/eventgrid/docs/Update-AzEventGridDomain.md @@ -0,0 +1,467 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/update-azeventgriddomain +schema: 2.0.0 +--- + +# Update-AzEventGridDomain + +## SYNOPSIS +Asynchronously updates a domain with the specified parameters. + +## SYNTAX + +### UpdateExpanded (Default) +``` +Update-AzEventGridDomain -Name -ResourceGroupName [-SubscriptionId ] + [-AutoCreateTopicWithFirstSubscription] [-AutoDeleteTopicWithLastSubscription] + [-DataResidencyBoundary ] [-DisableLocalAuth] [-IdentityPrincipalId ] + [-IdentityTenantId ] [-IdentityType ] [-IdentityUserAssignedIdentity ] + [-InboundIPRule ] [-PublicNetworkAccess ] [-SkuName ] + [-Tag ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] + [] +``` + +### UpdateViaIdentityExpanded +``` +Update-AzEventGridDomain -InputObject [-AutoCreateTopicWithFirstSubscription] + [-AutoDeleteTopicWithLastSubscription] [-DataResidencyBoundary ] [-DisableLocalAuth] + [-IdentityPrincipalId ] [-IdentityTenantId ] [-IdentityType ] + [-IdentityUserAssignedIdentity ] [-InboundIPRule ] + [-PublicNetworkAccess ] [-SkuName ] [-Tag ] [-DefaultProfile ] + [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Asynchronously updates a domain with the specified parameters. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AutoCreateTopicWithFirstSubscription +This Boolean is used to specify the creation mechanism for 'all' the Event Grid Domain Topics associated with this Event Grid Domain resource.In this context, creation of domain topic can be auto-managed (when true) or self-managed (when false). +The default value for this property is true.When this property is null or set to true, Event Grid is responsible of automatically creating the domain topic when the first event subscription iscreated at the scope of the domain topic. +If this property is set to false, then creating the first event subscription will require creating a domain topicby the user. +The self-management mode can be used if the user wants full control of when the domain topic is created, while auto-managed mode provides theflexibility to perform less operations and manage fewer resources by the user. +Also, note that in auto-managed creation mode, user is allowed to create thedomain topic on demand if needed. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AutoDeleteTopicWithLastSubscription +This Boolean is used to specify the deletion mechanism for 'all' the Event Grid Domain Topics associated with this Event Grid Domain resource.In this context, deletion of domain topic can be auto-managed (when true) or self-managed (when false). +The default value for this property is true.When this property is set to true, Event Grid is responsible of automatically deleting the domain topic when the last event subscription at the scopeof the domain topic is deleted. +If this property is set to false, then the user needs to manually delete the domain topic when it is no longer needed(e.g., when last event subscription is deleted and the resource needs to be cleaned up). +The self-management mode can be used if the user wants fullcontrol of when the domain topic needs to be deleted, while auto-managed mode provides the flexibility to perform less operations and manage fewerresources by the user. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DataResidencyBoundary +The data residency boundary for the domain. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DisableLocalAuth +This boolean is used to enable or disable local auth. +Default value is false. +When the property is set to true, only AAD token will be used to authenticate if user is allowed to publish to the domain. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IdentityPrincipalId +The principal ID of resource identity. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IdentityTenantId +The tenant ID of resource. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IdentityType +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. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IdentityUserAssignedIdentity +The list of user identities associated with the resource. +The user identity dictionary key references will be ARM resource ids in the form:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.This property is currently not used and reserved for future usage. + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InboundIPRule +This can be used to restrict traffic from specific IPs instead of all IPs. +Note: These are considered only if PublicNetworkAccess is enabled. +To construct, see NOTES section for INBOUNDIPRULE properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +Parameter Sets: UpdateViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +Name of the domain. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: DomainName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PublicNetworkAccess +This determines if traffic is allowed over public network. +By default it is enabled. +You can further restrict to specific IPs by configuring \ + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SkuName +The Sku name of the resource. +The possible values are: Basic or Premium. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription credentials that uniquely identify a Microsoft Azure subscription. +The subscription ID forms part of the URI for every service call. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Tag +Tags of the domains resource. + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INBOUNDIPRULE : This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess is enabled. + - `[Action ]`: Action to perform based on the match or no match of the IpMask. + - `[IPMask ]`: IP Address in CIDR notation e.g., 10.0.0.0/8. + +INPUTOBJECT : Identity Parameter + - `[ChannelName ]`: Name of the channel. + - `[DomainName ]`: Name of the domain. + - `[DomainTopicName ]`: Name of the topic. + - `[EventChannelName ]`: Name of the event channel. + - `[EventSubscriptionName ]`: Name of the event subscription. + - `[Id ]`: Resource identity path + - `[Location ]`: Name of the location. + - `[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\'. + - `[PartnerDestinationName ]`: Name of the partner destination. + - `[PartnerNamespaceName ]`: Name of the partner namespace. + - `[PartnerRegistrationName ]`: Name of the partner registration. + - `[PartnerTopicName ]`: Name of the partner topic. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection connection. + - `[PrivateLinkResourceName ]`: The name of private link resource. + - `[ProviderNamespace ]`: Namespace of the provider of the topic. + - `[ResourceGroupName ]`: The name of the resource group within the partners subscription. + - `[ResourceName ]`: Name of the resource. + - `[ResourceTypeName ]`: Name of the resource type. + - `[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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + - `[SubscriptionId ]`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + - `[SystemTopicName ]`: Name of the system topic. + - `[TopicName ]`: Name of the domain topic. + - `[TopicTypeName ]`: Name of the topic type. + - `[VerifiedPartnerName ]`: Name of the verified partner. + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/Update-AzEventGridDomainEventSubscription.md b/swaggerci/eventgrid/docs/Update-AzEventGridDomainEventSubscription.md new file mode 100644 index 000000000000..2f852340156e --- /dev/null +++ b/swaggerci/eventgrid/docs/Update-AzEventGridDomainEventSubscription.md @@ -0,0 +1,558 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/update-azeventgriddomaineventsubscription +schema: 2.0.0 +--- + +# Update-AzEventGridDomainEventSubscription + +## SYNOPSIS +Update an existing event subscription for a topic. + +## SYNTAX + +### UpdateExpanded (Default) +``` +Update-AzEventGridDomainEventSubscription -DomainName -EventSubscriptionName + -ResourceGroupName [-SubscriptionId ] + [-DeadLetterWithResourceIdentityType ] + [-DeadLetterWithResourceIdentityUserAssignedIdentity ] + [-DeliveryWithResourceIdentityDestinationEndpointType ] + [-DeliveryWithResourceIdentityType ] + [-DeliveryWithResourceIdentityUserAssignedIdentity ] [-EndpointType ] + [-EventDeliverySchema ] [-ExpirationTimeUtc ] + [-FilterAdvancedFilter ] [-FilterEnableAdvancedFilteringOnArray] + [-FilterIncludedEventType ] [-FilterIsSubjectCaseSensitive] [-FilterSubjectBeginsWith ] + [-FilterSubjectEndsWith ] [-Label ] [-RetryPolicyEventTimeToLiveInMinute ] + [-RetryPolicyMaxDeliveryAttempt ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] + [-Confirm] [-WhatIf] [] +``` + +### UpdateViaIdentityExpanded +``` +Update-AzEventGridDomainEventSubscription -InputObject + [-DeadLetterWithResourceIdentityType ] + [-DeadLetterWithResourceIdentityUserAssignedIdentity ] + [-DeliveryWithResourceIdentityDestinationEndpointType ] + [-DeliveryWithResourceIdentityType ] + [-DeliveryWithResourceIdentityUserAssignedIdentity ] [-EndpointType ] + [-EventDeliverySchema ] [-ExpirationTimeUtc ] + [-FilterAdvancedFilter ] [-FilterEnableAdvancedFilteringOnArray] + [-FilterIncludedEventType ] [-FilterIsSubjectCaseSensitive] [-FilterSubjectBeginsWith ] + [-FilterSubjectEndsWith ] [-Label ] [-RetryPolicyEventTimeToLiveInMinute ] + [-RetryPolicyMaxDeliveryAttempt ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] + [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Update an existing event subscription for a topic. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeadLetterWithResourceIdentityType +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. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeadLetterWithResourceIdentityUserAssignedIdentity +The user identity associated with the resource. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeliveryWithResourceIdentityDestinationEndpointType +Type of the endpoint for the event subscription destination. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeliveryWithResourceIdentityType +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. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeliveryWithResourceIdentityUserAssignedIdentity +The user identity associated with the resource. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DomainName +Name of the domain. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EndpointType +Type of the endpoint for the event subscription destination. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EventDeliverySchema +The event delivery schema for the event subscription. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EventSubscriptionName +Name of the event subscription to be updated. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ExpirationTimeUtc +Information about the expiration time for the event subscription. + +```yaml +Type: System.DateTime +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FilterAdvancedFilter +An array of advanced filters that are used for filtering event subscriptions. +To construct, see NOTES section for FILTERADVANCEDFILTER properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FilterEnableAdvancedFilteringOnArray +Allows advanced filters to be evaluated against an array of values instead of expecting a singular value. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FilterIncludedEventType +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. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FilterIsSubjectCaseSensitive +Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filtershould be compared in a case sensitive manner. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FilterSubjectBeginsWith +An optional string to filter events for an event subscription based on a resource path prefix.The format of this depends on the publisher of the events.Wildcard characters are not supported in this path. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FilterSubjectEndsWith +An optional string to filter events for an event subscription based on a resource path suffix.Wildcard characters are not supported in this path. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +Parameter Sets: UpdateViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Label +List of user defined labels. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -RetryPolicyEventTimeToLiveInMinute +Time To Live (in minutes) for events. + +```yaml +Type: System.Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -RetryPolicyMaxDeliveryAttempt +Maximum number of delivery retry attempts for events. + +```yaml +Type: System.Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription credentials that uniquely identify a Microsoft Azure subscription. +The subscription ID forms part of the URI for every service call. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +FILTERADVANCEDFILTER : An array of advanced filters that are used for filtering event subscriptions. + - `OperatorType `: The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. + - `[Key ]`: The field/property in the event based on which you want to filter. + +INPUTOBJECT : Identity Parameter + - `[ChannelName ]`: Name of the channel. + - `[DomainName ]`: Name of the domain. + - `[DomainTopicName ]`: Name of the topic. + - `[EventChannelName ]`: Name of the event channel. + - `[EventSubscriptionName ]`: Name of the event subscription. + - `[Id ]`: Resource identity path + - `[Location ]`: Name of the location. + - `[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\'. + - `[PartnerDestinationName ]`: Name of the partner destination. + - `[PartnerNamespaceName ]`: Name of the partner namespace. + - `[PartnerRegistrationName ]`: Name of the partner registration. + - `[PartnerTopicName ]`: Name of the partner topic. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection connection. + - `[PrivateLinkResourceName ]`: The name of private link resource. + - `[ProviderNamespace ]`: Namespace of the provider of the topic. + - `[ResourceGroupName ]`: The name of the resource group within the partners subscription. + - `[ResourceName ]`: Name of the resource. + - `[ResourceTypeName ]`: Name of the resource type. + - `[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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + - `[SubscriptionId ]`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + - `[SystemTopicName ]`: Name of the system topic. + - `[TopicName ]`: Name of the domain topic. + - `[TopicTypeName ]`: Name of the topic type. + - `[VerifiedPartnerName ]`: Name of the verified partner. + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/Update-AzEventGridDomainTopicEventSubscription.md b/swaggerci/eventgrid/docs/Update-AzEventGridDomainTopicEventSubscription.md new file mode 100644 index 000000000000..be91879f696d --- /dev/null +++ b/swaggerci/eventgrid/docs/Update-AzEventGridDomainTopicEventSubscription.md @@ -0,0 +1,573 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/update-azeventgriddomaintopiceventsubscription +schema: 2.0.0 +--- + +# Update-AzEventGridDomainTopicEventSubscription + +## SYNOPSIS +Update an existing event subscription for a domain topic. + +## SYNTAX + +### UpdateExpanded (Default) +``` +Update-AzEventGridDomainTopicEventSubscription -DomainName -EventSubscriptionName + -ResourceGroupName -TopicName [-SubscriptionId ] + [-DeadLetterWithResourceIdentityType ] + [-DeadLetterWithResourceIdentityUserAssignedIdentity ] + [-DeliveryWithResourceIdentityDestinationEndpointType ] + [-DeliveryWithResourceIdentityType ] + [-DeliveryWithResourceIdentityUserAssignedIdentity ] [-EndpointType ] + [-EventDeliverySchema ] [-ExpirationTimeUtc ] + [-FilterAdvancedFilter ] [-FilterEnableAdvancedFilteringOnArray] + [-FilterIncludedEventType ] [-FilterIsSubjectCaseSensitive] [-FilterSubjectBeginsWith ] + [-FilterSubjectEndsWith ] [-Label ] [-RetryPolicyEventTimeToLiveInMinute ] + [-RetryPolicyMaxDeliveryAttempt ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] + [-Confirm] [-WhatIf] [] +``` + +### UpdateViaIdentityExpanded +``` +Update-AzEventGridDomainTopicEventSubscription -InputObject + [-DeadLetterWithResourceIdentityType ] + [-DeadLetterWithResourceIdentityUserAssignedIdentity ] + [-DeliveryWithResourceIdentityDestinationEndpointType ] + [-DeliveryWithResourceIdentityType ] + [-DeliveryWithResourceIdentityUserAssignedIdentity ] [-EndpointType ] + [-EventDeliverySchema ] [-ExpirationTimeUtc ] + [-FilterAdvancedFilter ] [-FilterEnableAdvancedFilteringOnArray] + [-FilterIncludedEventType ] [-FilterIsSubjectCaseSensitive] [-FilterSubjectBeginsWith ] + [-FilterSubjectEndsWith ] [-Label ] [-RetryPolicyEventTimeToLiveInMinute ] + [-RetryPolicyMaxDeliveryAttempt ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] + [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Update an existing event subscription for a domain topic. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeadLetterWithResourceIdentityType +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. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeadLetterWithResourceIdentityUserAssignedIdentity +The user identity associated with the resource. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeliveryWithResourceIdentityDestinationEndpointType +Type of the endpoint for the event subscription destination. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeliveryWithResourceIdentityType +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. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeliveryWithResourceIdentityUserAssignedIdentity +The user identity associated with the resource. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DomainName +Name of the domain. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EndpointType +Type of the endpoint for the event subscription destination. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EventDeliverySchema +The event delivery schema for the event subscription. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EventSubscriptionName +Name of the event subscription to be updated. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ExpirationTimeUtc +Information about the expiration time for the event subscription. + +```yaml +Type: System.DateTime +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FilterAdvancedFilter +An array of advanced filters that are used for filtering event subscriptions. +To construct, see NOTES section for FILTERADVANCEDFILTER properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FilterEnableAdvancedFilteringOnArray +Allows advanced filters to be evaluated against an array of values instead of expecting a singular value. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FilterIncludedEventType +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. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FilterIsSubjectCaseSensitive +Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filtershould be compared in a case sensitive manner. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FilterSubjectBeginsWith +An optional string to filter events for an event subscription based on a resource path prefix.The format of this depends on the publisher of the events.Wildcard characters are not supported in this path. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FilterSubjectEndsWith +An optional string to filter events for an event subscription based on a resource path suffix.Wildcard characters are not supported in this path. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +Parameter Sets: UpdateViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Label +List of user defined labels. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -RetryPolicyEventTimeToLiveInMinute +Time To Live (in minutes) for events. + +```yaml +Type: System.Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -RetryPolicyMaxDeliveryAttempt +Maximum number of delivery retry attempts for events. + +```yaml +Type: System.Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription credentials that uniquely identify a Microsoft Azure subscription. +The subscription ID forms part of the URI for every service call. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TopicName +Name of the topic. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +FILTERADVANCEDFILTER : An array of advanced filters that are used for filtering event subscriptions. + - `OperatorType `: The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. + - `[Key ]`: The field/property in the event based on which you want to filter. + +INPUTOBJECT : Identity Parameter + - `[ChannelName ]`: Name of the channel. + - `[DomainName ]`: Name of the domain. + - `[DomainTopicName ]`: Name of the topic. + - `[EventChannelName ]`: Name of the event channel. + - `[EventSubscriptionName ]`: Name of the event subscription. + - `[Id ]`: Resource identity path + - `[Location ]`: Name of the location. + - `[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\'. + - `[PartnerDestinationName ]`: Name of the partner destination. + - `[PartnerNamespaceName ]`: Name of the partner namespace. + - `[PartnerRegistrationName ]`: Name of the partner registration. + - `[PartnerTopicName ]`: Name of the partner topic. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection connection. + - `[PrivateLinkResourceName ]`: The name of private link resource. + - `[ProviderNamespace ]`: Namespace of the provider of the topic. + - `[ResourceGroupName ]`: The name of the resource group within the partners subscription. + - `[ResourceName ]`: Name of the resource. + - `[ResourceTypeName ]`: Name of the resource type. + - `[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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + - `[SubscriptionId ]`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + - `[SystemTopicName ]`: Name of the system topic. + - `[TopicName ]`: Name of the domain topic. + - `[TopicTypeName ]`: Name of the topic type. + - `[VerifiedPartnerName ]`: Name of the verified partner. + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/Update-AzEventGridEventSubscription.md b/swaggerci/eventgrid/docs/Update-AzEventGridEventSubscription.md new file mode 100644 index 000000000000..7e1685d84b3b --- /dev/null +++ b/swaggerci/eventgrid/docs/Update-AzEventGridEventSubscription.md @@ -0,0 +1,528 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/update-azeventgrideventsubscription +schema: 2.0.0 +--- + +# Update-AzEventGridEventSubscription + +## SYNOPSIS +Asynchronously updates an existing event subscription. + +## SYNTAX + +### UpdateExpanded (Default) +``` +Update-AzEventGridEventSubscription -Name -Scope + [-DeadLetterWithResourceIdentityType ] + [-DeadLetterWithResourceIdentityUserAssignedIdentity ] + [-DeliveryWithResourceIdentityDestinationEndpointType ] + [-DeliveryWithResourceIdentityType ] + [-DeliveryWithResourceIdentityUserAssignedIdentity ] [-EndpointType ] + [-EventDeliverySchema ] [-ExpirationTimeUtc ] + [-FilterAdvancedFilter ] [-FilterEnableAdvancedFilteringOnArray] + [-FilterIncludedEventType ] [-FilterIsSubjectCaseSensitive] [-FilterSubjectBeginsWith ] + [-FilterSubjectEndsWith ] [-Label ] [-RetryPolicyEventTimeToLiveInMinute ] + [-RetryPolicyMaxDeliveryAttempt ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] + [-Confirm] [-WhatIf] [] +``` + +### UpdateViaIdentityExpanded +``` +Update-AzEventGridEventSubscription -InputObject + [-DeadLetterWithResourceIdentityType ] + [-DeadLetterWithResourceIdentityUserAssignedIdentity ] + [-DeliveryWithResourceIdentityDestinationEndpointType ] + [-DeliveryWithResourceIdentityType ] + [-DeliveryWithResourceIdentityUserAssignedIdentity ] [-EndpointType ] + [-EventDeliverySchema ] [-ExpirationTimeUtc ] + [-FilterAdvancedFilter ] [-FilterEnableAdvancedFilteringOnArray] + [-FilterIncludedEventType ] [-FilterIsSubjectCaseSensitive] [-FilterSubjectBeginsWith ] + [-FilterSubjectEndsWith ] [-Label ] [-RetryPolicyEventTimeToLiveInMinute ] + [-RetryPolicyMaxDeliveryAttempt ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] + [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Asynchronously updates an existing event subscription. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeadLetterWithResourceIdentityType +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. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeadLetterWithResourceIdentityUserAssignedIdentity +The user identity associated with the resource. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeliveryWithResourceIdentityDestinationEndpointType +Type of the endpoint for the event subscription destination. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeliveryWithResourceIdentityType +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. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeliveryWithResourceIdentityUserAssignedIdentity +The user identity associated with the resource. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EndpointType +Type of the endpoint for the event subscription destination. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EventDeliverySchema +The event delivery schema for the event subscription. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ExpirationTimeUtc +Information about the expiration time for the event subscription. + +```yaml +Type: System.DateTime +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FilterAdvancedFilter +An array of advanced filters that are used for filtering event subscriptions. +To construct, see NOTES section for FILTERADVANCEDFILTER properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FilterEnableAdvancedFilteringOnArray +Allows advanced filters to be evaluated against an array of values instead of expecting a singular value. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FilterIncludedEventType +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. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FilterIsSubjectCaseSensitive +Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filtershould be compared in a case sensitive manner. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FilterSubjectBeginsWith +An optional string to filter events for an event subscription based on a resource path prefix.The format of this depends on the publisher of the events.Wildcard characters are not supported in this path. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FilterSubjectEndsWith +An optional string to filter events for an event subscription based on a resource path suffix.Wildcard characters are not supported in this path. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +Parameter Sets: UpdateViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Label +List of user defined labels. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +Name of the event subscription to be updated. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: EventSubscriptionName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -RetryPolicyEventTimeToLiveInMinute +Time To Live (in minutes) for events. + +```yaml +Type: System.Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -RetryPolicyMaxDeliveryAttempt +Maximum number of delivery retry attempts for events. + +```yaml +Type: System.Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +FILTERADVANCEDFILTER : An array of advanced filters that are used for filtering event subscriptions. + - `OperatorType `: The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. + - `[Key ]`: The field/property in the event based on which you want to filter. + +INPUTOBJECT : Identity Parameter + - `[ChannelName ]`: Name of the channel. + - `[DomainName ]`: Name of the domain. + - `[DomainTopicName ]`: Name of the topic. + - `[EventChannelName ]`: Name of the event channel. + - `[EventSubscriptionName ]`: Name of the event subscription. + - `[Id ]`: Resource identity path + - `[Location ]`: Name of the location. + - `[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\'. + - `[PartnerDestinationName ]`: Name of the partner destination. + - `[PartnerNamespaceName ]`: Name of the partner namespace. + - `[PartnerRegistrationName ]`: Name of the partner registration. + - `[PartnerTopicName ]`: Name of the partner topic. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection connection. + - `[PrivateLinkResourceName ]`: The name of private link resource. + - `[ProviderNamespace ]`: Namespace of the provider of the topic. + - `[ResourceGroupName ]`: The name of the resource group within the partners subscription. + - `[ResourceName ]`: Name of the resource. + - `[ResourceTypeName ]`: Name of the resource type. + - `[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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + - `[SubscriptionId ]`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + - `[SystemTopicName ]`: Name of the system topic. + - `[TopicName ]`: Name of the domain topic. + - `[TopicTypeName ]`: Name of the topic type. + - `[VerifiedPartnerName ]`: Name of the verified partner. + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/Update-AzEventGridPartnerConfiguration.md b/swaggerci/eventgrid/docs/Update-AzEventGridPartnerConfiguration.md new file mode 100644 index 000000000000..748c8cfb28e8 --- /dev/null +++ b/swaggerci/eventgrid/docs/Update-AzEventGridPartnerConfiguration.md @@ -0,0 +1,275 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/update-azeventgridpartnerconfiguration +schema: 2.0.0 +--- + +# Update-AzEventGridPartnerConfiguration + +## SYNOPSIS +Synchronously updates a partner configuration with the specified parameters. + +## SYNTAX + +### UpdateExpanded (Default) +``` +Update-AzEventGridPartnerConfiguration -ResourceGroupName [-SubscriptionId ] + [-DefaultMaximumExpirationTimeInDay ] [-Tag ] [-DefaultProfile ] [-AsJob] + [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### UpdateViaIdentityExpanded +``` +Update-AzEventGridPartnerConfiguration -InputObject + [-DefaultMaximumExpirationTimeInDay ] [-Tag ] [-DefaultProfile ] [-AsJob] + [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Synchronously updates a partner configuration with the specified parameters. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultMaximumExpirationTimeInDay +The default time used to validate the maximum expiration time for each authorized partners in days. +Allowed values ar between 1 and 365 days. + +```yaml +Type: System.Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +Parameter Sets: UpdateViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription credentials that uniquely identify a Microsoft Azure subscription. +The subscription ID forms part of the URI for every service call. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Tag +Tags of the partner configuration resource. + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfiguration + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[ChannelName ]`: Name of the channel. + - `[DomainName ]`: Name of the domain. + - `[DomainTopicName ]`: Name of the topic. + - `[EventChannelName ]`: Name of the event channel. + - `[EventSubscriptionName ]`: Name of the event subscription. + - `[Id ]`: Resource identity path + - `[Location ]`: Name of the location. + - `[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\'. + - `[PartnerDestinationName ]`: Name of the partner destination. + - `[PartnerNamespaceName ]`: Name of the partner namespace. + - `[PartnerRegistrationName ]`: Name of the partner registration. + - `[PartnerTopicName ]`: Name of the partner topic. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection connection. + - `[PrivateLinkResourceName ]`: The name of private link resource. + - `[ProviderNamespace ]`: Namespace of the provider of the topic. + - `[ResourceGroupName ]`: The name of the resource group within the partners subscription. + - `[ResourceName ]`: Name of the resource. + - `[ResourceTypeName ]`: Name of the resource type. + - `[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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + - `[SubscriptionId ]`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + - `[SystemTopicName ]`: Name of the system topic. + - `[TopicName ]`: Name of the domain topic. + - `[TopicTypeName ]`: Name of the topic type. + - `[VerifiedPartnerName ]`: Name of the verified partner. + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/Update-AzEventGridPartnerDestination.md b/swaggerci/eventgrid/docs/Update-AzEventGridPartnerDestination.md new file mode 100644 index 000000000000..e7eec81b0923 --- /dev/null +++ b/swaggerci/eventgrid/docs/Update-AzEventGridPartnerDestination.md @@ -0,0 +1,242 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/update-azeventgridpartnerdestination +schema: 2.0.0 +--- + +# Update-AzEventGridPartnerDestination + +## SYNOPSIS +Asynchronously updates a partner destination with the specified parameters. + +## SYNTAX + +### UpdateExpanded (Default) +``` +Update-AzEventGridPartnerDestination -Name -ResourceGroupName [-SubscriptionId ] + [-Tag ] [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### UpdateViaIdentityExpanded +``` +Update-AzEventGridPartnerDestination -InputObject [-Tag ] + [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Asynchronously updates a partner destination with the specified parameters. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +Parameter Sets: UpdateViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +Name of the partner destination. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: PartnerDestinationName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription credentials that uniquely identify a Microsoft Azure subscription. +The subscription ID forms part of the URI for every service call. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Tag +Tags of the Partner Destination resource. + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestination + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[ChannelName ]`: Name of the channel. + - `[DomainName ]`: Name of the domain. + - `[DomainTopicName ]`: Name of the topic. + - `[EventChannelName ]`: Name of the event channel. + - `[EventSubscriptionName ]`: Name of the event subscription. + - `[Id ]`: Resource identity path + - `[Location ]`: Name of the location. + - `[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\'. + - `[PartnerDestinationName ]`: Name of the partner destination. + - `[PartnerNamespaceName ]`: Name of the partner namespace. + - `[PartnerRegistrationName ]`: Name of the partner registration. + - `[PartnerTopicName ]`: Name of the partner topic. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection connection. + - `[PrivateLinkResourceName ]`: The name of private link resource. + - `[ProviderNamespace ]`: Namespace of the provider of the topic. + - `[ResourceGroupName ]`: The name of the resource group within the partners subscription. + - `[ResourceName ]`: Name of the resource. + - `[ResourceTypeName ]`: Name of the resource type. + - `[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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + - `[SubscriptionId ]`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + - `[SystemTopicName ]`: Name of the system topic. + - `[TopicName ]`: Name of the domain topic. + - `[TopicTypeName ]`: Name of the topic type. + - `[VerifiedPartnerName ]`: Name of the verified partner. + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/Update-AzEventGridPartnerNamespace.md b/swaggerci/eventgrid/docs/Update-AzEventGridPartnerNamespace.md new file mode 100644 index 000000000000..84d01a04d988 --- /dev/null +++ b/swaggerci/eventgrid/docs/Update-AzEventGridPartnerNamespace.md @@ -0,0 +1,330 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/update-azeventgridpartnernamespace +schema: 2.0.0 +--- + +# Update-AzEventGridPartnerNamespace + +## SYNOPSIS +Asynchronously updates a partner namespace with the specified parameters. + +## SYNTAX + +### UpdateExpanded (Default) +``` +Update-AzEventGridPartnerNamespace -Name -ResourceGroupName [-SubscriptionId ] + [-DisableLocalAuth] [-InboundIPRule ] [-PublicNetworkAccess ] + [-Tag ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] + [] +``` + +### UpdateViaIdentityExpanded +``` +Update-AzEventGridPartnerNamespace -InputObject [-DisableLocalAuth] + [-InboundIPRule ] [-PublicNetworkAccess ] [-Tag ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Asynchronously updates a partner namespace with the specified parameters. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DisableLocalAuth +This boolean is used to enable or disable local auth. +Default value is false. +When the property is set to true, only AAD token will be used to authenticate if user is allowed to publish to the partner namespace. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InboundIPRule +This can be used to restrict traffic from specific IPs instead of all IPs. +Note: These are considered only if PublicNetworkAccess is enabled. +To construct, see NOTES section for INBOUNDIPRULE properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +Parameter Sets: UpdateViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +Name of the partner namespace. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: PartnerNamespaceName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PublicNetworkAccess +This determines if traffic is allowed over public network. +By default it is enabled. +You can further restrict to specific IPs by configuring \ + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription credentials that uniquely identify a Microsoft Azure subscription. +The subscription ID forms part of the URI for every service call. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Tag +Tags of the Partner Namespace. + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INBOUNDIPRULE : This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess is enabled. + - `[Action ]`: Action to perform based on the match or no match of the IpMask. + - `[IPMask ]`: IP Address in CIDR notation e.g., 10.0.0.0/8. + +INPUTOBJECT : Identity Parameter + - `[ChannelName ]`: Name of the channel. + - `[DomainName ]`: Name of the domain. + - `[DomainTopicName ]`: Name of the topic. + - `[EventChannelName ]`: Name of the event channel. + - `[EventSubscriptionName ]`: Name of the event subscription. + - `[Id ]`: Resource identity path + - `[Location ]`: Name of the location. + - `[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\'. + - `[PartnerDestinationName ]`: Name of the partner destination. + - `[PartnerNamespaceName ]`: Name of the partner namespace. + - `[PartnerRegistrationName ]`: Name of the partner registration. + - `[PartnerTopicName ]`: Name of the partner topic. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection connection. + - `[PrivateLinkResourceName ]`: The name of private link resource. + - `[ProviderNamespace ]`: Namespace of the provider of the topic. + - `[ResourceGroupName ]`: The name of the resource group within the partners subscription. + - `[ResourceName ]`: Name of the resource. + - `[ResourceTypeName ]`: Name of the resource type. + - `[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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + - `[SubscriptionId ]`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + - `[SystemTopicName ]`: Name of the system topic. + - `[TopicName ]`: Name of the domain topic. + - `[TopicTypeName ]`: Name of the topic type. + - `[VerifiedPartnerName ]`: Name of the verified partner. + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/Update-AzEventGridPartnerRegistration.md b/swaggerci/eventgrid/docs/Update-AzEventGridPartnerRegistration.md new file mode 100644 index 000000000000..66b10a5054bf --- /dev/null +++ b/swaggerci/eventgrid/docs/Update-AzEventGridPartnerRegistration.md @@ -0,0 +1,370 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/update-azeventgridpartnerregistration +schema: 2.0.0 +--- + +# Update-AzEventGridPartnerRegistration + +## SYNOPSIS +Updates a partner registration with the specified parameters. + +## SYNTAX + +### UpdateExpanded (Default) +``` +Update-AzEventGridPartnerRegistration -Name -ResourceGroupName [-SubscriptionId ] + [-AuthorizedAzureSubscriptionId ] [-LogoUri ] [-PartnerTopicTypeDescription ] + [-PartnerTopicTypeDisplayName ] [-PartnerTopicTypeName ] [-SetupUri ] + [-Tag ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] + [] +``` + +### UpdateViaIdentityExpanded +``` +Update-AzEventGridPartnerRegistration -InputObject + [-AuthorizedAzureSubscriptionId ] [-LogoUri ] [-PartnerTopicTypeDescription ] + [-PartnerTopicTypeDisplayName ] [-PartnerTopicTypeName ] [-SetupUri ] + [-Tag ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] + [] +``` + +## DESCRIPTION +Updates a partner registration with the specified parameters. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AuthorizedAzureSubscriptionId +List of IDs of Azure AD applications that are authorized to create a partner namespaceassociated with this partner registration. +This is an optional property. +Creatingpartner namespaces is always permitted under the same Azure subscription as the one usedfor creating the partner registration. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +Parameter Sets: UpdateViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -LogoUri +URI of the partner logo. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +Name of the partner registration. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: PartnerRegistrationName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PartnerTopicTypeDescription +Description of the partner topic type. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PartnerTopicTypeDisplayName +Display name of the partner topic type. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PartnerTopicTypeName +Name of the partner topic type. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SetupUri +URI of the partner website that can be used by Azure customers to setup Event Gridintegration on an event source. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription credentials that uniquely identify a Microsoft Azure subscription. +The subscription ID forms part of the URI for every service call. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Tag +Tags of the partner registration resource. + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[ChannelName ]`: Name of the channel. + - `[DomainName ]`: Name of the domain. + - `[DomainTopicName ]`: Name of the topic. + - `[EventChannelName ]`: Name of the event channel. + - `[EventSubscriptionName ]`: Name of the event subscription. + - `[Id ]`: Resource identity path + - `[Location ]`: Name of the location. + - `[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\'. + - `[PartnerDestinationName ]`: Name of the partner destination. + - `[PartnerNamespaceName ]`: Name of the partner namespace. + - `[PartnerRegistrationName ]`: Name of the partner registration. + - `[PartnerTopicName ]`: Name of the partner topic. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection connection. + - `[PrivateLinkResourceName ]`: The name of private link resource. + - `[ProviderNamespace ]`: Namespace of the provider of the topic. + - `[ResourceGroupName ]`: The name of the resource group within the partners subscription. + - `[ResourceName ]`: Name of the resource. + - `[ResourceTypeName ]`: Name of the resource type. + - `[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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + - `[SubscriptionId ]`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + - `[SystemTopicName ]`: Name of the system topic. + - `[TopicName ]`: Name of the domain topic. + - `[TopicTypeName ]`: Name of the topic type. + - `[VerifiedPartnerName ]`: Name of the verified partner. + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/Update-AzEventGridPartnerTopic.md b/swaggerci/eventgrid/docs/Update-AzEventGridPartnerTopic.md new file mode 100644 index 000000000000..9e08817d47a4 --- /dev/null +++ b/swaggerci/eventgrid/docs/Update-AzEventGridPartnerTopic.md @@ -0,0 +1,308 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/update-azeventgridpartnertopic +schema: 2.0.0 +--- + +# Update-AzEventGridPartnerTopic + +## SYNOPSIS +Asynchronously updates a partner topic with the specified parameters. + +## SYNTAX + +### UpdateExpanded (Default) +``` +Update-AzEventGridPartnerTopic -Name -ResourceGroupName [-SubscriptionId ] + [-IdentityPrincipalId ] [-IdentityTenantId ] [-IdentityType ] + [-IdentityUserAssignedIdentity ] [-Tag ] [-DefaultProfile ] [-PassThru] + [-Confirm] [-WhatIf] [] +``` + +### UpdateViaIdentityExpanded +``` +Update-AzEventGridPartnerTopic -InputObject [-IdentityPrincipalId ] + [-IdentityTenantId ] [-IdentityType ] [-IdentityUserAssignedIdentity ] + [-Tag ] [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Asynchronously updates a partner topic with the specified parameters. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IdentityPrincipalId +The principal ID of resource identity. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IdentityTenantId +The tenant ID of resource. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IdentityType +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. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IdentityUserAssignedIdentity +The list of user identities associated with the resource. +The user identity dictionary key references will be ARM resource ids in the form:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.This property is currently not used and reserved for future usage. + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +Parameter Sets: UpdateViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +Name of the partner topic. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: PartnerTopicName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription credentials that uniquely identify a Microsoft Azure subscription. +The subscription ID forms part of the URI for every service call. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Tag +Tags of the Partner Topic resource. + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopic + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[ChannelName ]`: Name of the channel. + - `[DomainName ]`: Name of the domain. + - `[DomainTopicName ]`: Name of the topic. + - `[EventChannelName ]`: Name of the event channel. + - `[EventSubscriptionName ]`: Name of the event subscription. + - `[Id ]`: Resource identity path + - `[Location ]`: Name of the location. + - `[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\'. + - `[PartnerDestinationName ]`: Name of the partner destination. + - `[PartnerNamespaceName ]`: Name of the partner namespace. + - `[PartnerRegistrationName ]`: Name of the partner registration. + - `[PartnerTopicName ]`: Name of the partner topic. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection connection. + - `[PrivateLinkResourceName ]`: The name of private link resource. + - `[ProviderNamespace ]`: Namespace of the provider of the topic. + - `[ResourceGroupName ]`: The name of the resource group within the partners subscription. + - `[ResourceName ]`: Name of the resource. + - `[ResourceTypeName ]`: Name of the resource type. + - `[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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + - `[SubscriptionId ]`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + - `[SystemTopicName ]`: Name of the system topic. + - `[TopicName ]`: Name of the domain topic. + - `[TopicTypeName ]`: Name of the topic type. + - `[VerifiedPartnerName ]`: Name of the verified partner. + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/Update-AzEventGridPartnerTopicEventSubscription.md b/swaggerci/eventgrid/docs/Update-AzEventGridPartnerTopicEventSubscription.md new file mode 100644 index 000000000000..bafc83b617e4 --- /dev/null +++ b/swaggerci/eventgrid/docs/Update-AzEventGridPartnerTopicEventSubscription.md @@ -0,0 +1,559 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/update-azeventgridpartnertopiceventsubscription +schema: 2.0.0 +--- + +# Update-AzEventGridPartnerTopicEventSubscription + +## SYNOPSIS +Update an existing event subscription of a partner topic. + +## SYNTAX + +### UpdateExpanded (Default) +``` +Update-AzEventGridPartnerTopicEventSubscription -EventSubscriptionName -PartnerTopicName + -ResourceGroupName [-SubscriptionId ] + [-DeadLetterWithResourceIdentityType ] + [-DeadLetterWithResourceIdentityUserAssignedIdentity ] + [-DeliveryWithResourceIdentityDestinationEndpointType ] + [-DeliveryWithResourceIdentityType ] + [-DeliveryWithResourceIdentityUserAssignedIdentity ] [-EndpointType ] + [-EventDeliverySchema ] [-ExpirationTimeUtc ] + [-FilterAdvancedFilter ] [-FilterEnableAdvancedFilteringOnArray] + [-FilterIncludedEventType ] [-FilterIsSubjectCaseSensitive] [-FilterSubjectBeginsWith ] + [-FilterSubjectEndsWith ] [-Label ] [-RetryPolicyEventTimeToLiveInMinute ] + [-RetryPolicyMaxDeliveryAttempt ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] + [-Confirm] [-WhatIf] [] +``` + +### UpdateViaIdentityExpanded +``` +Update-AzEventGridPartnerTopicEventSubscription -InputObject + [-DeadLetterWithResourceIdentityType ] + [-DeadLetterWithResourceIdentityUserAssignedIdentity ] + [-DeliveryWithResourceIdentityDestinationEndpointType ] + [-DeliveryWithResourceIdentityType ] + [-DeliveryWithResourceIdentityUserAssignedIdentity ] [-EndpointType ] + [-EventDeliverySchema ] [-ExpirationTimeUtc ] + [-FilterAdvancedFilter ] [-FilterEnableAdvancedFilteringOnArray] + [-FilterIncludedEventType ] [-FilterIsSubjectCaseSensitive] [-FilterSubjectBeginsWith ] + [-FilterSubjectEndsWith ] [-Label ] [-RetryPolicyEventTimeToLiveInMinute ] + [-RetryPolicyMaxDeliveryAttempt ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] + [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Update an existing event subscription of a partner topic. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeadLetterWithResourceIdentityType +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. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeadLetterWithResourceIdentityUserAssignedIdentity +The user identity associated with the resource. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeliveryWithResourceIdentityDestinationEndpointType +Type of the endpoint for the event subscription destination. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeliveryWithResourceIdentityType +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. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeliveryWithResourceIdentityUserAssignedIdentity +The user identity associated with the resource. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EndpointType +Type of the endpoint for the event subscription destination. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EventDeliverySchema +The event delivery schema for the event subscription. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -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. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ExpirationTimeUtc +Information about the expiration time for the event subscription. + +```yaml +Type: System.DateTime +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FilterAdvancedFilter +An array of advanced filters that are used for filtering event subscriptions. +To construct, see NOTES section for FILTERADVANCEDFILTER properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FilterEnableAdvancedFilteringOnArray +Allows advanced filters to be evaluated against an array of values instead of expecting a singular value. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FilterIncludedEventType +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. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FilterIsSubjectCaseSensitive +Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filtershould be compared in a case sensitive manner. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FilterSubjectBeginsWith +An optional string to filter events for an event subscription based on a resource path prefix.The format of this depends on the publisher of the events.Wildcard characters are not supported in this path. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FilterSubjectEndsWith +An optional string to filter events for an event subscription based on a resource path suffix.Wildcard characters are not supported in this path. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +Parameter Sets: UpdateViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Label +List of user defined labels. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PartnerTopicName +Name of the partner topic. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -RetryPolicyEventTimeToLiveInMinute +Time To Live (in minutes) for events. + +```yaml +Type: System.Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -RetryPolicyMaxDeliveryAttempt +Maximum number of delivery retry attempts for events. + +```yaml +Type: System.Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription credentials that uniquely identify a Microsoft Azure subscription. +The subscription ID forms part of the URI for every service call. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +FILTERADVANCEDFILTER : An array of advanced filters that are used for filtering event subscriptions. + - `OperatorType `: The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. + - `[Key ]`: The field/property in the event based on which you want to filter. + +INPUTOBJECT : Identity Parameter + - `[ChannelName ]`: Name of the channel. + - `[DomainName ]`: Name of the domain. + - `[DomainTopicName ]`: Name of the topic. + - `[EventChannelName ]`: Name of the event channel. + - `[EventSubscriptionName ]`: Name of the event subscription. + - `[Id ]`: Resource identity path + - `[Location ]`: Name of the location. + - `[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\'. + - `[PartnerDestinationName ]`: Name of the partner destination. + - `[PartnerNamespaceName ]`: Name of the partner namespace. + - `[PartnerRegistrationName ]`: Name of the partner registration. + - `[PartnerTopicName ]`: Name of the partner topic. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection connection. + - `[PrivateLinkResourceName ]`: The name of private link resource. + - `[ProviderNamespace ]`: Namespace of the provider of the topic. + - `[ResourceGroupName ]`: The name of the resource group within the partners subscription. + - `[ResourceName ]`: Name of the resource. + - `[ResourceTypeName ]`: Name of the resource type. + - `[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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + - `[SubscriptionId ]`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + - `[SystemTopicName ]`: Name of the system topic. + - `[TopicName ]`: Name of the domain topic. + - `[TopicTypeName ]`: Name of the topic type. + - `[VerifiedPartnerName ]`: Name of the verified partner. + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/Update-AzEventGridSystemTopic.md b/swaggerci/eventgrid/docs/Update-AzEventGridSystemTopic.md new file mode 100644 index 000000000000..6a1d0e210a6b --- /dev/null +++ b/swaggerci/eventgrid/docs/Update-AzEventGridSystemTopic.md @@ -0,0 +1,339 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/update-azeventgridsystemtopic +schema: 2.0.0 +--- + +# Update-AzEventGridSystemTopic + +## SYNOPSIS +Asynchronously updates a system topic with the specified parameters. + +## SYNTAX + +### UpdateExpanded (Default) +``` +Update-AzEventGridSystemTopic -Name -ResourceGroupName [-SubscriptionId ] + [-IdentityPrincipalId ] [-IdentityTenantId ] [-IdentityType ] + [-IdentityUserAssignedIdentity ] [-Tag ] [-DefaultProfile ] [-AsJob] + [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### UpdateViaIdentityExpanded +``` +Update-AzEventGridSystemTopic -InputObject [-IdentityPrincipalId ] + [-IdentityTenantId ] [-IdentityType ] [-IdentityUserAssignedIdentity ] + [-Tag ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] + [] +``` + +## DESCRIPTION +Asynchronously updates a system topic with the specified parameters. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IdentityPrincipalId +The principal ID of resource identity. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IdentityTenantId +The tenant ID of resource. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IdentityType +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. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IdentityUserAssignedIdentity +The list of user identities associated with the resource. +The user identity dictionary key references will be ARM resource ids in the form:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.This property is currently not used and reserved for future usage. + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +Parameter Sets: UpdateViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +Name of the system topic. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: SystemTopicName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription credentials that uniquely identify a Microsoft Azure subscription. +The subscription ID forms part of the URI for every service call. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Tag +Tags of the system topic. + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopic + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[ChannelName ]`: Name of the channel. + - `[DomainName ]`: Name of the domain. + - `[DomainTopicName ]`: Name of the topic. + - `[EventChannelName ]`: Name of the event channel. + - `[EventSubscriptionName ]`: Name of the event subscription. + - `[Id ]`: Resource identity path + - `[Location ]`: Name of the location. + - `[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\'. + - `[PartnerDestinationName ]`: Name of the partner destination. + - `[PartnerNamespaceName ]`: Name of the partner namespace. + - `[PartnerRegistrationName ]`: Name of the partner registration. + - `[PartnerTopicName ]`: Name of the partner topic. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection connection. + - `[PrivateLinkResourceName ]`: The name of private link resource. + - `[ProviderNamespace ]`: Namespace of the provider of the topic. + - `[ResourceGroupName ]`: The name of the resource group within the partners subscription. + - `[ResourceName ]`: Name of the resource. + - `[ResourceTypeName ]`: Name of the resource type. + - `[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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + - `[SubscriptionId ]`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + - `[SystemTopicName ]`: Name of the system topic. + - `[TopicName ]`: Name of the domain topic. + - `[TopicTypeName ]`: Name of the topic type. + - `[VerifiedPartnerName ]`: Name of the verified partner. + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/Update-AzEventGridSystemTopicEventSubscription.md b/swaggerci/eventgrid/docs/Update-AzEventGridSystemTopicEventSubscription.md new file mode 100644 index 000000000000..703130313f2a --- /dev/null +++ b/swaggerci/eventgrid/docs/Update-AzEventGridSystemTopicEventSubscription.md @@ -0,0 +1,559 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/update-azeventgridsystemtopiceventsubscription +schema: 2.0.0 +--- + +# Update-AzEventGridSystemTopicEventSubscription + +## SYNOPSIS +Update an existing event subscription of a system topic. + +## SYNTAX + +### UpdateExpanded (Default) +``` +Update-AzEventGridSystemTopicEventSubscription -EventSubscriptionName -ResourceGroupName + -SystemTopicName [-SubscriptionId ] + [-DeadLetterWithResourceIdentityType ] + [-DeadLetterWithResourceIdentityUserAssignedIdentity ] + [-DeliveryWithResourceIdentityDestinationEndpointType ] + [-DeliveryWithResourceIdentityType ] + [-DeliveryWithResourceIdentityUserAssignedIdentity ] [-EndpointType ] + [-EventDeliverySchema ] [-ExpirationTimeUtc ] + [-FilterAdvancedFilter ] [-FilterEnableAdvancedFilteringOnArray] + [-FilterIncludedEventType ] [-FilterIsSubjectCaseSensitive] [-FilterSubjectBeginsWith ] + [-FilterSubjectEndsWith ] [-Label ] [-RetryPolicyEventTimeToLiveInMinute ] + [-RetryPolicyMaxDeliveryAttempt ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] + [-Confirm] [-WhatIf] [] +``` + +### UpdateViaIdentityExpanded +``` +Update-AzEventGridSystemTopicEventSubscription -InputObject + [-DeadLetterWithResourceIdentityType ] + [-DeadLetterWithResourceIdentityUserAssignedIdentity ] + [-DeliveryWithResourceIdentityDestinationEndpointType ] + [-DeliveryWithResourceIdentityType ] + [-DeliveryWithResourceIdentityUserAssignedIdentity ] [-EndpointType ] + [-EventDeliverySchema ] [-ExpirationTimeUtc ] + [-FilterAdvancedFilter ] [-FilterEnableAdvancedFilteringOnArray] + [-FilterIncludedEventType ] [-FilterIsSubjectCaseSensitive] [-FilterSubjectBeginsWith ] + [-FilterSubjectEndsWith ] [-Label ] [-RetryPolicyEventTimeToLiveInMinute ] + [-RetryPolicyMaxDeliveryAttempt ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] + [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Update an existing event subscription of a system topic. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeadLetterWithResourceIdentityType +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. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeadLetterWithResourceIdentityUserAssignedIdentity +The user identity associated with the resource. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeliveryWithResourceIdentityDestinationEndpointType +Type of the endpoint for the event subscription destination. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeliveryWithResourceIdentityType +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. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeliveryWithResourceIdentityUserAssignedIdentity +The user identity associated with the resource. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EndpointType +Type of the endpoint for the event subscription destination. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EventDeliverySchema +The event delivery schema for the event subscription. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -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. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ExpirationTimeUtc +Information about the expiration time for the event subscription. + +```yaml +Type: System.DateTime +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FilterAdvancedFilter +An array of advanced filters that are used for filtering event subscriptions. +To construct, see NOTES section for FILTERADVANCEDFILTER properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FilterEnableAdvancedFilteringOnArray +Allows advanced filters to be evaluated against an array of values instead of expecting a singular value. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FilterIncludedEventType +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. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FilterIsSubjectCaseSensitive +Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filtershould be compared in a case sensitive manner. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FilterSubjectBeginsWith +An optional string to filter events for an event subscription based on a resource path prefix.The format of this depends on the publisher of the events.Wildcard characters are not supported in this path. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FilterSubjectEndsWith +An optional string to filter events for an event subscription based on a resource path suffix.Wildcard characters are not supported in this path. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +Parameter Sets: UpdateViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Label +List of user defined labels. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -RetryPolicyEventTimeToLiveInMinute +Time To Live (in minutes) for events. + +```yaml +Type: System.Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -RetryPolicyMaxDeliveryAttempt +Maximum number of delivery retry attempts for events. + +```yaml +Type: System.Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription credentials that uniquely identify a Microsoft Azure subscription. +The subscription ID forms part of the URI for every service call. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SystemTopicName +Name of the system topic. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +FILTERADVANCEDFILTER : An array of advanced filters that are used for filtering event subscriptions. + - `OperatorType `: The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. + - `[Key ]`: The field/property in the event based on which you want to filter. + +INPUTOBJECT : Identity Parameter + - `[ChannelName ]`: Name of the channel. + - `[DomainName ]`: Name of the domain. + - `[DomainTopicName ]`: Name of the topic. + - `[EventChannelName ]`: Name of the event channel. + - `[EventSubscriptionName ]`: Name of the event subscription. + - `[Id ]`: Resource identity path + - `[Location ]`: Name of the location. + - `[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\'. + - `[PartnerDestinationName ]`: Name of the partner destination. + - `[PartnerNamespaceName ]`: Name of the partner namespace. + - `[PartnerRegistrationName ]`: Name of the partner registration. + - `[PartnerTopicName ]`: Name of the partner topic. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection connection. + - `[PrivateLinkResourceName ]`: The name of private link resource. + - `[ProviderNamespace ]`: Namespace of the provider of the topic. + - `[ResourceGroupName ]`: The name of the resource group within the partners subscription. + - `[ResourceName ]`: Name of the resource. + - `[ResourceTypeName ]`: Name of the resource type. + - `[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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + - `[SubscriptionId ]`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + - `[SystemTopicName ]`: Name of the system topic. + - `[TopicName ]`: Name of the domain topic. + - `[TopicTypeName ]`: Name of the topic type. + - `[VerifiedPartnerName ]`: Name of the verified partner. + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/Update-AzEventGridTopic.md b/swaggerci/eventgrid/docs/Update-AzEventGridTopic.md new file mode 100644 index 000000000000..878a33011fc4 --- /dev/null +++ b/swaggerci/eventgrid/docs/Update-AzEventGridTopic.md @@ -0,0 +1,429 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/update-azeventgridtopic +schema: 2.0.0 +--- + +# Update-AzEventGridTopic + +## SYNOPSIS +Asynchronously updates a topic with the specified parameters. + +## SYNTAX + +### UpdateExpanded (Default) +``` +Update-AzEventGridTopic -Name -ResourceGroupName [-SubscriptionId ] + [-DataResidencyBoundary ] [-DisableLocalAuth] [-IdentityPrincipalId ] + [-IdentityTenantId ] [-IdentityType ] [-IdentityUserAssignedIdentity ] + [-InboundIPRule ] [-PublicNetworkAccess ] [-SkuName ] + [-Tag ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] + [] +``` + +### UpdateViaIdentityExpanded +``` +Update-AzEventGridTopic -InputObject [-DataResidencyBoundary ] + [-DisableLocalAuth] [-IdentityPrincipalId ] [-IdentityTenantId ] + [-IdentityType ] [-IdentityUserAssignedIdentity ] + [-InboundIPRule ] [-PublicNetworkAccess ] [-SkuName ] + [-Tag ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] + [] +``` + +## DESCRIPTION +Asynchronously updates a topic with the specified parameters. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DataResidencyBoundary +The data residency boundary for the topic. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DisableLocalAuth +This boolean is used to enable or disable local auth. +Default value is false. +When the property is set to true, only AAD token will be used to authenticate if user is allowed to publish to the topic. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IdentityPrincipalId +The principal ID of resource identity. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IdentityTenantId +The tenant ID of resource. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IdentityType +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. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IdentityUserAssignedIdentity +The list of user identities associated with the resource. +The user identity dictionary key references will be ARM resource ids in the form:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.This property is currently not used and reserved for future usage. + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InboundIPRule +This can be used to restrict traffic from specific IPs instead of all IPs. +Note: These are considered only if PublicNetworkAccess is enabled. +To construct, see NOTES section for INBOUNDIPRULE properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +Parameter Sets: UpdateViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +Name of the topic. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: TopicName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PublicNetworkAccess +This determines if traffic is allowed over public network. +By default it is enabled. +You can further restrict to specific IPs by configuring \ + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SkuName +The Sku name of the resource. +The possible values are: Basic or Premium. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription credentials that uniquely identify a Microsoft Azure subscription. +The subscription ID forms part of the URI for every service call. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Tag +Tags of the Topic resource. + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INBOUNDIPRULE : This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess is enabled. + - `[Action ]`: Action to perform based on the match or no match of the IpMask. + - `[IPMask ]`: IP Address in CIDR notation e.g., 10.0.0.0/8. + +INPUTOBJECT : Identity Parameter + - `[ChannelName ]`: Name of the channel. + - `[DomainName ]`: Name of the domain. + - `[DomainTopicName ]`: Name of the topic. + - `[EventChannelName ]`: Name of the event channel. + - `[EventSubscriptionName ]`: Name of the event subscription. + - `[Id ]`: Resource identity path + - `[Location ]`: Name of the location. + - `[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\'. + - `[PartnerDestinationName ]`: Name of the partner destination. + - `[PartnerNamespaceName ]`: Name of the partner namespace. + - `[PartnerRegistrationName ]`: Name of the partner registration. + - `[PartnerTopicName ]`: Name of the partner topic. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection connection. + - `[PrivateLinkResourceName ]`: The name of private link resource. + - `[ProviderNamespace ]`: Namespace of the provider of the topic. + - `[ResourceGroupName ]`: The name of the resource group within the partners subscription. + - `[ResourceName ]`: Name of the resource. + - `[ResourceTypeName ]`: Name of the resource type. + - `[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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + - `[SubscriptionId ]`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + - `[SystemTopicName ]`: Name of the system topic. + - `[TopicName ]`: Name of the domain topic. + - `[TopicTypeName ]`: Name of the topic type. + - `[VerifiedPartnerName ]`: Name of the verified partner. + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/docs/Update-AzEventGridTopicEventSubscription.md b/swaggerci/eventgrid/docs/Update-AzEventGridTopicEventSubscription.md new file mode 100644 index 000000000000..726df02bc099 --- /dev/null +++ b/swaggerci/eventgrid/docs/Update-AzEventGridTopicEventSubscription.md @@ -0,0 +1,558 @@ +--- +external help file: +Module Name: Az.EventGrid +online version: https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/update-azeventgridtopiceventsubscription +schema: 2.0.0 +--- + +# Update-AzEventGridTopicEventSubscription + +## SYNOPSIS +Update an existing event subscription for a topic. + +## SYNTAX + +### UpdateExpanded (Default) +``` +Update-AzEventGridTopicEventSubscription -EventSubscriptionName -ResourceGroupName + -TopicName [-SubscriptionId ] + [-DeadLetterWithResourceIdentityType ] + [-DeadLetterWithResourceIdentityUserAssignedIdentity ] + [-DeliveryWithResourceIdentityDestinationEndpointType ] + [-DeliveryWithResourceIdentityType ] + [-DeliveryWithResourceIdentityUserAssignedIdentity ] [-EndpointType ] + [-EventDeliverySchema ] [-ExpirationTimeUtc ] + [-FilterAdvancedFilter ] [-FilterEnableAdvancedFilteringOnArray] + [-FilterIncludedEventType ] [-FilterIsSubjectCaseSensitive] [-FilterSubjectBeginsWith ] + [-FilterSubjectEndsWith ] [-Label ] [-RetryPolicyEventTimeToLiveInMinute ] + [-RetryPolicyMaxDeliveryAttempt ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] + [-Confirm] [-WhatIf] [] +``` + +### UpdateViaIdentityExpanded +``` +Update-AzEventGridTopicEventSubscription -InputObject + [-DeadLetterWithResourceIdentityType ] + [-DeadLetterWithResourceIdentityUserAssignedIdentity ] + [-DeliveryWithResourceIdentityDestinationEndpointType ] + [-DeliveryWithResourceIdentityType ] + [-DeliveryWithResourceIdentityUserAssignedIdentity ] [-EndpointType ] + [-EventDeliverySchema ] [-ExpirationTimeUtc ] + [-FilterAdvancedFilter ] [-FilterEnableAdvancedFilteringOnArray] + [-FilterIncludedEventType ] [-FilterIsSubjectCaseSensitive] [-FilterSubjectBeginsWith ] + [-FilterSubjectEndsWith ] [-Label ] [-RetryPolicyEventTimeToLiveInMinute ] + [-RetryPolicyMaxDeliveryAttempt ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] + [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Update an existing event subscription for a topic. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeadLetterWithResourceIdentityType +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. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeadLetterWithResourceIdentityUserAssignedIdentity +The user identity associated with the resource. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeliveryWithResourceIdentityDestinationEndpointType +Type of the endpoint for the event subscription destination. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeliveryWithResourceIdentityType +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. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeliveryWithResourceIdentityUserAssignedIdentity +The user identity associated with the resource. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EndpointType +Type of the endpoint for the event subscription destination. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EventDeliverySchema +The event delivery schema for the event subscription. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EventSubscriptionName +Name of the event subscription to be updated. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ExpirationTimeUtc +Information about the expiration time for the event subscription. + +```yaml +Type: System.DateTime +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FilterAdvancedFilter +An array of advanced filters that are used for filtering event subscriptions. +To construct, see NOTES section for FILTERADVANCEDFILTER properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FilterEnableAdvancedFilteringOnArray +Allows advanced filters to be evaluated against an array of values instead of expecting a singular value. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FilterIncludedEventType +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. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FilterIsSubjectCaseSensitive +Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filtershould be compared in a case sensitive manner. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FilterSubjectBeginsWith +An optional string to filter events for an event subscription based on a resource path prefix.The format of this depends on the publisher of the events.Wildcard characters are not supported in this path. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FilterSubjectEndsWith +An optional string to filter events for an event subscription based on a resource path suffix.Wildcard characters are not supported in this path. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +Parameter Sets: UpdateViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Label +List of user defined labels. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -RetryPolicyEventTimeToLiveInMinute +Time To Live (in minutes) for events. + +```yaml +Type: System.Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -RetryPolicyMaxDeliveryAttempt +Maximum number of delivery retry attempts for events. + +```yaml +Type: System.Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription credentials that uniquely identify a Microsoft Azure subscription. +The subscription ID forms part of the URI for every service call. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TopicName +Name of the domain. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +FILTERADVANCEDFILTER : An array of advanced filters that are used for filtering event subscriptions. + - `OperatorType `: The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. + - `[Key ]`: The field/property in the event based on which you want to filter. + +INPUTOBJECT : Identity Parameter + - `[ChannelName ]`: Name of the channel. + - `[DomainName ]`: Name of the domain. + - `[DomainTopicName ]`: Name of the topic. + - `[EventChannelName ]`: Name of the event channel. + - `[EventSubscriptionName ]`: Name of the event subscription. + - `[Id ]`: Resource identity path + - `[Location ]`: Name of the location. + - `[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\'. + - `[PartnerDestinationName ]`: Name of the partner destination. + - `[PartnerNamespaceName ]`: Name of the partner namespace. + - `[PartnerRegistrationName ]`: Name of the partner registration. + - `[PartnerTopicName ]`: Name of the partner topic. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection connection. + - `[PrivateLinkResourceName ]`: The name of private link resource. + - `[ProviderNamespace ]`: Namespace of the provider of the topic. + - `[ResourceGroupName ]`: The name of the resource group within the partners subscription. + - `[ResourceName ]`: Name of the resource. + - `[ResourceTypeName ]`: Name of the resource type. + - `[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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + - `[SubscriptionId ]`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + - `[SystemTopicName ]`: Name of the system topic. + - `[TopicName ]`: Name of the domain topic. + - `[TopicTypeName ]`: Name of the topic type. + - `[VerifiedPartnerName ]`: Name of the verified partner. + +## RELATED LINKS + diff --git a/swaggerci/eventgrid/examples/Get-AzEventGridChannel.md b/swaggerci/eventgrid/examples/Get-AzEventGridChannel.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/Get-AzEventGridChannel.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/Get-AzEventGridChannelFullUrl.md b/swaggerci/eventgrid/examples/Get-AzEventGridChannelFullUrl.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/Get-AzEventGridChannelFullUrl.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/Get-AzEventGridDomain.md b/swaggerci/eventgrid/examples/Get-AzEventGridDomain.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/Get-AzEventGridDomain.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/Get-AzEventGridDomainEventSubscription.md b/swaggerci/eventgrid/examples/Get-AzEventGridDomainEventSubscription.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/Get-AzEventGridDomainEventSubscription.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/Get-AzEventGridDomainEventSubscriptionDeliveryAttribute.md b/swaggerci/eventgrid/examples/Get-AzEventGridDomainEventSubscriptionDeliveryAttribute.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/Get-AzEventGridDomainEventSubscriptionDeliveryAttribute.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/Get-AzEventGridDomainEventSubscriptionFullUrl.md b/swaggerci/eventgrid/examples/Get-AzEventGridDomainEventSubscriptionFullUrl.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/Get-AzEventGridDomainEventSubscriptionFullUrl.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/Get-AzEventGridDomainSharedAccessKey.md b/swaggerci/eventgrid/examples/Get-AzEventGridDomainSharedAccessKey.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/Get-AzEventGridDomainSharedAccessKey.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/Get-AzEventGridDomainTopic.md b/swaggerci/eventgrid/examples/Get-AzEventGridDomainTopic.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/Get-AzEventGridDomainTopic.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/Get-AzEventGridDomainTopicEventSubscription.md b/swaggerci/eventgrid/examples/Get-AzEventGridDomainTopicEventSubscription.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/Get-AzEventGridDomainTopicEventSubscription.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/Get-AzEventGridDomainTopicEventSubscriptionDeliveryAttribute.md b/swaggerci/eventgrid/examples/Get-AzEventGridDomainTopicEventSubscriptionDeliveryAttribute.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/Get-AzEventGridDomainTopicEventSubscriptionDeliveryAttribute.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/Get-AzEventGridDomainTopicEventSubscriptionFullUrl.md b/swaggerci/eventgrid/examples/Get-AzEventGridDomainTopicEventSubscriptionFullUrl.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/Get-AzEventGridDomainTopicEventSubscriptionFullUrl.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/Get-AzEventGridEventChannel.md b/swaggerci/eventgrid/examples/Get-AzEventGridEventChannel.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/Get-AzEventGridEventChannel.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/Get-AzEventGridEventSubscription.md b/swaggerci/eventgrid/examples/Get-AzEventGridEventSubscription.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/Get-AzEventGridEventSubscription.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/Get-AzEventGridEventSubscriptionDeliveryAttribute.md b/swaggerci/eventgrid/examples/Get-AzEventGridEventSubscriptionDeliveryAttribute.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/Get-AzEventGridEventSubscriptionDeliveryAttribute.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/Get-AzEventGridEventSubscriptionFullUrl.md b/swaggerci/eventgrid/examples/Get-AzEventGridEventSubscriptionFullUrl.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/Get-AzEventGridEventSubscriptionFullUrl.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/Get-AzEventGridEventSubscriptionGlobal.md b/swaggerci/eventgrid/examples/Get-AzEventGridEventSubscriptionGlobal.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/Get-AzEventGridEventSubscriptionGlobal.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/Get-AzEventGridEventSubscriptionRegional.md b/swaggerci/eventgrid/examples/Get-AzEventGridEventSubscriptionRegional.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/Get-AzEventGridEventSubscriptionRegional.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/Get-AzEventGridExtensionTopic.md b/swaggerci/eventgrid/examples/Get-AzEventGridExtensionTopic.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/Get-AzEventGridExtensionTopic.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/Get-AzEventGridPartnerConfiguration.md b/swaggerci/eventgrid/examples/Get-AzEventGridPartnerConfiguration.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/Get-AzEventGridPartnerConfiguration.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/Get-AzEventGridPartnerDestination.md b/swaggerci/eventgrid/examples/Get-AzEventGridPartnerDestination.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/Get-AzEventGridPartnerDestination.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/Get-AzEventGridPartnerNamespace.md b/swaggerci/eventgrid/examples/Get-AzEventGridPartnerNamespace.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/Get-AzEventGridPartnerNamespace.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/Get-AzEventGridPartnerNamespaceSharedAccessKey.md b/swaggerci/eventgrid/examples/Get-AzEventGridPartnerNamespaceSharedAccessKey.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/Get-AzEventGridPartnerNamespaceSharedAccessKey.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/Get-AzEventGridPartnerRegistration.md b/swaggerci/eventgrid/examples/Get-AzEventGridPartnerRegistration.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/Get-AzEventGridPartnerRegistration.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/Get-AzEventGridPartnerTopic.md b/swaggerci/eventgrid/examples/Get-AzEventGridPartnerTopic.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/Get-AzEventGridPartnerTopic.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/Get-AzEventGridPartnerTopicEventSubscription.md b/swaggerci/eventgrid/examples/Get-AzEventGridPartnerTopicEventSubscription.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/Get-AzEventGridPartnerTopicEventSubscription.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/Get-AzEventGridPartnerTopicEventSubscriptionDeliveryAttribute.md b/swaggerci/eventgrid/examples/Get-AzEventGridPartnerTopicEventSubscriptionDeliveryAttribute.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/Get-AzEventGridPartnerTopicEventSubscriptionDeliveryAttribute.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/Get-AzEventGridPartnerTopicEventSubscriptionFullUrl.md b/swaggerci/eventgrid/examples/Get-AzEventGridPartnerTopicEventSubscriptionFullUrl.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/Get-AzEventGridPartnerTopicEventSubscriptionFullUrl.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/Get-AzEventGridPrivateEndpointConnection.md b/swaggerci/eventgrid/examples/Get-AzEventGridPrivateEndpointConnection.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/Get-AzEventGridPrivateEndpointConnection.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/Get-AzEventGridPrivateLinkResource.md b/swaggerci/eventgrid/examples/Get-AzEventGridPrivateLinkResource.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/Get-AzEventGridPrivateLinkResource.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/Get-AzEventGridSystemTopic.md b/swaggerci/eventgrid/examples/Get-AzEventGridSystemTopic.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/Get-AzEventGridSystemTopic.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/Get-AzEventGridSystemTopicEventSubscription.md b/swaggerci/eventgrid/examples/Get-AzEventGridSystemTopicEventSubscription.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/Get-AzEventGridSystemTopicEventSubscription.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/Get-AzEventGridSystemTopicEventSubscriptionDeliveryAttribute.md b/swaggerci/eventgrid/examples/Get-AzEventGridSystemTopicEventSubscriptionDeliveryAttribute.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/Get-AzEventGridSystemTopicEventSubscriptionDeliveryAttribute.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/Get-AzEventGridSystemTopicEventSubscriptionFullUrl.md b/swaggerci/eventgrid/examples/Get-AzEventGridSystemTopicEventSubscriptionFullUrl.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/Get-AzEventGridSystemTopicEventSubscriptionFullUrl.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/Get-AzEventGridTopic.md b/swaggerci/eventgrid/examples/Get-AzEventGridTopic.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/Get-AzEventGridTopic.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/Get-AzEventGridTopicEventSubscription.md b/swaggerci/eventgrid/examples/Get-AzEventGridTopicEventSubscription.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/Get-AzEventGridTopicEventSubscription.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/Get-AzEventGridTopicEventSubscriptionDeliveryAttribute.md b/swaggerci/eventgrid/examples/Get-AzEventGridTopicEventSubscriptionDeliveryAttribute.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/Get-AzEventGridTopicEventSubscriptionDeliveryAttribute.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/Get-AzEventGridTopicEventSubscriptionFullUrl.md b/swaggerci/eventgrid/examples/Get-AzEventGridTopicEventSubscriptionFullUrl.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/Get-AzEventGridTopicEventSubscriptionFullUrl.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/Get-AzEventGridTopicEventType.md b/swaggerci/eventgrid/examples/Get-AzEventGridTopicEventType.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/Get-AzEventGridTopicEventType.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/Get-AzEventGridTopicSharedAccessKey.md b/swaggerci/eventgrid/examples/Get-AzEventGridTopicSharedAccessKey.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/Get-AzEventGridTopicSharedAccessKey.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/Get-AzEventGridTopicType.md b/swaggerci/eventgrid/examples/Get-AzEventGridTopicType.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/Get-AzEventGridTopicType.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/Get-AzEventGridTopicTypeEventType.md b/swaggerci/eventgrid/examples/Get-AzEventGridTopicTypeEventType.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/Get-AzEventGridTopicTypeEventType.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/Get-AzEventGridVerifiedPartner.md b/swaggerci/eventgrid/examples/Get-AzEventGridVerifiedPartner.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/Get-AzEventGridVerifiedPartner.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/Grant-AzEventGridPartnerConfigurationPartner.md b/swaggerci/eventgrid/examples/Grant-AzEventGridPartnerConfigurationPartner.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/Grant-AzEventGridPartnerConfigurationPartner.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/Initialize-AzEventGridPartnerDestination.md b/swaggerci/eventgrid/examples/Initialize-AzEventGridPartnerDestination.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/Initialize-AzEventGridPartnerDestination.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/Initialize-AzEventGridPartnerTopic.md b/swaggerci/eventgrid/examples/Initialize-AzEventGridPartnerTopic.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/Initialize-AzEventGridPartnerTopic.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/Invoke-AzEventGridDeactivatePartnerTopic.md b/swaggerci/eventgrid/examples/Invoke-AzEventGridDeactivatePartnerTopic.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/Invoke-AzEventGridDeactivatePartnerTopic.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/Invoke-AzEventGridPartnerConfigurationUnauthorize.md b/swaggerci/eventgrid/examples/Invoke-AzEventGridPartnerConfigurationUnauthorize.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/Invoke-AzEventGridPartnerConfigurationUnauthorize.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/New-AzEventGridChannel.md b/swaggerci/eventgrid/examples/New-AzEventGridChannel.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/New-AzEventGridChannel.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/New-AzEventGridDomain.md b/swaggerci/eventgrid/examples/New-AzEventGridDomain.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/New-AzEventGridDomain.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/New-AzEventGridDomainEventSubscription.md b/swaggerci/eventgrid/examples/New-AzEventGridDomainEventSubscription.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/New-AzEventGridDomainEventSubscription.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/New-AzEventGridDomainKey.md b/swaggerci/eventgrid/examples/New-AzEventGridDomainKey.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/New-AzEventGridDomainKey.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/New-AzEventGridDomainTopicEventSubscription.md b/swaggerci/eventgrid/examples/New-AzEventGridDomainTopicEventSubscription.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/New-AzEventGridDomainTopicEventSubscription.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/New-AzEventGridEventChannel.md b/swaggerci/eventgrid/examples/New-AzEventGridEventChannel.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/New-AzEventGridEventChannel.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/New-AzEventGridEventSubscription.md b/swaggerci/eventgrid/examples/New-AzEventGridEventSubscription.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/New-AzEventGridEventSubscription.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/New-AzEventGridPartnerConfiguration.md b/swaggerci/eventgrid/examples/New-AzEventGridPartnerConfiguration.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/New-AzEventGridPartnerConfiguration.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/New-AzEventGridPartnerDestination.md b/swaggerci/eventgrid/examples/New-AzEventGridPartnerDestination.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/New-AzEventGridPartnerDestination.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/New-AzEventGridPartnerNamespace.md b/swaggerci/eventgrid/examples/New-AzEventGridPartnerNamespace.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/New-AzEventGridPartnerNamespace.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/New-AzEventGridPartnerNamespaceKey.md b/swaggerci/eventgrid/examples/New-AzEventGridPartnerNamespaceKey.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/New-AzEventGridPartnerNamespaceKey.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/New-AzEventGridPartnerRegistration.md b/swaggerci/eventgrid/examples/New-AzEventGridPartnerRegistration.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/New-AzEventGridPartnerRegistration.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/New-AzEventGridPartnerTopic.md b/swaggerci/eventgrid/examples/New-AzEventGridPartnerTopic.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/New-AzEventGridPartnerTopic.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/New-AzEventGridPartnerTopicEventSubscription.md b/swaggerci/eventgrid/examples/New-AzEventGridPartnerTopicEventSubscription.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/New-AzEventGridPartnerTopicEventSubscription.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/New-AzEventGridSystemTopic.md b/swaggerci/eventgrid/examples/New-AzEventGridSystemTopic.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/New-AzEventGridSystemTopic.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/New-AzEventGridSystemTopicEventSubscription.md b/swaggerci/eventgrid/examples/New-AzEventGridSystemTopicEventSubscription.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/New-AzEventGridSystemTopicEventSubscription.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/New-AzEventGridTopic.md b/swaggerci/eventgrid/examples/New-AzEventGridTopic.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/New-AzEventGridTopic.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/New-AzEventGridTopicEventSubscription.md b/swaggerci/eventgrid/examples/New-AzEventGridTopicEventSubscription.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/New-AzEventGridTopicEventSubscription.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/New-AzEventGridTopicKey.md b/swaggerci/eventgrid/examples/New-AzEventGridTopicKey.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/New-AzEventGridTopicKey.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/Remove-AzEventGridChannel.md b/swaggerci/eventgrid/examples/Remove-AzEventGridChannel.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/Remove-AzEventGridChannel.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/Remove-AzEventGridDomain.md b/swaggerci/eventgrid/examples/Remove-AzEventGridDomain.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/Remove-AzEventGridDomain.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/Remove-AzEventGridDomainEventSubscription.md b/swaggerci/eventgrid/examples/Remove-AzEventGridDomainEventSubscription.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/Remove-AzEventGridDomainEventSubscription.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/Remove-AzEventGridDomainTopic.md b/swaggerci/eventgrid/examples/Remove-AzEventGridDomainTopic.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/Remove-AzEventGridDomainTopic.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/Remove-AzEventGridDomainTopicEventSubscription.md b/swaggerci/eventgrid/examples/Remove-AzEventGridDomainTopicEventSubscription.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/Remove-AzEventGridDomainTopicEventSubscription.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/Remove-AzEventGridEventChannel.md b/swaggerci/eventgrid/examples/Remove-AzEventGridEventChannel.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/Remove-AzEventGridEventChannel.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/Remove-AzEventGridEventSubscription.md b/swaggerci/eventgrid/examples/Remove-AzEventGridEventSubscription.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/Remove-AzEventGridEventSubscription.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/Remove-AzEventGridPartnerConfiguration.md b/swaggerci/eventgrid/examples/Remove-AzEventGridPartnerConfiguration.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/Remove-AzEventGridPartnerConfiguration.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/Remove-AzEventGridPartnerDestination.md b/swaggerci/eventgrid/examples/Remove-AzEventGridPartnerDestination.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/Remove-AzEventGridPartnerDestination.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/Remove-AzEventGridPartnerNamespace.md b/swaggerci/eventgrid/examples/Remove-AzEventGridPartnerNamespace.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/Remove-AzEventGridPartnerNamespace.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/Remove-AzEventGridPartnerRegistration.md b/swaggerci/eventgrid/examples/Remove-AzEventGridPartnerRegistration.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/Remove-AzEventGridPartnerRegistration.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/Remove-AzEventGridPartnerTopic.md b/swaggerci/eventgrid/examples/Remove-AzEventGridPartnerTopic.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/Remove-AzEventGridPartnerTopic.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/Remove-AzEventGridPartnerTopicEventSubscription.md b/swaggerci/eventgrid/examples/Remove-AzEventGridPartnerTopicEventSubscription.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/Remove-AzEventGridPartnerTopicEventSubscription.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/Remove-AzEventGridPrivateEndpointConnection.md b/swaggerci/eventgrid/examples/Remove-AzEventGridPrivateEndpointConnection.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/Remove-AzEventGridPrivateEndpointConnection.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/Remove-AzEventGridSystemTopic.md b/swaggerci/eventgrid/examples/Remove-AzEventGridSystemTopic.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/Remove-AzEventGridSystemTopic.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/Remove-AzEventGridSystemTopicEventSubscription.md b/swaggerci/eventgrid/examples/Remove-AzEventGridSystemTopicEventSubscription.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/Remove-AzEventGridSystemTopicEventSubscription.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/Remove-AzEventGridTopic.md b/swaggerci/eventgrid/examples/Remove-AzEventGridTopic.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/Remove-AzEventGridTopic.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/Remove-AzEventGridTopicEventSubscription.md b/swaggerci/eventgrid/examples/Remove-AzEventGridTopicEventSubscription.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/Remove-AzEventGridTopicEventSubscription.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/Update-AzEventGridChannel.md b/swaggerci/eventgrid/examples/Update-AzEventGridChannel.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/Update-AzEventGridChannel.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/Update-AzEventGridDomain.md b/swaggerci/eventgrid/examples/Update-AzEventGridDomain.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/Update-AzEventGridDomain.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/Update-AzEventGridDomainEventSubscription.md b/swaggerci/eventgrid/examples/Update-AzEventGridDomainEventSubscription.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/Update-AzEventGridDomainEventSubscription.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/Update-AzEventGridDomainTopicEventSubscription.md b/swaggerci/eventgrid/examples/Update-AzEventGridDomainTopicEventSubscription.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/Update-AzEventGridDomainTopicEventSubscription.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/Update-AzEventGridEventSubscription.md b/swaggerci/eventgrid/examples/Update-AzEventGridEventSubscription.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/Update-AzEventGridEventSubscription.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/Update-AzEventGridPartnerConfiguration.md b/swaggerci/eventgrid/examples/Update-AzEventGridPartnerConfiguration.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/Update-AzEventGridPartnerConfiguration.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/Update-AzEventGridPartnerDestination.md b/swaggerci/eventgrid/examples/Update-AzEventGridPartnerDestination.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/Update-AzEventGridPartnerDestination.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/Update-AzEventGridPartnerNamespace.md b/swaggerci/eventgrid/examples/Update-AzEventGridPartnerNamespace.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/Update-AzEventGridPartnerNamespace.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/Update-AzEventGridPartnerRegistration.md b/swaggerci/eventgrid/examples/Update-AzEventGridPartnerRegistration.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/Update-AzEventGridPartnerRegistration.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/Update-AzEventGridPartnerTopic.md b/swaggerci/eventgrid/examples/Update-AzEventGridPartnerTopic.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/Update-AzEventGridPartnerTopic.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/Update-AzEventGridPartnerTopicEventSubscription.md b/swaggerci/eventgrid/examples/Update-AzEventGridPartnerTopicEventSubscription.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/Update-AzEventGridPartnerTopicEventSubscription.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/Update-AzEventGridSystemTopic.md b/swaggerci/eventgrid/examples/Update-AzEventGridSystemTopic.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/Update-AzEventGridSystemTopic.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/Update-AzEventGridSystemTopicEventSubscription.md b/swaggerci/eventgrid/examples/Update-AzEventGridSystemTopicEventSubscription.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/Update-AzEventGridSystemTopicEventSubscription.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/Update-AzEventGridTopic.md b/swaggerci/eventgrid/examples/Update-AzEventGridTopic.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/Update-AzEventGridTopic.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/examples/Update-AzEventGridTopicEventSubscription.md b/swaggerci/eventgrid/examples/Update-AzEventGridTopicEventSubscription.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/eventgrid/examples/Update-AzEventGridTopicEventSubscription.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/eventgrid/export-surface.ps1 b/swaggerci/eventgrid/export-surface.ps1 new file mode 100644 index 000000000000..4d7ca89c62bb --- /dev/null +++ b/swaggerci/eventgrid/export-surface.ps1 @@ -0,0 +1,33 @@ +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- +param([switch]$Isolated, [switch]$IncludeGeneralParameters, [switch]$UseExpandedFormat) +$ErrorActionPreference = 'Stop' + +$pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path +if(-not $Isolated) { + Write-Host -ForegroundColor Green 'Creating isolated process...' + & "$pwsh" -NonInteractive -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -Isolated + return +} + +$dll = Join-Path $PSScriptRoot 'bin/Az.EventGrid.private.dll' +if(-not (Test-Path $dll)) { + Write-Error "Unable to find output assembly in '$binFolder'." +} +$null = Import-Module -Name $dll + +$moduleName = 'Az.EventGrid' +$exportsFolder = Join-Path $PSScriptRoot 'exports' +$resourcesFolder = Join-Path $PSScriptRoot 'resources' + +Export-CmdletSurface -ModuleName $moduleName -CmdletFolder $exportsFolder -OutputFolder $resourcesFolder -IncludeGeneralParameters $IncludeGeneralParameters.IsPresent -UseExpandedFormat $UseExpandedFormat.IsPresent +Write-Host -ForegroundColor Green "CmdletSurface file(s) created in '$resourcesFolder'" + +Export-ModelSurface -OutputFolder $resourcesFolder -UseExpandedFormat $UseExpandedFormat.IsPresent +Write-Host -ForegroundColor Green "ModelSurface file created in '$resourcesFolder'" + +Write-Host -ForegroundColor Green '-------------Done-------------' \ No newline at end of file diff --git a/swaggerci/eventgrid/exports/Get-AzEventGridChannel.ps1 b/swaggerci/eventgrid/exports/Get-AzEventGridChannel.ps1 new file mode 100644 index 000000000000..472f5edfde37 --- /dev/null +++ b/swaggerci/eventgrid/exports/Get-AzEventGridChannel.ps1 @@ -0,0 +1,248 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Get properties of a channel. +.Description +Get properties of a channel. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannel +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgridchannel +#> +function Get-AzEventGridChannel { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannel])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('ChannelName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the channel. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the partner namespace. + ${PartnerNamespaceName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the partners subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Query')] + [System.String] + # 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}, + + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Query')] + [System.Int32] + # 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}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.EventGrid.private\Get-AzEventGridChannel_Get'; + GetViaIdentity = 'Az.EventGrid.private\Get-AzEventGridChannel_GetViaIdentity'; + List = 'Az.EventGrid.private\Get-AzEventGridChannel_List'; + } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/Get-AzEventGridChannelFullUrl.ps1 b/swaggerci/eventgrid/exports/Get-AzEventGridChannelFullUrl.ps1 new file mode 100644 index 000000000000..e11bd8e88ea1 --- /dev/null +++ b/swaggerci/eventgrid/exports/Get-AzEventGridChannelFullUrl.ps1 @@ -0,0 +1,224 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Get the full endpoint URL of a partner destination channel. +.Description +Get the full endpoint URL of a partner destination channel. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +System.String +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgridchannelfullurl +#> +function Get-AzEventGridChannelFullUrl { +[OutputType([System.String])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the Channel. + ${ChannelName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the partner namespace. + ${PartnerNamespaceName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the partners subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.EventGrid.private\Get-AzEventGridChannelFullUrl_Get'; + GetViaIdentity = 'Az.EventGrid.private\Get-AzEventGridChannelFullUrl_GetViaIdentity'; + } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/Get-AzEventGridDomain.ps1 b/swaggerci/eventgrid/exports/Get-AzEventGridDomain.ps1 new file mode 100644 index 000000000000..b8974cd2a78d --- /dev/null +++ b/swaggerci/eventgrid/exports/Get-AzEventGridDomain.ps1 @@ -0,0 +1,245 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Get properties of a domain. +.Description +Get properties of a domain. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomain +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgriddomain +#> +function Get-AzEventGridDomain { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomain])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('DomainName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the domain. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List1', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Parameter(ParameterSetName='List1')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='List')] + [Parameter(ParameterSetName='List1')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Query')] + [System.String] + # 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}, + + [Parameter(ParameterSetName='List')] + [Parameter(ParameterSetName='List1')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Query')] + [System.Int32] + # 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}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.EventGrid.private\Get-AzEventGridDomain_Get'; + GetViaIdentity = 'Az.EventGrid.private\Get-AzEventGridDomain_GetViaIdentity'; + List = 'Az.EventGrid.private\Get-AzEventGridDomain_List'; + List1 = 'Az.EventGrid.private\Get-AzEventGridDomain_List1'; + } + if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/Get-AzEventGridDomainEventSubscription.ps1 b/swaggerci/eventgrid/exports/Get-AzEventGridDomainEventSubscription.ps1 new file mode 100644 index 000000000000..ec933d4efd3f --- /dev/null +++ b/swaggerci/eventgrid/exports/Get-AzEventGridDomainEventSubscription.ps1 @@ -0,0 +1,248 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Get properties of an event subscription of a domain. +.Description +Get properties of an event subscription of a domain. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgriddomaineventsubscription +#> +function Get-AzEventGridDomainEventSubscription { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the partner topic. + ${DomainName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # 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. + ${EventSubscriptionName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Query')] + [System.String] + # 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}, + + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Query')] + [System.Int32] + # 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}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.EventGrid.private\Get-AzEventGridDomainEventSubscription_Get'; + GetViaIdentity = 'Az.EventGrid.private\Get-AzEventGridDomainEventSubscription_GetViaIdentity'; + List = 'Az.EventGrid.private\Get-AzEventGridDomainEventSubscription_List'; + } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/Get-AzEventGridDomainEventSubscriptionDeliveryAttribute.ps1 b/swaggerci/eventgrid/exports/Get-AzEventGridDomainEventSubscriptionDeliveryAttribute.ps1 new file mode 100644 index 000000000000..77b0d5c73da0 --- /dev/null +++ b/swaggerci/eventgrid/exports/Get-AzEventGridDomainEventSubscriptionDeliveryAttribute.ps1 @@ -0,0 +1,224 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Get all delivery attributes for an event subscription for domain. +.Description +Get all delivery attributes for an event subscription for domain. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgriddomaineventsubscriptiondeliveryattribute +#> +function Get-AzEventGridDomainEventSubscriptionDeliveryAttribute { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the domain topic. + ${DomainName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the event subscription. + ${EventSubscriptionName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.EventGrid.private\Get-AzEventGridDomainEventSubscriptionDeliveryAttribute_Get'; + GetViaIdentity = 'Az.EventGrid.private\Get-AzEventGridDomainEventSubscriptionDeliveryAttribute_GetViaIdentity'; + } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/Get-AzEventGridDomainEventSubscriptionFullUrl.ps1 b/swaggerci/eventgrid/exports/Get-AzEventGridDomainEventSubscriptionFullUrl.ps1 new file mode 100644 index 000000000000..1f0fdc2db6b4 --- /dev/null +++ b/swaggerci/eventgrid/exports/Get-AzEventGridDomainEventSubscriptionFullUrl.ps1 @@ -0,0 +1,224 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Get the full endpoint URL for an event subscription for domain. +.Description +Get the full endpoint URL for an event subscription for domain. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +System.String +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgriddomaineventsubscriptionfullurl +#> +function Get-AzEventGridDomainEventSubscriptionFullUrl { +[OutputType([System.String])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the domain topic. + ${DomainName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the event subscription. + ${EventSubscriptionName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.EventGrid.private\Get-AzEventGridDomainEventSubscriptionFullUrl_Get'; + GetViaIdentity = 'Az.EventGrid.private\Get-AzEventGridDomainEventSubscriptionFullUrl_GetViaIdentity'; + } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/Get-AzEventGridDomainSharedAccessKey.ps1 b/swaggerci/eventgrid/exports/Get-AzEventGridDomainSharedAccessKey.ps1 new file mode 100644 index 000000000000..7d18072e20f4 --- /dev/null +++ b/swaggerci/eventgrid/exports/Get-AzEventGridDomainSharedAccessKey.ps1 @@ -0,0 +1,177 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +List the two keys used to publish to a domain. +.Description +List the two keys used to publish to a domain. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainSharedAccessKeys +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgriddomainsharedaccesskey +#> +function Get-AzEventGridDomainSharedAccessKey { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainSharedAccessKeys])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the domain. + ${DomainName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.EventGrid.private\Get-AzEventGridDomainSharedAccessKey_List'; + } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/Get-AzEventGridDomainTopic.ps1 b/swaggerci/eventgrid/exports/Get-AzEventGridDomainTopic.ps1 new file mode 100644 index 000000000000..6f0ba56205ca --- /dev/null +++ b/swaggerci/eventgrid/exports/Get-AzEventGridDomainTopic.ps1 @@ -0,0 +1,248 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Get properties of a domain topic. +.Description +Get properties of a domain topic. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopic +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgriddomaintopic +#> +function Get-AzEventGridDomainTopic { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopic])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the domain. + ${DomainName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('DomainTopicName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the topic. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Query')] + [System.String] + # 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}, + + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Query')] + [System.Int32] + # 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}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.EventGrid.private\Get-AzEventGridDomainTopic_Get'; + GetViaIdentity = 'Az.EventGrid.private\Get-AzEventGridDomainTopic_GetViaIdentity'; + List = 'Az.EventGrid.private\Get-AzEventGridDomainTopic_List'; + } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/Get-AzEventGridDomainTopicEventSubscription.ps1 b/swaggerci/eventgrid/exports/Get-AzEventGridDomainTopicEventSubscription.ps1 new file mode 100644 index 000000000000..fe2177d8103a --- /dev/null +++ b/swaggerci/eventgrid/exports/Get-AzEventGridDomainTopicEventSubscription.ps1 @@ -0,0 +1,254 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Get properties of a nested event subscription for a domain topic. +.Description +Get properties of a nested event subscription for a domain topic. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgriddomaintopiceventsubscription +#> +function Get-AzEventGridDomainTopicEventSubscription { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the top level domain. + ${DomainName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the event subscription. + ${EventSubscriptionName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the domain topic. + ${TopicName}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Query')] + [System.String] + # 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}, + + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Query')] + [System.Int32] + # 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}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.EventGrid.private\Get-AzEventGridDomainTopicEventSubscription_Get'; + GetViaIdentity = 'Az.EventGrid.private\Get-AzEventGridDomainTopicEventSubscription_GetViaIdentity'; + List = 'Az.EventGrid.private\Get-AzEventGridDomainTopicEventSubscription_List'; + } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/Get-AzEventGridDomainTopicEventSubscriptionDeliveryAttribute.ps1 b/swaggerci/eventgrid/exports/Get-AzEventGridDomainTopicEventSubscriptionDeliveryAttribute.ps1 new file mode 100644 index 000000000000..deeccf911a5a --- /dev/null +++ b/swaggerci/eventgrid/exports/Get-AzEventGridDomainTopicEventSubscriptionDeliveryAttribute.ps1 @@ -0,0 +1,230 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Get all delivery attributes for an event subscription for domain topic. +.Description +Get all delivery attributes for an event subscription for domain topic. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgriddomaintopiceventsubscriptiondeliveryattribute +#> +function Get-AzEventGridDomainTopicEventSubscriptionDeliveryAttribute { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the top level domain. + ${DomainName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the event subscription. + ${EventSubscriptionName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the domain topic. + ${TopicName}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.EventGrid.private\Get-AzEventGridDomainTopicEventSubscriptionDeliveryAttribute_Get'; + GetViaIdentity = 'Az.EventGrid.private\Get-AzEventGridDomainTopicEventSubscriptionDeliveryAttribute_GetViaIdentity'; + } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/Get-AzEventGridDomainTopicEventSubscriptionFullUrl.ps1 b/swaggerci/eventgrid/exports/Get-AzEventGridDomainTopicEventSubscriptionFullUrl.ps1 new file mode 100644 index 000000000000..394105825de9 --- /dev/null +++ b/swaggerci/eventgrid/exports/Get-AzEventGridDomainTopicEventSubscriptionFullUrl.ps1 @@ -0,0 +1,230 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Get the full endpoint URL for a nested event subscription for domain topic. +.Description +Get the full endpoint URL for a nested event subscription for domain topic. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +System.String +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgriddomaintopiceventsubscriptionfullurl +#> +function Get-AzEventGridDomainTopicEventSubscriptionFullUrl { +[OutputType([System.String])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the top level domain. + ${DomainName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the event subscription. + ${EventSubscriptionName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the domain topic. + ${TopicName}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.EventGrid.private\Get-AzEventGridDomainTopicEventSubscriptionFullUrl_Get'; + GetViaIdentity = 'Az.EventGrid.private\Get-AzEventGridDomainTopicEventSubscriptionFullUrl_GetViaIdentity'; + } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/Get-AzEventGridEventChannel.ps1 b/swaggerci/eventgrid/exports/Get-AzEventGridEventChannel.ps1 new file mode 100644 index 000000000000..9df7f4373b9e --- /dev/null +++ b/swaggerci/eventgrid/exports/Get-AzEventGridEventChannel.ps1 @@ -0,0 +1,248 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Get properties of an event channel. +.Description +Get properties of an event channel. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannel +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgrideventchannel +#> +function Get-AzEventGridEventChannel { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannel])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('EventChannelName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the event channel. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the partner namespace. + ${PartnerNamespaceName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Query')] + [System.String] + # 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}, + + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Query')] + [System.Int32] + # 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}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.EventGrid.private\Get-AzEventGridEventChannel_Get'; + GetViaIdentity = 'Az.EventGrid.private\Get-AzEventGridEventChannel_GetViaIdentity'; + List = 'Az.EventGrid.private\Get-AzEventGridEventChannel_List'; + } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/Get-AzEventGridEventSubscription.ps1 b/swaggerci/eventgrid/exports/Get-AzEventGridEventSubscription.ps1 new file mode 100644 index 000000000000..862268cb7c4e --- /dev/null +++ b/swaggerci/eventgrid/exports/Get-AzEventGridEventSubscription.ps1 @@ -0,0 +1,282 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Get properties of an event subscription. +.Description +Get properties of an event subscription. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgrideventsubscription +#> +function Get-AzEventGridEventSubscription { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('EventSubscriptionName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the event subscription. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # 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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + ${Scope}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Namespace of the provider of the topic. + ${ProviderNamespace}, + + [Parameter(ParameterSetName='List', Mandatory)] + [Parameter(ParameterSetName='List1', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the resource. + ${ResourceName}, + + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the resource type. + ${ResourceTypeName}, + + [Parameter(ParameterSetName='List')] + [Parameter(ParameterSetName='List1')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='List1', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the top level domain. + ${DomainName}, + + [Parameter(ParameterSetName='List1', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the domain topic. + ${TopicName}, + + [Parameter(ParameterSetName='List')] + [Parameter(ParameterSetName='List1')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Query')] + [System.String] + # 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}, + + [Parameter(ParameterSetName='List')] + [Parameter(ParameterSetName='List1')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Query')] + [System.Int32] + # 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}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.EventGrid.private\Get-AzEventGridEventSubscription_Get'; + GetViaIdentity = 'Az.EventGrid.private\Get-AzEventGridEventSubscription_GetViaIdentity'; + List = 'Az.EventGrid.private\Get-AzEventGridEventSubscription_List'; + List1 = 'Az.EventGrid.private\Get-AzEventGridEventSubscription_List1'; + } + if (('List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/Get-AzEventGridEventSubscriptionDeliveryAttribute.ps1 b/swaggerci/eventgrid/exports/Get-AzEventGridEventSubscriptionDeliveryAttribute.ps1 new file mode 100644 index 000000000000..af1a16659e7e --- /dev/null +++ b/swaggerci/eventgrid/exports/Get-AzEventGridEventSubscriptionDeliveryAttribute.ps1 @@ -0,0 +1,209 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Get all delivery attributes for an event subscription. +.Description +Get all delivery attributes for an event subscription. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgrideventsubscriptiondeliveryattribute +#> +function Get-AzEventGridEventSubscriptionDeliveryAttribute { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the event subscription. + ${EventSubscriptionName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # 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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + ${Scope}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.EventGrid.private\Get-AzEventGridEventSubscriptionDeliveryAttribute_Get'; + GetViaIdentity = 'Az.EventGrid.private\Get-AzEventGridEventSubscriptionDeliveryAttribute_GetViaIdentity'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/Get-AzEventGridEventSubscriptionFullUrl.ps1 b/swaggerci/eventgrid/exports/Get-AzEventGridEventSubscriptionFullUrl.ps1 new file mode 100644 index 000000000000..31778857972a --- /dev/null +++ b/swaggerci/eventgrid/exports/Get-AzEventGridEventSubscriptionFullUrl.ps1 @@ -0,0 +1,209 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Get the full endpoint URL for an event subscription. +.Description +Get the full endpoint URL for an event subscription. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +System.String +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgrideventsubscriptionfullurl +#> +function Get-AzEventGridEventSubscriptionFullUrl { +[OutputType([System.String])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the event subscription. + ${EventSubscriptionName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # 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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + ${Scope}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.EventGrid.private\Get-AzEventGridEventSubscriptionFullUrl_Get'; + GetViaIdentity = 'Az.EventGrid.private\Get-AzEventGridEventSubscriptionFullUrl_GetViaIdentity'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/Get-AzEventGridEventSubscriptionGlobal.ps1 b/swaggerci/eventgrid/exports/Get-AzEventGridEventSubscriptionGlobal.ps1 new file mode 100644 index 000000000000..e7f90a8e8e66 --- /dev/null +++ b/swaggerci/eventgrid/exports/Get-AzEventGridEventSubscriptionGlobal.ps1 @@ -0,0 +1,201 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +List all aggregated global event subscriptions under a specific Azure subscription. +.Description +List all aggregated global event subscriptions under a specific Azure subscription. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgrideventsubscriptionglobal +#> +function Get-AzEventGridEventSubscriptionGlobal { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='List1', Mandatory)] + [Parameter(ParameterSetName='List3', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the topic type. + ${TopicTypeName}, + + [Parameter(ParameterSetName='List2', Mandatory)] + [Parameter(ParameterSetName='List3', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Query')] + [System.String] + # 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}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Query')] + [System.Int32] + # 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}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.EventGrid.private\Get-AzEventGridEventSubscriptionGlobal_List'; + List1 = 'Az.EventGrid.private\Get-AzEventGridEventSubscriptionGlobal_List1'; + List2 = 'Az.EventGrid.private\Get-AzEventGridEventSubscriptionGlobal_List2'; + List3 = 'Az.EventGrid.private\Get-AzEventGridEventSubscriptionGlobal_List3'; + } + if (('List', 'List1', 'List2', 'List3') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/Get-AzEventGridEventSubscriptionRegional.ps1 b/swaggerci/eventgrid/exports/Get-AzEventGridEventSubscriptionRegional.ps1 new file mode 100644 index 000000000000..00bd9a7a0fc8 --- /dev/null +++ b/swaggerci/eventgrid/exports/Get-AzEventGridEventSubscriptionRegional.ps1 @@ -0,0 +1,207 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +List all event subscriptions from the given location under a specific Azure subscription. +.Description +List all event subscriptions from the given location under a specific Azure subscription. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgrideventsubscriptionregional +#> +function Get-AzEventGridEventSubscriptionRegional { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the location. + ${Location}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='List1', Mandatory)] + [Parameter(ParameterSetName='List3', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='List2', Mandatory)] + [Parameter(ParameterSetName='List3', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the topic type. + ${TopicTypeName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Query')] + [System.String] + # 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}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Query')] + [System.Int32] + # 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}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.EventGrid.private\Get-AzEventGridEventSubscriptionRegional_List'; + List1 = 'Az.EventGrid.private\Get-AzEventGridEventSubscriptionRegional_List1'; + List2 = 'Az.EventGrid.private\Get-AzEventGridEventSubscriptionRegional_List2'; + List3 = 'Az.EventGrid.private\Get-AzEventGridEventSubscriptionRegional_List3'; + } + if (('List', 'List1', 'List2', 'List3') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/Get-AzEventGridExtensionTopic.ps1 b/swaggerci/eventgrid/exports/Get-AzEventGridExtensionTopic.ps1 new file mode 100644 index 000000000000..7f4620c513f3 --- /dev/null +++ b/swaggerci/eventgrid/exports/Get-AzEventGridExtensionTopic.ps1 @@ -0,0 +1,203 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Get the properties of an extension topic. +.Description +Get the properties of an extension topic. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtensionTopic +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgridextensiontopic +#> +function Get-AzEventGridExtensionTopic { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtensionTopic])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # 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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for Azure resource. + ${Scope}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.EventGrid.private\Get-AzEventGridExtensionTopic_Get'; + GetViaIdentity = 'Az.EventGrid.private\Get-AzEventGridExtensionTopic_GetViaIdentity'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/Get-AzEventGridPartnerConfiguration.ps1 b/swaggerci/eventgrid/exports/Get-AzEventGridPartnerConfiguration.ps1 new file mode 100644 index 000000000000..5ec671256d21 --- /dev/null +++ b/swaggerci/eventgrid/exports/Get-AzEventGridPartnerConfiguration.ps1 @@ -0,0 +1,236 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Get properties of a partner configuration. +.Description +Get properties of a partner configuration. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfiguration +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgridpartnerconfiguration +#> +function Get-AzEventGridPartnerConfiguration { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfiguration])] +[CmdletBinding(DefaultParameterSetName='List1', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Parameter(ParameterSetName='List1')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='List1')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Query')] + [System.String] + # 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}, + + [Parameter(ParameterSetName='List1')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Query')] + [System.Int32] + # 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}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.EventGrid.private\Get-AzEventGridPartnerConfiguration_Get'; + GetViaIdentity = 'Az.EventGrid.private\Get-AzEventGridPartnerConfiguration_GetViaIdentity'; + List = 'Az.EventGrid.private\Get-AzEventGridPartnerConfiguration_List'; + List1 = 'Az.EventGrid.private\Get-AzEventGridPartnerConfiguration_List1'; + } + if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/Get-AzEventGridPartnerDestination.ps1 b/swaggerci/eventgrid/exports/Get-AzEventGridPartnerDestination.ps1 new file mode 100644 index 000000000000..ac3f77ccbba4 --- /dev/null +++ b/swaggerci/eventgrid/exports/Get-AzEventGridPartnerDestination.ps1 @@ -0,0 +1,245 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Get properties of a partner destination. +.Description +Get properties of a partner destination. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestination +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgridpartnerdestination +#> +function Get-AzEventGridPartnerDestination { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestination])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('PartnerDestinationName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the partner destination. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List1', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Parameter(ParameterSetName='List1')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='List')] + [Parameter(ParameterSetName='List1')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Query')] + [System.String] + # 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}, + + [Parameter(ParameterSetName='List')] + [Parameter(ParameterSetName='List1')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Query')] + [System.Int32] + # 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}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.EventGrid.private\Get-AzEventGridPartnerDestination_Get'; + GetViaIdentity = 'Az.EventGrid.private\Get-AzEventGridPartnerDestination_GetViaIdentity'; + List = 'Az.EventGrid.private\Get-AzEventGridPartnerDestination_List'; + List1 = 'Az.EventGrid.private\Get-AzEventGridPartnerDestination_List1'; + } + if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/Get-AzEventGridPartnerNamespace.ps1 b/swaggerci/eventgrid/exports/Get-AzEventGridPartnerNamespace.ps1 new file mode 100644 index 000000000000..6d8be216e08d --- /dev/null +++ b/swaggerci/eventgrid/exports/Get-AzEventGridPartnerNamespace.ps1 @@ -0,0 +1,245 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Get properties of a partner namespace. +.Description +Get properties of a partner namespace. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespace +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgridpartnernamespace +#> +function Get-AzEventGridPartnerNamespace { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespace])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('PartnerNamespaceName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the partner namespace. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List1', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Parameter(ParameterSetName='List1')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='List')] + [Parameter(ParameterSetName='List1')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Query')] + [System.String] + # 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}, + + [Parameter(ParameterSetName='List')] + [Parameter(ParameterSetName='List1')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Query')] + [System.Int32] + # 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}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.EventGrid.private\Get-AzEventGridPartnerNamespace_Get'; + GetViaIdentity = 'Az.EventGrid.private\Get-AzEventGridPartnerNamespace_GetViaIdentity'; + List = 'Az.EventGrid.private\Get-AzEventGridPartnerNamespace_List'; + List1 = 'Az.EventGrid.private\Get-AzEventGridPartnerNamespace_List1'; + } + if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/Get-AzEventGridPartnerNamespaceSharedAccessKey.ps1 b/swaggerci/eventgrid/exports/Get-AzEventGridPartnerNamespaceSharedAccessKey.ps1 new file mode 100644 index 000000000000..05a52020e2dd --- /dev/null +++ b/swaggerci/eventgrid/exports/Get-AzEventGridPartnerNamespaceSharedAccessKey.ps1 @@ -0,0 +1,177 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +List the two keys used to publish to a partner namespace. +.Description +List the two keys used to publish to a partner namespace. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceSharedAccessKeys +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgridpartnernamespacesharedaccesskey +#> +function Get-AzEventGridPartnerNamespaceSharedAccessKey { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceSharedAccessKeys])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the partner namespace. + ${PartnerNamespaceName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.EventGrid.private\Get-AzEventGridPartnerNamespaceSharedAccessKey_List'; + } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/Get-AzEventGridPartnerRegistration.ps1 b/swaggerci/eventgrid/exports/Get-AzEventGridPartnerRegistration.ps1 new file mode 100644 index 000000000000..851d53f0eda2 --- /dev/null +++ b/swaggerci/eventgrid/exports/Get-AzEventGridPartnerRegistration.ps1 @@ -0,0 +1,245 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Gets a partner registration with the specified parameters. +.Description +Gets a partner registration with the specified parameters. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistration +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgridpartnerregistration +#> +function Get-AzEventGridPartnerRegistration { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistration])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('PartnerRegistrationName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the partner registration. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List1', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Parameter(ParameterSetName='List1')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='List')] + [Parameter(ParameterSetName='List1')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Query')] + [System.String] + # 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}, + + [Parameter(ParameterSetName='List')] + [Parameter(ParameterSetName='List1')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Query')] + [System.Int32] + # 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}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.EventGrid.private\Get-AzEventGridPartnerRegistration_Get'; + GetViaIdentity = 'Az.EventGrid.private\Get-AzEventGridPartnerRegistration_GetViaIdentity'; + List = 'Az.EventGrid.private\Get-AzEventGridPartnerRegistration_List'; + List1 = 'Az.EventGrid.private\Get-AzEventGridPartnerRegistration_List1'; + } + if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/Get-AzEventGridPartnerTopic.ps1 b/swaggerci/eventgrid/exports/Get-AzEventGridPartnerTopic.ps1 new file mode 100644 index 000000000000..641b91b227fc --- /dev/null +++ b/swaggerci/eventgrid/exports/Get-AzEventGridPartnerTopic.ps1 @@ -0,0 +1,245 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Get properties of a partner topic. +.Description +Get properties of a partner topic. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopic +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgridpartnertopic +#> +function Get-AzEventGridPartnerTopic { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopic])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('PartnerTopicName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the partner topic. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List1', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Parameter(ParameterSetName='List1')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='List')] + [Parameter(ParameterSetName='List1')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Query')] + [System.String] + # 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}, + + [Parameter(ParameterSetName='List')] + [Parameter(ParameterSetName='List1')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Query')] + [System.Int32] + # 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}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.EventGrid.private\Get-AzEventGridPartnerTopic_Get'; + GetViaIdentity = 'Az.EventGrid.private\Get-AzEventGridPartnerTopic_GetViaIdentity'; + List = 'Az.EventGrid.private\Get-AzEventGridPartnerTopic_List'; + List1 = 'Az.EventGrid.private\Get-AzEventGridPartnerTopic_List1'; + } + if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/Get-AzEventGridPartnerTopicEventSubscription.ps1 b/swaggerci/eventgrid/exports/Get-AzEventGridPartnerTopicEventSubscription.ps1 new file mode 100644 index 000000000000..25c5eccf6640 --- /dev/null +++ b/swaggerci/eventgrid/exports/Get-AzEventGridPartnerTopicEventSubscription.ps1 @@ -0,0 +1,248 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Get properties of an event subscription of a partner topic. +.Description +Get properties of an event subscription of a partner topic. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgridpartnertopiceventsubscription +#> +function Get-AzEventGridPartnerTopicEventSubscription { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # 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. + ${EventSubscriptionName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the partner topic. + ${PartnerTopicName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Query')] + [System.String] + # 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}, + + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Query')] + [System.Int32] + # 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}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.EventGrid.private\Get-AzEventGridPartnerTopicEventSubscription_Get'; + GetViaIdentity = 'Az.EventGrid.private\Get-AzEventGridPartnerTopicEventSubscription_GetViaIdentity'; + List = 'Az.EventGrid.private\Get-AzEventGridPartnerTopicEventSubscription_List'; + } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/Get-AzEventGridPartnerTopicEventSubscriptionDeliveryAttribute.ps1 b/swaggerci/eventgrid/exports/Get-AzEventGridPartnerTopicEventSubscriptionDeliveryAttribute.ps1 new file mode 100644 index 000000000000..6851e1f5f3ed --- /dev/null +++ b/swaggerci/eventgrid/exports/Get-AzEventGridPartnerTopicEventSubscriptionDeliveryAttribute.ps1 @@ -0,0 +1,225 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Get all delivery attributes for an event subscription of a partner topic. +.Description +Get all delivery attributes for an event subscription of a partner topic. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgridpartnertopiceventsubscriptiondeliveryattribute +#> +function Get-AzEventGridPartnerTopicEventSubscriptionDeliveryAttribute { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # 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. + ${EventSubscriptionName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the partner topic. + ${PartnerTopicName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.EventGrid.private\Get-AzEventGridPartnerTopicEventSubscriptionDeliveryAttribute_Get'; + GetViaIdentity = 'Az.EventGrid.private\Get-AzEventGridPartnerTopicEventSubscriptionDeliveryAttribute_GetViaIdentity'; + } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/Get-AzEventGridPartnerTopicEventSubscriptionFullUrl.ps1 b/swaggerci/eventgrid/exports/Get-AzEventGridPartnerTopicEventSubscriptionFullUrl.ps1 new file mode 100644 index 000000000000..0900916034bd --- /dev/null +++ b/swaggerci/eventgrid/exports/Get-AzEventGridPartnerTopicEventSubscriptionFullUrl.ps1 @@ -0,0 +1,225 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Get the full endpoint URL for an event subscription of a partner topic. +.Description +Get the full endpoint URL for an event subscription of a partner topic. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +System.String +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgridpartnertopiceventsubscriptionfullurl +#> +function Get-AzEventGridPartnerTopicEventSubscriptionFullUrl { +[OutputType([System.String])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # 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. + ${EventSubscriptionName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the partner topic. + ${PartnerTopicName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.EventGrid.private\Get-AzEventGridPartnerTopicEventSubscriptionFullUrl_Get'; + GetViaIdentity = 'Az.EventGrid.private\Get-AzEventGridPartnerTopicEventSubscriptionFullUrl_GetViaIdentity'; + } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/Get-AzEventGridPrivateEndpointConnection.ps1 b/swaggerci/eventgrid/exports/Get-AzEventGridPrivateEndpointConnection.ps1 new file mode 100644 index 000000000000..b69cc29b0454 --- /dev/null +++ b/swaggerci/eventgrid/exports/Get-AzEventGridPrivateEndpointConnection.ps1 @@ -0,0 +1,257 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Get a specific private endpoint connection under a topic, domain, or partner namespace. +.Description +Get a specific private endpoint connection under a topic, domain, or partner namespace. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnection +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgridprivateendpointconnection +#> +function Get-AzEventGridPrivateEndpointConnection { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnection])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('PrivateEndpointConnectionName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the private endpoint connection connection. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the parent resource (namely, either, the topic name, domain name, or partner namespace name). + ${ParentName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ParentType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ParentType] + # The type of the parent resource. + # This can be either \'topics\', \'domains\', or \'partnerNamespaces\'. + ${ParentType}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Query')] + [System.String] + # 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}, + + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Query')] + [System.Int32] + # 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}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.EventGrid.private\Get-AzEventGridPrivateEndpointConnection_Get'; + GetViaIdentity = 'Az.EventGrid.private\Get-AzEventGridPrivateEndpointConnection_GetViaIdentity'; + List = 'Az.EventGrid.private\Get-AzEventGridPrivateEndpointConnection_List'; + } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/Get-AzEventGridPrivateLinkResource.ps1 b/swaggerci/eventgrid/exports/Get-AzEventGridPrivateLinkResource.ps1 new file mode 100644 index 000000000000..f9b1cbf6ee50 --- /dev/null +++ b/swaggerci/eventgrid/exports/Get-AzEventGridPrivateLinkResource.ps1 @@ -0,0 +1,256 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Get properties of a private link resource. +.Description +Get properties of a private link resource. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResource +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgridprivatelinkresource +#> +function Get-AzEventGridPrivateLinkResource { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResource])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('PrivateLinkResourceName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of private link resource. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the parent resource (namely, either, the topic name, domain name, or partner namespace name). + ${ParentName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The type of the parent resource. + # This can be either \'topics\', \'domains\', or \'partnerNamespaces\'. + ${ParentType}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Query')] + [System.String] + # 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}, + + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Query')] + [System.Int32] + # 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}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.EventGrid.private\Get-AzEventGridPrivateLinkResource_Get'; + GetViaIdentity = 'Az.EventGrid.private\Get-AzEventGridPrivateLinkResource_GetViaIdentity'; + List = 'Az.EventGrid.private\Get-AzEventGridPrivateLinkResource_List'; + } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/Get-AzEventGridSystemTopic.ps1 b/swaggerci/eventgrid/exports/Get-AzEventGridSystemTopic.ps1 new file mode 100644 index 000000000000..09b138a5054b --- /dev/null +++ b/swaggerci/eventgrid/exports/Get-AzEventGridSystemTopic.ps1 @@ -0,0 +1,245 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Get properties of a system topic. +.Description +Get properties of a system topic. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopic +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgridsystemtopic +#> +function Get-AzEventGridSystemTopic { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopic])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('SystemTopicName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the system topic. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List1', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Parameter(ParameterSetName='List1')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='List')] + [Parameter(ParameterSetName='List1')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Query')] + [System.String] + # 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}, + + [Parameter(ParameterSetName='List')] + [Parameter(ParameterSetName='List1')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Query')] + [System.Int32] + # 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}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.EventGrid.private\Get-AzEventGridSystemTopic_Get'; + GetViaIdentity = 'Az.EventGrid.private\Get-AzEventGridSystemTopic_GetViaIdentity'; + List = 'Az.EventGrid.private\Get-AzEventGridSystemTopic_List'; + List1 = 'Az.EventGrid.private\Get-AzEventGridSystemTopic_List1'; + } + if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/Get-AzEventGridSystemTopicEventSubscription.ps1 b/swaggerci/eventgrid/exports/Get-AzEventGridSystemTopicEventSubscription.ps1 new file mode 100644 index 000000000000..5e4d9d4aefa0 --- /dev/null +++ b/swaggerci/eventgrid/exports/Get-AzEventGridSystemTopicEventSubscription.ps1 @@ -0,0 +1,248 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Get an event subscription. +.Description +Get an event subscription. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgridsystemtopiceventsubscription +#> +function Get-AzEventGridSystemTopicEventSubscription { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # 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. + ${EventSubscriptionName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the system topic. + ${SystemTopicName}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Query')] + [System.String] + # 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}, + + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Query')] + [System.Int32] + # 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}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.EventGrid.private\Get-AzEventGridSystemTopicEventSubscription_Get'; + GetViaIdentity = 'Az.EventGrid.private\Get-AzEventGridSystemTopicEventSubscription_GetViaIdentity'; + List = 'Az.EventGrid.private\Get-AzEventGridSystemTopicEventSubscription_List'; + } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/Get-AzEventGridSystemTopicEventSubscriptionDeliveryAttribute.ps1 b/swaggerci/eventgrid/exports/Get-AzEventGridSystemTopicEventSubscriptionDeliveryAttribute.ps1 new file mode 100644 index 000000000000..d66bc44629d1 --- /dev/null +++ b/swaggerci/eventgrid/exports/Get-AzEventGridSystemTopicEventSubscriptionDeliveryAttribute.ps1 @@ -0,0 +1,225 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Get all delivery attributes for an event subscription. +.Description +Get all delivery attributes for an event subscription. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgridsystemtopiceventsubscriptiondeliveryattribute +#> +function Get-AzEventGridSystemTopicEventSubscriptionDeliveryAttribute { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # 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. + ${EventSubscriptionName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the system topic. + ${SystemTopicName}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.EventGrid.private\Get-AzEventGridSystemTopicEventSubscriptionDeliveryAttribute_Get'; + GetViaIdentity = 'Az.EventGrid.private\Get-AzEventGridSystemTopicEventSubscriptionDeliveryAttribute_GetViaIdentity'; + } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/Get-AzEventGridSystemTopicEventSubscriptionFullUrl.ps1 b/swaggerci/eventgrid/exports/Get-AzEventGridSystemTopicEventSubscriptionFullUrl.ps1 new file mode 100644 index 000000000000..4d56e37b47c9 --- /dev/null +++ b/swaggerci/eventgrid/exports/Get-AzEventGridSystemTopicEventSubscriptionFullUrl.ps1 @@ -0,0 +1,225 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Get the full endpoint URL for an event subscription of a system topic. +.Description +Get the full endpoint URL for an event subscription of a system topic. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +System.String +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgridsystemtopiceventsubscriptionfullurl +#> +function Get-AzEventGridSystemTopicEventSubscriptionFullUrl { +[OutputType([System.String])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # 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. + ${EventSubscriptionName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the system topic. + ${SystemTopicName}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.EventGrid.private\Get-AzEventGridSystemTopicEventSubscriptionFullUrl_Get'; + GetViaIdentity = 'Az.EventGrid.private\Get-AzEventGridSystemTopicEventSubscriptionFullUrl_GetViaIdentity'; + } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/Get-AzEventGridTopic.ps1 b/swaggerci/eventgrid/exports/Get-AzEventGridTopic.ps1 new file mode 100644 index 000000000000..0c284114c779 --- /dev/null +++ b/swaggerci/eventgrid/exports/Get-AzEventGridTopic.ps1 @@ -0,0 +1,245 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Get properties of a topic. +.Description +Get properties of a topic. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopic +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgridtopic +#> +function Get-AzEventGridTopic { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopic])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('TopicName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the topic. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List1', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Parameter(ParameterSetName='List1')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='List')] + [Parameter(ParameterSetName='List1')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Query')] + [System.String] + # 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}, + + [Parameter(ParameterSetName='List')] + [Parameter(ParameterSetName='List1')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Query')] + [System.Int32] + # 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}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.EventGrid.private\Get-AzEventGridTopic_Get'; + GetViaIdentity = 'Az.EventGrid.private\Get-AzEventGridTopic_GetViaIdentity'; + List = 'Az.EventGrid.private\Get-AzEventGridTopic_List'; + List1 = 'Az.EventGrid.private\Get-AzEventGridTopic_List1'; + } + if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/Get-AzEventGridTopicEventSubscription.ps1 b/swaggerci/eventgrid/exports/Get-AzEventGridTopicEventSubscription.ps1 new file mode 100644 index 000000000000..18fb75f4646b --- /dev/null +++ b/swaggerci/eventgrid/exports/Get-AzEventGridTopicEventSubscription.ps1 @@ -0,0 +1,248 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Get properties of an event subscription of a topic. +.Description +Get properties of an event subscription of a topic. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgridtopiceventsubscription +#> +function Get-AzEventGridTopicEventSubscription { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # 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. + ${EventSubscriptionName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the partner topic. + ${TopicName}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Query')] + [System.String] + # 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}, + + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Query')] + [System.Int32] + # 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}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.EventGrid.private\Get-AzEventGridTopicEventSubscription_Get'; + GetViaIdentity = 'Az.EventGrid.private\Get-AzEventGridTopicEventSubscription_GetViaIdentity'; + List = 'Az.EventGrid.private\Get-AzEventGridTopicEventSubscription_List'; + } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/Get-AzEventGridTopicEventSubscriptionDeliveryAttribute.ps1 b/swaggerci/eventgrid/exports/Get-AzEventGridTopicEventSubscriptionDeliveryAttribute.ps1 new file mode 100644 index 000000000000..f940683ea4d3 --- /dev/null +++ b/swaggerci/eventgrid/exports/Get-AzEventGridTopicEventSubscriptionDeliveryAttribute.ps1 @@ -0,0 +1,224 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Get all delivery attributes for an event subscription for topic. +.Description +Get all delivery attributes for an event subscription for topic. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgridtopiceventsubscriptiondeliveryattribute +#> +function Get-AzEventGridTopicEventSubscriptionDeliveryAttribute { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the event subscription. + ${EventSubscriptionName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the domain topic. + ${TopicName}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.EventGrid.private\Get-AzEventGridTopicEventSubscriptionDeliveryAttribute_Get'; + GetViaIdentity = 'Az.EventGrid.private\Get-AzEventGridTopicEventSubscriptionDeliveryAttribute_GetViaIdentity'; + } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/Get-AzEventGridTopicEventSubscriptionFullUrl.ps1 b/swaggerci/eventgrid/exports/Get-AzEventGridTopicEventSubscriptionFullUrl.ps1 new file mode 100644 index 000000000000..9ec130d1b423 --- /dev/null +++ b/swaggerci/eventgrid/exports/Get-AzEventGridTopicEventSubscriptionFullUrl.ps1 @@ -0,0 +1,224 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Get the full endpoint URL for an event subscription for topic. +.Description +Get the full endpoint URL for an event subscription for topic. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +System.String +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgridtopiceventsubscriptionfullurl +#> +function Get-AzEventGridTopicEventSubscriptionFullUrl { +[OutputType([System.String])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the event subscription. + ${EventSubscriptionName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the domain topic. + ${TopicName}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.EventGrid.private\Get-AzEventGridTopicEventSubscriptionFullUrl_Get'; + GetViaIdentity = 'Az.EventGrid.private\Get-AzEventGridTopicEventSubscriptionFullUrl_GetViaIdentity'; + } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/Get-AzEventGridTopicEventType.ps1 b/swaggerci/eventgrid/exports/Get-AzEventGridTopicEventType.ps1 new file mode 100644 index 000000000000..a73d120abaa6 --- /dev/null +++ b/swaggerci/eventgrid/exports/Get-AzEventGridTopicEventType.ps1 @@ -0,0 +1,189 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +List event types for a topic. +.Description +List event types for a topic. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventType +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgridtopiceventtype +#> +function Get-AzEventGridTopicEventType { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventType])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Namespace of the provider of the topic. + ${ProviderNamespace}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the topic. + ${ResourceName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the topic type. + ${ResourceTypeName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.EventGrid.private\Get-AzEventGridTopicEventType_List'; + } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/Get-AzEventGridTopicSharedAccessKey.ps1 b/swaggerci/eventgrid/exports/Get-AzEventGridTopicSharedAccessKey.ps1 new file mode 100644 index 000000000000..915445bcd46b --- /dev/null +++ b/swaggerci/eventgrid/exports/Get-AzEventGridTopicSharedAccessKey.ps1 @@ -0,0 +1,177 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +List the two keys used to publish to a topic. +.Description +List the two keys used to publish to a topic. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicSharedAccessKeys +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgridtopicsharedaccesskey +#> +function Get-AzEventGridTopicSharedAccessKey { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicSharedAccessKeys])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the topic. + ${TopicName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.EventGrid.private\Get-AzEventGridTopicSharedAccessKey_List'; + } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/Get-AzEventGridTopicType.ps1 b/swaggerci/eventgrid/exports/Get-AzEventGridTopicType.ps1 new file mode 100644 index 000000000000..099c2d851c3e --- /dev/null +++ b/swaggerci/eventgrid/exports/Get-AzEventGridTopicType.ps1 @@ -0,0 +1,203 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Get information about a topic type. +.Description +Get information about a topic type. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypeInfo +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgridtopictype +#> +function Get-AzEventGridTopicType { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypeInfo])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('TopicTypeName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the topic type. + ${Name}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.EventGrid.private\Get-AzEventGridTopicType_Get'; + GetViaIdentity = 'Az.EventGrid.private\Get-AzEventGridTopicType_GetViaIdentity'; + List = 'Az.EventGrid.private\Get-AzEventGridTopicType_List'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/Get-AzEventGridTopicTypeEventType.ps1 b/swaggerci/eventgrid/exports/Get-AzEventGridTopicTypeEventType.ps1 new file mode 100644 index 000000000000..2965dbbbb226 --- /dev/null +++ b/swaggerci/eventgrid/exports/Get-AzEventGridTopicTypeEventType.ps1 @@ -0,0 +1,160 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +List event types for a topic type. +.Description +List event types for a topic type. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventType +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgridtopictypeeventtype +#> +function Get-AzEventGridTopicTypeEventType { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventType])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the topic type. + ${TopicTypeName}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.EventGrid.private\Get-AzEventGridTopicTypeEventType_List'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/Get-AzEventGridVerifiedPartner.ps1 b/swaggerci/eventgrid/exports/Get-AzEventGridVerifiedPartner.ps1 new file mode 100644 index 000000000000..2f9f084c4577 --- /dev/null +++ b/swaggerci/eventgrid/exports/Get-AzEventGridVerifiedPartner.ps1 @@ -0,0 +1,222 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Get properties of a verified partner. +.Description +Get properties of a verified partner. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartner +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgridverifiedpartner +#> +function Get-AzEventGridVerifiedPartner { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartner])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('VerifiedPartnerName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the verified partner. + ${Name}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Query')] + [System.String] + # 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}, + + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Query')] + [System.Int32] + # 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}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.EventGrid.private\Get-AzEventGridVerifiedPartner_Get'; + GetViaIdentity = 'Az.EventGrid.private\Get-AzEventGridVerifiedPartner_GetViaIdentity'; + List = 'Az.EventGrid.private\Get-AzEventGridVerifiedPartner_List'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/Grant-AzEventGridPartnerConfigurationPartner.ps1 b/swaggerci/eventgrid/exports/Grant-AzEventGridPartnerConfigurationPartner.ps1 new file mode 100644 index 000000000000..62039b4a212e --- /dev/null +++ b/swaggerci/eventgrid/exports/Grant-AzEventGridPartnerConfigurationPartner.ps1 @@ -0,0 +1,255 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Authorize a single partner either by partner registration immutable Id or by partner name. +.Description +Authorize a single partner either by partner registration immutable Id or by partner name. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartner +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfiguration +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. + +PARTNERINFO : Information about the partner. + [AuthorizationExpirationTimeInUtc ]: Expiration time of the partner authorization. If this timer expires, any request from this partner to create, update or delete resources in subscriber's context will fail. If specified, the allowed values are between 1 to the value of defaultMaximumExpirationTimeInDays specified in PartnerConfiguration. If not specified, the default value will be the value of defaultMaximumExpirationTimeInDays specified in PartnerConfiguration or 7 if this value is not specified. + [Name ]: The partner name. + [RegistrationImmutableId ]: The immutableId of the corresponding partner registration. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/grant-azeventgridpartnerconfigurationpartner +#> +function Grant-AzEventGridPartnerConfigurationPartner { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfiguration])] +[CmdletBinding(DefaultParameterSetName='AuthorizeExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Authorize', Mandatory)] + [Parameter(ParameterSetName='AuthorizeExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Authorize')] + [Parameter(ParameterSetName='AuthorizeExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='AuthorizeViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='AuthorizeViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Authorize', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='AuthorizeViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartner] + # Information about the partner. + # To construct, see NOTES section for PARTNERINFO properties and create a hash table. + ${PartnerInfo}, + + [Parameter(ParameterSetName='AuthorizeExpanded')] + [Parameter(ParameterSetName='AuthorizeViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.DateTime] + # Expiration time of the partner authorization. + # If this timer expires, any request from this partner to create, update or delete resources in subscriber'scontext will fail. + # If specified, the allowed values are between 1 to the value of defaultMaximumExpirationTimeInDays specified in PartnerConfiguration.If not specified, the default value will be the value of defaultMaximumExpirationTimeInDays specified in PartnerConfiguration or 7 if this value is not specified. + ${AuthorizationExpirationTimeInUtc}, + + [Parameter(ParameterSetName='AuthorizeExpanded')] + [Parameter(ParameterSetName='AuthorizeViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The partner name. + ${PartnerName}, + + [Parameter(ParameterSetName='AuthorizeExpanded')] + [Parameter(ParameterSetName='AuthorizeViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The immutableId of the corresponding partner registration. + ${PartnerRegistrationImmutableId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Authorize = 'Az.EventGrid.private\Grant-AzEventGridPartnerConfigurationPartner_Authorize'; + AuthorizeExpanded = 'Az.EventGrid.private\Grant-AzEventGridPartnerConfigurationPartner_AuthorizeExpanded'; + AuthorizeViaIdentity = 'Az.EventGrid.private\Grant-AzEventGridPartnerConfigurationPartner_AuthorizeViaIdentity'; + AuthorizeViaIdentityExpanded = 'Az.EventGrid.private\Grant-AzEventGridPartnerConfigurationPartner_AuthorizeViaIdentityExpanded'; + } + if (('Authorize', 'AuthorizeExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/Initialize-AzEventGridPartnerDestination.ps1 b/swaggerci/eventgrid/exports/Initialize-AzEventGridPartnerDestination.ps1 new file mode 100644 index 000000000000..f1a321842c39 --- /dev/null +++ b/swaggerci/eventgrid/exports/Initialize-AzEventGridPartnerDestination.ps1 @@ -0,0 +1,219 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Activate a newly created partner destination. +.Description +Activate a newly created partner destination. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestination +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/initialize-azeventgridpartnerdestination +#> +function Initialize-AzEventGridPartnerDestination { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestination])] +[CmdletBinding(DefaultParameterSetName='Activate', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Activate', Mandatory)] + [Alias('PartnerDestinationName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the partner destination. + ${Name}, + + [Parameter(ParameterSetName='Activate', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Activate')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='ActivateViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Activate = 'Az.EventGrid.private\Initialize-AzEventGridPartnerDestination_Activate'; + ActivateViaIdentity = 'Az.EventGrid.private\Initialize-AzEventGridPartnerDestination_ActivateViaIdentity'; + } + if (('Activate') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/Initialize-AzEventGridPartnerTopic.ps1 b/swaggerci/eventgrid/exports/Initialize-AzEventGridPartnerTopic.ps1 new file mode 100644 index 000000000000..7dbaed3362e4 --- /dev/null +++ b/swaggerci/eventgrid/exports/Initialize-AzEventGridPartnerTopic.ps1 @@ -0,0 +1,219 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Activate a newly created partner topic. +.Description +Activate a newly created partner topic. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopic +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/initialize-azeventgridpartnertopic +#> +function Initialize-AzEventGridPartnerTopic { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopic])] +[CmdletBinding(DefaultParameterSetName='Activate', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Activate', Mandatory)] + [Alias('PartnerTopicName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the partner topic. + ${Name}, + + [Parameter(ParameterSetName='Activate', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Activate')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='ActivateViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Activate = 'Az.EventGrid.private\Initialize-AzEventGridPartnerTopic_Activate'; + ActivateViaIdentity = 'Az.EventGrid.private\Initialize-AzEventGridPartnerTopic_ActivateViaIdentity'; + } + if (('Activate') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/Invoke-AzEventGridDeactivatePartnerTopic.ps1 b/swaggerci/eventgrid/exports/Invoke-AzEventGridDeactivatePartnerTopic.ps1 new file mode 100644 index 000000000000..3b111ff8f515 --- /dev/null +++ b/swaggerci/eventgrid/exports/Invoke-AzEventGridDeactivatePartnerTopic.ps1 @@ -0,0 +1,218 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Deactivate specific partner topic. +.Description +Deactivate specific partner topic. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopic +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/invoke-azeventgriddeactivatepartnertopic +#> +function Invoke-AzEventGridDeactivatePartnerTopic { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopic])] +[CmdletBinding(DefaultParameterSetName='Deactivate', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Deactivate', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the partner topic. + ${PartnerTopicName}, + + [Parameter(ParameterSetName='Deactivate', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Deactivate')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeactivateViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Deactivate = 'Az.EventGrid.private\Invoke-AzEventGridDeactivatePartnerTopic_Deactivate'; + DeactivateViaIdentity = 'Az.EventGrid.private\Invoke-AzEventGridDeactivatePartnerTopic_DeactivateViaIdentity'; + } + if (('Deactivate') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/Invoke-AzEventGridPartnerConfigurationUnauthorize.ps1 b/swaggerci/eventgrid/exports/Invoke-AzEventGridPartnerConfigurationUnauthorize.ps1 new file mode 100644 index 000000000000..b5c26659b8eb --- /dev/null +++ b/swaggerci/eventgrid/exports/Invoke-AzEventGridPartnerConfigurationUnauthorize.ps1 @@ -0,0 +1,255 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Unauthorize a single partner either by partner registration immutable Id or by partner name. +.Description +Unauthorize a single partner either by partner registration immutable Id or by partner name. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartner +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfiguration +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. + +PARTNERINFO : Information about the partner. + [AuthorizationExpirationTimeInUtc ]: Expiration time of the partner authorization. If this timer expires, any request from this partner to create, update or delete resources in subscriber's context will fail. If specified, the allowed values are between 1 to the value of defaultMaximumExpirationTimeInDays specified in PartnerConfiguration. If not specified, the default value will be the value of defaultMaximumExpirationTimeInDays specified in PartnerConfiguration or 7 if this value is not specified. + [Name ]: The partner name. + [RegistrationImmutableId ]: The immutableId of the corresponding partner registration. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/invoke-azeventgridpartnerconfigurationunauthorize +#> +function Invoke-AzEventGridPartnerConfigurationUnauthorize { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfiguration])] +[CmdletBinding(DefaultParameterSetName='PartnerExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Partner', Mandatory)] + [Parameter(ParameterSetName='PartnerExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Partner')] + [Parameter(ParameterSetName='PartnerExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='PartnerViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='PartnerViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Partner', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='PartnerViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartner] + # Information about the partner. + # To construct, see NOTES section for PARTNERINFO properties and create a hash table. + ${PartnerInfo}, + + [Parameter(ParameterSetName='PartnerExpanded')] + [Parameter(ParameterSetName='PartnerViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.DateTime] + # Expiration time of the partner authorization. + # If this timer expires, any request from this partner to create, update or delete resources in subscriber'scontext will fail. + # If specified, the allowed values are between 1 to the value of defaultMaximumExpirationTimeInDays specified in PartnerConfiguration.If not specified, the default value will be the value of defaultMaximumExpirationTimeInDays specified in PartnerConfiguration or 7 if this value is not specified. + ${AuthorizationExpirationTimeInUtc}, + + [Parameter(ParameterSetName='PartnerExpanded')] + [Parameter(ParameterSetName='PartnerViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The partner name. + ${PartnerName}, + + [Parameter(ParameterSetName='PartnerExpanded')] + [Parameter(ParameterSetName='PartnerViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The immutableId of the corresponding partner registration. + ${PartnerRegistrationImmutableId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Partner = 'Az.EventGrid.private\Invoke-AzEventGridPartnerConfigurationUnauthorize_Partner'; + PartnerExpanded = 'Az.EventGrid.private\Invoke-AzEventGridPartnerConfigurationUnauthorize_PartnerExpanded'; + PartnerViaIdentity = 'Az.EventGrid.private\Invoke-AzEventGridPartnerConfigurationUnauthorize_PartnerViaIdentity'; + PartnerViaIdentityExpanded = 'Az.EventGrid.private\Invoke-AzEventGridPartnerConfigurationUnauthorize_PartnerViaIdentityExpanded'; + } + if (('Partner', 'PartnerExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/New-AzEventGridChannel.ps1 b/swaggerci/eventgrid/exports/New-AzEventGridChannel.ps1 new file mode 100644 index 000000000000..25f484bf6b03 --- /dev/null +++ b/swaggerci/eventgrid/exports/New-AzEventGridChannel.ps1 @@ -0,0 +1,303 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Synchronously creates or updates a new channel with the specified parameters. +.Description +Synchronously creates or updates a new channel with the specified parameters. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannel +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +PARTNERDESTINATIONINFORESOURCEMOVECHANGEHISTORY : Change history of the resource move. + [AzureSubscriptionId ]: Azure subscription ID of the resource. + [ChangedTimeUtc ]: UTC timestamp of when the resource was changed. + [ResourceGroupName ]: Azure Resource Group of the resource. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/new-azeventgridchannel +#> +function New-AzEventGridChannel { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannel])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Alias('ChannelName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the channel. + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the partner namespace. + ${PartnerNamespaceName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the partners subscription. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ChannelType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ChannelType] + # The type of the event channel which represents the direction flow of events. + ${ChannelType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInlineEventTypes]))] + [System.Collections.Hashtable] + # A collection of inline event types for the resource. + # The inline event type keys are of type string which represents the name of the event.An example of a valid inline event name is "Contoso.OrderCreated".The inline event type values are of type InlineEventProperties and will contain additional information for every inline event type. + ${EventTypeInfoInlineEventType}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind] + # The kind of event type used. + ${EventTypeInfoKind}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.DateTime] + # Expiration time of the channel. + # If this timer expires while the corresponding partner topic is never activated,the channel and corresponding partner topic are deleted. + ${ExpirationTimeIfNotActivatedUtc}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # Context or helpful message that can be used during the approval process by the subscriber. + ${MessageForActivation}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # Azure subscription ID of the subscriber. + # The partner destination associated with the channel will becreated under this Azure subscription. + ${PartnerDestinationInfoAzureSubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # Additional context of the partner destination endpoint. + ${PartnerDestinationInfoEndpointServiceContext}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # Name of the partner destination associated with the channel. + ${PartnerDestinationInfoName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # Azure Resource Group of the subscriber. + # The partner destination associated with the channel will becreated under this resource group. + ${PartnerDestinationInfoResourceGroupName}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceMoveChangeHistory[]] + # Change history of the resource move. + # To construct, see NOTES section for PARTNERDESTINATIONINFORESOURCEMOVECHANGEHISTORY properties and create a hash table. + ${PartnerDestinationInfoResourceMoveChangeHistory}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # Azure subscription ID of the subscriber. + # The partner topic associated with the channel will becreated under this Azure subscription. + ${PartnerTopicInfoAzureSubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # Name of the partner topic associated with the channel. + ${PartnerTopicInfoName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # Azure Resource Group of the subscriber. + # The partner topic associated with the channel will becreated under this resource group. + ${PartnerTopicInfoResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The source information is provided by the publisher to determine the scope or context from which the eventsare originating. + # This information can be used by the subscriber during the approval process of thecreated partner topic. + ${PartnerTopicInfoSource}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ChannelProvisioningState])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ChannelProvisioningState] + # Provisioning state of the channel. + ${ProvisioningState}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ReadinessState])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ReadinessState] + # The readiness state of the corresponding partner topic. + ${ReadinessState}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.EventGrid.private\New-AzEventGridChannel_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/New-AzEventGridDomain.ps1 b/swaggerci/eventgrid/exports/New-AzEventGridDomain.ps1 new file mode 100644 index 000000000000..49e4886f36e2 --- /dev/null +++ b/swaggerci/eventgrid/exports/New-AzEventGridDomain.ps1 @@ -0,0 +1,306 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Asynchronously creates or updates a new domain with the specified parameters. +.Description +Asynchronously creates or updates a new domain with the specified parameters. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INBOUNDIPRULE : This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess is enabled. + [Action ]: Action to perform based on the match or no match of the IpMask. + [IPMask ]: IP Address in CIDR notation e.g., 10.0.0.0/8. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/new-azeventgriddomain +#> +function New-AzEventGridDomain { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Alias('DomainName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the domain. + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # Location of the resource. + ${Location}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Management.Automation.SwitchParameter] + # This Boolean is used to specify the creation mechanism for 'all' the Event Grid Domain Topics associated with this Event Grid Domain resource.In this context, creation of domain topic can be auto-managed (when true) or self-managed (when false). + # The default value for this property is true.When this property is null or set to true, Event Grid is responsible of automatically creating the domain topic when the first event subscription iscreated at the scope of the domain topic. + # If this property is set to false, then creating the first event subscription will require creating a domain topicby the user. + # The self-management mode can be used if the user wants full control of when the domain topic is created, while auto-managed mode provides theflexibility to perform less operations and manage fewer resources by the user. + # Also, note that in auto-managed creation mode, user is allowed to create thedomain topic on demand if needed. + ${AutoCreateTopicWithFirstSubscription}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Management.Automation.SwitchParameter] + # This Boolean is used to specify the deletion mechanism for 'all' the Event Grid Domain Topics associated with this Event Grid Domain resource.In this context, deletion of domain topic can be auto-managed (when true) or self-managed (when false). + # The default value for this property is true.When this property is set to true, Event Grid is responsible of automatically deleting the domain topic when the last event subscription at the scopeof the domain topic is deleted. + # If this property is set to false, then the user needs to manually delete the domain topic when it is no longer needed(e.g., when last event subscription is deleted and the resource needs to be cleaned up). + # The self-management mode can be used if the user wants fullcontrol of when the domain topic needs to be deleted, while auto-managed mode provides the flexibility to perform less operations and manage fewerresources by the user. + ${AutoDeleteTopicWithLastSubscription}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary] + # Data Residency Boundary of the resource. + ${DataResidencyBoundary}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Management.Automation.SwitchParameter] + # This boolean is used to enable or disable local auth. + # Default value is false. + # When the property is set to true, only AAD token will be used to authenticate if user is allowed to publish to the domain. + ${DisableLocalAuth}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The principal ID of resource identity. + ${IdentityPrincipalId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The tenant ID of resource. + ${IdentityTenantId}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType] + # 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. + ${IdentityType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities]))] + [System.Collections.Hashtable] + # The list of user identities associated with the resource. + # The user identity dictionary key references will be ARM resource ids in the form:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.This property is currently not used and reserved for future usage. + ${IdentityUserAssignedIdentity}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[]] + # This can be used to restrict traffic from specific IPs instead of all IPs. + # Note: These are considered only if PublicNetworkAccess is enabled. + # To construct, see NOTES section for INBOUNDIPRULE properties and create a hash table. + ${InboundIPRule}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.InputSchema])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.InputSchema] + # This determines the format that Event Grid should expect for incoming events published to the Event Grid Domain Resource. + ${InputSchema}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess] + # This determines if traffic is allowed over public network. + # By default it is enabled.You can further restrict to specific IPs by configuring + ${PublicNetworkAccess}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku] + # The Sku name of the resource. + # The possible values are: Basic or Premium. + ${SkuName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceTags]))] + [System.Collections.Hashtable] + # Tags of the resource. + ${Tag}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.EventGrid.private\New-AzEventGridDomain_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/New-AzEventGridDomainEventSubscription.ps1 b/swaggerci/eventgrid/exports/New-AzEventGridDomainEventSubscription.ps1 new file mode 100644 index 000000000000..bf2ed369adb4 --- /dev/null +++ b/swaggerci/eventgrid/exports/New-AzEventGridDomainEventSubscription.ps1 @@ -0,0 +1,320 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Asynchronously creates a new event subscription or updates an existing event subscription. +.Description +Asynchronously creates a new event subscription or updates an existing event subscription. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +FILTERADVANCEDFILTER : An array of advanced filters that are used for filtering event subscriptions. + OperatorType : The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. + [Key ]: The field/property in the event based on which you want to filter. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/new-azeventgriddomaineventsubscription +#> +function New-AzEventGridDomainEventSubscription { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the domain topic. + ${DomainName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # 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. + ${EventSubscriptionName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.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. + ${DeadLetterWithResourceIdentityType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The user identity associated with the resource. + ${DeadLetterWithResourceIdentityUserAssignedIdentity}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType] + # Type of the endpoint for the event subscription destination. + ${DeliveryWithResourceIdentityDestinationEndpointType}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.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. + ${DeliveryWithResourceIdentityType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The user identity associated with the resource. + ${DeliveryWithResourceIdentityUserAssignedIdentity}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType] + # Type of the endpoint for the event subscription destination. + ${EndpointType}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema] + # The event delivery schema for the event subscription. + ${EventDeliverySchema}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.DateTime] + # Expiration time of the event subscription. + ${ExpirationTimeUtc}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[]] + # An array of advanced filters that are used for filtering event subscriptions. + # To construct, see NOTES section for FILTERADVANCEDFILTER properties and create a hash table. + ${FilterAdvancedFilter}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Allows advanced filters to be evaluated against an array of values instead of expecting a singular value. + ${FilterEnableAdvancedFilteringOnArray}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String[]] + # 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. + ${FilterIncludedEventType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filtershould be compared in a case sensitive manner. + ${FilterIsSubjectCaseSensitive}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # An optional string to filter events for an event subscription based on a resource path prefix.The format of this depends on the publisher of the events.Wildcard characters are not supported in this path. + ${FilterSubjectBeginsWith}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # An optional string to filter events for an event subscription based on a resource path suffix.Wildcard characters are not supported in this path. + ${FilterSubjectEndsWith}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String[]] + # List of user defined labels. + ${Label}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Int32] + # Time To Live (in minutes) for events. + ${RetryPolicyEventTimeToLiveInMinute}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Int32] + # Maximum number of delivery retry attempts for events. + ${RetryPolicyMaxDeliveryAttempt}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.EventGrid.private\New-AzEventGridDomainEventSubscription_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/New-AzEventGridDomainKey.ps1 b/swaggerci/eventgrid/exports/New-AzEventGridDomainKey.ps1 new file mode 100644 index 000000000000..2a59380e3abd --- /dev/null +++ b/swaggerci/eventgrid/exports/New-AzEventGridDomainKey.ps1 @@ -0,0 +1,244 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Regenerate a shared access key for a domain. +.Description +Regenerate a shared access key for a domain. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainRegenerateKeyRequest +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainSharedAccessKeys +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. + +REGENERATEKEYREQUEST : Domain regenerate share access key request. + KeyName : Key name to regenerate key1 or key2. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/new-azeventgriddomainkey +#> +function New-AzEventGridDomainKey { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainSharedAccessKeys])] +[CmdletBinding(DefaultParameterSetName='RegenerateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Regenerate', Mandatory)] + [Parameter(ParameterSetName='RegenerateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the domain. + ${DomainName}, + + [Parameter(ParameterSetName='Regenerate', Mandatory)] + [Parameter(ParameterSetName='RegenerateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Regenerate')] + [Parameter(ParameterSetName='RegenerateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='RegenerateViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='RegenerateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Regenerate', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='RegenerateViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainRegenerateKeyRequest] + # Domain regenerate share access key request. + # To construct, see NOTES section for REGENERATEKEYREQUEST properties and create a hash table. + ${RegenerateKeyRequest}, + + [Parameter(ParameterSetName='RegenerateExpanded', Mandatory)] + [Parameter(ParameterSetName='RegenerateViaIdentityExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # Key name to regenerate key1 or key2. + ${KeyName}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Regenerate = 'Az.EventGrid.private\New-AzEventGridDomainKey_Regenerate'; + RegenerateExpanded = 'Az.EventGrid.private\New-AzEventGridDomainKey_RegenerateExpanded'; + RegenerateViaIdentity = 'Az.EventGrid.private\New-AzEventGridDomainKey_RegenerateViaIdentity'; + RegenerateViaIdentityExpanded = 'Az.EventGrid.private\New-AzEventGridDomainKey_RegenerateViaIdentityExpanded'; + } + if (('Regenerate', 'RegenerateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/New-AzEventGridDomainTopicEventSubscription.ps1 b/swaggerci/eventgrid/exports/New-AzEventGridDomainTopicEventSubscription.ps1 new file mode 100644 index 000000000000..e688b2e33fe0 --- /dev/null +++ b/swaggerci/eventgrid/exports/New-AzEventGridDomainTopicEventSubscription.ps1 @@ -0,0 +1,326 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Asynchronously creates a new event subscription or updates an existing event subscription. +.Description +Asynchronously creates a new event subscription or updates an existing event subscription. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +FILTERADVANCEDFILTER : An array of advanced filters that are used for filtering event subscriptions. + OperatorType : The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. + [Key ]: The field/property in the event based on which you want to filter. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/new-azeventgriddomaintopiceventsubscription +#> +function New-AzEventGridDomainTopicEventSubscription { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the top level domain. + ${DomainName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # 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. + ${EventSubscriptionName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the domain topic. + ${TopicName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.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. + ${DeadLetterWithResourceIdentityType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The user identity associated with the resource. + ${DeadLetterWithResourceIdentityUserAssignedIdentity}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType] + # Type of the endpoint for the event subscription destination. + ${DeliveryWithResourceIdentityDestinationEndpointType}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.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. + ${DeliveryWithResourceIdentityType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The user identity associated with the resource. + ${DeliveryWithResourceIdentityUserAssignedIdentity}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType] + # Type of the endpoint for the event subscription destination. + ${EndpointType}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema] + # The event delivery schema for the event subscription. + ${EventDeliverySchema}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.DateTime] + # Expiration time of the event subscription. + ${ExpirationTimeUtc}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[]] + # An array of advanced filters that are used for filtering event subscriptions. + # To construct, see NOTES section for FILTERADVANCEDFILTER properties and create a hash table. + ${FilterAdvancedFilter}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Allows advanced filters to be evaluated against an array of values instead of expecting a singular value. + ${FilterEnableAdvancedFilteringOnArray}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String[]] + # 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. + ${FilterIncludedEventType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filtershould be compared in a case sensitive manner. + ${FilterIsSubjectCaseSensitive}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # An optional string to filter events for an event subscription based on a resource path prefix.The format of this depends on the publisher of the events.Wildcard characters are not supported in this path. + ${FilterSubjectBeginsWith}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # An optional string to filter events for an event subscription based on a resource path suffix.Wildcard characters are not supported in this path. + ${FilterSubjectEndsWith}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String[]] + # List of user defined labels. + ${Label}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Int32] + # Time To Live (in minutes) for events. + ${RetryPolicyEventTimeToLiveInMinute}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Int32] + # Maximum number of delivery retry attempts for events. + ${RetryPolicyMaxDeliveryAttempt}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.EventGrid.private\New-AzEventGridDomainTopicEventSubscription_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/New-AzEventGridEventChannel.ps1 b/swaggerci/eventgrid/exports/New-AzEventGridEventChannel.ps1 new file mode 100644 index 000000000000..b656f7f3306d --- /dev/null +++ b/swaggerci/eventgrid/exports/New-AzEventGridEventChannel.ps1 @@ -0,0 +1,247 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Asynchronously creates a new event channel with the specified parameters. +.Description +Asynchronously creates a new event channel with the specified parameters. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannel +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +FILTERADVANCEDFILTER : An array of advanced filters that are used for filtering event channels. + OperatorType : The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. + [Key ]: The field/property in the event based on which you want to filter. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/new-azeventgrideventchannel +#> +function New-AzEventGridEventChannel { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannel])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Alias('EventChannelName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the event channel. + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the partner namespace. + ${PartnerNamespaceName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # Azure subscription ID of the customer creating the event channel. + # The partner topicassociated with the event channel will be created under this Azure subscription. + ${DestinationAzureSubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # Name of the partner topic associated with the event channel. + ${DestinationPartnerTopicName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # Azure Resource Group of the customer creating the event channel. + # The partner topicassociated with the event channel will be created under this resource group. + ${DestinationResourceGroup}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The identifier of the resource that's the source of the events.This represents a unique resource in the partner's resource model. + ${EventChannelSource}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.DateTime] + # Expiration time of the event channel. + # If this timer expires while the corresponding partner topic is never activated,the event channel and corresponding partner topic are deleted. + ${ExpirationTimeIfNotActivatedUtc}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[]] + # An array of advanced filters that are used for filtering event channels. + # To construct, see NOTES section for FILTERADVANCEDFILTER properties and create a hash table. + ${FilterAdvancedFilter}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Allows advanced filters to be evaluated against an array of values instead of expecting a singular value. + # The default value is either false or null. + ${FilterEnableAdvancedFilteringOnArray}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # Friendly description about the topic. + # This can be set by the publisher/partner to show custom description for the customer partner topic.This will be helpful to remove any ambiguity of the origin of creation of the partner topic for the customer. + ${PartnerTopicFriendlyDescription}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.EventGrid.private\New-AzEventGridEventChannel_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/New-AzEventGridEventSubscription.ps1 b/swaggerci/eventgrid/exports/New-AzEventGridEventSubscription.ps1 new file mode 100644 index 000000000000..3432f6decc42 --- /dev/null +++ b/swaggerci/eventgrid/exports/New-AzEventGridEventSubscription.ps1 @@ -0,0 +1,306 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Asynchronously creates a new event subscription or updates an existing event subscription based on the specified scope. +.Description +Asynchronously creates a new event subscription or updates an existing event subscription based on the specified scope. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +FILTERADVANCEDFILTER : An array of advanced filters that are used for filtering event subscriptions. + OperatorType : The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. + [Key ]: The field/property in the event based on which you want to filter. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/new-azeventgrideventsubscription +#> +function New-AzEventGridEventSubscription { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Alias('EventSubscriptionName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the event subscription. + # Event subscription names must be between 3 and 64 characters in length and should use alphanumeric letters only. + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # 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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + ${Scope}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.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. + ${DeadLetterWithResourceIdentityType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The user identity associated with the resource. + ${DeadLetterWithResourceIdentityUserAssignedIdentity}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType] + # Type of the endpoint for the event subscription destination. + ${DeliveryWithResourceIdentityDestinationEndpointType}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.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. + ${DeliveryWithResourceIdentityType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The user identity associated with the resource. + ${DeliveryWithResourceIdentityUserAssignedIdentity}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType] + # Type of the endpoint for the event subscription destination. + ${EndpointType}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema] + # The event delivery schema for the event subscription. + ${EventDeliverySchema}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.DateTime] + # Expiration time of the event subscription. + ${ExpirationTimeUtc}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[]] + # An array of advanced filters that are used for filtering event subscriptions. + # To construct, see NOTES section for FILTERADVANCEDFILTER properties and create a hash table. + ${FilterAdvancedFilter}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Allows advanced filters to be evaluated against an array of values instead of expecting a singular value. + ${FilterEnableAdvancedFilteringOnArray}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String[]] + # 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. + ${FilterIncludedEventType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filtershould be compared in a case sensitive manner. + ${FilterIsSubjectCaseSensitive}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # An optional string to filter events for an event subscription based on a resource path prefix.The format of this depends on the publisher of the events.Wildcard characters are not supported in this path. + ${FilterSubjectBeginsWith}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # An optional string to filter events for an event subscription based on a resource path suffix.Wildcard characters are not supported in this path. + ${FilterSubjectEndsWith}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String[]] + # List of user defined labels. + ${Label}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Int32] + # Time To Live (in minutes) for events. + ${RetryPolicyEventTimeToLiveInMinute}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Int32] + # Maximum number of delivery retry attempts for events. + ${RetryPolicyMaxDeliveryAttempt}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.EventGrid.private\New-AzEventGridEventSubscription_CreateExpanded'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/New-AzEventGridPartnerConfiguration.ps1 b/swaggerci/eventgrid/exports/New-AzEventGridPartnerConfiguration.ps1 new file mode 100644 index 000000000000..66062faefa7d --- /dev/null +++ b/swaggerci/eventgrid/exports/New-AzEventGridPartnerConfiguration.ps1 @@ -0,0 +1,228 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Synchronously creates or updates a partner configuration with the specified parameters. +.Description +Synchronously creates or updates a partner configuration with the specified parameters. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfiguration +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +PARTNERAUTHORIZATIONAUTHORIZEDPARTNERSLIST : The list of authorized partners. + [AuthorizationExpirationTimeInUtc ]: Expiration time of the partner authorization. If this timer expires, any request from this partner to create, update or delete resources in subscriber's context will fail. If specified, the allowed values are between 1 to the value of defaultMaximumExpirationTimeInDays specified in PartnerConfiguration. If not specified, the default value will be the value of defaultMaximumExpirationTimeInDays specified in PartnerConfiguration or 7 if this value is not specified. + [Name ]: The partner name. + [RegistrationImmutableId ]: The immutableId of the corresponding partner registration. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/new-azeventgridpartnerconfiguration +#> +function New-AzEventGridPartnerConfiguration { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfiguration])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # Location of the resource. + ${Location}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartner[]] + # The list of authorized partners. + # To construct, see NOTES section for PARTNERAUTHORIZATIONAUTHORIZEDPARTNERSLIST properties and create a hash table. + ${PartnerAuthorizationAuthorizedPartnersList}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Int32] + # Time used to validate the authorization expiration time for each authorized partner. + # If DefaultMaximumExpirationTimeInDays isnot specified, the default is 7 days. + # Otherwise, allowed values are between 1 and 365 days. + ${PartnerAuthorizationDefaultMaximumExpirationTimeInDay}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerConfigurationProvisioningState])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerConfigurationProvisioningState] + # Provisioning state of the partner configuration. + ${ProvisioningState}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationTags]))] + [System.Collections.Hashtable] + # Tags of the resource. + ${Tag}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.EventGrid.private\New-AzEventGridPartnerConfiguration_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/New-AzEventGridPartnerDestination.ps1 b/swaggerci/eventgrid/exports/New-AzEventGridPartnerDestination.ps1 new file mode 100644 index 000000000000..38776efe9de8 --- /dev/null +++ b/swaggerci/eventgrid/exports/New-AzEventGridPartnerDestination.ps1 @@ -0,0 +1,236 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Asynchronously creates a new partner destination with the specified parameters. +.Description +Asynchronously creates a new partner destination with the specified parameters. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestination +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/new-azeventgridpartnerdestination +#> +function New-AzEventGridPartnerDestination { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestination])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Alias('PartnerDestinationName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the partner destination. + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # Location of the resource. + ${Location}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerDestinationActivationState])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerDestinationActivationState] + # Activation state of the partner destination. + ${ActivationState}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # Endpoint Base URL of the partner destination + ${EndpointBaseUrl}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # Endpoint context associated with this partner destination. + ${EndpointServiceContext}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.DateTime] + # 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}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # Context or helpful message that can be used during the approval process. + ${MessageForActivation}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The immutable Id of the corresponding partner registration. + ${PartnerRegistrationImmutableId}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerDestinationProvisioningState])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerDestinationProvisioningState] + # Provisioning state of the partner destination. + ${ProvisioningState}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceTags]))] + [System.Collections.Hashtable] + # Tags of the resource. + ${Tag}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.EventGrid.private\New-AzEventGridPartnerDestination_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/New-AzEventGridPartnerNamespace.ps1 b/swaggerci/eventgrid/exports/New-AzEventGridPartnerNamespace.ps1 new file mode 100644 index 000000000000..f86d49771285 --- /dev/null +++ b/swaggerci/eventgrid/exports/New-AzEventGridPartnerNamespace.ps1 @@ -0,0 +1,251 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Asynchronously creates a new partner namespace with the specified parameters. +.Description +Asynchronously creates a new partner namespace with the specified parameters. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INBOUNDIPRULE : This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess is enabled. + [Action ]: Action to perform based on the match or no match of the IpMask. + [IPMask ]: IP Address in CIDR notation e.g., 10.0.0.0/8. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/new-azeventgridpartnernamespace +#> +function New-AzEventGridPartnerNamespace { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Alias('PartnerNamespaceName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the partner namespace. + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # Location of the resource. + ${Location}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Management.Automation.SwitchParameter] + # This boolean is used to enable or disable local auth. + # Default value is false. + # When the property is set to true, only AAD token will be used to authenticate if user is allowed to publish to the partner namespace. + ${DisableLocalAuth}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[]] + # This can be used to restrict traffic from specific IPs instead of all IPs. + # Note: These are considered only if PublicNetworkAccess is enabled. + # To construct, see NOTES section for INBOUNDIPRULE properties and create a hash table. + ${InboundIPRule}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # 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}. + ${PartnerRegistrationFullyQualifiedId}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicRoutingMode])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicRoutingMode] + # This determines if events published to this partner namespace should use the source attribute in the event payloador use the channel name in the header when matching to the partner topic. + # If none is specified, source attribute routing will be used to match the partner topic. + ${PartnerTopicRoutingMode}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess] + # This determines if traffic is allowed over public network. + # By default it is enabled.You can further restrict to specific IPs by configuring + ${PublicNetworkAccess}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceTags]))] + [System.Collections.Hashtable] + # Tags of the resource. + ${Tag}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.EventGrid.private\New-AzEventGridPartnerNamespace_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/New-AzEventGridPartnerNamespaceKey.ps1 b/swaggerci/eventgrid/exports/New-AzEventGridPartnerNamespaceKey.ps1 new file mode 100644 index 000000000000..1f9ad1013c40 --- /dev/null +++ b/swaggerci/eventgrid/exports/New-AzEventGridPartnerNamespaceKey.ps1 @@ -0,0 +1,244 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Regenerate a shared access key for a partner namespace. +.Description +Regenerate a shared access key for a partner namespace. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceRegenerateKeyRequest +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceSharedAccessKeys +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. + +REGENERATEKEYREQUEST : PartnerNamespace regenerate shared access key request. + KeyName : Key name to regenerate (key1 or key2). +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/new-azeventgridpartnernamespacekey +#> +function New-AzEventGridPartnerNamespaceKey { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceSharedAccessKeys])] +[CmdletBinding(DefaultParameterSetName='RegenerateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Regenerate', Mandatory)] + [Parameter(ParameterSetName='RegenerateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the partner namespace. + ${PartnerNamespaceName}, + + [Parameter(ParameterSetName='Regenerate', Mandatory)] + [Parameter(ParameterSetName='RegenerateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Regenerate')] + [Parameter(ParameterSetName='RegenerateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='RegenerateViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='RegenerateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Regenerate', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='RegenerateViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceRegenerateKeyRequest] + # PartnerNamespace regenerate shared access key request. + # To construct, see NOTES section for REGENERATEKEYREQUEST properties and create a hash table. + ${RegenerateKeyRequest}, + + [Parameter(ParameterSetName='RegenerateExpanded', Mandatory)] + [Parameter(ParameterSetName='RegenerateViaIdentityExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # Key name to regenerate (key1 or key2). + ${KeyName}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Regenerate = 'Az.EventGrid.private\New-AzEventGridPartnerNamespaceKey_Regenerate'; + RegenerateExpanded = 'Az.EventGrid.private\New-AzEventGridPartnerNamespaceKey_RegenerateExpanded'; + RegenerateViaIdentity = 'Az.EventGrid.private\New-AzEventGridPartnerNamespaceKey_RegenerateViaIdentity'; + RegenerateViaIdentityExpanded = 'Az.EventGrid.private\New-AzEventGridPartnerNamespaceKey_RegenerateViaIdentityExpanded'; + } + if (('Regenerate', 'RegenerateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/New-AzEventGridPartnerRegistration.ps1 b/swaggerci/eventgrid/exports/New-AzEventGridPartnerRegistration.ps1 new file mode 100644 index 000000000000..95003435e91d --- /dev/null +++ b/swaggerci/eventgrid/exports/New-AzEventGridPartnerRegistration.ps1 @@ -0,0 +1,293 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Creates a new partner registration with the specified parameters. +.Description +Creates a new partner registration with the specified parameters. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistration +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/new-azeventgridpartnerregistration +#> +function New-AzEventGridPartnerRegistration { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistration])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Alias('PartnerRegistrationName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the partner registration. + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # Location of the resource. + ${Location}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String[]] + # List of Azure subscription Ids that are authorized to create a partner namespaceassociated with this partner registration. + # This is an optional property. + # Creatingpartner namespaces is always permitted under the same Azure subscription as the one usedfor creating the partner registration. + ${AuthorizedAzureSubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The extension of the customer service URI of the publisher. + ${CustomerServiceUri}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # URI of the logo. + ${LogoUri}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # Long description for the custom scenarios and integration to be displayed in the portal if needed.Length of this description should not exceed 2048 characters. + ${LongDescription}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The extension of the customer service number of the publisher. + # Only digits are allowed and number of digits should not exceed 10. + ${PartnerCustomerServiceExtension}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The customer service number of the publisher. + # The expected phone format should start with a '+' sign followed by the country code. + # The remaining digits are then followed. + # Only digits and spaces are allowed and itslength cannot exceed 16 digits including country code. + # Examples of valid phone numbers are: +1 515 123 4567 and+966 7 5115 2471. + # Examples of invalid phone numbers are: +1 (515) 123-4567, 1 515 123 4567 and +966 121 5115 24 7 551 1234 43 + ${PartnerCustomerServiceNumber}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # Official name of the partner name. + # For example: "Contoso". + ${PartnerName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The immutableId of the corresponding partner registration. + ${PartnerRegistrationImmutableId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # Short description of the partner resource type. + # The length of this description should not exceed 256 characters. + ${PartnerResourceTypeDescription}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # Display name of the partner resource type. + ${PartnerResourceTypeDisplayName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # Name of the partner resource type. + ${PartnerResourceTypeName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # URI of the partner website that can be used by Azure customers to setup Event Gridintegration on an event source. + ${SetupUri}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceTags]))] + [System.Collections.Hashtable] + # Tags of the resource. + ${Tag}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerRegistrationVisibilityState])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerRegistrationVisibilityState] + # Visibility state of the partner registration. + ${VisibilityState}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.EventGrid.private\New-AzEventGridPartnerRegistration_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/New-AzEventGridPartnerTopic.ps1 b/swaggerci/eventgrid/exports/New-AzEventGridPartnerTopic.ps1 new file mode 100644 index 000000000000..a8e434c9499e --- /dev/null +++ b/swaggerci/eventgrid/exports/New-AzEventGridPartnerTopic.ps1 @@ -0,0 +1,275 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Asynchronously creates a new partner topic with the specified parameters. +.Description +Asynchronously creates a new partner topic with the specified parameters. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopic +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/new-azeventgridpartnertopic +#> +function New-AzEventGridPartnerTopic { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopic])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Alias('PartnerTopicName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the partner topic. + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # Location of the resource. + ${Location}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicActivationState])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicActivationState] + # Activation state of the partner topic. + ${ActivationState}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInlineEventTypes]))] + [System.Collections.Hashtable] + # A collection of inline event types for the resource. + # The inline event type keys are of type string which represents the name of the event.An example of a valid inline event name is "Contoso.OrderCreated".The inline event type values are of type InlineEventProperties and will contain additional information for every inline event type. + ${EventTypeInfoInlineEventType}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind] + # The kind of event type used. + ${EventTypeInfoKind}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.DateTime] + # Expiration time of the partner topic. + # If this timer expires while the partner topic is still never activated,the partner topic and corresponding event channel are deleted. + ${ExpirationTimeIfNotActivatedUtc}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The principal ID of resource identity. + ${IdentityPrincipalId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The tenant ID of resource. + ${IdentityTenantId}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType] + # 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. + ${IdentityType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities]))] + [System.Collections.Hashtable] + # The list of user identities associated with the resource. + # The user identity dictionary key references will be ARM resource ids in the form:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.This property is currently not used and reserved for future usage. + ${IdentityUserAssignedIdentity}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # Context or helpful message that can be used during the approval process by the subscriber. + ${MessageForActivation}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The immutableId of the corresponding partner registration. + ${PartnerRegistrationImmutableId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # Friendly description about the topic. + # This can be set by the publisher/partner to show custom description for the customer partner topic.This will be helpful to remove any ambiguity of the origin of creation of the partner topic for the customer. + ${PartnerTopicFriendlyDescription}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # Source associated with this partner topic. + # This represents a unique partner resource. + ${Source}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceTags]))] + [System.Collections.Hashtable] + # Tags of the resource. + ${Tag}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.EventGrid.private\New-AzEventGridPartnerTopic_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/New-AzEventGridPartnerTopicEventSubscription.ps1 b/swaggerci/eventgrid/exports/New-AzEventGridPartnerTopicEventSubscription.ps1 new file mode 100644 index 000000000000..49aba5af4a21 --- /dev/null +++ b/swaggerci/eventgrid/exports/New-AzEventGridPartnerTopicEventSubscription.ps1 @@ -0,0 +1,322 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Asynchronously creates or updates an event subscription of a partner topic with the specified parameters. +Existing event subscriptions will be updated with this API. +.Description +Asynchronously creates or updates an event subscription of a partner topic with the specified parameters. +Existing event subscriptions will be updated with this API. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +FILTERADVANCEDFILTER : An array of advanced filters that are used for filtering event subscriptions. + OperatorType : The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. + [Key ]: The field/property in the event based on which you want to filter. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/new-azeventgridpartnertopiceventsubscription +#> +function New-AzEventGridPartnerTopicEventSubscription { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # 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. + ${EventSubscriptionName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the partner topic. + ${PartnerTopicName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.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. + ${DeadLetterWithResourceIdentityType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The user identity associated with the resource. + ${DeadLetterWithResourceIdentityUserAssignedIdentity}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType] + # Type of the endpoint for the event subscription destination. + ${DeliveryWithResourceIdentityDestinationEndpointType}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.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. + ${DeliveryWithResourceIdentityType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The user identity associated with the resource. + ${DeliveryWithResourceIdentityUserAssignedIdentity}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType] + # Type of the endpoint for the event subscription destination. + ${EndpointType}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema] + # The event delivery schema for the event subscription. + ${EventDeliverySchema}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.DateTime] + # Expiration time of the event subscription. + ${ExpirationTimeUtc}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[]] + # An array of advanced filters that are used for filtering event subscriptions. + # To construct, see NOTES section for FILTERADVANCEDFILTER properties and create a hash table. + ${FilterAdvancedFilter}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Allows advanced filters to be evaluated against an array of values instead of expecting a singular value. + ${FilterEnableAdvancedFilteringOnArray}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String[]] + # 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. + ${FilterIncludedEventType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filtershould be compared in a case sensitive manner. + ${FilterIsSubjectCaseSensitive}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # An optional string to filter events for an event subscription based on a resource path prefix.The format of this depends on the publisher of the events.Wildcard characters are not supported in this path. + ${FilterSubjectBeginsWith}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # An optional string to filter events for an event subscription based on a resource path suffix.Wildcard characters are not supported in this path. + ${FilterSubjectEndsWith}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String[]] + # List of user defined labels. + ${Label}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Int32] + # Time To Live (in minutes) for events. + ${RetryPolicyEventTimeToLiveInMinute}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Int32] + # Maximum number of delivery retry attempts for events. + ${RetryPolicyMaxDeliveryAttempt}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.EventGrid.private\New-AzEventGridPartnerTopicEventSubscription_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/New-AzEventGridSystemTopic.ps1 b/swaggerci/eventgrid/exports/New-AzEventGridSystemTopic.ps1 new file mode 100644 index 000000000000..93ec139b8e01 --- /dev/null +++ b/swaggerci/eventgrid/exports/New-AzEventGridSystemTopic.ps1 @@ -0,0 +1,244 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Asynchronously creates a new system topic with the specified parameters. +.Description +Asynchronously creates a new system topic with the specified parameters. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopic +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/new-azeventgridsystemtopic +#> +function New-AzEventGridSystemTopic { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopic])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Alias('SystemTopicName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the system topic. + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # Location of the resource. + ${Location}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The principal ID of resource identity. + ${IdentityPrincipalId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The tenant ID of resource. + ${IdentityTenantId}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType] + # 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. + ${IdentityType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities]))] + [System.Collections.Hashtable] + # The list of user identities associated with the resource. + # The user identity dictionary key references will be ARM resource ids in the form:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.This property is currently not used and reserved for future usage. + ${IdentityUserAssignedIdentity}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # Source for the system topic. + ${Source}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceTags]))] + [System.Collections.Hashtable] + # Tags of the resource. + ${Tag}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # TopicType for the system topic. + ${TopicType}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.EventGrid.private\New-AzEventGridSystemTopic_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/New-AzEventGridSystemTopicEventSubscription.ps1 b/swaggerci/eventgrid/exports/New-AzEventGridSystemTopicEventSubscription.ps1 new file mode 100644 index 000000000000..b9ce2948d6bf --- /dev/null +++ b/swaggerci/eventgrid/exports/New-AzEventGridSystemTopicEventSubscription.ps1 @@ -0,0 +1,322 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Asynchronously creates or updates an event subscription with the specified parameters. +Existing event subscriptions will be updated with this API. +.Description +Asynchronously creates or updates an event subscription with the specified parameters. +Existing event subscriptions will be updated with this API. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +FILTERADVANCEDFILTER : An array of advanced filters that are used for filtering event subscriptions. + OperatorType : The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. + [Key ]: The field/property in the event based on which you want to filter. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/new-azeventgridsystemtopiceventsubscription +#> +function New-AzEventGridSystemTopicEventSubscription { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # 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. + ${EventSubscriptionName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the system topic. + ${SystemTopicName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.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. + ${DeadLetterWithResourceIdentityType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The user identity associated with the resource. + ${DeadLetterWithResourceIdentityUserAssignedIdentity}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType] + # Type of the endpoint for the event subscription destination. + ${DeliveryWithResourceIdentityDestinationEndpointType}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.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. + ${DeliveryWithResourceIdentityType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The user identity associated with the resource. + ${DeliveryWithResourceIdentityUserAssignedIdentity}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType] + # Type of the endpoint for the event subscription destination. + ${EndpointType}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema] + # The event delivery schema for the event subscription. + ${EventDeliverySchema}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.DateTime] + # Expiration time of the event subscription. + ${ExpirationTimeUtc}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[]] + # An array of advanced filters that are used for filtering event subscriptions. + # To construct, see NOTES section for FILTERADVANCEDFILTER properties and create a hash table. + ${FilterAdvancedFilter}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Allows advanced filters to be evaluated against an array of values instead of expecting a singular value. + ${FilterEnableAdvancedFilteringOnArray}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String[]] + # 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. + ${FilterIncludedEventType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filtershould be compared in a case sensitive manner. + ${FilterIsSubjectCaseSensitive}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # An optional string to filter events for an event subscription based on a resource path prefix.The format of this depends on the publisher of the events.Wildcard characters are not supported in this path. + ${FilterSubjectBeginsWith}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # An optional string to filter events for an event subscription based on a resource path suffix.Wildcard characters are not supported in this path. + ${FilterSubjectEndsWith}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String[]] + # List of user defined labels. + ${Label}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Int32] + # Time To Live (in minutes) for events. + ${RetryPolicyEventTimeToLiveInMinute}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Int32] + # Maximum number of delivery retry attempts for events. + ${RetryPolicyMaxDeliveryAttempt}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.EventGrid.private\New-AzEventGridSystemTopicEventSubscription_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/New-AzEventGridTopic.ps1 b/swaggerci/eventgrid/exports/New-AzEventGridTopic.ps1 new file mode 100644 index 000000000000..6df70a7cfb3f --- /dev/null +++ b/swaggerci/eventgrid/exports/New-AzEventGridTopic.ps1 @@ -0,0 +1,307 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Asynchronously creates a new topic with the specified parameters. +.Description +Asynchronously creates a new topic with the specified parameters. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INBOUNDIPRULE : This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess is enabled. + [Action ]: Action to perform based on the match or no match of the IpMask. + [IPMask ]: IP Address in CIDR notation e.g., 10.0.0.0/8. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/new-azeventgridtopic +#> +function New-AzEventGridTopic { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Alias('TopicName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the topic. + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # Location of the resource. + ${Location}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary] + # Data Residency Boundary of the resource. + ${DataResidencyBoundary}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Management.Automation.SwitchParameter] + # This boolean is used to enable or disable local auth. + # Default value is false. + # When the property is set to true, only AAD token will be used to authenticate if user is allowed to publish to the topic. + ${DisableLocalAuth}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # Fully qualified name of the extended location. + ${ExtendedLocationName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # Type of the extended location. + ${ExtendedLocationType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The principal ID of resource identity. + ${IdentityPrincipalId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The tenant ID of resource. + ${IdentityTenantId}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType] + # 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. + ${IdentityType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities]))] + [System.Collections.Hashtable] + # The list of user identities associated with the resource. + # The user identity dictionary key references will be ARM resource ids in the form:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.This property is currently not used and reserved for future usage. + ${IdentityUserAssignedIdentity}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[]] + # This can be used to restrict traffic from specific IPs instead of all IPs. + # Note: These are considered only if PublicNetworkAccess is enabled. + # To construct, see NOTES section for INBOUNDIPRULE properties and create a hash table. + ${InboundIPRule}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.InputSchema])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.InputSchema] + # This determines the format that Event Grid should expect for incoming events published to the topic. + ${InputSchema}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceKind])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceKind] + # Kind of the resource. + ${Kind}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess] + # This determines if traffic is allowed over public network. + # By default it is enabled. + # You can further restrict to specific IPs by configuring + ${PublicNetworkAccess}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku] + # The Sku name of the resource. + # The possible values are: Basic or Premium. + ${SkuName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceTags]))] + [System.Collections.Hashtable] + # Tags of the resource. + ${Tag}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.EventGrid.private\New-AzEventGridTopic_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/New-AzEventGridTopicEventSubscription.ps1 b/swaggerci/eventgrid/exports/New-AzEventGridTopicEventSubscription.ps1 new file mode 100644 index 000000000000..57b7717d19ac --- /dev/null +++ b/swaggerci/eventgrid/exports/New-AzEventGridTopicEventSubscription.ps1 @@ -0,0 +1,320 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Asynchronously creates a new event subscription or updates an existing event subscription. +.Description +Asynchronously creates a new event subscription or updates an existing event subscription. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +FILTERADVANCEDFILTER : An array of advanced filters that are used for filtering event subscriptions. + OperatorType : The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. + [Key ]: The field/property in the event based on which you want to filter. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/new-azeventgridtopiceventsubscription +#> +function New-AzEventGridTopicEventSubscription { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # 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. + ${EventSubscriptionName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the domain topic. + ${TopicName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.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. + ${DeadLetterWithResourceIdentityType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The user identity associated with the resource. + ${DeadLetterWithResourceIdentityUserAssignedIdentity}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType] + # Type of the endpoint for the event subscription destination. + ${DeliveryWithResourceIdentityDestinationEndpointType}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.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. + ${DeliveryWithResourceIdentityType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The user identity associated with the resource. + ${DeliveryWithResourceIdentityUserAssignedIdentity}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType] + # Type of the endpoint for the event subscription destination. + ${EndpointType}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema] + # The event delivery schema for the event subscription. + ${EventDeliverySchema}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.DateTime] + # Expiration time of the event subscription. + ${ExpirationTimeUtc}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[]] + # An array of advanced filters that are used for filtering event subscriptions. + # To construct, see NOTES section for FILTERADVANCEDFILTER properties and create a hash table. + ${FilterAdvancedFilter}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Allows advanced filters to be evaluated against an array of values instead of expecting a singular value. + ${FilterEnableAdvancedFilteringOnArray}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String[]] + # 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. + ${FilterIncludedEventType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filtershould be compared in a case sensitive manner. + ${FilterIsSubjectCaseSensitive}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # An optional string to filter events for an event subscription based on a resource path prefix.The format of this depends on the publisher of the events.Wildcard characters are not supported in this path. + ${FilterSubjectBeginsWith}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # An optional string to filter events for an event subscription based on a resource path suffix.Wildcard characters are not supported in this path. + ${FilterSubjectEndsWith}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String[]] + # List of user defined labels. + ${Label}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Int32] + # Time To Live (in minutes) for events. + ${RetryPolicyEventTimeToLiveInMinute}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Int32] + # Maximum number of delivery retry attempts for events. + ${RetryPolicyMaxDeliveryAttempt}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.EventGrid.private\New-AzEventGridTopicEventSubscription_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/New-AzEventGridTopicKey.ps1 b/swaggerci/eventgrid/exports/New-AzEventGridTopicKey.ps1 new file mode 100644 index 000000000000..af0e80b91ad1 --- /dev/null +++ b/swaggerci/eventgrid/exports/New-AzEventGridTopicKey.ps1 @@ -0,0 +1,256 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Regenerate a shared access key for a topic. +.Description +Regenerate a shared access key for a topic. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicRegenerateKeyRequest +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicSharedAccessKeys +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. + +REGENERATEKEYREQUEST : Topic regenerate share access key request + KeyName : Key name to regenerate key1 or key2 +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/new-azeventgridtopickey +#> +function New-AzEventGridTopicKey { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicSharedAccessKeys])] +[CmdletBinding(DefaultParameterSetName='RegenerateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Regenerate', Mandatory)] + [Parameter(ParameterSetName='RegenerateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Regenerate')] + [Parameter(ParameterSetName='RegenerateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='Regenerate', Mandatory)] + [Parameter(ParameterSetName='RegenerateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the topic. + ${TopicName}, + + [Parameter(ParameterSetName='RegenerateViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='RegenerateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Regenerate', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='RegenerateViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicRegenerateKeyRequest] + # Topic regenerate share access key request + # To construct, see NOTES section for REGENERATEKEYREQUEST properties and create a hash table. + ${RegenerateKeyRequest}, + + [Parameter(ParameterSetName='RegenerateExpanded', Mandatory)] + [Parameter(ParameterSetName='RegenerateViaIdentityExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # Key name to regenerate key1 or key2 + ${KeyName}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Regenerate = 'Az.EventGrid.private\New-AzEventGridTopicKey_Regenerate'; + RegenerateExpanded = 'Az.EventGrid.private\New-AzEventGridTopicKey_RegenerateExpanded'; + RegenerateViaIdentity = 'Az.EventGrid.private\New-AzEventGridTopicKey_RegenerateViaIdentity'; + RegenerateViaIdentityExpanded = 'Az.EventGrid.private\New-AzEventGridTopicKey_RegenerateViaIdentityExpanded'; + } + if (('Regenerate', 'RegenerateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/ProxyCmdletDefinitions.ps1 b/swaggerci/eventgrid/exports/ProxyCmdletDefinitions.ps1 new file mode 100644 index 000000000000..9e0ebd298e1f --- /dev/null +++ b/swaggerci/eventgrid/exports/ProxyCmdletDefinitions.ps1 @@ -0,0 +1,24141 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Get the full endpoint URL of a partner destination channel. +.Description +Get the full endpoint URL of a partner destination channel. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +System.String +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgridchannelfullurl +#> +function Get-AzEventGridChannelFullUrl { +[OutputType([System.String])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the Channel. + ${ChannelName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the partner namespace. + ${PartnerNamespaceName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the partners subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.EventGrid.private\Get-AzEventGridChannelFullUrl_Get'; + GetViaIdentity = 'Az.EventGrid.private\Get-AzEventGridChannelFullUrl_GetViaIdentity'; + } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Get properties of a channel. +.Description +Get properties of a channel. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannel +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgridchannel +#> +function Get-AzEventGridChannel { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannel])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('ChannelName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the channel. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the partner namespace. + ${PartnerNamespaceName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the partners subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Query')] + [System.String] + # 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}, + + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Query')] + [System.Int32] + # 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}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.EventGrid.private\Get-AzEventGridChannel_Get'; + GetViaIdentity = 'Az.EventGrid.private\Get-AzEventGridChannel_GetViaIdentity'; + List = 'Az.EventGrid.private\Get-AzEventGridChannel_List'; + } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Get all delivery attributes for an event subscription for domain. +.Description +Get all delivery attributes for an event subscription for domain. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgriddomaineventsubscriptiondeliveryattribute +#> +function Get-AzEventGridDomainEventSubscriptionDeliveryAttribute { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the domain topic. + ${DomainName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the event subscription. + ${EventSubscriptionName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.EventGrid.private\Get-AzEventGridDomainEventSubscriptionDeliveryAttribute_Get'; + GetViaIdentity = 'Az.EventGrid.private\Get-AzEventGridDomainEventSubscriptionDeliveryAttribute_GetViaIdentity'; + } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Get the full endpoint URL for an event subscription for domain. +.Description +Get the full endpoint URL for an event subscription for domain. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +System.String +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgriddomaineventsubscriptionfullurl +#> +function Get-AzEventGridDomainEventSubscriptionFullUrl { +[OutputType([System.String])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the domain topic. + ${DomainName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the event subscription. + ${EventSubscriptionName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.EventGrid.private\Get-AzEventGridDomainEventSubscriptionFullUrl_Get'; + GetViaIdentity = 'Az.EventGrid.private\Get-AzEventGridDomainEventSubscriptionFullUrl_GetViaIdentity'; + } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Get properties of an event subscription of a domain. +.Description +Get properties of an event subscription of a domain. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgriddomaineventsubscription +#> +function Get-AzEventGridDomainEventSubscription { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the partner topic. + ${DomainName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # 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. + ${EventSubscriptionName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Query')] + [System.String] + # 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}, + + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Query')] + [System.Int32] + # 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}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.EventGrid.private\Get-AzEventGridDomainEventSubscription_Get'; + GetViaIdentity = 'Az.EventGrid.private\Get-AzEventGridDomainEventSubscription_GetViaIdentity'; + List = 'Az.EventGrid.private\Get-AzEventGridDomainEventSubscription_List'; + } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +List the two keys used to publish to a domain. +.Description +List the two keys used to publish to a domain. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainSharedAccessKeys +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgriddomainsharedaccesskey +#> +function Get-AzEventGridDomainSharedAccessKey { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainSharedAccessKeys])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the domain. + ${DomainName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.EventGrid.private\Get-AzEventGridDomainSharedAccessKey_List'; + } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Get all delivery attributes for an event subscription for domain topic. +.Description +Get all delivery attributes for an event subscription for domain topic. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgriddomaintopiceventsubscriptiondeliveryattribute +#> +function Get-AzEventGridDomainTopicEventSubscriptionDeliveryAttribute { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the top level domain. + ${DomainName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the event subscription. + ${EventSubscriptionName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the domain topic. + ${TopicName}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.EventGrid.private\Get-AzEventGridDomainTopicEventSubscriptionDeliveryAttribute_Get'; + GetViaIdentity = 'Az.EventGrid.private\Get-AzEventGridDomainTopicEventSubscriptionDeliveryAttribute_GetViaIdentity'; + } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Get the full endpoint URL for a nested event subscription for domain topic. +.Description +Get the full endpoint URL for a nested event subscription for domain topic. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +System.String +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgriddomaintopiceventsubscriptionfullurl +#> +function Get-AzEventGridDomainTopicEventSubscriptionFullUrl { +[OutputType([System.String])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the top level domain. + ${DomainName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the event subscription. + ${EventSubscriptionName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the domain topic. + ${TopicName}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.EventGrid.private\Get-AzEventGridDomainTopicEventSubscriptionFullUrl_Get'; + GetViaIdentity = 'Az.EventGrid.private\Get-AzEventGridDomainTopicEventSubscriptionFullUrl_GetViaIdentity'; + } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Get properties of a nested event subscription for a domain topic. +.Description +Get properties of a nested event subscription for a domain topic. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgriddomaintopiceventsubscription +#> +function Get-AzEventGridDomainTopicEventSubscription { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the top level domain. + ${DomainName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the event subscription. + ${EventSubscriptionName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the domain topic. + ${TopicName}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Query')] + [System.String] + # 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}, + + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Query')] + [System.Int32] + # 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}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.EventGrid.private\Get-AzEventGridDomainTopicEventSubscription_Get'; + GetViaIdentity = 'Az.EventGrid.private\Get-AzEventGridDomainTopicEventSubscription_GetViaIdentity'; + List = 'Az.EventGrid.private\Get-AzEventGridDomainTopicEventSubscription_List'; + } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Get properties of a domain topic. +.Description +Get properties of a domain topic. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopic +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgriddomaintopic +#> +function Get-AzEventGridDomainTopic { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopic])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the domain. + ${DomainName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('DomainTopicName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the topic. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Query')] + [System.String] + # 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}, + + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Query')] + [System.Int32] + # 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}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.EventGrid.private\Get-AzEventGridDomainTopic_Get'; + GetViaIdentity = 'Az.EventGrid.private\Get-AzEventGridDomainTopic_GetViaIdentity'; + List = 'Az.EventGrid.private\Get-AzEventGridDomainTopic_List'; + } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Get properties of a domain. +.Description +Get properties of a domain. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomain +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgriddomain +#> +function Get-AzEventGridDomain { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomain])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('DomainName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the domain. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List1', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Parameter(ParameterSetName='List1')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='List')] + [Parameter(ParameterSetName='List1')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Query')] + [System.String] + # 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}, + + [Parameter(ParameterSetName='List')] + [Parameter(ParameterSetName='List1')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Query')] + [System.Int32] + # 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}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.EventGrid.private\Get-AzEventGridDomain_Get'; + GetViaIdentity = 'Az.EventGrid.private\Get-AzEventGridDomain_GetViaIdentity'; + List = 'Az.EventGrid.private\Get-AzEventGridDomain_List'; + List1 = 'Az.EventGrid.private\Get-AzEventGridDomain_List1'; + } + if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Get properties of an event channel. +.Description +Get properties of an event channel. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannel +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgrideventchannel +#> +function Get-AzEventGridEventChannel { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannel])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('EventChannelName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the event channel. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the partner namespace. + ${PartnerNamespaceName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Query')] + [System.String] + # 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}, + + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Query')] + [System.Int32] + # 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}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.EventGrid.private\Get-AzEventGridEventChannel_Get'; + GetViaIdentity = 'Az.EventGrid.private\Get-AzEventGridEventChannel_GetViaIdentity'; + List = 'Az.EventGrid.private\Get-AzEventGridEventChannel_List'; + } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Get all delivery attributes for an event subscription. +.Description +Get all delivery attributes for an event subscription. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgrideventsubscriptiondeliveryattribute +#> +function Get-AzEventGridEventSubscriptionDeliveryAttribute { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the event subscription. + ${EventSubscriptionName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # 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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + ${Scope}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.EventGrid.private\Get-AzEventGridEventSubscriptionDeliveryAttribute_Get'; + GetViaIdentity = 'Az.EventGrid.private\Get-AzEventGridEventSubscriptionDeliveryAttribute_GetViaIdentity'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Get the full endpoint URL for an event subscription. +.Description +Get the full endpoint URL for an event subscription. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +System.String +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgrideventsubscriptionfullurl +#> +function Get-AzEventGridEventSubscriptionFullUrl { +[OutputType([System.String])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the event subscription. + ${EventSubscriptionName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # 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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + ${Scope}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.EventGrid.private\Get-AzEventGridEventSubscriptionFullUrl_Get'; + GetViaIdentity = 'Az.EventGrid.private\Get-AzEventGridEventSubscriptionFullUrl_GetViaIdentity'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +List all aggregated global event subscriptions under a specific Azure subscription. +.Description +List all aggregated global event subscriptions under a specific Azure subscription. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgrideventsubscriptionglobal +#> +function Get-AzEventGridEventSubscriptionGlobal { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='List1', Mandatory)] + [Parameter(ParameterSetName='List3', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the topic type. + ${TopicTypeName}, + + [Parameter(ParameterSetName='List2', Mandatory)] + [Parameter(ParameterSetName='List3', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Query')] + [System.String] + # 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}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Query')] + [System.Int32] + # 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}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.EventGrid.private\Get-AzEventGridEventSubscriptionGlobal_List'; + List1 = 'Az.EventGrid.private\Get-AzEventGridEventSubscriptionGlobal_List1'; + List2 = 'Az.EventGrid.private\Get-AzEventGridEventSubscriptionGlobal_List2'; + List3 = 'Az.EventGrid.private\Get-AzEventGridEventSubscriptionGlobal_List3'; + } + if (('List', 'List1', 'List2', 'List3') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +List all event subscriptions from the given location under a specific Azure subscription. +.Description +List all event subscriptions from the given location under a specific Azure subscription. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgrideventsubscriptionregional +#> +function Get-AzEventGridEventSubscriptionRegional { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the location. + ${Location}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='List1', Mandatory)] + [Parameter(ParameterSetName='List3', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='List2', Mandatory)] + [Parameter(ParameterSetName='List3', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the topic type. + ${TopicTypeName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Query')] + [System.String] + # 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}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Query')] + [System.Int32] + # 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}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.EventGrid.private\Get-AzEventGridEventSubscriptionRegional_List'; + List1 = 'Az.EventGrid.private\Get-AzEventGridEventSubscriptionRegional_List1'; + List2 = 'Az.EventGrid.private\Get-AzEventGridEventSubscriptionRegional_List2'; + List3 = 'Az.EventGrid.private\Get-AzEventGridEventSubscriptionRegional_List3'; + } + if (('List', 'List1', 'List2', 'List3') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Get properties of an event subscription. +.Description +Get properties of an event subscription. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgrideventsubscription +#> +function Get-AzEventGridEventSubscription { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('EventSubscriptionName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the event subscription. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # 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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + ${Scope}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Namespace of the provider of the topic. + ${ProviderNamespace}, + + [Parameter(ParameterSetName='List', Mandatory)] + [Parameter(ParameterSetName='List1', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the resource. + ${ResourceName}, + + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the resource type. + ${ResourceTypeName}, + + [Parameter(ParameterSetName='List')] + [Parameter(ParameterSetName='List1')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='List1', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the top level domain. + ${DomainName}, + + [Parameter(ParameterSetName='List1', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the domain topic. + ${TopicName}, + + [Parameter(ParameterSetName='List')] + [Parameter(ParameterSetName='List1')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Query')] + [System.String] + # 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}, + + [Parameter(ParameterSetName='List')] + [Parameter(ParameterSetName='List1')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Query')] + [System.Int32] + # 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}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.EventGrid.private\Get-AzEventGridEventSubscription_Get'; + GetViaIdentity = 'Az.EventGrid.private\Get-AzEventGridEventSubscription_GetViaIdentity'; + List = 'Az.EventGrid.private\Get-AzEventGridEventSubscription_List'; + List1 = 'Az.EventGrid.private\Get-AzEventGridEventSubscription_List1'; + } + if (('List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Get the properties of an extension topic. +.Description +Get the properties of an extension topic. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtensionTopic +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgridextensiontopic +#> +function Get-AzEventGridExtensionTopic { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtensionTopic])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # 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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for Azure resource. + ${Scope}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.EventGrid.private\Get-AzEventGridExtensionTopic_Get'; + GetViaIdentity = 'Az.EventGrid.private\Get-AzEventGridExtensionTopic_GetViaIdentity'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Get properties of a partner configuration. +.Description +Get properties of a partner configuration. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfiguration +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgridpartnerconfiguration +#> +function Get-AzEventGridPartnerConfiguration { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfiguration])] +[CmdletBinding(DefaultParameterSetName='List1', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Parameter(ParameterSetName='List1')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='List1')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Query')] + [System.String] + # 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}, + + [Parameter(ParameterSetName='List1')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Query')] + [System.Int32] + # 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}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.EventGrid.private\Get-AzEventGridPartnerConfiguration_Get'; + GetViaIdentity = 'Az.EventGrid.private\Get-AzEventGridPartnerConfiguration_GetViaIdentity'; + List = 'Az.EventGrid.private\Get-AzEventGridPartnerConfiguration_List'; + List1 = 'Az.EventGrid.private\Get-AzEventGridPartnerConfiguration_List1'; + } + if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Get properties of a partner destination. +.Description +Get properties of a partner destination. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestination +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgridpartnerdestination +#> +function Get-AzEventGridPartnerDestination { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestination])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('PartnerDestinationName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the partner destination. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List1', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Parameter(ParameterSetName='List1')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='List')] + [Parameter(ParameterSetName='List1')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Query')] + [System.String] + # 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}, + + [Parameter(ParameterSetName='List')] + [Parameter(ParameterSetName='List1')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Query')] + [System.Int32] + # 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}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.EventGrid.private\Get-AzEventGridPartnerDestination_Get'; + GetViaIdentity = 'Az.EventGrid.private\Get-AzEventGridPartnerDestination_GetViaIdentity'; + List = 'Az.EventGrid.private\Get-AzEventGridPartnerDestination_List'; + List1 = 'Az.EventGrid.private\Get-AzEventGridPartnerDestination_List1'; + } + if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +List the two keys used to publish to a partner namespace. +.Description +List the two keys used to publish to a partner namespace. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceSharedAccessKeys +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgridpartnernamespacesharedaccesskey +#> +function Get-AzEventGridPartnerNamespaceSharedAccessKey { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceSharedAccessKeys])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the partner namespace. + ${PartnerNamespaceName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.EventGrid.private\Get-AzEventGridPartnerNamespaceSharedAccessKey_List'; + } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Get properties of a partner namespace. +.Description +Get properties of a partner namespace. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespace +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgridpartnernamespace +#> +function Get-AzEventGridPartnerNamespace { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespace])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('PartnerNamespaceName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the partner namespace. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List1', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Parameter(ParameterSetName='List1')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='List')] + [Parameter(ParameterSetName='List1')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Query')] + [System.String] + # 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}, + + [Parameter(ParameterSetName='List')] + [Parameter(ParameterSetName='List1')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Query')] + [System.Int32] + # 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}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.EventGrid.private\Get-AzEventGridPartnerNamespace_Get'; + GetViaIdentity = 'Az.EventGrid.private\Get-AzEventGridPartnerNamespace_GetViaIdentity'; + List = 'Az.EventGrid.private\Get-AzEventGridPartnerNamespace_List'; + List1 = 'Az.EventGrid.private\Get-AzEventGridPartnerNamespace_List1'; + } + if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Gets a partner registration with the specified parameters. +.Description +Gets a partner registration with the specified parameters. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistration +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgridpartnerregistration +#> +function Get-AzEventGridPartnerRegistration { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistration])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('PartnerRegistrationName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the partner registration. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List1', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Parameter(ParameterSetName='List1')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='List')] + [Parameter(ParameterSetName='List1')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Query')] + [System.String] + # 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}, + + [Parameter(ParameterSetName='List')] + [Parameter(ParameterSetName='List1')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Query')] + [System.Int32] + # 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}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.EventGrid.private\Get-AzEventGridPartnerRegistration_Get'; + GetViaIdentity = 'Az.EventGrid.private\Get-AzEventGridPartnerRegistration_GetViaIdentity'; + List = 'Az.EventGrid.private\Get-AzEventGridPartnerRegistration_List'; + List1 = 'Az.EventGrid.private\Get-AzEventGridPartnerRegistration_List1'; + } + if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Get all delivery attributes for an event subscription of a partner topic. +.Description +Get all delivery attributes for an event subscription of a partner topic. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgridpartnertopiceventsubscriptiondeliveryattribute +#> +function Get-AzEventGridPartnerTopicEventSubscriptionDeliveryAttribute { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # 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. + ${EventSubscriptionName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the partner topic. + ${PartnerTopicName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.EventGrid.private\Get-AzEventGridPartnerTopicEventSubscriptionDeliveryAttribute_Get'; + GetViaIdentity = 'Az.EventGrid.private\Get-AzEventGridPartnerTopicEventSubscriptionDeliveryAttribute_GetViaIdentity'; + } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Get the full endpoint URL for an event subscription of a partner topic. +.Description +Get the full endpoint URL for an event subscription of a partner topic. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +System.String +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgridpartnertopiceventsubscriptionfullurl +#> +function Get-AzEventGridPartnerTopicEventSubscriptionFullUrl { +[OutputType([System.String])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # 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. + ${EventSubscriptionName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the partner topic. + ${PartnerTopicName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.EventGrid.private\Get-AzEventGridPartnerTopicEventSubscriptionFullUrl_Get'; + GetViaIdentity = 'Az.EventGrid.private\Get-AzEventGridPartnerTopicEventSubscriptionFullUrl_GetViaIdentity'; + } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Get properties of an event subscription of a partner topic. +.Description +Get properties of an event subscription of a partner topic. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgridpartnertopiceventsubscription +#> +function Get-AzEventGridPartnerTopicEventSubscription { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # 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. + ${EventSubscriptionName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the partner topic. + ${PartnerTopicName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Query')] + [System.String] + # 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}, + + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Query')] + [System.Int32] + # 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}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.EventGrid.private\Get-AzEventGridPartnerTopicEventSubscription_Get'; + GetViaIdentity = 'Az.EventGrid.private\Get-AzEventGridPartnerTopicEventSubscription_GetViaIdentity'; + List = 'Az.EventGrid.private\Get-AzEventGridPartnerTopicEventSubscription_List'; + } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Get properties of a partner topic. +.Description +Get properties of a partner topic. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopic +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgridpartnertopic +#> +function Get-AzEventGridPartnerTopic { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopic])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('PartnerTopicName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the partner topic. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List1', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Parameter(ParameterSetName='List1')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='List')] + [Parameter(ParameterSetName='List1')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Query')] + [System.String] + # 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}, + + [Parameter(ParameterSetName='List')] + [Parameter(ParameterSetName='List1')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Query')] + [System.Int32] + # 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}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.EventGrid.private\Get-AzEventGridPartnerTopic_Get'; + GetViaIdentity = 'Az.EventGrid.private\Get-AzEventGridPartnerTopic_GetViaIdentity'; + List = 'Az.EventGrid.private\Get-AzEventGridPartnerTopic_List'; + List1 = 'Az.EventGrid.private\Get-AzEventGridPartnerTopic_List1'; + } + if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Get a specific private endpoint connection under a topic, domain, or partner namespace. +.Description +Get a specific private endpoint connection under a topic, domain, or partner namespace. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnection +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgridprivateendpointconnection +#> +function Get-AzEventGridPrivateEndpointConnection { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnection])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('PrivateEndpointConnectionName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the private endpoint connection connection. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the parent resource (namely, either, the topic name, domain name, or partner namespace name). + ${ParentName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ParentType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ParentType] + # The type of the parent resource. + # This can be either \'topics\', \'domains\', or \'partnerNamespaces\'. + ${ParentType}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Query')] + [System.String] + # 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}, + + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Query')] + [System.Int32] + # 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}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.EventGrid.private\Get-AzEventGridPrivateEndpointConnection_Get'; + GetViaIdentity = 'Az.EventGrid.private\Get-AzEventGridPrivateEndpointConnection_GetViaIdentity'; + List = 'Az.EventGrid.private\Get-AzEventGridPrivateEndpointConnection_List'; + } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Get properties of a private link resource. +.Description +Get properties of a private link resource. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResource +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgridprivatelinkresource +#> +function Get-AzEventGridPrivateLinkResource { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResource])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('PrivateLinkResourceName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of private link resource. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the parent resource (namely, either, the topic name, domain name, or partner namespace name). + ${ParentName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The type of the parent resource. + # This can be either \'topics\', \'domains\', or \'partnerNamespaces\'. + ${ParentType}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Query')] + [System.String] + # 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}, + + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Query')] + [System.Int32] + # 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}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.EventGrid.private\Get-AzEventGridPrivateLinkResource_Get'; + GetViaIdentity = 'Az.EventGrid.private\Get-AzEventGridPrivateLinkResource_GetViaIdentity'; + List = 'Az.EventGrid.private\Get-AzEventGridPrivateLinkResource_List'; + } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Get all delivery attributes for an event subscription. +.Description +Get all delivery attributes for an event subscription. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgridsystemtopiceventsubscriptiondeliveryattribute +#> +function Get-AzEventGridSystemTopicEventSubscriptionDeliveryAttribute { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # 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. + ${EventSubscriptionName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the system topic. + ${SystemTopicName}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.EventGrid.private\Get-AzEventGridSystemTopicEventSubscriptionDeliveryAttribute_Get'; + GetViaIdentity = 'Az.EventGrid.private\Get-AzEventGridSystemTopicEventSubscriptionDeliveryAttribute_GetViaIdentity'; + } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Get the full endpoint URL for an event subscription of a system topic. +.Description +Get the full endpoint URL for an event subscription of a system topic. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +System.String +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgridsystemtopiceventsubscriptionfullurl +#> +function Get-AzEventGridSystemTopicEventSubscriptionFullUrl { +[OutputType([System.String])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # 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. + ${EventSubscriptionName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the system topic. + ${SystemTopicName}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.EventGrid.private\Get-AzEventGridSystemTopicEventSubscriptionFullUrl_Get'; + GetViaIdentity = 'Az.EventGrid.private\Get-AzEventGridSystemTopicEventSubscriptionFullUrl_GetViaIdentity'; + } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Get an event subscription. +.Description +Get an event subscription. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgridsystemtopiceventsubscription +#> +function Get-AzEventGridSystemTopicEventSubscription { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # 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. + ${EventSubscriptionName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the system topic. + ${SystemTopicName}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Query')] + [System.String] + # 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}, + + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Query')] + [System.Int32] + # 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}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.EventGrid.private\Get-AzEventGridSystemTopicEventSubscription_Get'; + GetViaIdentity = 'Az.EventGrid.private\Get-AzEventGridSystemTopicEventSubscription_GetViaIdentity'; + List = 'Az.EventGrid.private\Get-AzEventGridSystemTopicEventSubscription_List'; + } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Get properties of a system topic. +.Description +Get properties of a system topic. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopic +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgridsystemtopic +#> +function Get-AzEventGridSystemTopic { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopic])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('SystemTopicName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the system topic. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List1', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Parameter(ParameterSetName='List1')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='List')] + [Parameter(ParameterSetName='List1')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Query')] + [System.String] + # 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}, + + [Parameter(ParameterSetName='List')] + [Parameter(ParameterSetName='List1')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Query')] + [System.Int32] + # 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}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.EventGrid.private\Get-AzEventGridSystemTopic_Get'; + GetViaIdentity = 'Az.EventGrid.private\Get-AzEventGridSystemTopic_GetViaIdentity'; + List = 'Az.EventGrid.private\Get-AzEventGridSystemTopic_List'; + List1 = 'Az.EventGrid.private\Get-AzEventGridSystemTopic_List1'; + } + if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Get all delivery attributes for an event subscription for topic. +.Description +Get all delivery attributes for an event subscription for topic. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgridtopiceventsubscriptiondeliveryattribute +#> +function Get-AzEventGridTopicEventSubscriptionDeliveryAttribute { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the event subscription. + ${EventSubscriptionName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the domain topic. + ${TopicName}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.EventGrid.private\Get-AzEventGridTopicEventSubscriptionDeliveryAttribute_Get'; + GetViaIdentity = 'Az.EventGrid.private\Get-AzEventGridTopicEventSubscriptionDeliveryAttribute_GetViaIdentity'; + } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Get the full endpoint URL for an event subscription for topic. +.Description +Get the full endpoint URL for an event subscription for topic. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +System.String +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgridtopiceventsubscriptionfullurl +#> +function Get-AzEventGridTopicEventSubscriptionFullUrl { +[OutputType([System.String])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the event subscription. + ${EventSubscriptionName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the domain topic. + ${TopicName}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.EventGrid.private\Get-AzEventGridTopicEventSubscriptionFullUrl_Get'; + GetViaIdentity = 'Az.EventGrid.private\Get-AzEventGridTopicEventSubscriptionFullUrl_GetViaIdentity'; + } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Get properties of an event subscription of a topic. +.Description +Get properties of an event subscription of a topic. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgridtopiceventsubscription +#> +function Get-AzEventGridTopicEventSubscription { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # 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. + ${EventSubscriptionName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the partner topic. + ${TopicName}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Query')] + [System.String] + # 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}, + + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Query')] + [System.Int32] + # 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}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.EventGrid.private\Get-AzEventGridTopicEventSubscription_Get'; + GetViaIdentity = 'Az.EventGrid.private\Get-AzEventGridTopicEventSubscription_GetViaIdentity'; + List = 'Az.EventGrid.private\Get-AzEventGridTopicEventSubscription_List'; + } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +List event types for a topic. +.Description +List event types for a topic. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventType +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgridtopiceventtype +#> +function Get-AzEventGridTopicEventType { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventType])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Namespace of the provider of the topic. + ${ProviderNamespace}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the topic. + ${ResourceName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the topic type. + ${ResourceTypeName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.EventGrid.private\Get-AzEventGridTopicEventType_List'; + } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +List the two keys used to publish to a topic. +.Description +List the two keys used to publish to a topic. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicSharedAccessKeys +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgridtopicsharedaccesskey +#> +function Get-AzEventGridTopicSharedAccessKey { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicSharedAccessKeys])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the topic. + ${TopicName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.EventGrid.private\Get-AzEventGridTopicSharedAccessKey_List'; + } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +List event types for a topic type. +.Description +List event types for a topic type. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventType +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgridtopictypeeventtype +#> +function Get-AzEventGridTopicTypeEventType { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventType])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the topic type. + ${TopicTypeName}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.EventGrid.private\Get-AzEventGridTopicTypeEventType_List'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Get information about a topic type. +.Description +Get information about a topic type. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypeInfo +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgridtopictype +#> +function Get-AzEventGridTopicType { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypeInfo])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('TopicTypeName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the topic type. + ${Name}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.EventGrid.private\Get-AzEventGridTopicType_Get'; + GetViaIdentity = 'Az.EventGrid.private\Get-AzEventGridTopicType_GetViaIdentity'; + List = 'Az.EventGrid.private\Get-AzEventGridTopicType_List'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Get properties of a topic. +.Description +Get properties of a topic. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopic +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgridtopic +#> +function Get-AzEventGridTopic { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopic])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('TopicName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the topic. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List1', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Parameter(ParameterSetName='List1')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='List')] + [Parameter(ParameterSetName='List1')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Query')] + [System.String] + # 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}, + + [Parameter(ParameterSetName='List')] + [Parameter(ParameterSetName='List1')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Query')] + [System.Int32] + # 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}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.EventGrid.private\Get-AzEventGridTopic_Get'; + GetViaIdentity = 'Az.EventGrid.private\Get-AzEventGridTopic_GetViaIdentity'; + List = 'Az.EventGrid.private\Get-AzEventGridTopic_List'; + List1 = 'Az.EventGrid.private\Get-AzEventGridTopic_List1'; + } + if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Get properties of a verified partner. +.Description +Get properties of a verified partner. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartner +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgridverifiedpartner +#> +function Get-AzEventGridVerifiedPartner { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartner])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('VerifiedPartnerName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the verified partner. + ${Name}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Query')] + [System.String] + # 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}, + + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Query')] + [System.Int32] + # 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}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.EventGrid.private\Get-AzEventGridVerifiedPartner_Get'; + GetViaIdentity = 'Az.EventGrid.private\Get-AzEventGridVerifiedPartner_GetViaIdentity'; + List = 'Az.EventGrid.private\Get-AzEventGridVerifiedPartner_List'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Authorize a single partner either by partner registration immutable Id or by partner name. +.Description +Authorize a single partner either by partner registration immutable Id or by partner name. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartner +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfiguration +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. + +PARTNERINFO : Information about the partner. + [AuthorizationExpirationTimeInUtc ]: Expiration time of the partner authorization. If this timer expires, any request from this partner to create, update or delete resources in subscriber's context will fail. If specified, the allowed values are between 1 to the value of defaultMaximumExpirationTimeInDays specified in PartnerConfiguration. If not specified, the default value will be the value of defaultMaximumExpirationTimeInDays specified in PartnerConfiguration or 7 if this value is not specified. + [Name ]: The partner name. + [RegistrationImmutableId ]: The immutableId of the corresponding partner registration. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/grant-azeventgridpartnerconfigurationpartner +#> +function Grant-AzEventGridPartnerConfigurationPartner { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfiguration])] +[CmdletBinding(DefaultParameterSetName='AuthorizeExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Authorize', Mandatory)] + [Parameter(ParameterSetName='AuthorizeExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Authorize')] + [Parameter(ParameterSetName='AuthorizeExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='AuthorizeViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='AuthorizeViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Authorize', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='AuthorizeViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartner] + # Information about the partner. + # To construct, see NOTES section for PARTNERINFO properties and create a hash table. + ${PartnerInfo}, + + [Parameter(ParameterSetName='AuthorizeExpanded')] + [Parameter(ParameterSetName='AuthorizeViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.DateTime] + # Expiration time of the partner authorization. + # If this timer expires, any request from this partner to create, update or delete resources in subscriber'scontext will fail. + # If specified, the allowed values are between 1 to the value of defaultMaximumExpirationTimeInDays specified in PartnerConfiguration.If not specified, the default value will be the value of defaultMaximumExpirationTimeInDays specified in PartnerConfiguration or 7 if this value is not specified. + ${AuthorizationExpirationTimeInUtc}, + + [Parameter(ParameterSetName='AuthorizeExpanded')] + [Parameter(ParameterSetName='AuthorizeViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The partner name. + ${PartnerName}, + + [Parameter(ParameterSetName='AuthorizeExpanded')] + [Parameter(ParameterSetName='AuthorizeViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The immutableId of the corresponding partner registration. + ${PartnerRegistrationImmutableId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Authorize = 'Az.EventGrid.private\Grant-AzEventGridPartnerConfigurationPartner_Authorize'; + AuthorizeExpanded = 'Az.EventGrid.private\Grant-AzEventGridPartnerConfigurationPartner_AuthorizeExpanded'; + AuthorizeViaIdentity = 'Az.EventGrid.private\Grant-AzEventGridPartnerConfigurationPartner_AuthorizeViaIdentity'; + AuthorizeViaIdentityExpanded = 'Az.EventGrid.private\Grant-AzEventGridPartnerConfigurationPartner_AuthorizeViaIdentityExpanded'; + } + if (('Authorize', 'AuthorizeExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Activate a newly created partner destination. +.Description +Activate a newly created partner destination. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestination +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/initialize-azeventgridpartnerdestination +#> +function Initialize-AzEventGridPartnerDestination { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestination])] +[CmdletBinding(DefaultParameterSetName='Activate', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Activate', Mandatory)] + [Alias('PartnerDestinationName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the partner destination. + ${Name}, + + [Parameter(ParameterSetName='Activate', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Activate')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='ActivateViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Activate = 'Az.EventGrid.private\Initialize-AzEventGridPartnerDestination_Activate'; + ActivateViaIdentity = 'Az.EventGrid.private\Initialize-AzEventGridPartnerDestination_ActivateViaIdentity'; + } + if (('Activate') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Activate a newly created partner topic. +.Description +Activate a newly created partner topic. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopic +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/initialize-azeventgridpartnertopic +#> +function Initialize-AzEventGridPartnerTopic { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopic])] +[CmdletBinding(DefaultParameterSetName='Activate', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Activate', Mandatory)] + [Alias('PartnerTopicName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the partner topic. + ${Name}, + + [Parameter(ParameterSetName='Activate', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Activate')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='ActivateViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Activate = 'Az.EventGrid.private\Initialize-AzEventGridPartnerTopic_Activate'; + ActivateViaIdentity = 'Az.EventGrid.private\Initialize-AzEventGridPartnerTopic_ActivateViaIdentity'; + } + if (('Activate') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Deactivate specific partner topic. +.Description +Deactivate specific partner topic. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopic +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/invoke-azeventgriddeactivatepartnertopic +#> +function Invoke-AzEventGridDeactivatePartnerTopic { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopic])] +[CmdletBinding(DefaultParameterSetName='Deactivate', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Deactivate', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the partner topic. + ${PartnerTopicName}, + + [Parameter(ParameterSetName='Deactivate', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Deactivate')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeactivateViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Deactivate = 'Az.EventGrid.private\Invoke-AzEventGridDeactivatePartnerTopic_Deactivate'; + DeactivateViaIdentity = 'Az.EventGrid.private\Invoke-AzEventGridDeactivatePartnerTopic_DeactivateViaIdentity'; + } + if (('Deactivate') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Unauthorize a single partner either by partner registration immutable Id or by partner name. +.Description +Unauthorize a single partner either by partner registration immutable Id or by partner name. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartner +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfiguration +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. + +PARTNERINFO : Information about the partner. + [AuthorizationExpirationTimeInUtc ]: Expiration time of the partner authorization. If this timer expires, any request from this partner to create, update or delete resources in subscriber's context will fail. If specified, the allowed values are between 1 to the value of defaultMaximumExpirationTimeInDays specified in PartnerConfiguration. If not specified, the default value will be the value of defaultMaximumExpirationTimeInDays specified in PartnerConfiguration or 7 if this value is not specified. + [Name ]: The partner name. + [RegistrationImmutableId ]: The immutableId of the corresponding partner registration. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/invoke-azeventgridpartnerconfigurationunauthorize +#> +function Invoke-AzEventGridPartnerConfigurationUnauthorize { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfiguration])] +[CmdletBinding(DefaultParameterSetName='PartnerExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Partner', Mandatory)] + [Parameter(ParameterSetName='PartnerExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Partner')] + [Parameter(ParameterSetName='PartnerExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='PartnerViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='PartnerViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Partner', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='PartnerViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartner] + # Information about the partner. + # To construct, see NOTES section for PARTNERINFO properties and create a hash table. + ${PartnerInfo}, + + [Parameter(ParameterSetName='PartnerExpanded')] + [Parameter(ParameterSetName='PartnerViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.DateTime] + # Expiration time of the partner authorization. + # If this timer expires, any request from this partner to create, update or delete resources in subscriber'scontext will fail. + # If specified, the allowed values are between 1 to the value of defaultMaximumExpirationTimeInDays specified in PartnerConfiguration.If not specified, the default value will be the value of defaultMaximumExpirationTimeInDays specified in PartnerConfiguration or 7 if this value is not specified. + ${AuthorizationExpirationTimeInUtc}, + + [Parameter(ParameterSetName='PartnerExpanded')] + [Parameter(ParameterSetName='PartnerViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The partner name. + ${PartnerName}, + + [Parameter(ParameterSetName='PartnerExpanded')] + [Parameter(ParameterSetName='PartnerViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The immutableId of the corresponding partner registration. + ${PartnerRegistrationImmutableId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Partner = 'Az.EventGrid.private\Invoke-AzEventGridPartnerConfigurationUnauthorize_Partner'; + PartnerExpanded = 'Az.EventGrid.private\Invoke-AzEventGridPartnerConfigurationUnauthorize_PartnerExpanded'; + PartnerViaIdentity = 'Az.EventGrid.private\Invoke-AzEventGridPartnerConfigurationUnauthorize_PartnerViaIdentity'; + PartnerViaIdentityExpanded = 'Az.EventGrid.private\Invoke-AzEventGridPartnerConfigurationUnauthorize_PartnerViaIdentityExpanded'; + } + if (('Partner', 'PartnerExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Synchronously creates or updates a new channel with the specified parameters. +.Description +Synchronously creates or updates a new channel with the specified parameters. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannel +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +PARTNERDESTINATIONINFORESOURCEMOVECHANGEHISTORY : Change history of the resource move. + [AzureSubscriptionId ]: Azure subscription ID of the resource. + [ChangedTimeUtc ]: UTC timestamp of when the resource was changed. + [ResourceGroupName ]: Azure Resource Group of the resource. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/new-azeventgridchannel +#> +function New-AzEventGridChannel { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannel])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Alias('ChannelName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the channel. + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the partner namespace. + ${PartnerNamespaceName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the partners subscription. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ChannelType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ChannelType] + # The type of the event channel which represents the direction flow of events. + ${ChannelType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInlineEventTypes]))] + [System.Collections.Hashtable] + # A collection of inline event types for the resource. + # The inline event type keys are of type string which represents the name of the event.An example of a valid inline event name is "Contoso.OrderCreated".The inline event type values are of type InlineEventProperties and will contain additional information for every inline event type. + ${EventTypeInfoInlineEventType}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind] + # The kind of event type used. + ${EventTypeInfoKind}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.DateTime] + # Expiration time of the channel. + # If this timer expires while the corresponding partner topic is never activated,the channel and corresponding partner topic are deleted. + ${ExpirationTimeIfNotActivatedUtc}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # Context or helpful message that can be used during the approval process by the subscriber. + ${MessageForActivation}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # Azure subscription ID of the subscriber. + # The partner destination associated with the channel will becreated under this Azure subscription. + ${PartnerDestinationInfoAzureSubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # Additional context of the partner destination endpoint. + ${PartnerDestinationInfoEndpointServiceContext}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # Name of the partner destination associated with the channel. + ${PartnerDestinationInfoName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # Azure Resource Group of the subscriber. + # The partner destination associated with the channel will becreated under this resource group. + ${PartnerDestinationInfoResourceGroupName}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceMoveChangeHistory[]] + # Change history of the resource move. + # To construct, see NOTES section for PARTNERDESTINATIONINFORESOURCEMOVECHANGEHISTORY properties and create a hash table. + ${PartnerDestinationInfoResourceMoveChangeHistory}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # Azure subscription ID of the subscriber. + # The partner topic associated with the channel will becreated under this Azure subscription. + ${PartnerTopicInfoAzureSubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # Name of the partner topic associated with the channel. + ${PartnerTopicInfoName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # Azure Resource Group of the subscriber. + # The partner topic associated with the channel will becreated under this resource group. + ${PartnerTopicInfoResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The source information is provided by the publisher to determine the scope or context from which the eventsare originating. + # This information can be used by the subscriber during the approval process of thecreated partner topic. + ${PartnerTopicInfoSource}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ChannelProvisioningState])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ChannelProvisioningState] + # Provisioning state of the channel. + ${ProvisioningState}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ReadinessState])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ReadinessState] + # The readiness state of the corresponding partner topic. + ${ReadinessState}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.EventGrid.private\New-AzEventGridChannel_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Asynchronously creates a new event subscription or updates an existing event subscription. +.Description +Asynchronously creates a new event subscription or updates an existing event subscription. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +FILTERADVANCEDFILTER : An array of advanced filters that are used for filtering event subscriptions. + OperatorType : The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. + [Key ]: The field/property in the event based on which you want to filter. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/new-azeventgriddomaineventsubscription +#> +function New-AzEventGridDomainEventSubscription { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the domain topic. + ${DomainName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # 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. + ${EventSubscriptionName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.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. + ${DeadLetterWithResourceIdentityType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The user identity associated with the resource. + ${DeadLetterWithResourceIdentityUserAssignedIdentity}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType] + # Type of the endpoint for the event subscription destination. + ${DeliveryWithResourceIdentityDestinationEndpointType}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.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. + ${DeliveryWithResourceIdentityType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The user identity associated with the resource. + ${DeliveryWithResourceIdentityUserAssignedIdentity}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType] + # Type of the endpoint for the event subscription destination. + ${EndpointType}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema] + # The event delivery schema for the event subscription. + ${EventDeliverySchema}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.DateTime] + # Expiration time of the event subscription. + ${ExpirationTimeUtc}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[]] + # An array of advanced filters that are used for filtering event subscriptions. + # To construct, see NOTES section for FILTERADVANCEDFILTER properties and create a hash table. + ${FilterAdvancedFilter}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Allows advanced filters to be evaluated against an array of values instead of expecting a singular value. + ${FilterEnableAdvancedFilteringOnArray}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String[]] + # 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. + ${FilterIncludedEventType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filtershould be compared in a case sensitive manner. + ${FilterIsSubjectCaseSensitive}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # An optional string to filter events for an event subscription based on a resource path prefix.The format of this depends on the publisher of the events.Wildcard characters are not supported in this path. + ${FilterSubjectBeginsWith}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # An optional string to filter events for an event subscription based on a resource path suffix.Wildcard characters are not supported in this path. + ${FilterSubjectEndsWith}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String[]] + # List of user defined labels. + ${Label}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Int32] + # Time To Live (in minutes) for events. + ${RetryPolicyEventTimeToLiveInMinute}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Int32] + # Maximum number of delivery retry attempts for events. + ${RetryPolicyMaxDeliveryAttempt}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.EventGrid.private\New-AzEventGridDomainEventSubscription_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Regenerate a shared access key for a domain. +.Description +Regenerate a shared access key for a domain. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainRegenerateKeyRequest +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainSharedAccessKeys +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. + +REGENERATEKEYREQUEST : Domain regenerate share access key request. + KeyName : Key name to regenerate key1 or key2. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/new-azeventgriddomainkey +#> +function New-AzEventGridDomainKey { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainSharedAccessKeys])] +[CmdletBinding(DefaultParameterSetName='RegenerateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Regenerate', Mandatory)] + [Parameter(ParameterSetName='RegenerateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the domain. + ${DomainName}, + + [Parameter(ParameterSetName='Regenerate', Mandatory)] + [Parameter(ParameterSetName='RegenerateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Regenerate')] + [Parameter(ParameterSetName='RegenerateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='RegenerateViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='RegenerateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Regenerate', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='RegenerateViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainRegenerateKeyRequest] + # Domain regenerate share access key request. + # To construct, see NOTES section for REGENERATEKEYREQUEST properties and create a hash table. + ${RegenerateKeyRequest}, + + [Parameter(ParameterSetName='RegenerateExpanded', Mandatory)] + [Parameter(ParameterSetName='RegenerateViaIdentityExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # Key name to regenerate key1 or key2. + ${KeyName}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Regenerate = 'Az.EventGrid.private\New-AzEventGridDomainKey_Regenerate'; + RegenerateExpanded = 'Az.EventGrid.private\New-AzEventGridDomainKey_RegenerateExpanded'; + RegenerateViaIdentity = 'Az.EventGrid.private\New-AzEventGridDomainKey_RegenerateViaIdentity'; + RegenerateViaIdentityExpanded = 'Az.EventGrid.private\New-AzEventGridDomainKey_RegenerateViaIdentityExpanded'; + } + if (('Regenerate', 'RegenerateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Asynchronously creates a new event subscription or updates an existing event subscription. +.Description +Asynchronously creates a new event subscription or updates an existing event subscription. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +FILTERADVANCEDFILTER : An array of advanced filters that are used for filtering event subscriptions. + OperatorType : The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. + [Key ]: The field/property in the event based on which you want to filter. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/new-azeventgriddomaintopiceventsubscription +#> +function New-AzEventGridDomainTopicEventSubscription { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the top level domain. + ${DomainName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # 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. + ${EventSubscriptionName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the domain topic. + ${TopicName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.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. + ${DeadLetterWithResourceIdentityType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The user identity associated with the resource. + ${DeadLetterWithResourceIdentityUserAssignedIdentity}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType] + # Type of the endpoint for the event subscription destination. + ${DeliveryWithResourceIdentityDestinationEndpointType}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.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. + ${DeliveryWithResourceIdentityType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The user identity associated with the resource. + ${DeliveryWithResourceIdentityUserAssignedIdentity}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType] + # Type of the endpoint for the event subscription destination. + ${EndpointType}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema] + # The event delivery schema for the event subscription. + ${EventDeliverySchema}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.DateTime] + # Expiration time of the event subscription. + ${ExpirationTimeUtc}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[]] + # An array of advanced filters that are used for filtering event subscriptions. + # To construct, see NOTES section for FILTERADVANCEDFILTER properties and create a hash table. + ${FilterAdvancedFilter}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Allows advanced filters to be evaluated against an array of values instead of expecting a singular value. + ${FilterEnableAdvancedFilteringOnArray}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String[]] + # 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. + ${FilterIncludedEventType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filtershould be compared in a case sensitive manner. + ${FilterIsSubjectCaseSensitive}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # An optional string to filter events for an event subscription based on a resource path prefix.The format of this depends on the publisher of the events.Wildcard characters are not supported in this path. + ${FilterSubjectBeginsWith}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # An optional string to filter events for an event subscription based on a resource path suffix.Wildcard characters are not supported in this path. + ${FilterSubjectEndsWith}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String[]] + # List of user defined labels. + ${Label}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Int32] + # Time To Live (in minutes) for events. + ${RetryPolicyEventTimeToLiveInMinute}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Int32] + # Maximum number of delivery retry attempts for events. + ${RetryPolicyMaxDeliveryAttempt}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.EventGrid.private\New-AzEventGridDomainTopicEventSubscription_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Asynchronously creates or updates a new domain with the specified parameters. +.Description +Asynchronously creates or updates a new domain with the specified parameters. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INBOUNDIPRULE : This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess is enabled. + [Action ]: Action to perform based on the match or no match of the IpMask. + [IPMask ]: IP Address in CIDR notation e.g., 10.0.0.0/8. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/new-azeventgriddomain +#> +function New-AzEventGridDomain { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Alias('DomainName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the domain. + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # Location of the resource. + ${Location}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Management.Automation.SwitchParameter] + # This Boolean is used to specify the creation mechanism for 'all' the Event Grid Domain Topics associated with this Event Grid Domain resource.In this context, creation of domain topic can be auto-managed (when true) or self-managed (when false). + # The default value for this property is true.When this property is null or set to true, Event Grid is responsible of automatically creating the domain topic when the first event subscription iscreated at the scope of the domain topic. + # If this property is set to false, then creating the first event subscription will require creating a domain topicby the user. + # The self-management mode can be used if the user wants full control of when the domain topic is created, while auto-managed mode provides theflexibility to perform less operations and manage fewer resources by the user. + # Also, note that in auto-managed creation mode, user is allowed to create thedomain topic on demand if needed. + ${AutoCreateTopicWithFirstSubscription}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Management.Automation.SwitchParameter] + # This Boolean is used to specify the deletion mechanism for 'all' the Event Grid Domain Topics associated with this Event Grid Domain resource.In this context, deletion of domain topic can be auto-managed (when true) or self-managed (when false). + # The default value for this property is true.When this property is set to true, Event Grid is responsible of automatically deleting the domain topic when the last event subscription at the scopeof the domain topic is deleted. + # If this property is set to false, then the user needs to manually delete the domain topic when it is no longer needed(e.g., when last event subscription is deleted and the resource needs to be cleaned up). + # The self-management mode can be used if the user wants fullcontrol of when the domain topic needs to be deleted, while auto-managed mode provides the flexibility to perform less operations and manage fewerresources by the user. + ${AutoDeleteTopicWithLastSubscription}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary] + # Data Residency Boundary of the resource. + ${DataResidencyBoundary}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Management.Automation.SwitchParameter] + # This boolean is used to enable or disable local auth. + # Default value is false. + # When the property is set to true, only AAD token will be used to authenticate if user is allowed to publish to the domain. + ${DisableLocalAuth}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The principal ID of resource identity. + ${IdentityPrincipalId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The tenant ID of resource. + ${IdentityTenantId}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType] + # 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. + ${IdentityType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities]))] + [System.Collections.Hashtable] + # The list of user identities associated with the resource. + # The user identity dictionary key references will be ARM resource ids in the form:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.This property is currently not used and reserved for future usage. + ${IdentityUserAssignedIdentity}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[]] + # This can be used to restrict traffic from specific IPs instead of all IPs. + # Note: These are considered only if PublicNetworkAccess is enabled. + # To construct, see NOTES section for INBOUNDIPRULE properties and create a hash table. + ${InboundIPRule}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.InputSchema])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.InputSchema] + # This determines the format that Event Grid should expect for incoming events published to the Event Grid Domain Resource. + ${InputSchema}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess] + # This determines if traffic is allowed over public network. + # By default it is enabled.You can further restrict to specific IPs by configuring + ${PublicNetworkAccess}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku] + # The Sku name of the resource. + # The possible values are: Basic or Premium. + ${SkuName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceTags]))] + [System.Collections.Hashtable] + # Tags of the resource. + ${Tag}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.EventGrid.private\New-AzEventGridDomain_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Asynchronously creates a new event channel with the specified parameters. +.Description +Asynchronously creates a new event channel with the specified parameters. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannel +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +FILTERADVANCEDFILTER : An array of advanced filters that are used for filtering event channels. + OperatorType : The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. + [Key ]: The field/property in the event based on which you want to filter. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/new-azeventgrideventchannel +#> +function New-AzEventGridEventChannel { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannel])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Alias('EventChannelName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the event channel. + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the partner namespace. + ${PartnerNamespaceName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # Azure subscription ID of the customer creating the event channel. + # The partner topicassociated with the event channel will be created under this Azure subscription. + ${DestinationAzureSubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # Name of the partner topic associated with the event channel. + ${DestinationPartnerTopicName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # Azure Resource Group of the customer creating the event channel. + # The partner topicassociated with the event channel will be created under this resource group. + ${DestinationResourceGroup}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The identifier of the resource that's the source of the events.This represents a unique resource in the partner's resource model. + ${EventChannelSource}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.DateTime] + # Expiration time of the event channel. + # If this timer expires while the corresponding partner topic is never activated,the event channel and corresponding partner topic are deleted. + ${ExpirationTimeIfNotActivatedUtc}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[]] + # An array of advanced filters that are used for filtering event channels. + # To construct, see NOTES section for FILTERADVANCEDFILTER properties and create a hash table. + ${FilterAdvancedFilter}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Allows advanced filters to be evaluated against an array of values instead of expecting a singular value. + # The default value is either false or null. + ${FilterEnableAdvancedFilteringOnArray}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # Friendly description about the topic. + # This can be set by the publisher/partner to show custom description for the customer partner topic.This will be helpful to remove any ambiguity of the origin of creation of the partner topic for the customer. + ${PartnerTopicFriendlyDescription}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.EventGrid.private\New-AzEventGridEventChannel_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Asynchronously creates a new event subscription or updates an existing event subscription based on the specified scope. +.Description +Asynchronously creates a new event subscription or updates an existing event subscription based on the specified scope. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +FILTERADVANCEDFILTER : An array of advanced filters that are used for filtering event subscriptions. + OperatorType : The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. + [Key ]: The field/property in the event based on which you want to filter. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/new-azeventgrideventsubscription +#> +function New-AzEventGridEventSubscription { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Alias('EventSubscriptionName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the event subscription. + # Event subscription names must be between 3 and 64 characters in length and should use alphanumeric letters only. + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # 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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + ${Scope}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.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. + ${DeadLetterWithResourceIdentityType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The user identity associated with the resource. + ${DeadLetterWithResourceIdentityUserAssignedIdentity}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType] + # Type of the endpoint for the event subscription destination. + ${DeliveryWithResourceIdentityDestinationEndpointType}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.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. + ${DeliveryWithResourceIdentityType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The user identity associated with the resource. + ${DeliveryWithResourceIdentityUserAssignedIdentity}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType] + # Type of the endpoint for the event subscription destination. + ${EndpointType}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema] + # The event delivery schema for the event subscription. + ${EventDeliverySchema}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.DateTime] + # Expiration time of the event subscription. + ${ExpirationTimeUtc}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[]] + # An array of advanced filters that are used for filtering event subscriptions. + # To construct, see NOTES section for FILTERADVANCEDFILTER properties and create a hash table. + ${FilterAdvancedFilter}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Allows advanced filters to be evaluated against an array of values instead of expecting a singular value. + ${FilterEnableAdvancedFilteringOnArray}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String[]] + # 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. + ${FilterIncludedEventType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filtershould be compared in a case sensitive manner. + ${FilterIsSubjectCaseSensitive}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # An optional string to filter events for an event subscription based on a resource path prefix.The format of this depends on the publisher of the events.Wildcard characters are not supported in this path. + ${FilterSubjectBeginsWith}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # An optional string to filter events for an event subscription based on a resource path suffix.Wildcard characters are not supported in this path. + ${FilterSubjectEndsWith}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String[]] + # List of user defined labels. + ${Label}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Int32] + # Time To Live (in minutes) for events. + ${RetryPolicyEventTimeToLiveInMinute}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Int32] + # Maximum number of delivery retry attempts for events. + ${RetryPolicyMaxDeliveryAttempt}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.EventGrid.private\New-AzEventGridEventSubscription_CreateExpanded'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Synchronously creates or updates a partner configuration with the specified parameters. +.Description +Synchronously creates or updates a partner configuration with the specified parameters. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfiguration +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +PARTNERAUTHORIZATIONAUTHORIZEDPARTNERSLIST : The list of authorized partners. + [AuthorizationExpirationTimeInUtc ]: Expiration time of the partner authorization. If this timer expires, any request from this partner to create, update or delete resources in subscriber's context will fail. If specified, the allowed values are between 1 to the value of defaultMaximumExpirationTimeInDays specified in PartnerConfiguration. If not specified, the default value will be the value of defaultMaximumExpirationTimeInDays specified in PartnerConfiguration or 7 if this value is not specified. + [Name ]: The partner name. + [RegistrationImmutableId ]: The immutableId of the corresponding partner registration. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/new-azeventgridpartnerconfiguration +#> +function New-AzEventGridPartnerConfiguration { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfiguration])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # Location of the resource. + ${Location}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartner[]] + # The list of authorized partners. + # To construct, see NOTES section for PARTNERAUTHORIZATIONAUTHORIZEDPARTNERSLIST properties and create a hash table. + ${PartnerAuthorizationAuthorizedPartnersList}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Int32] + # Time used to validate the authorization expiration time for each authorized partner. + # If DefaultMaximumExpirationTimeInDays isnot specified, the default is 7 days. + # Otherwise, allowed values are between 1 and 365 days. + ${PartnerAuthorizationDefaultMaximumExpirationTimeInDay}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerConfigurationProvisioningState])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerConfigurationProvisioningState] + # Provisioning state of the partner configuration. + ${ProvisioningState}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationTags]))] + [System.Collections.Hashtable] + # Tags of the resource. + ${Tag}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.EventGrid.private\New-AzEventGridPartnerConfiguration_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Asynchronously creates a new partner destination with the specified parameters. +.Description +Asynchronously creates a new partner destination with the specified parameters. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestination +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/new-azeventgridpartnerdestination +#> +function New-AzEventGridPartnerDestination { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestination])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Alias('PartnerDestinationName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the partner destination. + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # Location of the resource. + ${Location}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerDestinationActivationState])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerDestinationActivationState] + # Activation state of the partner destination. + ${ActivationState}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # Endpoint Base URL of the partner destination + ${EndpointBaseUrl}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # Endpoint context associated with this partner destination. + ${EndpointServiceContext}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.DateTime] + # 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}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # Context or helpful message that can be used during the approval process. + ${MessageForActivation}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The immutable Id of the corresponding partner registration. + ${PartnerRegistrationImmutableId}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerDestinationProvisioningState])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerDestinationProvisioningState] + # Provisioning state of the partner destination. + ${ProvisioningState}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceTags]))] + [System.Collections.Hashtable] + # Tags of the resource. + ${Tag}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.EventGrid.private\New-AzEventGridPartnerDestination_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Regenerate a shared access key for a partner namespace. +.Description +Regenerate a shared access key for a partner namespace. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceRegenerateKeyRequest +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceSharedAccessKeys +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. + +REGENERATEKEYREQUEST : PartnerNamespace regenerate shared access key request. + KeyName : Key name to regenerate (key1 or key2). +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/new-azeventgridpartnernamespacekey +#> +function New-AzEventGridPartnerNamespaceKey { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceSharedAccessKeys])] +[CmdletBinding(DefaultParameterSetName='RegenerateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Regenerate', Mandatory)] + [Parameter(ParameterSetName='RegenerateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the partner namespace. + ${PartnerNamespaceName}, + + [Parameter(ParameterSetName='Regenerate', Mandatory)] + [Parameter(ParameterSetName='RegenerateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Regenerate')] + [Parameter(ParameterSetName='RegenerateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='RegenerateViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='RegenerateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Regenerate', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='RegenerateViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceRegenerateKeyRequest] + # PartnerNamespace regenerate shared access key request. + # To construct, see NOTES section for REGENERATEKEYREQUEST properties and create a hash table. + ${RegenerateKeyRequest}, + + [Parameter(ParameterSetName='RegenerateExpanded', Mandatory)] + [Parameter(ParameterSetName='RegenerateViaIdentityExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # Key name to regenerate (key1 or key2). + ${KeyName}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Regenerate = 'Az.EventGrid.private\New-AzEventGridPartnerNamespaceKey_Regenerate'; + RegenerateExpanded = 'Az.EventGrid.private\New-AzEventGridPartnerNamespaceKey_RegenerateExpanded'; + RegenerateViaIdentity = 'Az.EventGrid.private\New-AzEventGridPartnerNamespaceKey_RegenerateViaIdentity'; + RegenerateViaIdentityExpanded = 'Az.EventGrid.private\New-AzEventGridPartnerNamespaceKey_RegenerateViaIdentityExpanded'; + } + if (('Regenerate', 'RegenerateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Asynchronously creates a new partner namespace with the specified parameters. +.Description +Asynchronously creates a new partner namespace with the specified parameters. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INBOUNDIPRULE : This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess is enabled. + [Action ]: Action to perform based on the match or no match of the IpMask. + [IPMask ]: IP Address in CIDR notation e.g., 10.0.0.0/8. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/new-azeventgridpartnernamespace +#> +function New-AzEventGridPartnerNamespace { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Alias('PartnerNamespaceName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the partner namespace. + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # Location of the resource. + ${Location}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Management.Automation.SwitchParameter] + # This boolean is used to enable or disable local auth. + # Default value is false. + # When the property is set to true, only AAD token will be used to authenticate if user is allowed to publish to the partner namespace. + ${DisableLocalAuth}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[]] + # This can be used to restrict traffic from specific IPs instead of all IPs. + # Note: These are considered only if PublicNetworkAccess is enabled. + # To construct, see NOTES section for INBOUNDIPRULE properties and create a hash table. + ${InboundIPRule}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # 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}. + ${PartnerRegistrationFullyQualifiedId}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicRoutingMode])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicRoutingMode] + # This determines if events published to this partner namespace should use the source attribute in the event payloador use the channel name in the header when matching to the partner topic. + # If none is specified, source attribute routing will be used to match the partner topic. + ${PartnerTopicRoutingMode}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess] + # This determines if traffic is allowed over public network. + # By default it is enabled.You can further restrict to specific IPs by configuring + ${PublicNetworkAccess}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceTags]))] + [System.Collections.Hashtable] + # Tags of the resource. + ${Tag}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.EventGrid.private\New-AzEventGridPartnerNamespace_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Creates a new partner registration with the specified parameters. +.Description +Creates a new partner registration with the specified parameters. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistration +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/new-azeventgridpartnerregistration +#> +function New-AzEventGridPartnerRegistration { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistration])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Alias('PartnerRegistrationName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the partner registration. + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # Location of the resource. + ${Location}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String[]] + # List of Azure subscription Ids that are authorized to create a partner namespaceassociated with this partner registration. + # This is an optional property. + # Creatingpartner namespaces is always permitted under the same Azure subscription as the one usedfor creating the partner registration. + ${AuthorizedAzureSubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The extension of the customer service URI of the publisher. + ${CustomerServiceUri}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # URI of the logo. + ${LogoUri}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # Long description for the custom scenarios and integration to be displayed in the portal if needed.Length of this description should not exceed 2048 characters. + ${LongDescription}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The extension of the customer service number of the publisher. + # Only digits are allowed and number of digits should not exceed 10. + ${PartnerCustomerServiceExtension}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The customer service number of the publisher. + # The expected phone format should start with a '+' sign followed by the country code. + # The remaining digits are then followed. + # Only digits and spaces are allowed and itslength cannot exceed 16 digits including country code. + # Examples of valid phone numbers are: +1 515 123 4567 and+966 7 5115 2471. + # Examples of invalid phone numbers are: +1 (515) 123-4567, 1 515 123 4567 and +966 121 5115 24 7 551 1234 43 + ${PartnerCustomerServiceNumber}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # Official name of the partner name. + # For example: "Contoso". + ${PartnerName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The immutableId of the corresponding partner registration. + ${PartnerRegistrationImmutableId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # Short description of the partner resource type. + # The length of this description should not exceed 256 characters. + ${PartnerResourceTypeDescription}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # Display name of the partner resource type. + ${PartnerResourceTypeDisplayName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # Name of the partner resource type. + ${PartnerResourceTypeName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # URI of the partner website that can be used by Azure customers to setup Event Gridintegration on an event source. + ${SetupUri}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceTags]))] + [System.Collections.Hashtable] + # Tags of the resource. + ${Tag}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerRegistrationVisibilityState])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerRegistrationVisibilityState] + # Visibility state of the partner registration. + ${VisibilityState}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.EventGrid.private\New-AzEventGridPartnerRegistration_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Asynchronously creates or updates an event subscription of a partner topic with the specified parameters. +Existing event subscriptions will be updated with this API. +.Description +Asynchronously creates or updates an event subscription of a partner topic with the specified parameters. +Existing event subscriptions will be updated with this API. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +FILTERADVANCEDFILTER : An array of advanced filters that are used for filtering event subscriptions. + OperatorType : The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. + [Key ]: The field/property in the event based on which you want to filter. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/new-azeventgridpartnertopiceventsubscription +#> +function New-AzEventGridPartnerTopicEventSubscription { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # 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. + ${EventSubscriptionName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the partner topic. + ${PartnerTopicName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.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. + ${DeadLetterWithResourceIdentityType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The user identity associated with the resource. + ${DeadLetterWithResourceIdentityUserAssignedIdentity}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType] + # Type of the endpoint for the event subscription destination. + ${DeliveryWithResourceIdentityDestinationEndpointType}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.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. + ${DeliveryWithResourceIdentityType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The user identity associated with the resource. + ${DeliveryWithResourceIdentityUserAssignedIdentity}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType] + # Type of the endpoint for the event subscription destination. + ${EndpointType}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema] + # The event delivery schema for the event subscription. + ${EventDeliverySchema}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.DateTime] + # Expiration time of the event subscription. + ${ExpirationTimeUtc}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[]] + # An array of advanced filters that are used for filtering event subscriptions. + # To construct, see NOTES section for FILTERADVANCEDFILTER properties and create a hash table. + ${FilterAdvancedFilter}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Allows advanced filters to be evaluated against an array of values instead of expecting a singular value. + ${FilterEnableAdvancedFilteringOnArray}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String[]] + # 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. + ${FilterIncludedEventType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filtershould be compared in a case sensitive manner. + ${FilterIsSubjectCaseSensitive}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # An optional string to filter events for an event subscription based on a resource path prefix.The format of this depends on the publisher of the events.Wildcard characters are not supported in this path. + ${FilterSubjectBeginsWith}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # An optional string to filter events for an event subscription based on a resource path suffix.Wildcard characters are not supported in this path. + ${FilterSubjectEndsWith}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String[]] + # List of user defined labels. + ${Label}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Int32] + # Time To Live (in minutes) for events. + ${RetryPolicyEventTimeToLiveInMinute}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Int32] + # Maximum number of delivery retry attempts for events. + ${RetryPolicyMaxDeliveryAttempt}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.EventGrid.private\New-AzEventGridPartnerTopicEventSubscription_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Asynchronously creates a new partner topic with the specified parameters. +.Description +Asynchronously creates a new partner topic with the specified parameters. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopic +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/new-azeventgridpartnertopic +#> +function New-AzEventGridPartnerTopic { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopic])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Alias('PartnerTopicName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the partner topic. + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # Location of the resource. + ${Location}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicActivationState])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicActivationState] + # Activation state of the partner topic. + ${ActivationState}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInlineEventTypes]))] + [System.Collections.Hashtable] + # A collection of inline event types for the resource. + # The inline event type keys are of type string which represents the name of the event.An example of a valid inline event name is "Contoso.OrderCreated".The inline event type values are of type InlineEventProperties and will contain additional information for every inline event type. + ${EventTypeInfoInlineEventType}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind] + # The kind of event type used. + ${EventTypeInfoKind}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.DateTime] + # Expiration time of the partner topic. + # If this timer expires while the partner topic is still never activated,the partner topic and corresponding event channel are deleted. + ${ExpirationTimeIfNotActivatedUtc}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The principal ID of resource identity. + ${IdentityPrincipalId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The tenant ID of resource. + ${IdentityTenantId}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType] + # 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. + ${IdentityType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities]))] + [System.Collections.Hashtable] + # The list of user identities associated with the resource. + # The user identity dictionary key references will be ARM resource ids in the form:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.This property is currently not used and reserved for future usage. + ${IdentityUserAssignedIdentity}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # Context or helpful message that can be used during the approval process by the subscriber. + ${MessageForActivation}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The immutableId of the corresponding partner registration. + ${PartnerRegistrationImmutableId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # Friendly description about the topic. + # This can be set by the publisher/partner to show custom description for the customer partner topic.This will be helpful to remove any ambiguity of the origin of creation of the partner topic for the customer. + ${PartnerTopicFriendlyDescription}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # Source associated with this partner topic. + # This represents a unique partner resource. + ${Source}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceTags]))] + [System.Collections.Hashtable] + # Tags of the resource. + ${Tag}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.EventGrid.private\New-AzEventGridPartnerTopic_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Asynchronously creates or updates an event subscription with the specified parameters. +Existing event subscriptions will be updated with this API. +.Description +Asynchronously creates or updates an event subscription with the specified parameters. +Existing event subscriptions will be updated with this API. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +FILTERADVANCEDFILTER : An array of advanced filters that are used for filtering event subscriptions. + OperatorType : The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. + [Key ]: The field/property in the event based on which you want to filter. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/new-azeventgridsystemtopiceventsubscription +#> +function New-AzEventGridSystemTopicEventSubscription { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # 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. + ${EventSubscriptionName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the system topic. + ${SystemTopicName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.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. + ${DeadLetterWithResourceIdentityType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The user identity associated with the resource. + ${DeadLetterWithResourceIdentityUserAssignedIdentity}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType] + # Type of the endpoint for the event subscription destination. + ${DeliveryWithResourceIdentityDestinationEndpointType}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.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. + ${DeliveryWithResourceIdentityType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The user identity associated with the resource. + ${DeliveryWithResourceIdentityUserAssignedIdentity}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType] + # Type of the endpoint for the event subscription destination. + ${EndpointType}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema] + # The event delivery schema for the event subscription. + ${EventDeliverySchema}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.DateTime] + # Expiration time of the event subscription. + ${ExpirationTimeUtc}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[]] + # An array of advanced filters that are used for filtering event subscriptions. + # To construct, see NOTES section for FILTERADVANCEDFILTER properties and create a hash table. + ${FilterAdvancedFilter}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Allows advanced filters to be evaluated against an array of values instead of expecting a singular value. + ${FilterEnableAdvancedFilteringOnArray}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String[]] + # 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. + ${FilterIncludedEventType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filtershould be compared in a case sensitive manner. + ${FilterIsSubjectCaseSensitive}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # An optional string to filter events for an event subscription based on a resource path prefix.The format of this depends on the publisher of the events.Wildcard characters are not supported in this path. + ${FilterSubjectBeginsWith}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # An optional string to filter events for an event subscription based on a resource path suffix.Wildcard characters are not supported in this path. + ${FilterSubjectEndsWith}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String[]] + # List of user defined labels. + ${Label}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Int32] + # Time To Live (in minutes) for events. + ${RetryPolicyEventTimeToLiveInMinute}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Int32] + # Maximum number of delivery retry attempts for events. + ${RetryPolicyMaxDeliveryAttempt}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.EventGrid.private\New-AzEventGridSystemTopicEventSubscription_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Asynchronously creates a new system topic with the specified parameters. +.Description +Asynchronously creates a new system topic with the specified parameters. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopic +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/new-azeventgridsystemtopic +#> +function New-AzEventGridSystemTopic { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopic])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Alias('SystemTopicName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the system topic. + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # Location of the resource. + ${Location}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The principal ID of resource identity. + ${IdentityPrincipalId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The tenant ID of resource. + ${IdentityTenantId}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType] + # 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. + ${IdentityType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities]))] + [System.Collections.Hashtable] + # The list of user identities associated with the resource. + # The user identity dictionary key references will be ARM resource ids in the form:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.This property is currently not used and reserved for future usage. + ${IdentityUserAssignedIdentity}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # Source for the system topic. + ${Source}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceTags]))] + [System.Collections.Hashtable] + # Tags of the resource. + ${Tag}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # TopicType for the system topic. + ${TopicType}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.EventGrid.private\New-AzEventGridSystemTopic_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Asynchronously creates a new event subscription or updates an existing event subscription. +.Description +Asynchronously creates a new event subscription or updates an existing event subscription. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +FILTERADVANCEDFILTER : An array of advanced filters that are used for filtering event subscriptions. + OperatorType : The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. + [Key ]: The field/property in the event based on which you want to filter. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/new-azeventgridtopiceventsubscription +#> +function New-AzEventGridTopicEventSubscription { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # 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. + ${EventSubscriptionName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the domain topic. + ${TopicName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.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. + ${DeadLetterWithResourceIdentityType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The user identity associated with the resource. + ${DeadLetterWithResourceIdentityUserAssignedIdentity}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType] + # Type of the endpoint for the event subscription destination. + ${DeliveryWithResourceIdentityDestinationEndpointType}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.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. + ${DeliveryWithResourceIdentityType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The user identity associated with the resource. + ${DeliveryWithResourceIdentityUserAssignedIdentity}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType] + # Type of the endpoint for the event subscription destination. + ${EndpointType}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema] + # The event delivery schema for the event subscription. + ${EventDeliverySchema}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.DateTime] + # Expiration time of the event subscription. + ${ExpirationTimeUtc}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[]] + # An array of advanced filters that are used for filtering event subscriptions. + # To construct, see NOTES section for FILTERADVANCEDFILTER properties and create a hash table. + ${FilterAdvancedFilter}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Allows advanced filters to be evaluated against an array of values instead of expecting a singular value. + ${FilterEnableAdvancedFilteringOnArray}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String[]] + # 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. + ${FilterIncludedEventType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filtershould be compared in a case sensitive manner. + ${FilterIsSubjectCaseSensitive}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # An optional string to filter events for an event subscription based on a resource path prefix.The format of this depends on the publisher of the events.Wildcard characters are not supported in this path. + ${FilterSubjectBeginsWith}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # An optional string to filter events for an event subscription based on a resource path suffix.Wildcard characters are not supported in this path. + ${FilterSubjectEndsWith}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String[]] + # List of user defined labels. + ${Label}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Int32] + # Time To Live (in minutes) for events. + ${RetryPolicyEventTimeToLiveInMinute}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Int32] + # Maximum number of delivery retry attempts for events. + ${RetryPolicyMaxDeliveryAttempt}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.EventGrid.private\New-AzEventGridTopicEventSubscription_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Regenerate a shared access key for a topic. +.Description +Regenerate a shared access key for a topic. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicRegenerateKeyRequest +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicSharedAccessKeys +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. + +REGENERATEKEYREQUEST : Topic regenerate share access key request + KeyName : Key name to regenerate key1 or key2 +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/new-azeventgridtopickey +#> +function New-AzEventGridTopicKey { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicSharedAccessKeys])] +[CmdletBinding(DefaultParameterSetName='RegenerateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Regenerate', Mandatory)] + [Parameter(ParameterSetName='RegenerateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Regenerate')] + [Parameter(ParameterSetName='RegenerateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='Regenerate', Mandatory)] + [Parameter(ParameterSetName='RegenerateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the topic. + ${TopicName}, + + [Parameter(ParameterSetName='RegenerateViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='RegenerateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Regenerate', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='RegenerateViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicRegenerateKeyRequest] + # Topic regenerate share access key request + # To construct, see NOTES section for REGENERATEKEYREQUEST properties and create a hash table. + ${RegenerateKeyRequest}, + + [Parameter(ParameterSetName='RegenerateExpanded', Mandatory)] + [Parameter(ParameterSetName='RegenerateViaIdentityExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # Key name to regenerate key1 or key2 + ${KeyName}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Regenerate = 'Az.EventGrid.private\New-AzEventGridTopicKey_Regenerate'; + RegenerateExpanded = 'Az.EventGrid.private\New-AzEventGridTopicKey_RegenerateExpanded'; + RegenerateViaIdentity = 'Az.EventGrid.private\New-AzEventGridTopicKey_RegenerateViaIdentity'; + RegenerateViaIdentityExpanded = 'Az.EventGrid.private\New-AzEventGridTopicKey_RegenerateViaIdentityExpanded'; + } + if (('Regenerate', 'RegenerateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Asynchronously creates a new topic with the specified parameters. +.Description +Asynchronously creates a new topic with the specified parameters. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INBOUNDIPRULE : This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess is enabled. + [Action ]: Action to perform based on the match or no match of the IpMask. + [IPMask ]: IP Address in CIDR notation e.g., 10.0.0.0/8. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/new-azeventgridtopic +#> +function New-AzEventGridTopic { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Alias('TopicName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the topic. + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # Location of the resource. + ${Location}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary] + # Data Residency Boundary of the resource. + ${DataResidencyBoundary}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Management.Automation.SwitchParameter] + # This boolean is used to enable or disable local auth. + # Default value is false. + # When the property is set to true, only AAD token will be used to authenticate if user is allowed to publish to the topic. + ${DisableLocalAuth}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # Fully qualified name of the extended location. + ${ExtendedLocationName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # Type of the extended location. + ${ExtendedLocationType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The principal ID of resource identity. + ${IdentityPrincipalId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The tenant ID of resource. + ${IdentityTenantId}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType] + # 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. + ${IdentityType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities]))] + [System.Collections.Hashtable] + # The list of user identities associated with the resource. + # The user identity dictionary key references will be ARM resource ids in the form:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.This property is currently not used and reserved for future usage. + ${IdentityUserAssignedIdentity}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[]] + # This can be used to restrict traffic from specific IPs instead of all IPs. + # Note: These are considered only if PublicNetworkAccess is enabled. + # To construct, see NOTES section for INBOUNDIPRULE properties and create a hash table. + ${InboundIPRule}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.InputSchema])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.InputSchema] + # This determines the format that Event Grid should expect for incoming events published to the topic. + ${InputSchema}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceKind])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceKind] + # Kind of the resource. + ${Kind}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess] + # This determines if traffic is allowed over public network. + # By default it is enabled. + # You can further restrict to specific IPs by configuring + ${PublicNetworkAccess}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku] + # The Sku name of the resource. + # The possible values are: Basic or Premium. + ${SkuName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceTags]))] + [System.Collections.Hashtable] + # Tags of the resource. + ${Tag}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.EventGrid.private\New-AzEventGridTopic_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Delete an existing channel. +.Description +Delete an existing channel. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/remove-azeventgridchannel +#> +function Remove-AzEventGridChannel { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('ChannelName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the channel. + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the partner namespace. + ${PartnerNamespaceName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the partners subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.EventGrid.private\Remove-AzEventGridChannel_Delete'; + DeleteViaIdentity = 'Az.EventGrid.private\Remove-AzEventGridChannel_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Delete an existing event subscription for a domain. +.Description +Delete an existing event subscription for a domain. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/remove-azeventgriddomaineventsubscription +#> +function Remove-AzEventGridDomainEventSubscription { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the domain. + ${DomainName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the event subscription to be deleted. + # Event subscription names must be between 3 and 100 characters in length and use alphanumeric letters only. + ${EventSubscriptionName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.EventGrid.private\Remove-AzEventGridDomainEventSubscription_Delete'; + DeleteViaIdentity = 'Az.EventGrid.private\Remove-AzEventGridDomainEventSubscription_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Delete a nested existing event subscription for a domain topic. +.Description +Delete a nested existing event subscription for a domain topic. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/remove-azeventgriddomaintopiceventsubscription +#> +function Remove-AzEventGridDomainTopicEventSubscription { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the top level domain. + ${DomainName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the event subscription to be deleted. + # Event subscription names must be between 3 and 100 characters in length and use alphanumeric letters only. + ${EventSubscriptionName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the domain topic. + ${TopicName}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.EventGrid.private\Remove-AzEventGridDomainTopicEventSubscription_Delete'; + DeleteViaIdentity = 'Az.EventGrid.private\Remove-AzEventGridDomainTopicEventSubscription_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Delete existing domain topic. +.Description +Delete existing domain topic. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/remove-azeventgriddomaintopic +#> +function Remove-AzEventGridDomainTopic { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the domain. + ${DomainName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('DomainTopicName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the domain topic. + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.EventGrid.private\Remove-AzEventGridDomainTopic_Delete'; + DeleteViaIdentity = 'Az.EventGrid.private\Remove-AzEventGridDomainTopic_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Delete existing domain. +.Description +Delete existing domain. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/remove-azeventgriddomain +#> +function Remove-AzEventGridDomain { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('DomainName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the domain. + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.EventGrid.private\Remove-AzEventGridDomain_Delete'; + DeleteViaIdentity = 'Az.EventGrid.private\Remove-AzEventGridDomain_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Delete existing event channel. +.Description +Delete existing event channel. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/remove-azeventgrideventchannel +#> +function Remove-AzEventGridEventChannel { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('EventChannelName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the event channel. + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the partner namespace. + ${PartnerNamespaceName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.EventGrid.private\Remove-AzEventGridEventChannel_Delete'; + DeleteViaIdentity = 'Az.EventGrid.private\Remove-AzEventGridEventChannel_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Delete an existing event subscription. +.Description +Delete an existing event subscription. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/remove-azeventgrideventsubscription +#> +function Remove-AzEventGridEventSubscription { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('EventSubscriptionName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the event subscription. + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # 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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + ${Scope}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.EventGrid.private\Remove-AzEventGridEventSubscription_Delete'; + DeleteViaIdentity = 'Az.EventGrid.private\Remove-AzEventGridEventSubscription_DeleteViaIdentity'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Delete existing partner configuration. +.Description +Delete existing partner configuration. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/remove-azeventgridpartnerconfiguration +#> +function Remove-AzEventGridPartnerConfiguration { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.EventGrid.private\Remove-AzEventGridPartnerConfiguration_Delete'; + DeleteViaIdentity = 'Az.EventGrid.private\Remove-AzEventGridPartnerConfiguration_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Delete existing partner destination. +.Description +Delete existing partner destination. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/remove-azeventgridpartnerdestination +#> +function Remove-AzEventGridPartnerDestination { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('PartnerDestinationName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the partner destination. + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.EventGrid.private\Remove-AzEventGridPartnerDestination_Delete'; + DeleteViaIdentity = 'Az.EventGrid.private\Remove-AzEventGridPartnerDestination_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Delete existing partner namespace. +.Description +Delete existing partner namespace. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/remove-azeventgridpartnernamespace +#> +function Remove-AzEventGridPartnerNamespace { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('PartnerNamespaceName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the partner namespace. + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.EventGrid.private\Remove-AzEventGridPartnerNamespace_Delete'; + DeleteViaIdentity = 'Az.EventGrid.private\Remove-AzEventGridPartnerNamespace_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Deletes a partner registration with the specified parameters. +.Description +Deletes a partner registration with the specified parameters. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/remove-azeventgridpartnerregistration +#> +function Remove-AzEventGridPartnerRegistration { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('PartnerRegistrationName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the partner registration. + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.EventGrid.private\Remove-AzEventGridPartnerRegistration_Delete'; + DeleteViaIdentity = 'Az.EventGrid.private\Remove-AzEventGridPartnerRegistration_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Delete an existing event subscription of a partner topic. +.Description +Delete an existing event subscription of a partner topic. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/remove-azeventgridpartnertopiceventsubscription +#> +function Remove-AzEventGridPartnerTopicEventSubscription { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # 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. + ${EventSubscriptionName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the partner topic. + ${PartnerTopicName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.EventGrid.private\Remove-AzEventGridPartnerTopicEventSubscription_Delete'; + DeleteViaIdentity = 'Az.EventGrid.private\Remove-AzEventGridPartnerTopicEventSubscription_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Delete existing partner topic. +.Description +Delete existing partner topic. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/remove-azeventgridpartnertopic +#> +function Remove-AzEventGridPartnerTopic { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('PartnerTopicName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the partner topic. + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.EventGrid.private\Remove-AzEventGridPartnerTopic_Delete'; + DeleteViaIdentity = 'Az.EventGrid.private\Remove-AzEventGridPartnerTopic_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Delete a specific private endpoint connection under a topic, domain, or partner namespace. +.Description +Delete a specific private endpoint connection under a topic, domain, or partner namespace. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/remove-azeventgridprivateendpointconnection +#> +function Remove-AzEventGridPrivateEndpointConnection { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('PrivateEndpointConnectionName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the private endpoint connection connection. + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the parent resource (namely, either, the topic name, domain name, or partner namespace name). + ${ParentName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ParentType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ParentType] + # The type of the parent resource. + # This can be either \'topics\', \'domains\', or \'partnerNamespaces\'. + ${ParentType}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.EventGrid.private\Remove-AzEventGridPrivateEndpointConnection_Delete'; + DeleteViaIdentity = 'Az.EventGrid.private\Remove-AzEventGridPrivateEndpointConnection_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Delete an existing event subscription of a system topic. +.Description +Delete an existing event subscription of a system topic. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/remove-azeventgridsystemtopiceventsubscription +#> +function Remove-AzEventGridSystemTopicEventSubscription { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # 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. + ${EventSubscriptionName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the system topic. + ${SystemTopicName}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.EventGrid.private\Remove-AzEventGridSystemTopicEventSubscription_Delete'; + DeleteViaIdentity = 'Az.EventGrid.private\Remove-AzEventGridSystemTopicEventSubscription_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Delete existing system topic. +.Description +Delete existing system topic. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/remove-azeventgridsystemtopic +#> +function Remove-AzEventGridSystemTopic { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('SystemTopicName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the system topic. + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.EventGrid.private\Remove-AzEventGridSystemTopic_Delete'; + DeleteViaIdentity = 'Az.EventGrid.private\Remove-AzEventGridSystemTopic_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Delete an existing event subscription for a topic. +.Description +Delete an existing event subscription for a topic. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/remove-azeventgridtopiceventsubscription +#> +function Remove-AzEventGridTopicEventSubscription { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the event subscription to be deleted. + # Event subscription names must be between 3 and 100 characters in length and use alphanumeric letters only. + ${EventSubscriptionName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the topic. + ${TopicName}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.EventGrid.private\Remove-AzEventGridTopicEventSubscription_Delete'; + DeleteViaIdentity = 'Az.EventGrid.private\Remove-AzEventGridTopicEventSubscription_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Delete existing topic. +.Description +Delete existing topic. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/remove-azeventgridtopic +#> +function Remove-AzEventGridTopic { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('TopicName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the topic. + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.EventGrid.private\Remove-AzEventGridTopic_Delete'; + DeleteViaIdentity = 'Az.EventGrid.private\Remove-AzEventGridTopic_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Synchronously updates a channel with the specified parameters. +.Description +Synchronously updates a channel with the specified parameters. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/update-azeventgridchannel +#> +function Update-AzEventGridChannel { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Alias('ChannelName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the channel. + ${Name}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the partner namespace. + ${PartnerNamespaceName}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the partners subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInlineEventTypes]))] + [System.Collections.Hashtable] + # A collection of inline event types for the resource. + # The inline event type keys are of type string which represents the name of the event.An example of a valid inline event name is "Contoso.OrderCreated".The inline event type values are of type InlineEventProperties and will contain additional information for every inline event type. + ${EventTypeInfoInlineEventType}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind] + # The kind of event type used. + ${EventTypeInfoKind}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.DateTime] + # Expiration time of the event channel. + # If this timer expires while the corresponding partner topic or partner destination is never activated,the channel and corresponding partner topic or partner destination are deleted. + ${ExpirationTimeIfNotActivatedUtc}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + UpdateExpanded = 'Az.EventGrid.private\Update-AzEventGridChannel_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.EventGrid.private\Update-AzEventGridChannel_UpdateViaIdentityExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Update an existing event subscription for a topic. +.Description +Update an existing event subscription for a topic. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +FILTERADVANCEDFILTER : An array of advanced filters that are used for filtering event subscriptions. + OperatorType : The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. + [Key ]: The field/property in the event based on which you want to filter. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/update-azeventgriddomaineventsubscription +#> +function Update-AzEventGridDomainEventSubscription { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the domain. + ${DomainName}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the event subscription to be updated. + ${EventSubscriptionName}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.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. + ${DeadLetterWithResourceIdentityType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The user identity associated with the resource. + ${DeadLetterWithResourceIdentityUserAssignedIdentity}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType] + # Type of the endpoint for the event subscription destination. + ${DeliveryWithResourceIdentityDestinationEndpointType}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.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. + ${DeliveryWithResourceIdentityType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The user identity associated with the resource. + ${DeliveryWithResourceIdentityUserAssignedIdentity}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType] + # Type of the endpoint for the event subscription destination. + ${EndpointType}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema] + # The event delivery schema for the event subscription. + ${EventDeliverySchema}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.DateTime] + # Information about the expiration time for the event subscription. + ${ExpirationTimeUtc}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[]] + # An array of advanced filters that are used for filtering event subscriptions. + # To construct, see NOTES section for FILTERADVANCEDFILTER properties and create a hash table. + ${FilterAdvancedFilter}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Allows advanced filters to be evaluated against an array of values instead of expecting a singular value. + ${FilterEnableAdvancedFilteringOnArray}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String[]] + # 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. + ${FilterIncludedEventType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filtershould be compared in a case sensitive manner. + ${FilterIsSubjectCaseSensitive}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # An optional string to filter events for an event subscription based on a resource path prefix.The format of this depends on the publisher of the events.Wildcard characters are not supported in this path. + ${FilterSubjectBeginsWith}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # An optional string to filter events for an event subscription based on a resource path suffix.Wildcard characters are not supported in this path. + ${FilterSubjectEndsWith}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String[]] + # List of user defined labels. + ${Label}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Int32] + # Time To Live (in minutes) for events. + ${RetryPolicyEventTimeToLiveInMinute}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Int32] + # Maximum number of delivery retry attempts for events. + ${RetryPolicyMaxDeliveryAttempt}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + UpdateExpanded = 'Az.EventGrid.private\Update-AzEventGridDomainEventSubscription_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.EventGrid.private\Update-AzEventGridDomainEventSubscription_UpdateViaIdentityExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Update an existing event subscription for a domain topic. +.Description +Update an existing event subscription for a domain topic. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +FILTERADVANCEDFILTER : An array of advanced filters that are used for filtering event subscriptions. + OperatorType : The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. + [Key ]: The field/property in the event based on which you want to filter. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/update-azeventgriddomaintopiceventsubscription +#> +function Update-AzEventGridDomainTopicEventSubscription { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the domain. + ${DomainName}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the event subscription to be updated. + ${EventSubscriptionName}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the topic. + ${TopicName}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.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. + ${DeadLetterWithResourceIdentityType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The user identity associated with the resource. + ${DeadLetterWithResourceIdentityUserAssignedIdentity}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType] + # Type of the endpoint for the event subscription destination. + ${DeliveryWithResourceIdentityDestinationEndpointType}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.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. + ${DeliveryWithResourceIdentityType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The user identity associated with the resource. + ${DeliveryWithResourceIdentityUserAssignedIdentity}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType] + # Type of the endpoint for the event subscription destination. + ${EndpointType}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema] + # The event delivery schema for the event subscription. + ${EventDeliverySchema}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.DateTime] + # Information about the expiration time for the event subscription. + ${ExpirationTimeUtc}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[]] + # An array of advanced filters that are used for filtering event subscriptions. + # To construct, see NOTES section for FILTERADVANCEDFILTER properties and create a hash table. + ${FilterAdvancedFilter}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Allows advanced filters to be evaluated against an array of values instead of expecting a singular value. + ${FilterEnableAdvancedFilteringOnArray}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String[]] + # 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. + ${FilterIncludedEventType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filtershould be compared in a case sensitive manner. + ${FilterIsSubjectCaseSensitive}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # An optional string to filter events for an event subscription based on a resource path prefix.The format of this depends on the publisher of the events.Wildcard characters are not supported in this path. + ${FilterSubjectBeginsWith}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # An optional string to filter events for an event subscription based on a resource path suffix.Wildcard characters are not supported in this path. + ${FilterSubjectEndsWith}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String[]] + # List of user defined labels. + ${Label}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Int32] + # Time To Live (in minutes) for events. + ${RetryPolicyEventTimeToLiveInMinute}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Int32] + # Maximum number of delivery retry attempts for events. + ${RetryPolicyMaxDeliveryAttempt}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + UpdateExpanded = 'Az.EventGrid.private\Update-AzEventGridDomainTopicEventSubscription_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.EventGrid.private\Update-AzEventGridDomainTopicEventSubscription_UpdateViaIdentityExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Asynchronously updates a domain with the specified parameters. +.Description +Asynchronously updates a domain with the specified parameters. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INBOUNDIPRULE : This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess is enabled. + [Action ]: Action to perform based on the match or no match of the IpMask. + [IPMask ]: IP Address in CIDR notation e.g., 10.0.0.0/8. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/update-azeventgriddomain +#> +function Update-AzEventGridDomain { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Alias('DomainName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the domain. + ${Name}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Management.Automation.SwitchParameter] + # This Boolean is used to specify the creation mechanism for 'all' the Event Grid Domain Topics associated with this Event Grid Domain resource.In this context, creation of domain topic can be auto-managed (when true) or self-managed (when false). + # The default value for this property is true.When this property is null or set to true, Event Grid is responsible of automatically creating the domain topic when the first event subscription iscreated at the scope of the domain topic. + # If this property is set to false, then creating the first event subscription will require creating a domain topicby the user. + # The self-management mode can be used if the user wants full control of when the domain topic is created, while auto-managed mode provides theflexibility to perform less operations and manage fewer resources by the user. + # Also, note that in auto-managed creation mode, user is allowed to create thedomain topic on demand if needed. + ${AutoCreateTopicWithFirstSubscription}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Management.Automation.SwitchParameter] + # This Boolean is used to specify the deletion mechanism for 'all' the Event Grid Domain Topics associated with this Event Grid Domain resource.In this context, deletion of domain topic can be auto-managed (when true) or self-managed (when false). + # The default value for this property is true.When this property is set to true, Event Grid is responsible of automatically deleting the domain topic when the last event subscription at the scopeof the domain topic is deleted. + # If this property is set to false, then the user needs to manually delete the domain topic when it is no longer needed(e.g., when last event subscription is deleted and the resource needs to be cleaned up). + # The self-management mode can be used if the user wants fullcontrol of when the domain topic needs to be deleted, while auto-managed mode provides the flexibility to perform less operations and manage fewerresources by the user. + ${AutoDeleteTopicWithLastSubscription}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary] + # The data residency boundary for the domain. + ${DataResidencyBoundary}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Management.Automation.SwitchParameter] + # This boolean is used to enable or disable local auth. + # Default value is false. + # When the property is set to true, only AAD token will be used to authenticate if user is allowed to publish to the domain. + ${DisableLocalAuth}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The principal ID of resource identity. + ${IdentityPrincipalId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The tenant ID of resource. + ${IdentityTenantId}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType] + # 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. + ${IdentityType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities]))] + [System.Collections.Hashtable] + # The list of user identities associated with the resource. + # The user identity dictionary key references will be ARM resource ids in the form:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.This property is currently not used and reserved for future usage. + ${IdentityUserAssignedIdentity}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[]] + # This can be used to restrict traffic from specific IPs instead of all IPs. + # Note: These are considered only if PublicNetworkAccess is enabled. + # To construct, see NOTES section for INBOUNDIPRULE properties and create a hash table. + ${InboundIPRule}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess] + # This determines if traffic is allowed over public network. + # By default it is enabled. + # You can further restrict to specific IPs by configuring + ${PublicNetworkAccess}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku] + # The Sku name of the resource. + # The possible values are: Basic or Premium. + ${SkuName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParametersTags]))] + [System.Collections.Hashtable] + # Tags of the domains resource. + ${Tag}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + UpdateExpanded = 'Az.EventGrid.private\Update-AzEventGridDomain_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.EventGrid.private\Update-AzEventGridDomain_UpdateViaIdentityExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Asynchronously updates an existing event subscription. +.Description +Asynchronously updates an existing event subscription. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +FILTERADVANCEDFILTER : An array of advanced filters that are used for filtering event subscriptions. + OperatorType : The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. + [Key ]: The field/property in the event based on which you want to filter. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/update-azeventgrideventsubscription +#> +function Update-AzEventGridEventSubscription { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Alias('EventSubscriptionName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the event subscription to be updated. + ${Name}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # 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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + ${Scope}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.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. + ${DeadLetterWithResourceIdentityType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The user identity associated with the resource. + ${DeadLetterWithResourceIdentityUserAssignedIdentity}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType] + # Type of the endpoint for the event subscription destination. + ${DeliveryWithResourceIdentityDestinationEndpointType}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.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. + ${DeliveryWithResourceIdentityType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The user identity associated with the resource. + ${DeliveryWithResourceIdentityUserAssignedIdentity}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType] + # Type of the endpoint for the event subscription destination. + ${EndpointType}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema] + # The event delivery schema for the event subscription. + ${EventDeliverySchema}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.DateTime] + # Information about the expiration time for the event subscription. + ${ExpirationTimeUtc}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[]] + # An array of advanced filters that are used for filtering event subscriptions. + # To construct, see NOTES section for FILTERADVANCEDFILTER properties and create a hash table. + ${FilterAdvancedFilter}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Allows advanced filters to be evaluated against an array of values instead of expecting a singular value. + ${FilterEnableAdvancedFilteringOnArray}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String[]] + # 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. + ${FilterIncludedEventType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filtershould be compared in a case sensitive manner. + ${FilterIsSubjectCaseSensitive}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # An optional string to filter events for an event subscription based on a resource path prefix.The format of this depends on the publisher of the events.Wildcard characters are not supported in this path. + ${FilterSubjectBeginsWith}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # An optional string to filter events for an event subscription based on a resource path suffix.Wildcard characters are not supported in this path. + ${FilterSubjectEndsWith}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String[]] + # List of user defined labels. + ${Label}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Int32] + # Time To Live (in minutes) for events. + ${RetryPolicyEventTimeToLiveInMinute}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Int32] + # Maximum number of delivery retry attempts for events. + ${RetryPolicyMaxDeliveryAttempt}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + UpdateExpanded = 'Az.EventGrid.private\Update-AzEventGridEventSubscription_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.EventGrid.private\Update-AzEventGridEventSubscription_UpdateViaIdentityExpanded'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Synchronously updates a partner configuration with the specified parameters. +.Description +Synchronously updates a partner configuration with the specified parameters. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfiguration +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/update-azeventgridpartnerconfiguration +#> +function Update-AzEventGridPartnerConfiguration { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfiguration])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Int32] + # The default time used to validate the maximum expiration time for each authorized partners in days. + # Allowed values ar between 1 and 365 days. + ${DefaultMaximumExpirationTimeInDay}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationUpdateParametersTags]))] + [System.Collections.Hashtable] + # Tags of the partner configuration resource. + ${Tag}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + UpdateExpanded = 'Az.EventGrid.private\Update-AzEventGridPartnerConfiguration_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.EventGrid.private\Update-AzEventGridPartnerConfiguration_UpdateViaIdentityExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Asynchronously updates a partner destination with the specified parameters. +.Description +Asynchronously updates a partner destination with the specified parameters. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestination +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/update-azeventgridpartnerdestination +#> +function Update-AzEventGridPartnerDestination { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestination])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Alias('PartnerDestinationName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the partner destination. + ${Name}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationUpdateParametersTags]))] + [System.Collections.Hashtable] + # Tags of the Partner Destination resource. + ${Tag}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + UpdateExpanded = 'Az.EventGrid.private\Update-AzEventGridPartnerDestination_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.EventGrid.private\Update-AzEventGridPartnerDestination_UpdateViaIdentityExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Asynchronously updates a partner namespace with the specified parameters. +.Description +Asynchronously updates a partner namespace with the specified parameters. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INBOUNDIPRULE : This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess is enabled. + [Action ]: Action to perform based on the match or no match of the IpMask. + [IPMask ]: IP Address in CIDR notation e.g., 10.0.0.0/8. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/update-azeventgridpartnernamespace +#> +function Update-AzEventGridPartnerNamespace { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Alias('PartnerNamespaceName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the partner namespace. + ${Name}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Management.Automation.SwitchParameter] + # This boolean is used to enable or disable local auth. + # Default value is false. + # When the property is set to true, only AAD token will be used to authenticate if user is allowed to publish to the partner namespace. + ${DisableLocalAuth}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[]] + # This can be used to restrict traffic from specific IPs instead of all IPs. + # Note: These are considered only if PublicNetworkAccess is enabled. + # To construct, see NOTES section for INBOUNDIPRULE properties and create a hash table. + ${InboundIPRule}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess] + # This determines if traffic is allowed over public network. + # By default it is enabled. + # You can further restrict to specific IPs by configuring + ${PublicNetworkAccess}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParametersTags]))] + [System.Collections.Hashtable] + # Tags of the Partner Namespace. + ${Tag}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + UpdateExpanded = 'Az.EventGrid.private\Update-AzEventGridPartnerNamespace_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.EventGrid.private\Update-AzEventGridPartnerNamespace_UpdateViaIdentityExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Updates a partner registration with the specified parameters. +.Description +Updates a partner registration with the specified parameters. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/update-azeventgridpartnerregistration +#> +function Update-AzEventGridPartnerRegistration { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Alias('PartnerRegistrationName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the partner registration. + ${Name}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String[]] + # List of IDs of Azure AD applications that are authorized to create a partner namespaceassociated with this partner registration. + # This is an optional property. + # Creatingpartner namespaces is always permitted under the same Azure subscription as the one usedfor creating the partner registration. + ${AuthorizedAzureSubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # URI of the partner logo. + ${LogoUri}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # Description of the partner topic type. + ${PartnerTopicTypeDescription}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # Display name of the partner topic type. + ${PartnerTopicTypeDisplayName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # Name of the partner topic type. + ${PartnerTopicTypeName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # URI of the partner website that can be used by Azure customers to setup Event Gridintegration on an event source. + ${SetupUri}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationUpdateParametersTags]))] + [System.Collections.Hashtable] + # Tags of the partner registration resource. + ${Tag}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + UpdateExpanded = 'Az.EventGrid.private\Update-AzEventGridPartnerRegistration_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.EventGrid.private\Update-AzEventGridPartnerRegistration_UpdateViaIdentityExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Update an existing event subscription of a partner topic. +.Description +Update an existing event subscription of a partner topic. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +FILTERADVANCEDFILTER : An array of advanced filters that are used for filtering event subscriptions. + OperatorType : The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. + [Key ]: The field/property in the event based on which you want to filter. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/update-azeventgridpartnertopiceventsubscription +#> +function Update-AzEventGridPartnerTopicEventSubscription { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # 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. + ${EventSubscriptionName}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the partner topic. + ${PartnerTopicName}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.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. + ${DeadLetterWithResourceIdentityType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The user identity associated with the resource. + ${DeadLetterWithResourceIdentityUserAssignedIdentity}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType] + # Type of the endpoint for the event subscription destination. + ${DeliveryWithResourceIdentityDestinationEndpointType}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.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. + ${DeliveryWithResourceIdentityType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The user identity associated with the resource. + ${DeliveryWithResourceIdentityUserAssignedIdentity}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType] + # Type of the endpoint for the event subscription destination. + ${EndpointType}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema] + # The event delivery schema for the event subscription. + ${EventDeliverySchema}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.DateTime] + # Information about the expiration time for the event subscription. + ${ExpirationTimeUtc}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[]] + # An array of advanced filters that are used for filtering event subscriptions. + # To construct, see NOTES section for FILTERADVANCEDFILTER properties and create a hash table. + ${FilterAdvancedFilter}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Allows advanced filters to be evaluated against an array of values instead of expecting a singular value. + ${FilterEnableAdvancedFilteringOnArray}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String[]] + # 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. + ${FilterIncludedEventType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filtershould be compared in a case sensitive manner. + ${FilterIsSubjectCaseSensitive}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # An optional string to filter events for an event subscription based on a resource path prefix.The format of this depends on the publisher of the events.Wildcard characters are not supported in this path. + ${FilterSubjectBeginsWith}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # An optional string to filter events for an event subscription based on a resource path suffix.Wildcard characters are not supported in this path. + ${FilterSubjectEndsWith}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String[]] + # List of user defined labels. + ${Label}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Int32] + # Time To Live (in minutes) for events. + ${RetryPolicyEventTimeToLiveInMinute}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Int32] + # Maximum number of delivery retry attempts for events. + ${RetryPolicyMaxDeliveryAttempt}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + UpdateExpanded = 'Az.EventGrid.private\Update-AzEventGridPartnerTopicEventSubscription_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.EventGrid.private\Update-AzEventGridPartnerTopicEventSubscription_UpdateViaIdentityExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Asynchronously updates a partner topic with the specified parameters. +.Description +Asynchronously updates a partner topic with the specified parameters. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopic +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/update-azeventgridpartnertopic +#> +function Update-AzEventGridPartnerTopic { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopic])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Alias('PartnerTopicName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the partner topic. + ${Name}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The principal ID of resource identity. + ${IdentityPrincipalId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The tenant ID of resource. + ${IdentityTenantId}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType] + # 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. + ${IdentityType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities]))] + [System.Collections.Hashtable] + # The list of user identities associated with the resource. + # The user identity dictionary key references will be ARM resource ids in the form:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.This property is currently not used and reserved for future usage. + ${IdentityUserAssignedIdentity}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicUpdateParametersTags]))] + [System.Collections.Hashtable] + # Tags of the Partner Topic resource. + ${Tag}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + UpdateExpanded = 'Az.EventGrid.private\Update-AzEventGridPartnerTopic_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.EventGrid.private\Update-AzEventGridPartnerTopic_UpdateViaIdentityExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Update an existing event subscription of a system topic. +.Description +Update an existing event subscription of a system topic. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +FILTERADVANCEDFILTER : An array of advanced filters that are used for filtering event subscriptions. + OperatorType : The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. + [Key ]: The field/property in the event based on which you want to filter. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/update-azeventgridsystemtopiceventsubscription +#> +function Update-AzEventGridSystemTopicEventSubscription { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # 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. + ${EventSubscriptionName}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the system topic. + ${SystemTopicName}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.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. + ${DeadLetterWithResourceIdentityType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The user identity associated with the resource. + ${DeadLetterWithResourceIdentityUserAssignedIdentity}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType] + # Type of the endpoint for the event subscription destination. + ${DeliveryWithResourceIdentityDestinationEndpointType}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.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. + ${DeliveryWithResourceIdentityType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The user identity associated with the resource. + ${DeliveryWithResourceIdentityUserAssignedIdentity}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType] + # Type of the endpoint for the event subscription destination. + ${EndpointType}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema] + # The event delivery schema for the event subscription. + ${EventDeliverySchema}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.DateTime] + # Information about the expiration time for the event subscription. + ${ExpirationTimeUtc}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[]] + # An array of advanced filters that are used for filtering event subscriptions. + # To construct, see NOTES section for FILTERADVANCEDFILTER properties and create a hash table. + ${FilterAdvancedFilter}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Allows advanced filters to be evaluated against an array of values instead of expecting a singular value. + ${FilterEnableAdvancedFilteringOnArray}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String[]] + # 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. + ${FilterIncludedEventType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filtershould be compared in a case sensitive manner. + ${FilterIsSubjectCaseSensitive}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # An optional string to filter events for an event subscription based on a resource path prefix.The format of this depends on the publisher of the events.Wildcard characters are not supported in this path. + ${FilterSubjectBeginsWith}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # An optional string to filter events for an event subscription based on a resource path suffix.Wildcard characters are not supported in this path. + ${FilterSubjectEndsWith}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String[]] + # List of user defined labels. + ${Label}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Int32] + # Time To Live (in minutes) for events. + ${RetryPolicyEventTimeToLiveInMinute}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Int32] + # Maximum number of delivery retry attempts for events. + ${RetryPolicyMaxDeliveryAttempt}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + UpdateExpanded = 'Az.EventGrid.private\Update-AzEventGridSystemTopicEventSubscription_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.EventGrid.private\Update-AzEventGridSystemTopicEventSubscription_UpdateViaIdentityExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Asynchronously updates a system topic with the specified parameters. +.Description +Asynchronously updates a system topic with the specified parameters. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopic +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/update-azeventgridsystemtopic +#> +function Update-AzEventGridSystemTopic { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopic])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Alias('SystemTopicName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the system topic. + ${Name}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The principal ID of resource identity. + ${IdentityPrincipalId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The tenant ID of resource. + ${IdentityTenantId}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType] + # 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. + ${IdentityType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities]))] + [System.Collections.Hashtable] + # The list of user identities associated with the resource. + # The user identity dictionary key references will be ARM resource ids in the form:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.This property is currently not used and reserved for future usage. + ${IdentityUserAssignedIdentity}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicUpdateParametersTags]))] + [System.Collections.Hashtable] + # Tags of the system topic. + ${Tag}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + UpdateExpanded = 'Az.EventGrid.private\Update-AzEventGridSystemTopic_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.EventGrid.private\Update-AzEventGridSystemTopic_UpdateViaIdentityExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Update an existing event subscription for a topic. +.Description +Update an existing event subscription for a topic. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +FILTERADVANCEDFILTER : An array of advanced filters that are used for filtering event subscriptions. + OperatorType : The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. + [Key ]: The field/property in the event based on which you want to filter. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/update-azeventgridtopiceventsubscription +#> +function Update-AzEventGridTopicEventSubscription { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the event subscription to be updated. + ${EventSubscriptionName}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the domain. + ${TopicName}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.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. + ${DeadLetterWithResourceIdentityType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The user identity associated with the resource. + ${DeadLetterWithResourceIdentityUserAssignedIdentity}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType] + # Type of the endpoint for the event subscription destination. + ${DeliveryWithResourceIdentityDestinationEndpointType}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.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. + ${DeliveryWithResourceIdentityType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The user identity associated with the resource. + ${DeliveryWithResourceIdentityUserAssignedIdentity}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType] + # Type of the endpoint for the event subscription destination. + ${EndpointType}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema] + # The event delivery schema for the event subscription. + ${EventDeliverySchema}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.DateTime] + # Information about the expiration time for the event subscription. + ${ExpirationTimeUtc}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[]] + # An array of advanced filters that are used for filtering event subscriptions. + # To construct, see NOTES section for FILTERADVANCEDFILTER properties and create a hash table. + ${FilterAdvancedFilter}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Allows advanced filters to be evaluated against an array of values instead of expecting a singular value. + ${FilterEnableAdvancedFilteringOnArray}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String[]] + # 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. + ${FilterIncludedEventType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filtershould be compared in a case sensitive manner. + ${FilterIsSubjectCaseSensitive}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # An optional string to filter events for an event subscription based on a resource path prefix.The format of this depends on the publisher of the events.Wildcard characters are not supported in this path. + ${FilterSubjectBeginsWith}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # An optional string to filter events for an event subscription based on a resource path suffix.Wildcard characters are not supported in this path. + ${FilterSubjectEndsWith}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String[]] + # List of user defined labels. + ${Label}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Int32] + # Time To Live (in minutes) for events. + ${RetryPolicyEventTimeToLiveInMinute}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Int32] + # Maximum number of delivery retry attempts for events. + ${RetryPolicyMaxDeliveryAttempt}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + UpdateExpanded = 'Az.EventGrid.private\Update-AzEventGridTopicEventSubscription_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.EventGrid.private\Update-AzEventGridTopicEventSubscription_UpdateViaIdentityExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Asynchronously updates a topic with the specified parameters. +.Description +Asynchronously updates a topic with the specified parameters. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INBOUNDIPRULE : This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess is enabled. + [Action ]: Action to perform based on the match or no match of the IpMask. + [IPMask ]: IP Address in CIDR notation e.g., 10.0.0.0/8. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/update-azeventgridtopic +#> +function Update-AzEventGridTopic { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Alias('TopicName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the topic. + ${Name}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary] + # The data residency boundary for the topic. + ${DataResidencyBoundary}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Management.Automation.SwitchParameter] + # This boolean is used to enable or disable local auth. + # Default value is false. + # When the property is set to true, only AAD token will be used to authenticate if user is allowed to publish to the topic. + ${DisableLocalAuth}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The principal ID of resource identity. + ${IdentityPrincipalId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The tenant ID of resource. + ${IdentityTenantId}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType] + # 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. + ${IdentityType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities]))] + [System.Collections.Hashtable] + # The list of user identities associated with the resource. + # The user identity dictionary key references will be ARM resource ids in the form:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.This property is currently not used and reserved for future usage. + ${IdentityUserAssignedIdentity}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[]] + # This can be used to restrict traffic from specific IPs instead of all IPs. + # Note: These are considered only if PublicNetworkAccess is enabled. + # To construct, see NOTES section for INBOUNDIPRULE properties and create a hash table. + ${InboundIPRule}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess] + # This determines if traffic is allowed over public network. + # By default it is enabled. + # You can further restrict to specific IPs by configuring + ${PublicNetworkAccess}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku] + # The Sku name of the resource. + # The possible values are: Basic or Premium. + ${SkuName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParametersTags]))] + [System.Collections.Hashtable] + # Tags of the Topic resource. + ${Tag}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + UpdateExpanded = 'Az.EventGrid.private\Update-AzEventGridTopic_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.EventGrid.private\Update-AzEventGridTopic_UpdateViaIdentityExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/README.md b/swaggerci/eventgrid/exports/README.md new file mode 100644 index 000000000000..5a156e94b5b0 --- /dev/null +++ b/swaggerci/eventgrid/exports/README.md @@ -0,0 +1,20 @@ +# Exports +This directory contains the cmdlets *exported by* `Az.EventGrid`. No other cmdlets in this repository are directly exported. What that means is the `Az.EventGrid` module will run [Export-ModuleMember](https://docs.microsoft.com/powershell/module/microsoft.powershell.core/export-modulemember) on the cmldets in this directory. The cmdlets in this directory are generated at **build-time**. Do not put any custom code, files, cmdlets, etc. into this directory. Please use `../custom` for all custom implementation. + +## Info +- Modifiable: no +- Generated: all +- Committed: no +- Packaged: yes + +## Details +The cmdlets generated here are created every time you run `build-module.ps1`. These cmdlets are a merge of all (excluding `InternalExport`) cmdlets from the private binary (`../bin/Az.EventGrid.private.dll`) and from the `../custom/Az.EventGrid.custom.psm1` module. Cmdlets that are *not merged* from those directories are decorated with the `InternalExport` attribute. This happens when you set the cmdlet to **hide** from configuration. For more information on hiding, see [cmdlet hiding](https://github.com/Azure/autorest/blob/master/docs/powershell/options.md#cmdlet-hiding-exportation-suppression) or the [README.md](../internal/README.md) in the `../internal` folder. + +## Purpose +We generate script cmdlets out of the binary cmdlets and custom cmdlets. The format of script cmdlets are simplistic; thus, easier to generate at build time. Generating the cmdlets is required as to allow merging of generated binary, hand-written binary, and hand-written custom cmdlets. For Azure cmdlets, having script cmdlets simplifies the mechanism for exporting Azure profiles. + +## Structure +The cmdlets generated here will flat in the directory (no sub-folders) as long as there are no Azure profiles specified for any cmdlets. Azure profiles (the `Profiles` attribute) is only applied when generating with the `--azure` attribute (or `azure: true` in the configuration). When Azure profiles are applied, the folder structure has a folder per profile. Each profile folder has only those cmdlets that apply to that profile. + +## Usage +When `./Az.EventGrid.psm1` is loaded, it dynamically exports cmdlets here based on the folder structure and on the selected profile. If there are no sub-folders, it exports all cmdlets at the root of this folder. If there are sub-folders, it checks to see the selected profile. If no profile is selected, it exports the cmdlets in the last sub-folder (alphabetically). If a profile is selected, it exports the cmdlets in the sub-folder that matches the profile name. If there is no sub-folder that matches the profile name, it exports no cmdlets and writes a warning message. \ No newline at end of file diff --git a/swaggerci/eventgrid/exports/Remove-AzEventGridChannel.ps1 b/swaggerci/eventgrid/exports/Remove-AzEventGridChannel.ps1 new file mode 100644 index 000000000000..9d1138dac49d --- /dev/null +++ b/swaggerci/eventgrid/exports/Remove-AzEventGridChannel.ps1 @@ -0,0 +1,237 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Delete an existing channel. +.Description +Delete an existing channel. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/remove-azeventgridchannel +#> +function Remove-AzEventGridChannel { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('ChannelName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the channel. + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the partner namespace. + ${PartnerNamespaceName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the partners subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.EventGrid.private\Remove-AzEventGridChannel_Delete'; + DeleteViaIdentity = 'Az.EventGrid.private\Remove-AzEventGridChannel_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/Remove-AzEventGridDomain.ps1 b/swaggerci/eventgrid/exports/Remove-AzEventGridDomain.ps1 new file mode 100644 index 000000000000..46a73d86bccf --- /dev/null +++ b/swaggerci/eventgrid/exports/Remove-AzEventGridDomain.ps1 @@ -0,0 +1,231 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Delete existing domain. +.Description +Delete existing domain. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/remove-azeventgriddomain +#> +function Remove-AzEventGridDomain { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('DomainName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the domain. + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.EventGrid.private\Remove-AzEventGridDomain_Delete'; + DeleteViaIdentity = 'Az.EventGrid.private\Remove-AzEventGridDomain_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/Remove-AzEventGridDomainEventSubscription.ps1 b/swaggerci/eventgrid/exports/Remove-AzEventGridDomainEventSubscription.ps1 new file mode 100644 index 000000000000..bdaf7a85c55c --- /dev/null +++ b/swaggerci/eventgrid/exports/Remove-AzEventGridDomainEventSubscription.ps1 @@ -0,0 +1,237 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Delete an existing event subscription for a domain. +.Description +Delete an existing event subscription for a domain. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/remove-azeventgriddomaineventsubscription +#> +function Remove-AzEventGridDomainEventSubscription { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the domain. + ${DomainName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the event subscription to be deleted. + # Event subscription names must be between 3 and 100 characters in length and use alphanumeric letters only. + ${EventSubscriptionName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.EventGrid.private\Remove-AzEventGridDomainEventSubscription_Delete'; + DeleteViaIdentity = 'Az.EventGrid.private\Remove-AzEventGridDomainEventSubscription_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/Remove-AzEventGridDomainTopic.ps1 b/swaggerci/eventgrid/exports/Remove-AzEventGridDomainTopic.ps1 new file mode 100644 index 000000000000..a34b4860fc80 --- /dev/null +++ b/swaggerci/eventgrid/exports/Remove-AzEventGridDomainTopic.ps1 @@ -0,0 +1,237 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Delete existing domain topic. +.Description +Delete existing domain topic. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/remove-azeventgriddomaintopic +#> +function Remove-AzEventGridDomainTopic { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the domain. + ${DomainName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('DomainTopicName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the domain topic. + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.EventGrid.private\Remove-AzEventGridDomainTopic_Delete'; + DeleteViaIdentity = 'Az.EventGrid.private\Remove-AzEventGridDomainTopic_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/Remove-AzEventGridDomainTopicEventSubscription.ps1 b/swaggerci/eventgrid/exports/Remove-AzEventGridDomainTopicEventSubscription.ps1 new file mode 100644 index 000000000000..7b03a2c8a43b --- /dev/null +++ b/swaggerci/eventgrid/exports/Remove-AzEventGridDomainTopicEventSubscription.ps1 @@ -0,0 +1,243 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Delete a nested existing event subscription for a domain topic. +.Description +Delete a nested existing event subscription for a domain topic. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/remove-azeventgriddomaintopiceventsubscription +#> +function Remove-AzEventGridDomainTopicEventSubscription { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the top level domain. + ${DomainName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the event subscription to be deleted. + # Event subscription names must be between 3 and 100 characters in length and use alphanumeric letters only. + ${EventSubscriptionName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the domain topic. + ${TopicName}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.EventGrid.private\Remove-AzEventGridDomainTopicEventSubscription_Delete'; + DeleteViaIdentity = 'Az.EventGrid.private\Remove-AzEventGridDomainTopicEventSubscription_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/Remove-AzEventGridEventChannel.ps1 b/swaggerci/eventgrid/exports/Remove-AzEventGridEventChannel.ps1 new file mode 100644 index 000000000000..2615bc556c70 --- /dev/null +++ b/swaggerci/eventgrid/exports/Remove-AzEventGridEventChannel.ps1 @@ -0,0 +1,237 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Delete existing event channel. +.Description +Delete existing event channel. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/remove-azeventgrideventchannel +#> +function Remove-AzEventGridEventChannel { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('EventChannelName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the event channel. + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the partner namespace. + ${PartnerNamespaceName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.EventGrid.private\Remove-AzEventGridEventChannel_Delete'; + DeleteViaIdentity = 'Az.EventGrid.private\Remove-AzEventGridEventChannel_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/Remove-AzEventGridEventSubscription.ps1 b/swaggerci/eventgrid/exports/Remove-AzEventGridEventSubscription.ps1 new file mode 100644 index 000000000000..a4b0262ad4d6 --- /dev/null +++ b/swaggerci/eventgrid/exports/Remove-AzEventGridEventSubscription.ps1 @@ -0,0 +1,222 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Delete an existing event subscription. +.Description +Delete an existing event subscription. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/remove-azeventgrideventsubscription +#> +function Remove-AzEventGridEventSubscription { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('EventSubscriptionName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the event subscription. + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # 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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + ${Scope}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.EventGrid.private\Remove-AzEventGridEventSubscription_Delete'; + DeleteViaIdentity = 'Az.EventGrid.private\Remove-AzEventGridEventSubscription_DeleteViaIdentity'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/Remove-AzEventGridPartnerConfiguration.ps1 b/swaggerci/eventgrid/exports/Remove-AzEventGridPartnerConfiguration.ps1 new file mode 100644 index 000000000000..256e71422092 --- /dev/null +++ b/swaggerci/eventgrid/exports/Remove-AzEventGridPartnerConfiguration.ps1 @@ -0,0 +1,224 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Delete existing partner configuration. +.Description +Delete existing partner configuration. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/remove-azeventgridpartnerconfiguration +#> +function Remove-AzEventGridPartnerConfiguration { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.EventGrid.private\Remove-AzEventGridPartnerConfiguration_Delete'; + DeleteViaIdentity = 'Az.EventGrid.private\Remove-AzEventGridPartnerConfiguration_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/Remove-AzEventGridPartnerDestination.ps1 b/swaggerci/eventgrid/exports/Remove-AzEventGridPartnerDestination.ps1 new file mode 100644 index 000000000000..76fc99aa96df --- /dev/null +++ b/swaggerci/eventgrid/exports/Remove-AzEventGridPartnerDestination.ps1 @@ -0,0 +1,231 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Delete existing partner destination. +.Description +Delete existing partner destination. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/remove-azeventgridpartnerdestination +#> +function Remove-AzEventGridPartnerDestination { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('PartnerDestinationName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the partner destination. + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.EventGrid.private\Remove-AzEventGridPartnerDestination_Delete'; + DeleteViaIdentity = 'Az.EventGrid.private\Remove-AzEventGridPartnerDestination_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/Remove-AzEventGridPartnerNamespace.ps1 b/swaggerci/eventgrid/exports/Remove-AzEventGridPartnerNamespace.ps1 new file mode 100644 index 000000000000..c069b35b1e31 --- /dev/null +++ b/swaggerci/eventgrid/exports/Remove-AzEventGridPartnerNamespace.ps1 @@ -0,0 +1,231 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Delete existing partner namespace. +.Description +Delete existing partner namespace. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/remove-azeventgridpartnernamespace +#> +function Remove-AzEventGridPartnerNamespace { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('PartnerNamespaceName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the partner namespace. + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.EventGrid.private\Remove-AzEventGridPartnerNamespace_Delete'; + DeleteViaIdentity = 'Az.EventGrid.private\Remove-AzEventGridPartnerNamespace_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/Remove-AzEventGridPartnerRegistration.ps1 b/swaggerci/eventgrid/exports/Remove-AzEventGridPartnerRegistration.ps1 new file mode 100644 index 000000000000..3bad289d38ec --- /dev/null +++ b/swaggerci/eventgrid/exports/Remove-AzEventGridPartnerRegistration.ps1 @@ -0,0 +1,231 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Deletes a partner registration with the specified parameters. +.Description +Deletes a partner registration with the specified parameters. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/remove-azeventgridpartnerregistration +#> +function Remove-AzEventGridPartnerRegistration { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('PartnerRegistrationName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the partner registration. + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.EventGrid.private\Remove-AzEventGridPartnerRegistration_Delete'; + DeleteViaIdentity = 'Az.EventGrid.private\Remove-AzEventGridPartnerRegistration_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/Remove-AzEventGridPartnerTopic.ps1 b/swaggerci/eventgrid/exports/Remove-AzEventGridPartnerTopic.ps1 new file mode 100644 index 000000000000..71b8000a03e8 --- /dev/null +++ b/swaggerci/eventgrid/exports/Remove-AzEventGridPartnerTopic.ps1 @@ -0,0 +1,231 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Delete existing partner topic. +.Description +Delete existing partner topic. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/remove-azeventgridpartnertopic +#> +function Remove-AzEventGridPartnerTopic { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('PartnerTopicName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the partner topic. + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.EventGrid.private\Remove-AzEventGridPartnerTopic_Delete'; + DeleteViaIdentity = 'Az.EventGrid.private\Remove-AzEventGridPartnerTopic_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/Remove-AzEventGridPartnerTopicEventSubscription.ps1 b/swaggerci/eventgrid/exports/Remove-AzEventGridPartnerTopicEventSubscription.ps1 new file mode 100644 index 000000000000..19fdf4c0eab0 --- /dev/null +++ b/swaggerci/eventgrid/exports/Remove-AzEventGridPartnerTopicEventSubscription.ps1 @@ -0,0 +1,237 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Delete an existing event subscription of a partner topic. +.Description +Delete an existing event subscription of a partner topic. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/remove-azeventgridpartnertopiceventsubscription +#> +function Remove-AzEventGridPartnerTopicEventSubscription { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # 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. + ${EventSubscriptionName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the partner topic. + ${PartnerTopicName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.EventGrid.private\Remove-AzEventGridPartnerTopicEventSubscription_Delete'; + DeleteViaIdentity = 'Az.EventGrid.private\Remove-AzEventGridPartnerTopicEventSubscription_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/Remove-AzEventGridPrivateEndpointConnection.ps1 b/swaggerci/eventgrid/exports/Remove-AzEventGridPrivateEndpointConnection.ps1 new file mode 100644 index 000000000000..1d7533ea9625 --- /dev/null +++ b/swaggerci/eventgrid/exports/Remove-AzEventGridPrivateEndpointConnection.ps1 @@ -0,0 +1,245 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Delete a specific private endpoint connection under a topic, domain, or partner namespace. +.Description +Delete a specific private endpoint connection under a topic, domain, or partner namespace. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/remove-azeventgridprivateendpointconnection +#> +function Remove-AzEventGridPrivateEndpointConnection { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('PrivateEndpointConnectionName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the private endpoint connection connection. + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the parent resource (namely, either, the topic name, domain name, or partner namespace name). + ${ParentName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ParentType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ParentType] + # The type of the parent resource. + # This can be either \'topics\', \'domains\', or \'partnerNamespaces\'. + ${ParentType}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.EventGrid.private\Remove-AzEventGridPrivateEndpointConnection_Delete'; + DeleteViaIdentity = 'Az.EventGrid.private\Remove-AzEventGridPrivateEndpointConnection_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/Remove-AzEventGridSystemTopic.ps1 b/swaggerci/eventgrid/exports/Remove-AzEventGridSystemTopic.ps1 new file mode 100644 index 000000000000..f6cd5560954e --- /dev/null +++ b/swaggerci/eventgrid/exports/Remove-AzEventGridSystemTopic.ps1 @@ -0,0 +1,231 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Delete existing system topic. +.Description +Delete existing system topic. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/remove-azeventgridsystemtopic +#> +function Remove-AzEventGridSystemTopic { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('SystemTopicName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the system topic. + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.EventGrid.private\Remove-AzEventGridSystemTopic_Delete'; + DeleteViaIdentity = 'Az.EventGrid.private\Remove-AzEventGridSystemTopic_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/Remove-AzEventGridSystemTopicEventSubscription.ps1 b/swaggerci/eventgrid/exports/Remove-AzEventGridSystemTopicEventSubscription.ps1 new file mode 100644 index 000000000000..301550948516 --- /dev/null +++ b/swaggerci/eventgrid/exports/Remove-AzEventGridSystemTopicEventSubscription.ps1 @@ -0,0 +1,237 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Delete an existing event subscription of a system topic. +.Description +Delete an existing event subscription of a system topic. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/remove-azeventgridsystemtopiceventsubscription +#> +function Remove-AzEventGridSystemTopicEventSubscription { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # 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. + ${EventSubscriptionName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the system topic. + ${SystemTopicName}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.EventGrid.private\Remove-AzEventGridSystemTopicEventSubscription_Delete'; + DeleteViaIdentity = 'Az.EventGrid.private\Remove-AzEventGridSystemTopicEventSubscription_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/Remove-AzEventGridTopic.ps1 b/swaggerci/eventgrid/exports/Remove-AzEventGridTopic.ps1 new file mode 100644 index 000000000000..7c93222f8657 --- /dev/null +++ b/swaggerci/eventgrid/exports/Remove-AzEventGridTopic.ps1 @@ -0,0 +1,231 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Delete existing topic. +.Description +Delete existing topic. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/remove-azeventgridtopic +#> +function Remove-AzEventGridTopic { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('TopicName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the topic. + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.EventGrid.private\Remove-AzEventGridTopic_Delete'; + DeleteViaIdentity = 'Az.EventGrid.private\Remove-AzEventGridTopic_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/Remove-AzEventGridTopicEventSubscription.ps1 b/swaggerci/eventgrid/exports/Remove-AzEventGridTopicEventSubscription.ps1 new file mode 100644 index 000000000000..552a1551509e --- /dev/null +++ b/swaggerci/eventgrid/exports/Remove-AzEventGridTopicEventSubscription.ps1 @@ -0,0 +1,237 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Delete an existing event subscription for a topic. +.Description +Delete an existing event subscription for a topic. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/remove-azeventgridtopiceventsubscription +#> +function Remove-AzEventGridTopicEventSubscription { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the event subscription to be deleted. + # Event subscription names must be between 3 and 100 characters in length and use alphanumeric letters only. + ${EventSubscriptionName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the topic. + ${TopicName}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.EventGrid.private\Remove-AzEventGridTopicEventSubscription_Delete'; + DeleteViaIdentity = 'Az.EventGrid.private\Remove-AzEventGridTopicEventSubscription_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/Update-AzEventGridChannel.ps1 b/swaggerci/eventgrid/exports/Update-AzEventGridChannel.ps1 new file mode 100644 index 000000000000..a9fa5d9853b6 --- /dev/null +++ b/swaggerci/eventgrid/exports/Update-AzEventGridChannel.ps1 @@ -0,0 +1,247 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Synchronously updates a channel with the specified parameters. +.Description +Synchronously updates a channel with the specified parameters. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/update-azeventgridchannel +#> +function Update-AzEventGridChannel { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Alias('ChannelName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the channel. + ${Name}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the partner namespace. + ${PartnerNamespaceName}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the partners subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInlineEventTypes]))] + [System.Collections.Hashtable] + # A collection of inline event types for the resource. + # The inline event type keys are of type string which represents the name of the event.An example of a valid inline event name is "Contoso.OrderCreated".The inline event type values are of type InlineEventProperties and will contain additional information for every inline event type. + ${EventTypeInfoInlineEventType}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind] + # The kind of event type used. + ${EventTypeInfoKind}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.DateTime] + # Expiration time of the event channel. + # If this timer expires while the corresponding partner topic or partner destination is never activated,the channel and corresponding partner topic or partner destination are deleted. + ${ExpirationTimeIfNotActivatedUtc}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + UpdateExpanded = 'Az.EventGrid.private\Update-AzEventGridChannel_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.EventGrid.private\Update-AzEventGridChannel_UpdateViaIdentityExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/Update-AzEventGridDomain.ps1 b/swaggerci/eventgrid/exports/Update-AzEventGridDomain.ps1 new file mode 100644 index 000000000000..157bae46c902 --- /dev/null +++ b/swaggerci/eventgrid/exports/Update-AzEventGridDomain.ps1 @@ -0,0 +1,331 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Asynchronously updates a domain with the specified parameters. +.Description +Asynchronously updates a domain with the specified parameters. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INBOUNDIPRULE : This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess is enabled. + [Action ]: Action to perform based on the match or no match of the IpMask. + [IPMask ]: IP Address in CIDR notation e.g., 10.0.0.0/8. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/update-azeventgriddomain +#> +function Update-AzEventGridDomain { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Alias('DomainName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the domain. + ${Name}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Management.Automation.SwitchParameter] + # This Boolean is used to specify the creation mechanism for 'all' the Event Grid Domain Topics associated with this Event Grid Domain resource.In this context, creation of domain topic can be auto-managed (when true) or self-managed (when false). + # The default value for this property is true.When this property is null or set to true, Event Grid is responsible of automatically creating the domain topic when the first event subscription iscreated at the scope of the domain topic. + # If this property is set to false, then creating the first event subscription will require creating a domain topicby the user. + # The self-management mode can be used if the user wants full control of when the domain topic is created, while auto-managed mode provides theflexibility to perform less operations and manage fewer resources by the user. + # Also, note that in auto-managed creation mode, user is allowed to create thedomain topic on demand if needed. + ${AutoCreateTopicWithFirstSubscription}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Management.Automation.SwitchParameter] + # This Boolean is used to specify the deletion mechanism for 'all' the Event Grid Domain Topics associated with this Event Grid Domain resource.In this context, deletion of domain topic can be auto-managed (when true) or self-managed (when false). + # The default value for this property is true.When this property is set to true, Event Grid is responsible of automatically deleting the domain topic when the last event subscription at the scopeof the domain topic is deleted. + # If this property is set to false, then the user needs to manually delete the domain topic when it is no longer needed(e.g., when last event subscription is deleted and the resource needs to be cleaned up). + # The self-management mode can be used if the user wants fullcontrol of when the domain topic needs to be deleted, while auto-managed mode provides the flexibility to perform less operations and manage fewerresources by the user. + ${AutoDeleteTopicWithLastSubscription}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary] + # The data residency boundary for the domain. + ${DataResidencyBoundary}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Management.Automation.SwitchParameter] + # This boolean is used to enable or disable local auth. + # Default value is false. + # When the property is set to true, only AAD token will be used to authenticate if user is allowed to publish to the domain. + ${DisableLocalAuth}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The principal ID of resource identity. + ${IdentityPrincipalId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The tenant ID of resource. + ${IdentityTenantId}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType] + # 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. + ${IdentityType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities]))] + [System.Collections.Hashtable] + # The list of user identities associated with the resource. + # The user identity dictionary key references will be ARM resource ids in the form:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.This property is currently not used and reserved for future usage. + ${IdentityUserAssignedIdentity}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[]] + # This can be used to restrict traffic from specific IPs instead of all IPs. + # Note: These are considered only if PublicNetworkAccess is enabled. + # To construct, see NOTES section for INBOUNDIPRULE properties and create a hash table. + ${InboundIPRule}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess] + # This determines if traffic is allowed over public network. + # By default it is enabled. + # You can further restrict to specific IPs by configuring + ${PublicNetworkAccess}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku] + # The Sku name of the resource. + # The possible values are: Basic or Premium. + ${SkuName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParametersTags]))] + [System.Collections.Hashtable] + # Tags of the domains resource. + ${Tag}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + UpdateExpanded = 'Az.EventGrid.private\Update-AzEventGridDomain_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.EventGrid.private\Update-AzEventGridDomain_UpdateViaIdentityExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/Update-AzEventGridDomainEventSubscription.ps1 b/swaggerci/eventgrid/exports/Update-AzEventGridDomainEventSubscription.ps1 new file mode 100644 index 000000000000..35d20944e6aa --- /dev/null +++ b/swaggerci/eventgrid/exports/Update-AzEventGridDomainEventSubscription.ps1 @@ -0,0 +1,356 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Update an existing event subscription for a topic. +.Description +Update an existing event subscription for a topic. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +FILTERADVANCEDFILTER : An array of advanced filters that are used for filtering event subscriptions. + OperatorType : The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. + [Key ]: The field/property in the event based on which you want to filter. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/update-azeventgriddomaineventsubscription +#> +function Update-AzEventGridDomainEventSubscription { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the domain. + ${DomainName}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the event subscription to be updated. + ${EventSubscriptionName}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.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. + ${DeadLetterWithResourceIdentityType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The user identity associated with the resource. + ${DeadLetterWithResourceIdentityUserAssignedIdentity}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType] + # Type of the endpoint for the event subscription destination. + ${DeliveryWithResourceIdentityDestinationEndpointType}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.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. + ${DeliveryWithResourceIdentityType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The user identity associated with the resource. + ${DeliveryWithResourceIdentityUserAssignedIdentity}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType] + # Type of the endpoint for the event subscription destination. + ${EndpointType}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema] + # The event delivery schema for the event subscription. + ${EventDeliverySchema}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.DateTime] + # Information about the expiration time for the event subscription. + ${ExpirationTimeUtc}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[]] + # An array of advanced filters that are used for filtering event subscriptions. + # To construct, see NOTES section for FILTERADVANCEDFILTER properties and create a hash table. + ${FilterAdvancedFilter}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Allows advanced filters to be evaluated against an array of values instead of expecting a singular value. + ${FilterEnableAdvancedFilteringOnArray}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String[]] + # 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. + ${FilterIncludedEventType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filtershould be compared in a case sensitive manner. + ${FilterIsSubjectCaseSensitive}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # An optional string to filter events for an event subscription based on a resource path prefix.The format of this depends on the publisher of the events.Wildcard characters are not supported in this path. + ${FilterSubjectBeginsWith}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # An optional string to filter events for an event subscription based on a resource path suffix.Wildcard characters are not supported in this path. + ${FilterSubjectEndsWith}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String[]] + # List of user defined labels. + ${Label}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Int32] + # Time To Live (in minutes) for events. + ${RetryPolicyEventTimeToLiveInMinute}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Int32] + # Maximum number of delivery retry attempts for events. + ${RetryPolicyMaxDeliveryAttempt}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + UpdateExpanded = 'Az.EventGrid.private\Update-AzEventGridDomainEventSubscription_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.EventGrid.private\Update-AzEventGridDomainEventSubscription_UpdateViaIdentityExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/Update-AzEventGridDomainTopicEventSubscription.ps1 b/swaggerci/eventgrid/exports/Update-AzEventGridDomainTopicEventSubscription.ps1 new file mode 100644 index 000000000000..3bd710f8c4fe --- /dev/null +++ b/swaggerci/eventgrid/exports/Update-AzEventGridDomainTopicEventSubscription.ps1 @@ -0,0 +1,362 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Update an existing event subscription for a domain topic. +.Description +Update an existing event subscription for a domain topic. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +FILTERADVANCEDFILTER : An array of advanced filters that are used for filtering event subscriptions. + OperatorType : The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. + [Key ]: The field/property in the event based on which you want to filter. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/update-azeventgriddomaintopiceventsubscription +#> +function Update-AzEventGridDomainTopicEventSubscription { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the domain. + ${DomainName}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the event subscription to be updated. + ${EventSubscriptionName}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the topic. + ${TopicName}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.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. + ${DeadLetterWithResourceIdentityType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The user identity associated with the resource. + ${DeadLetterWithResourceIdentityUserAssignedIdentity}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType] + # Type of the endpoint for the event subscription destination. + ${DeliveryWithResourceIdentityDestinationEndpointType}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.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. + ${DeliveryWithResourceIdentityType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The user identity associated with the resource. + ${DeliveryWithResourceIdentityUserAssignedIdentity}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType] + # Type of the endpoint for the event subscription destination. + ${EndpointType}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema] + # The event delivery schema for the event subscription. + ${EventDeliverySchema}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.DateTime] + # Information about the expiration time for the event subscription. + ${ExpirationTimeUtc}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[]] + # An array of advanced filters that are used for filtering event subscriptions. + # To construct, see NOTES section for FILTERADVANCEDFILTER properties and create a hash table. + ${FilterAdvancedFilter}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Allows advanced filters to be evaluated against an array of values instead of expecting a singular value. + ${FilterEnableAdvancedFilteringOnArray}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String[]] + # 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. + ${FilterIncludedEventType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filtershould be compared in a case sensitive manner. + ${FilterIsSubjectCaseSensitive}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # An optional string to filter events for an event subscription based on a resource path prefix.The format of this depends on the publisher of the events.Wildcard characters are not supported in this path. + ${FilterSubjectBeginsWith}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # An optional string to filter events for an event subscription based on a resource path suffix.Wildcard characters are not supported in this path. + ${FilterSubjectEndsWith}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String[]] + # List of user defined labels. + ${Label}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Int32] + # Time To Live (in minutes) for events. + ${RetryPolicyEventTimeToLiveInMinute}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Int32] + # Maximum number of delivery retry attempts for events. + ${RetryPolicyMaxDeliveryAttempt}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + UpdateExpanded = 'Az.EventGrid.private\Update-AzEventGridDomainTopicEventSubscription_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.EventGrid.private\Update-AzEventGridDomainTopicEventSubscription_UpdateViaIdentityExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/Update-AzEventGridEventSubscription.ps1 b/swaggerci/eventgrid/exports/Update-AzEventGridEventSubscription.ps1 new file mode 100644 index 000000000000..2013f0c5acfc --- /dev/null +++ b/swaggerci/eventgrid/exports/Update-AzEventGridEventSubscription.ps1 @@ -0,0 +1,342 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Asynchronously updates an existing event subscription. +.Description +Asynchronously updates an existing event subscription. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +FILTERADVANCEDFILTER : An array of advanced filters that are used for filtering event subscriptions. + OperatorType : The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. + [Key ]: The field/property in the event based on which you want to filter. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/update-azeventgrideventsubscription +#> +function Update-AzEventGridEventSubscription { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Alias('EventSubscriptionName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the event subscription to be updated. + ${Name}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # 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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + ${Scope}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.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. + ${DeadLetterWithResourceIdentityType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The user identity associated with the resource. + ${DeadLetterWithResourceIdentityUserAssignedIdentity}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType] + # Type of the endpoint for the event subscription destination. + ${DeliveryWithResourceIdentityDestinationEndpointType}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.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. + ${DeliveryWithResourceIdentityType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The user identity associated with the resource. + ${DeliveryWithResourceIdentityUserAssignedIdentity}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType] + # Type of the endpoint for the event subscription destination. + ${EndpointType}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema] + # The event delivery schema for the event subscription. + ${EventDeliverySchema}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.DateTime] + # Information about the expiration time for the event subscription. + ${ExpirationTimeUtc}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[]] + # An array of advanced filters that are used for filtering event subscriptions. + # To construct, see NOTES section for FILTERADVANCEDFILTER properties and create a hash table. + ${FilterAdvancedFilter}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Allows advanced filters to be evaluated against an array of values instead of expecting a singular value. + ${FilterEnableAdvancedFilteringOnArray}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String[]] + # 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. + ${FilterIncludedEventType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filtershould be compared in a case sensitive manner. + ${FilterIsSubjectCaseSensitive}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # An optional string to filter events for an event subscription based on a resource path prefix.The format of this depends on the publisher of the events.Wildcard characters are not supported in this path. + ${FilterSubjectBeginsWith}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # An optional string to filter events for an event subscription based on a resource path suffix.Wildcard characters are not supported in this path. + ${FilterSubjectEndsWith}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String[]] + # List of user defined labels. + ${Label}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Int32] + # Time To Live (in minutes) for events. + ${RetryPolicyEventTimeToLiveInMinute}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Int32] + # Maximum number of delivery retry attempts for events. + ${RetryPolicyMaxDeliveryAttempt}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + UpdateExpanded = 'Az.EventGrid.private\Update-AzEventGridEventSubscription_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.EventGrid.private\Update-AzEventGridEventSubscription_UpdateViaIdentityExpanded'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/Update-AzEventGridPartnerConfiguration.ps1 b/swaggerci/eventgrid/exports/Update-AzEventGridPartnerConfiguration.ps1 new file mode 100644 index 000000000000..358a28876494 --- /dev/null +++ b/swaggerci/eventgrid/exports/Update-AzEventGridPartnerConfiguration.ps1 @@ -0,0 +1,238 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Synchronously updates a partner configuration with the specified parameters. +.Description +Synchronously updates a partner configuration with the specified parameters. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfiguration +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/update-azeventgridpartnerconfiguration +#> +function Update-AzEventGridPartnerConfiguration { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfiguration])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Int32] + # The default time used to validate the maximum expiration time for each authorized partners in days. + # Allowed values ar between 1 and 365 days. + ${DefaultMaximumExpirationTimeInDay}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationUpdateParametersTags]))] + [System.Collections.Hashtable] + # Tags of the partner configuration resource. + ${Tag}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + UpdateExpanded = 'Az.EventGrid.private\Update-AzEventGridPartnerConfiguration_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.EventGrid.private\Update-AzEventGridPartnerConfiguration_UpdateViaIdentityExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/Update-AzEventGridPartnerDestination.ps1 b/swaggerci/eventgrid/exports/Update-AzEventGridPartnerDestination.ps1 new file mode 100644 index 000000000000..1c13c3d6a44f --- /dev/null +++ b/swaggerci/eventgrid/exports/Update-AzEventGridPartnerDestination.ps1 @@ -0,0 +1,226 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Asynchronously updates a partner destination with the specified parameters. +.Description +Asynchronously updates a partner destination with the specified parameters. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestination +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/update-azeventgridpartnerdestination +#> +function Update-AzEventGridPartnerDestination { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestination])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Alias('PartnerDestinationName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the partner destination. + ${Name}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationUpdateParametersTags]))] + [System.Collections.Hashtable] + # Tags of the Partner Destination resource. + ${Tag}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + UpdateExpanded = 'Az.EventGrid.private\Update-AzEventGridPartnerDestination_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.EventGrid.private\Update-AzEventGridPartnerDestination_UpdateViaIdentityExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/Update-AzEventGridPartnerNamespace.ps1 b/swaggerci/eventgrid/exports/Update-AzEventGridPartnerNamespace.ps1 new file mode 100644 index 000000000000..b2901712dc51 --- /dev/null +++ b/swaggerci/eventgrid/exports/Update-AzEventGridPartnerNamespace.ps1 @@ -0,0 +1,268 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Asynchronously updates a partner namespace with the specified parameters. +.Description +Asynchronously updates a partner namespace with the specified parameters. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INBOUNDIPRULE : This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess is enabled. + [Action ]: Action to perform based on the match or no match of the IpMask. + [IPMask ]: IP Address in CIDR notation e.g., 10.0.0.0/8. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/update-azeventgridpartnernamespace +#> +function Update-AzEventGridPartnerNamespace { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Alias('PartnerNamespaceName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the partner namespace. + ${Name}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Management.Automation.SwitchParameter] + # This boolean is used to enable or disable local auth. + # Default value is false. + # When the property is set to true, only AAD token will be used to authenticate if user is allowed to publish to the partner namespace. + ${DisableLocalAuth}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[]] + # This can be used to restrict traffic from specific IPs instead of all IPs. + # Note: These are considered only if PublicNetworkAccess is enabled. + # To construct, see NOTES section for INBOUNDIPRULE properties and create a hash table. + ${InboundIPRule}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess] + # This determines if traffic is allowed over public network. + # By default it is enabled. + # You can further restrict to specific IPs by configuring + ${PublicNetworkAccess}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParametersTags]))] + [System.Collections.Hashtable] + # Tags of the Partner Namespace. + ${Tag}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + UpdateExpanded = 'Az.EventGrid.private\Update-AzEventGridPartnerNamespace_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.EventGrid.private\Update-AzEventGridPartnerNamespace_UpdateViaIdentityExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/Update-AzEventGridPartnerRegistration.ps1 b/swaggerci/eventgrid/exports/Update-AzEventGridPartnerRegistration.ps1 new file mode 100644 index 000000000000..55af70f3df93 --- /dev/null +++ b/swaggerci/eventgrid/exports/Update-AzEventGridPartnerRegistration.ps1 @@ -0,0 +1,277 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Updates a partner registration with the specified parameters. +.Description +Updates a partner registration with the specified parameters. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/update-azeventgridpartnerregistration +#> +function Update-AzEventGridPartnerRegistration { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Alias('PartnerRegistrationName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the partner registration. + ${Name}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String[]] + # List of IDs of Azure AD applications that are authorized to create a partner namespaceassociated with this partner registration. + # This is an optional property. + # Creatingpartner namespaces is always permitted under the same Azure subscription as the one usedfor creating the partner registration. + ${AuthorizedAzureSubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # URI of the partner logo. + ${LogoUri}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # Description of the partner topic type. + ${PartnerTopicTypeDescription}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # Display name of the partner topic type. + ${PartnerTopicTypeDisplayName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # Name of the partner topic type. + ${PartnerTopicTypeName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # URI of the partner website that can be used by Azure customers to setup Event Gridintegration on an event source. + ${SetupUri}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationUpdateParametersTags]))] + [System.Collections.Hashtable] + # Tags of the partner registration resource. + ${Tag}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + UpdateExpanded = 'Az.EventGrid.private\Update-AzEventGridPartnerRegistration_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.EventGrid.private\Update-AzEventGridPartnerRegistration_UpdateViaIdentityExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/Update-AzEventGridPartnerTopic.ps1 b/swaggerci/eventgrid/exports/Update-AzEventGridPartnerTopic.ps1 new file mode 100644 index 000000000000..a6880ded26bc --- /dev/null +++ b/swaggerci/eventgrid/exports/Update-AzEventGridPartnerTopic.ps1 @@ -0,0 +1,255 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Asynchronously updates a partner topic with the specified parameters. +.Description +Asynchronously updates a partner topic with the specified parameters. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopic +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/update-azeventgridpartnertopic +#> +function Update-AzEventGridPartnerTopic { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopic])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Alias('PartnerTopicName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the partner topic. + ${Name}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The principal ID of resource identity. + ${IdentityPrincipalId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The tenant ID of resource. + ${IdentityTenantId}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType] + # 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. + ${IdentityType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities]))] + [System.Collections.Hashtable] + # The list of user identities associated with the resource. + # The user identity dictionary key references will be ARM resource ids in the form:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.This property is currently not used and reserved for future usage. + ${IdentityUserAssignedIdentity}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicUpdateParametersTags]))] + [System.Collections.Hashtable] + # Tags of the Partner Topic resource. + ${Tag}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + UpdateExpanded = 'Az.EventGrid.private\Update-AzEventGridPartnerTopic_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.EventGrid.private\Update-AzEventGridPartnerTopic_UpdateViaIdentityExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/Update-AzEventGridPartnerTopicEventSubscription.ps1 b/swaggerci/eventgrid/exports/Update-AzEventGridPartnerTopicEventSubscription.ps1 new file mode 100644 index 000000000000..ce19407ebcb0 --- /dev/null +++ b/swaggerci/eventgrid/exports/Update-AzEventGridPartnerTopicEventSubscription.ps1 @@ -0,0 +1,357 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Update an existing event subscription of a partner topic. +.Description +Update an existing event subscription of a partner topic. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +FILTERADVANCEDFILTER : An array of advanced filters that are used for filtering event subscriptions. + OperatorType : The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. + [Key ]: The field/property in the event based on which you want to filter. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/update-azeventgridpartnertopiceventsubscription +#> +function Update-AzEventGridPartnerTopicEventSubscription { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # 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. + ${EventSubscriptionName}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the partner topic. + ${PartnerTopicName}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.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. + ${DeadLetterWithResourceIdentityType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The user identity associated with the resource. + ${DeadLetterWithResourceIdentityUserAssignedIdentity}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType] + # Type of the endpoint for the event subscription destination. + ${DeliveryWithResourceIdentityDestinationEndpointType}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.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. + ${DeliveryWithResourceIdentityType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The user identity associated with the resource. + ${DeliveryWithResourceIdentityUserAssignedIdentity}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType] + # Type of the endpoint for the event subscription destination. + ${EndpointType}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema] + # The event delivery schema for the event subscription. + ${EventDeliverySchema}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.DateTime] + # Information about the expiration time for the event subscription. + ${ExpirationTimeUtc}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[]] + # An array of advanced filters that are used for filtering event subscriptions. + # To construct, see NOTES section for FILTERADVANCEDFILTER properties and create a hash table. + ${FilterAdvancedFilter}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Allows advanced filters to be evaluated against an array of values instead of expecting a singular value. + ${FilterEnableAdvancedFilteringOnArray}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String[]] + # 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. + ${FilterIncludedEventType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filtershould be compared in a case sensitive manner. + ${FilterIsSubjectCaseSensitive}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # An optional string to filter events for an event subscription based on a resource path prefix.The format of this depends on the publisher of the events.Wildcard characters are not supported in this path. + ${FilterSubjectBeginsWith}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # An optional string to filter events for an event subscription based on a resource path suffix.Wildcard characters are not supported in this path. + ${FilterSubjectEndsWith}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String[]] + # List of user defined labels. + ${Label}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Int32] + # Time To Live (in minutes) for events. + ${RetryPolicyEventTimeToLiveInMinute}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Int32] + # Maximum number of delivery retry attempts for events. + ${RetryPolicyMaxDeliveryAttempt}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + UpdateExpanded = 'Az.EventGrid.private\Update-AzEventGridPartnerTopicEventSubscription_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.EventGrid.private\Update-AzEventGridPartnerTopicEventSubscription_UpdateViaIdentityExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/Update-AzEventGridSystemTopic.ps1 b/swaggerci/eventgrid/exports/Update-AzEventGridSystemTopic.ps1 new file mode 100644 index 000000000000..4b3039bc3385 --- /dev/null +++ b/swaggerci/eventgrid/exports/Update-AzEventGridSystemTopic.ps1 @@ -0,0 +1,267 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Asynchronously updates a system topic with the specified parameters. +.Description +Asynchronously updates a system topic with the specified parameters. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopic +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/update-azeventgridsystemtopic +#> +function Update-AzEventGridSystemTopic { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopic])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Alias('SystemTopicName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the system topic. + ${Name}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The principal ID of resource identity. + ${IdentityPrincipalId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The tenant ID of resource. + ${IdentityTenantId}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType] + # 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. + ${IdentityType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities]))] + [System.Collections.Hashtable] + # The list of user identities associated with the resource. + # The user identity dictionary key references will be ARM resource ids in the form:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.This property is currently not used and reserved for future usage. + ${IdentityUserAssignedIdentity}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicUpdateParametersTags]))] + [System.Collections.Hashtable] + # Tags of the system topic. + ${Tag}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + UpdateExpanded = 'Az.EventGrid.private\Update-AzEventGridSystemTopic_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.EventGrid.private\Update-AzEventGridSystemTopic_UpdateViaIdentityExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/Update-AzEventGridSystemTopicEventSubscription.ps1 b/swaggerci/eventgrid/exports/Update-AzEventGridSystemTopicEventSubscription.ps1 new file mode 100644 index 000000000000..3aed31427c6e --- /dev/null +++ b/swaggerci/eventgrid/exports/Update-AzEventGridSystemTopicEventSubscription.ps1 @@ -0,0 +1,357 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Update an existing event subscription of a system topic. +.Description +Update an existing event subscription of a system topic. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +FILTERADVANCEDFILTER : An array of advanced filters that are used for filtering event subscriptions. + OperatorType : The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. + [Key ]: The field/property in the event based on which you want to filter. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/update-azeventgridsystemtopiceventsubscription +#> +function Update-AzEventGridSystemTopicEventSubscription { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # 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. + ${EventSubscriptionName}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the system topic. + ${SystemTopicName}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.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. + ${DeadLetterWithResourceIdentityType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The user identity associated with the resource. + ${DeadLetterWithResourceIdentityUserAssignedIdentity}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType] + # Type of the endpoint for the event subscription destination. + ${DeliveryWithResourceIdentityDestinationEndpointType}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.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. + ${DeliveryWithResourceIdentityType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The user identity associated with the resource. + ${DeliveryWithResourceIdentityUserAssignedIdentity}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType] + # Type of the endpoint for the event subscription destination. + ${EndpointType}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema] + # The event delivery schema for the event subscription. + ${EventDeliverySchema}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.DateTime] + # Information about the expiration time for the event subscription. + ${ExpirationTimeUtc}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[]] + # An array of advanced filters that are used for filtering event subscriptions. + # To construct, see NOTES section for FILTERADVANCEDFILTER properties and create a hash table. + ${FilterAdvancedFilter}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Allows advanced filters to be evaluated against an array of values instead of expecting a singular value. + ${FilterEnableAdvancedFilteringOnArray}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String[]] + # 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. + ${FilterIncludedEventType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filtershould be compared in a case sensitive manner. + ${FilterIsSubjectCaseSensitive}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # An optional string to filter events for an event subscription based on a resource path prefix.The format of this depends on the publisher of the events.Wildcard characters are not supported in this path. + ${FilterSubjectBeginsWith}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # An optional string to filter events for an event subscription based on a resource path suffix.Wildcard characters are not supported in this path. + ${FilterSubjectEndsWith}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String[]] + # List of user defined labels. + ${Label}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Int32] + # Time To Live (in minutes) for events. + ${RetryPolicyEventTimeToLiveInMinute}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Int32] + # Maximum number of delivery retry attempts for events. + ${RetryPolicyMaxDeliveryAttempt}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + UpdateExpanded = 'Az.EventGrid.private\Update-AzEventGridSystemTopicEventSubscription_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.EventGrid.private\Update-AzEventGridSystemTopicEventSubscription_UpdateViaIdentityExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/Update-AzEventGridTopic.ps1 b/swaggerci/eventgrid/exports/Update-AzEventGridTopic.ps1 new file mode 100644 index 000000000000..9a454d75619f --- /dev/null +++ b/swaggerci/eventgrid/exports/Update-AzEventGridTopic.ps1 @@ -0,0 +1,312 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Asynchronously updates a topic with the specified parameters. +.Description +Asynchronously updates a topic with the specified parameters. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INBOUNDIPRULE : This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess is enabled. + [Action ]: Action to perform based on the match or no match of the IpMask. + [IPMask ]: IP Address in CIDR notation e.g., 10.0.0.0/8. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/update-azeventgridtopic +#> +function Update-AzEventGridTopic { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Alias('TopicName')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the topic. + ${Name}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary] + # The data residency boundary for the topic. + ${DataResidencyBoundary}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Management.Automation.SwitchParameter] + # This boolean is used to enable or disable local auth. + # Default value is false. + # When the property is set to true, only AAD token will be used to authenticate if user is allowed to publish to the topic. + ${DisableLocalAuth}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The principal ID of resource identity. + ${IdentityPrincipalId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The tenant ID of resource. + ${IdentityTenantId}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType] + # 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. + ${IdentityType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities]))] + [System.Collections.Hashtable] + # The list of user identities associated with the resource. + # The user identity dictionary key references will be ARM resource ids in the form:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.This property is currently not used and reserved for future usage. + ${IdentityUserAssignedIdentity}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[]] + # This can be used to restrict traffic from specific IPs instead of all IPs. + # Note: These are considered only if PublicNetworkAccess is enabled. + # To construct, see NOTES section for INBOUNDIPRULE properties and create a hash table. + ${InboundIPRule}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess] + # This determines if traffic is allowed over public network. + # By default it is enabled. + # You can further restrict to specific IPs by configuring + ${PublicNetworkAccess}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku] + # The Sku name of the resource. + # The possible values are: Basic or Premium. + ${SkuName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParametersTags]))] + [System.Collections.Hashtable] + # Tags of the Topic resource. + ${Tag}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + UpdateExpanded = 'Az.EventGrid.private\Update-AzEventGridTopic_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.EventGrid.private\Update-AzEventGridTopic_UpdateViaIdentityExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/exports/Update-AzEventGridTopicEventSubscription.ps1 b/swaggerci/eventgrid/exports/Update-AzEventGridTopicEventSubscription.ps1 new file mode 100644 index 000000000000..96a166bdb56b --- /dev/null +++ b/swaggerci/eventgrid/exports/Update-AzEventGridTopicEventSubscription.ps1 @@ -0,0 +1,356 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Update an existing event subscription for a topic. +.Description +Update an existing event subscription for a topic. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +FILTERADVANCEDFILTER : An array of advanced filters that are used for filtering event subscriptions. + OperatorType : The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. + [Key ]: The field/property in the event based on which you want to filter. + +INPUTOBJECT : Identity Parameter + [ChannelName ]: Name of the channel. + [DomainName ]: Name of the domain. + [DomainTopicName ]: Name of the topic. + [EventChannelName ]: Name of the event channel. + [EventSubscriptionName ]: Name of the event subscription. + [Id ]: Resource identity path + [Location ]: Name of the location. + [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\'. + [PartnerDestinationName ]: Name of the partner destination. + [PartnerNamespaceName ]: Name of the partner namespace. + [PartnerRegistrationName ]: Name of the partner registration. + [PartnerTopicName ]: Name of the partner topic. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection connection. + [PrivateLinkResourceName ]: The name of private link resource. + [ProviderNamespace ]: Namespace of the provider of the topic. + [ResourceGroupName ]: The name of the resource group within the partners subscription. + [ResourceName ]: Name of the resource. + [ResourceTypeName ]: Name of the resource type. + [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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. + [SubscriptionId ]: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + [SystemTopicName ]: Name of the system topic. + [TopicName ]: Name of the domain topic. + [TopicTypeName ]: Name of the topic type. + [VerifiedPartnerName ]: Name of the verified partner. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/update-azeventgridtopiceventsubscription +#> +function Update-AzEventGridTopicEventSubscription { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the event subscription to be updated. + ${EventSubscriptionName}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Subscription credentials that uniquely identify a Microsoft Azure subscription. + # The subscription ID forms part of the URI for every service call. + ${SubscriptionId}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [System.String] + # Name of the domain. + ${TopicName}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.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. + ${DeadLetterWithResourceIdentityType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The user identity associated with the resource. + ${DeadLetterWithResourceIdentityUserAssignedIdentity}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType] + # Type of the endpoint for the event subscription destination. + ${DeliveryWithResourceIdentityDestinationEndpointType}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.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. + ${DeliveryWithResourceIdentityType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # The user identity associated with the resource. + ${DeliveryWithResourceIdentityUserAssignedIdentity}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType] + # Type of the endpoint for the event subscription destination. + ${EndpointType}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema])] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema] + # The event delivery schema for the event subscription. + ${EventDeliverySchema}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.DateTime] + # Information about the expiration time for the event subscription. + ${ExpirationTimeUtc}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[]] + # An array of advanced filters that are used for filtering event subscriptions. + # To construct, see NOTES section for FILTERADVANCEDFILTER properties and create a hash table. + ${FilterAdvancedFilter}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Allows advanced filters to be evaluated against an array of values instead of expecting a singular value. + ${FilterEnableAdvancedFilteringOnArray}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String[]] + # 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. + ${FilterIncludedEventType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filtershould be compared in a case sensitive manner. + ${FilterIsSubjectCaseSensitive}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # An optional string to filter events for an event subscription based on a resource path prefix.The format of this depends on the publisher of the events.Wildcard characters are not supported in this path. + ${FilterSubjectBeginsWith}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String] + # An optional string to filter events for an event subscription based on a resource path suffix.Wildcard characters are not supported in this path. + ${FilterSubjectEndsWith}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.String[]] + # List of user defined labels. + ${Label}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Int32] + # Time To Live (in minutes) for events. + ${RetryPolicyEventTimeToLiveInMinute}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Body')] + [System.Int32] + # Maximum number of delivery retry attempts for events. + ${RetryPolicyMaxDeliveryAttempt}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + UpdateExpanded = 'Az.EventGrid.private\Update-AzEventGridTopicEventSubscription_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.EventGrid.private\Update-AzEventGridTopicEventSubscription_UpdateViaIdentityExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/eventgrid/generate-help.ps1 b/swaggerci/eventgrid/generate-help.ps1 new file mode 100644 index 000000000000..87220f557f07 --- /dev/null +++ b/swaggerci/eventgrid/generate-help.ps1 @@ -0,0 +1,66 @@ +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- +param([switch]$Isolated) +$ErrorActionPreference = 'Stop' + +$pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path +if(-not $Isolated) { + Write-Host -ForegroundColor Green 'Creating isolated process...' + & "$pwsh" -NonInteractive -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -Isolated + return +} + +$exportsFolder = Join-Path $PSScriptRoot 'exports' +if(-not (Test-Path $exportsFolder)) { + Write-Error "Exports folder '$exportsFolder' was not found." +} + +$directories = Get-ChildItem -Directory -Path $exportsFolder +$hasProfiles = ($directories | Measure-Object).Count -gt 0 +if(-not $hasProfiles) { + $directories = Get-Item -Path $exportsFolder +} + +$docsFolder = Join-Path $PSScriptRoot 'docs' +if(Test-Path $docsFolder) { + $null = Get-ChildItem -Path $docsFolder -Recurse -Exclude 'README.md' | Remove-Item -Recurse -ErrorAction SilentlyContinue +} +$null = New-Item -ItemType Directory -Force -Path $docsFolder -ErrorAction SilentlyContinue +$examplesFolder = Join-Path $PSScriptRoot 'examples' + +$modulePsd1 = Get-Item -Path (Join-Path $PSScriptRoot './Az.EventGrid.psd1') +$modulePath = $modulePsd1.FullName +$moduleName = $modulePsd1.BaseName + +# Load DLL to use build-time cmdlets +Import-Module -Name $modulePath +Import-Module -Name (Join-Path $PSScriptRoot './bin/Az.EventGrid.private.dll') +$instance = [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module]::Instance +# Module info is shared per profile +$moduleInfo = Get-Module -Name $moduleName + +foreach($directory in $directories) +{ + if($hasProfiles) { + Select-AzProfile -Name $directory.Name + } + # Reload module per profile + Import-Module -Name $modulePath -Force + + $cmdletNames = Get-ScriptCmdlet -ScriptFolder $directory.FullName + $cmdletHelpInfo = $cmdletNames | ForEach-Object { Get-Help -Name $_ -Full } + $cmdletFunctionInfo = Get-ScriptCmdlet -ScriptFolder $directory.FullName -AsFunctionInfo + + $docsPath = Join-Path $docsFolder $directory.Name + $null = New-Item -ItemType Directory -Force -Path $docsPath -ErrorAction SilentlyContinue + $examplesPath = Join-Path $examplesFolder $directory.Name + + Export-HelpMarkdown -ModuleInfo $moduleInfo -FunctionInfo $cmdletFunctionInfo -HelpInfo $cmdletHelpInfo -DocsFolder $docsPath -ExamplesFolder $examplesPath + Write-Host -ForegroundColor Green "Created documentation in '$docsPath'" +} + +Write-Host -ForegroundColor Green '-------------Done-------------' \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/Module.cs b/swaggerci/eventgrid/generated/Module.cs new file mode 100644 index 000000000000..5836a918eb42 --- /dev/null +++ b/swaggerci/eventgrid/generated/Module.cs @@ -0,0 +1,181 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using SendAsyncStepDelegate = global::System.Func, global::System.Threading.Tasks.Task>, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>; + using PipelineChangeDelegate = global::System.Action, global::System.Threading.Tasks.Task>, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>>; + using GetParameterDelegate = global::System.Func; + using ModuleLoadPipelineDelegate = global::System.Action, global::System.Threading.Tasks.Task>, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>>, global::System.Action, global::System.Threading.Tasks.Task>, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>>>; + using ArgumentCompleterDelegate = global::System.Func; + using GetTelemetryIdDelegate = global::System.Func; + using TelemetryDelegate = global::System.Action; + using NewRequestPipelineDelegate = global::System.Action, global::System.Threading.Tasks.Task>, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>>, global::System.Action, global::System.Threading.Tasks.Task>, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>>>; + using SignalDelegate = global::System.Func, global::System.Threading.Tasks.Task>; + using EventListenerDelegate = global::System.Func, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Management.Automation.InvocationInfo, string, string, string, global::System.Exception, global::System.Threading.Tasks.Task>; + using NextDelegate = global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>; + + /// A class that contains the module-common code and data. + public partial class Module + { + /// The currently selected profile. + public string Profile = global::System.String.Empty; + + public global::System.Net.Http.HttpClientHandler _handler = new global::System.Net.Http.HttpClientHandler(); + + /// the ISendAsync pipeline instance + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline _pipeline; + + /// the ISendAsync pipeline instance (when proxy is enabled) + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline _pipelineWithProxy; + + public bool _useProxy = false; + + public global::System.Net.WebProxy _webProxy = new global::System.Net.WebProxy(); + + /// Gets completion data for azure specific fields + public ArgumentCompleterDelegate ArgumentCompleter { get; set; } + + /// The instance of the Client API + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient ClientAPI { get; set; } + + /// A delegate that gets called for each signalled event + public EventListenerDelegate EventListener { get; set; } + + /// The delegate to call to get parameter data from a common module. + public GetParameterDelegate GetParameterValue { get; set; } + + /// The delegate to get the telemetry Id. + public GetTelemetryIdDelegate GetTelemetryId { get; set; } + + /// Backing field for property. + private static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module _instance; + + /// the singleton of this module class + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module Instance => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module._instance?? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module._instance = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module()); + + /// The Name of this module + public string Name => @"Az.EventGrid"; + + /// The delegate to call when this module is loaded (supporting a commmon module). + public ModuleLoadPipelineDelegate OnModuleLoad { get; set; } + + /// The delegate to call before each new request (supporting a commmon module). + public NewRequestPipelineDelegate OnNewRequest { get; set; } + + /// The name of the currently selected Azure profile + public global::System.String ProfileName { get; set; } + + /// The ResourceID for this module (azure arm). + public string ResourceId => @"Az.EventGrid"; + + /// The delegate for creating a telemetry. + public TelemetryDelegate Telemetry { get; set; } + + /// The from the cmdlet + /// The HttpPipeline for the request + + partial void AfterCreatePipeline(global::System.Management.Automation.InvocationInfo invocationInfo, ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline pipeline); + + /// The from the cmdlet + /// The HttpPipeline for the request + + partial void BeforeCreatePipeline(global::System.Management.Automation.InvocationInfo invocationInfo, ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline pipeline); + + partial void CustomInit(); + + /// Creates an instance of the HttpPipeline for each call. + /// The from the cmdlet + /// the cmdlet's correlation id. + /// the cmdlet's process record correlation id. + /// the cmdlet's parameterset name. + /// a dict for extensible parameters + /// An instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline for the remote call. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline CreatePipeline(global::System.Management.Automation.InvocationInfo invocationInfo, string correlationId, string processRecordId, string parameterSetName = null, global::System.Collections.Generic.IDictionary extensibleParameters = null) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline pipeline = null; + BeforeCreatePipeline(invocationInfo, ref pipeline); + pipeline = (pipeline ?? (_useProxy ? _pipelineWithProxy : _pipeline)).Clone(); + AfterCreatePipeline(invocationInfo, ref pipeline); + pipeline.Append(new Runtime.CmdInfoHandler(processRecordId, invocationInfo, parameterSetName).SendAsync); + OnNewRequest?.Invoke( invocationInfo, correlationId,processRecordId, (step)=> { pipeline.Prepend(step); } , (step)=> { pipeline.Append(step); } ); + return pipeline; + } + + /// Gets parameters from a common module. + /// The from the cmdlet + /// the cmdlet's correlation id. + /// The name of the parameter to get the value for. + /// + /// The parameter value from the common module. (Note: this should be type converted on the way back) + /// + public object GetParameter(global::System.Management.Automation.InvocationInfo invocationInfo, string correlationId, string parameterName) => GetParameterValue?.Invoke( ResourceId, Name, invocationInfo, correlationId,parameterName ); + + /// Initialization steps performed after the module is loaded. + public void Init() + { + OnModuleLoad?.Invoke( ResourceId, Name ,(step)=> { _pipeline.Prepend(step); } , (step)=> { _pipeline.Append(step); } ); + OnModuleLoad?.Invoke( ResourceId, Name ,(step)=> { _pipelineWithProxy.Prepend(step); } , (step)=> { _pipelineWithProxy.Append(step); } ); + CustomInit(); + } + + /// Creates the module instance. + private Module() + { + /// constructor + ClientAPI = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient(); + _handler.Proxy = _webProxy; + _pipeline = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline(new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpClientFactory(new global::System.Net.Http.HttpClient())); + _pipelineWithProxy = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline(new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpClientFactory(new global::System.Net.Http.HttpClient(_handler))); + } + + /// The HTTP Proxy to use. + /// The HTTP Proxy Credentials + /// True if the proxy should use default credentials + public void SetProxyConfiguration(global::System.Uri proxy, global::System.Management.Automation.PSCredential proxyCredential, bool proxyUseDefaultCredentials) + { + _useProxy = proxy != null; + if (proxy == null) + { + return; + } + // set the proxy configuration + _webProxy.Address = proxy; + _webProxy.BypassProxyOnLocal = false; + if (proxyUseDefaultCredentials) + { + _webProxy.Credentials = null; + _webProxy.UseDefaultCredentials = true; + } + else + { + _webProxy.UseDefaultCredentials = false; + _webProxy.Credentials = proxyCredential ?.GetNetworkCredential(); + } + } + + /// Called to dispatch events to the common module listener + /// The ID of the event + /// The cancellation token for the event + /// A delegate to get the detailed event data + /// The callback for the event dispatcher + /// The from the cmdlet + /// the cmdlet's parameterset name. + /// the cmdlet's correlation id. + /// the cmdlet's process record correlation id. + /// the exception that is being thrown (if available) + /// + /// A that will be complete when handling of the event is completed. + /// + public async global::System.Threading.Tasks.Task Signal(string id, global::System.Threading.CancellationToken token, global::System.Func getEventData, SignalDelegate signal, global::System.Management.Automation.InvocationInfo invocationInfo, string parameterSetName, string correlationId, string processRecordId, global::System.Exception exception) + { + using( NoSynchronizationContext ) + { + await EventListener?.Invoke(id,token,getEventData, signal, invocationInfo, parameterSetName, correlationId,processRecordId,exception); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/EventGridManagementClient.cs b/swaggerci/eventgrid/generated/api/EventGridManagementClient.cs new file mode 100644 index 000000000000..441b94da642d --- /dev/null +++ b/swaggerci/eventgrid/generated/api/EventGridManagementClient.cs @@ -0,0 +1,29734 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// + /// Low-level API implementation for the EventGridManagementClient service. + /// Azure EventGrid Management Client + /// + public partial class EventGridManagementClient + { + + /// Synchronously creates or updates a new channel with the specified parameters. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the partners subscription. + /// Name of the partner namespace. + /// Name of the channel. + /// Channel information. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ChannelsCreateOrUpdate(string subscriptionId, string resourceGroupName, string partnerNamespaceName, string channelName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannel body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/partnerNamespaces/" + + global::System.Uri.EscapeDataString(partnerNamespaceName) + + "/channels/" + + global::System.Uri.EscapeDataString(channelName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ChannelsCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Synchronously creates or updates a new channel with the specified parameters. + /// + /// Channel information. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ChannelsCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannel body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/partnerNamespaces/(?[^/]+)/channels/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerNamespaces/{partnerNamespaceName}/channels/{channelName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var partnerNamespaceName = _match.Groups["partnerNamespaceName"].Value; + var channelName = _match.Groups["channelName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/partnerNamespaces/" + + partnerNamespaceName + + "/channels/" + + channelName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ChannelsCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ChannelsCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.Channel.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.Channel.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the partners subscription. + /// Name of the partner namespace. + /// Name of the channel. + /// Channel information. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ChannelsCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string partnerNamespaceName, string channelName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannel body, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(partnerNamespaceName),partnerNamespaceName); + await eventListener.AssertNotNull(nameof(channelName),channelName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Delete an existing channel. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the partners subscription. + /// Name of the partner namespace. + /// Name of the channel. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ChannelsDelete(string subscriptionId, string resourceGroupName, string partnerNamespaceName, string channelName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/partnerNamespaces/" + + global::System.Uri.EscapeDataString(partnerNamespaceName) + + "/channels/" + + global::System.Uri.EscapeDataString(channelName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ChannelsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Delete an existing channel. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ChannelsDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/partnerNamespaces/(?[^/]+)/channels/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerNamespaces/{partnerNamespaceName}/channels/{channelName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var partnerNamespaceName = _match.Groups["partnerNamespaceName"].Value; + var channelName = _match.Groups["channelName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/partnerNamespaces/" + + partnerNamespaceName + + "/channels/" + + channelName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ChannelsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ChannelsDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_finalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the partners subscription. + /// Name of the partner namespace. + /// Name of the channel. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ChannelsDelete_Validate(string subscriptionId, string resourceGroupName, string partnerNamespaceName, string channelName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(partnerNamespaceName),partnerNamespaceName); + await eventListener.AssertNotNull(nameof(channelName),channelName); + } + } + + /// Get properties of a channel. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the partners subscription. + /// Name of the partner namespace. + /// Name of the channel. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ChannelsGet(string subscriptionId, string resourceGroupName, string partnerNamespaceName, string channelName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/partnerNamespaces/" + + global::System.Uri.EscapeDataString(partnerNamespaceName) + + "/channels/" + + global::System.Uri.EscapeDataString(channelName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ChannelsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Get the full endpoint URL of a partner destination channel. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the partners subscription. + /// Name of the partner namespace. + /// Name of the Channel. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ChannelsGetFullUrl(string subscriptionId, string resourceGroupName, string partnerNamespaceName, string channelName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/partnerNamespaces/" + + global::System.Uri.EscapeDataString(partnerNamespaceName) + + "/channels/" + + global::System.Uri.EscapeDataString(channelName) + + "/getFullUrl" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ChannelsGetFullUrl_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Get the full endpoint URL of a partner destination channel. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ChannelsGetFullUrlViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/partnerNamespaces/(?[^/]+)/channels/(?[^/]+)/getFullUrl$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerNamespaces/{partnerNamespaceName}/channels/{channelName}/getFullUrl'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var partnerNamespaceName = _match.Groups["partnerNamespaceName"].Value; + var channelName = _match.Groups["channelName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/partnerNamespaces/" + + partnerNamespaceName + + "/channels/" + + channelName + + "/getFullUrl" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ChannelsGetFullUrl_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ChannelsGetFullUrl_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionFullUrl.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the partners subscription. + /// Name of the partner namespace. + /// Name of the Channel. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ChannelsGetFullUrl_Validate(string subscriptionId, string resourceGroupName, string partnerNamespaceName, string channelName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(partnerNamespaceName),partnerNamespaceName); + await eventListener.AssertNotNull(nameof(channelName),channelName); + } + } + + /// Get properties of a channel. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ChannelsGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/partnerNamespaces/(?[^/]+)/channels/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerNamespaces/{partnerNamespaceName}/channels/{channelName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var partnerNamespaceName = _match.Groups["partnerNamespaceName"].Value; + var channelName = _match.Groups["channelName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/partnerNamespaces/" + + partnerNamespaceName + + "/channels/" + + channelName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ChannelsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ChannelsGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.Channel.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation events + /// back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the partners subscription. + /// Name of the partner namespace. + /// Name of the channel. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ChannelsGet_Validate(string subscriptionId, string resourceGroupName, string partnerNamespaceName, string channelName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(partnerNamespaceName),partnerNamespaceName); + await eventListener.AssertNotNull(nameof(channelName),channelName); + } + } + + /// List all the channels in a partner namespace. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the partners subscription. + /// Name of the partner namespace. + /// 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'. + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ChannelsListByPartnerNamespace(string subscriptionId, string resourceGroupName, string partnerNamespaceName, string Filter, int? Top, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/partnerNamespaces/" + + global::System.Uri.EscapeDataString(partnerNamespaceName) + + "/channels" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ChannelsListByPartnerNamespace_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// List all the channels in a partner namespace. + /// + /// 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'. + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ChannelsListByPartnerNamespaceViaIdentity(global::System.String viaIdentity, string Filter, int? Top, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/partnerNamespaces/(?[^/]+)/channels$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerNamespaces/{partnerNamespaceName}/channels'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var partnerNamespaceName = _match.Groups["partnerNamespaceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/partnerNamespaces/" + + partnerNamespaceName + + "/channels" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ChannelsListByPartnerNamespace_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ChannelsListByPartnerNamespace_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ChannelsListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the partners subscription. + /// Name of the partner namespace. + /// 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'. + /// 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. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ChannelsListByPartnerNamespace_Validate(string subscriptionId, string resourceGroupName, string partnerNamespaceName, string Filter, int? Top, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(partnerNamespaceName),partnerNamespaceName); + await eventListener.AssertNotNull(nameof(Filter),Filter); + } + } + + /// Synchronously updates a channel with the specified parameters. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the partners subscription. + /// Name of the partner namespace. + /// Name of the channel. + /// Channel update information. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ChannelsUpdate(string subscriptionId, string resourceGroupName, string partnerNamespaceName, string channelName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParameters body, global::System.Func onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/partnerNamespaces/" + + global::System.Uri.EscapeDataString(partnerNamespaceName) + + "/channels/" + + global::System.Uri.EscapeDataString(channelName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ChannelsUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Synchronously updates a channel with the specified parameters. + /// + /// Channel update information. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ChannelsUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParameters body, global::System.Func onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/partnerNamespaces/(?[^/]+)/channels/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerNamespaces/{partnerNamespaceName}/channels/{channelName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var partnerNamespaceName = _match.Groups["partnerNamespaceName"].Value; + var channelName = _match.Groups["channelName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/partnerNamespaces/" + + partnerNamespaceName + + "/channels/" + + channelName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ChannelsUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ChannelsUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the partners subscription. + /// Name of the partner namespace. + /// Name of the channel. + /// Channel update information. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ChannelsUpdate_Validate(string subscriptionId, string resourceGroupName, string partnerNamespaceName, string channelName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParameters body, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(partnerNamespaceName),partnerNamespaceName); + await eventListener.AssertNotNull(nameof(channelName),channelName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// + /// Asynchronously creates a new event subscription or updates an existing event subscription. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the domain topic. + /// 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. + /// Event subscription properties containing the destination and filter information. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DomainEventSubscriptionsCreateOrUpdate(string subscriptionId, string resourceGroupName, string domainName, string eventSubscriptionName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/domains/" + + global::System.Uri.EscapeDataString(domainName) + + "/eventSubscriptions/" + + global::System.Uri.EscapeDataString(eventSubscriptionName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DomainEventSubscriptionsCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Asynchronously creates a new event subscription or updates an existing event subscription. + /// + /// + /// Event subscription properties containing the destination and filter information. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DomainEventSubscriptionsCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/domains/(?[^/]+)/eventSubscriptions/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/eventSubscriptions/{eventSubscriptionName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var domainName = _match.Groups["domainName"].Value; + var eventSubscriptionName = _match.Groups["eventSubscriptionName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/domains/" + + domainName + + "/eventSubscriptions/" + + eventSubscriptionName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DomainEventSubscriptionsCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DomainEventSubscriptionsCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscription.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but + /// you will get validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the domain topic. + /// 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. + /// Event subscription properties containing the destination and filter information. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DomainEventSubscriptionsCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string domainName, string eventSubscriptionName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription body, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(domainName),domainName); + await eventListener.AssertNotNull(nameof(eventSubscriptionName),eventSubscriptionName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Delete an existing event subscription for a domain. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the domain. + /// Name of the event subscription to be deleted. Event subscription names must be between + /// 3 and 100 characters in length and use alphanumeric letters only. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DomainEventSubscriptionsDelete(string subscriptionId, string resourceGroupName, string domainName, string eventSubscriptionName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/domains/" + + global::System.Uri.EscapeDataString(domainName) + + "/eventSubscriptions/" + + global::System.Uri.EscapeDataString(eventSubscriptionName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DomainEventSubscriptionsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Delete an existing event subscription for a domain. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DomainEventSubscriptionsDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/domains/(?[^/]+)/eventSubscriptions/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/eventSubscriptions/{eventSubscriptionName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var domainName = _match.Groups["domainName"].Value; + var eventSubscriptionName = _match.Groups["eventSubscriptionName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/domains/" + + domainName + + "/eventSubscriptions/" + + eventSubscriptionName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DomainEventSubscriptionsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DomainEventSubscriptionsDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_finalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the domain. + /// Name of the event subscription to be deleted. Event subscription names must be between + /// 3 and 100 characters in length and use alphanumeric letters only. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DomainEventSubscriptionsDelete_Validate(string subscriptionId, string resourceGroupName, string domainName, string eventSubscriptionName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(domainName),domainName); + await eventListener.AssertNotNull(nameof(eventSubscriptionName),eventSubscriptionName); + } + } + + /// Get properties of an event subscription of a domain. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the partner topic. + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DomainEventSubscriptionsGet(string subscriptionId, string resourceGroupName, string domainName, string eventSubscriptionName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/domains/" + + global::System.Uri.EscapeDataString(domainName) + + "/eventSubscriptions/" + + global::System.Uri.EscapeDataString(eventSubscriptionName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DomainEventSubscriptionsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Get all delivery attributes for an event subscription for domain. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the domain topic. + /// Name of the event subscription. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DomainEventSubscriptionsGetDeliveryAttributes(string subscriptionId, string resourceGroupName, string domainName, string eventSubscriptionName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/domains/" + + global::System.Uri.EscapeDataString(domainName) + + "/eventSubscriptions/" + + global::System.Uri.EscapeDataString(eventSubscriptionName) + + "/getDeliveryAttributes" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DomainEventSubscriptionsGetDeliveryAttributes_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Get all delivery attributes for an event subscription for domain. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DomainEventSubscriptionsGetDeliveryAttributesViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/domains/(?[^/]+)/eventSubscriptions/(?[^/]+)/getDeliveryAttributes$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/eventSubscriptions/{eventSubscriptionName}/getDeliveryAttributes'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var domainName = _match.Groups["domainName"].Value; + var eventSubscriptionName = _match.Groups["eventSubscriptionName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/domains/" + + domainName + + "/eventSubscriptions/" + + eventSubscriptionName + + "/getDeliveryAttributes" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DomainEventSubscriptionsGetDeliveryAttributes_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DomainEventSubscriptionsGetDeliveryAttributes_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeliveryAttributeListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, + /// but you will get validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the domain topic. + /// Name of the event subscription. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DomainEventSubscriptionsGetDeliveryAttributes_Validate(string subscriptionId, string resourceGroupName, string domainName, string eventSubscriptionName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(domainName),domainName); + await eventListener.AssertNotNull(nameof(eventSubscriptionName),eventSubscriptionName); + } + } + + /// Get the full endpoint URL for an event subscription for domain. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the domain topic. + /// Name of the event subscription. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DomainEventSubscriptionsGetFullUrl(string subscriptionId, string resourceGroupName, string domainName, string eventSubscriptionName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/domains/" + + global::System.Uri.EscapeDataString(domainName) + + "/eventSubscriptions/" + + global::System.Uri.EscapeDataString(eventSubscriptionName) + + "/getFullUrl" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DomainEventSubscriptionsGetFullUrl_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Get the full endpoint URL for an event subscription for domain. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DomainEventSubscriptionsGetFullUrlViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/domains/(?[^/]+)/eventSubscriptions/(?[^/]+)/getFullUrl$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/eventSubscriptions/{eventSubscriptionName}/getFullUrl'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var domainName = _match.Groups["domainName"].Value; + var eventSubscriptionName = _match.Groups["eventSubscriptionName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/domains/" + + domainName + + "/eventSubscriptions/" + + eventSubscriptionName + + "/getFullUrl" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DomainEventSubscriptionsGetFullUrl_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DomainEventSubscriptionsGetFullUrl_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionFullUrl.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the domain topic. + /// Name of the event subscription. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DomainEventSubscriptionsGetFullUrl_Validate(string subscriptionId, string resourceGroupName, string domainName, string eventSubscriptionName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(domainName),domainName); + await eventListener.AssertNotNull(nameof(eventSubscriptionName),eventSubscriptionName); + } + } + + /// Get properties of an event subscription of a domain. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DomainEventSubscriptionsGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/domains/(?[^/]+)/eventSubscriptions/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/eventSubscriptions/{eventSubscriptionName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var domainName = _match.Groups["domainName"].Value; + var eventSubscriptionName = _match.Groups["eventSubscriptionName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/domains/" + + domainName + + "/eventSubscriptions/" + + eventSubscriptionName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DomainEventSubscriptionsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DomainEventSubscriptionsGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscription.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the partner topic. + /// 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. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DomainEventSubscriptionsGet_Validate(string subscriptionId, string resourceGroupName, string domainName, string eventSubscriptionName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(domainName),domainName); + await eventListener.AssertNotNull(nameof(eventSubscriptionName),eventSubscriptionName); + } + } + + /// List all event subscriptions that have been created for a specific topic. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the domain. + /// 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'. + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DomainEventSubscriptionsList(string subscriptionId, string resourceGroupName, string domainName, string Filter, int? Top, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/domains/" + + global::System.Uri.EscapeDataString(domainName) + + "/eventSubscriptions" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DomainEventSubscriptionsList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// List all event subscriptions that have been created for a specific topic. + /// + /// 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'. + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DomainEventSubscriptionsListViaIdentity(global::System.String viaIdentity, string Filter, int? Top, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/domains/(?[^/]+)/eventSubscriptions$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/eventSubscriptions'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var domainName = _match.Groups["domainName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/domains/" + + domainName + + "/eventSubscriptions" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DomainEventSubscriptionsList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DomainEventSubscriptionsList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionsListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the domain. + /// 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'. + /// 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. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DomainEventSubscriptionsList_Validate(string subscriptionId, string resourceGroupName, string domainName, string Filter, int? Top, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(domainName),domainName); + await eventListener.AssertNotNull(nameof(Filter),Filter); + } + } + + /// Update an existing event subscription for a topic. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the domain. + /// Name of the event subscription to be updated. + /// Updated event subscription information. + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DomainEventSubscriptionsUpdate(string subscriptionId, string resourceGroupName, string domainName, string eventSubscriptionName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParameters body, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/domains/" + + global::System.Uri.EscapeDataString(domainName) + + "/eventSubscriptions/" + + global::System.Uri.EscapeDataString(eventSubscriptionName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DomainEventSubscriptionsUpdate_Call(request,onDefault,eventListener,sender); + } + } + + /// Update an existing event subscription for a topic. + /// + /// Updated event subscription information. + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DomainEventSubscriptionsUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParameters body, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/domains/(?[^/]+)/eventSubscriptions/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/eventSubscriptions/{eventSubscriptionName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var domainName = _match.Groups["domainName"].Value; + var eventSubscriptionName = _match.Groups["eventSubscriptionName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/domains/" + + domainName + + "/eventSubscriptions/" + + eventSubscriptionName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DomainEventSubscriptionsUpdate_Call(request,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DomainEventSubscriptionsUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the domain. + /// Name of the event subscription to be updated. + /// Updated event subscription information. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DomainEventSubscriptionsUpdate_Validate(string subscriptionId, string resourceGroupName, string domainName, string eventSubscriptionName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParameters body, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(domainName),domainName); + await eventListener.AssertNotNull(nameof(eventSubscriptionName),eventSubscriptionName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// + /// Asynchronously creates a new event subscription or updates an existing event subscription. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the top level domain. + /// Name of the domain topic. + /// 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. + /// Event subscription properties containing the destination and filter information. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DomainTopicEventSubscriptionsCreateOrUpdate(string subscriptionId, string resourceGroupName, string domainName, string topicName, string eventSubscriptionName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/domains/" + + global::System.Uri.EscapeDataString(domainName) + + "/topics/" + + global::System.Uri.EscapeDataString(topicName) + + "/eventSubscriptions/" + + global::System.Uri.EscapeDataString(eventSubscriptionName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DomainTopicEventSubscriptionsCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Asynchronously creates a new event subscription or updates an existing event subscription. + /// + /// + /// Event subscription properties containing the destination and filter information. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DomainTopicEventSubscriptionsCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/domains/(?[^/]+)/topics/(?[^/]+)/eventSubscriptions/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/topics/{topicName}/eventSubscriptions/{eventSubscriptionName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var domainName = _match.Groups["domainName"].Value; + var topicName = _match.Groups["topicName"].Value; + var eventSubscriptionName = _match.Groups["eventSubscriptionName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/domains/" + + domainName + + "/topics/" + + topicName + + "/eventSubscriptions/" + + eventSubscriptionName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DomainTopicEventSubscriptionsCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DomainTopicEventSubscriptionsCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscription.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, + /// but you will get validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the top level domain. + /// Name of the domain topic. + /// 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. + /// Event subscription properties containing the destination and filter information. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DomainTopicEventSubscriptionsCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string domainName, string topicName, string eventSubscriptionName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription body, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(domainName),domainName); + await eventListener.AssertNotNull(nameof(topicName),topicName); + await eventListener.AssertNotNull(nameof(eventSubscriptionName),eventSubscriptionName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Delete a nested existing event subscription for a domain topic. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the top level domain. + /// Name of the domain topic. + /// Name of the event subscription to be deleted. Event subscription names must be between + /// 3 and 100 characters in length and use alphanumeric letters only. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DomainTopicEventSubscriptionsDelete(string subscriptionId, string resourceGroupName, string domainName, string topicName, string eventSubscriptionName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/domains/" + + global::System.Uri.EscapeDataString(domainName) + + "/topics/" + + global::System.Uri.EscapeDataString(topicName) + + "/eventSubscriptions/" + + global::System.Uri.EscapeDataString(eventSubscriptionName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DomainTopicEventSubscriptionsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Delete a nested existing event subscription for a domain topic. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DomainTopicEventSubscriptionsDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/domains/(?[^/]+)/topics/(?[^/]+)/eventSubscriptions/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/topics/{topicName}/eventSubscriptions/{eventSubscriptionName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var domainName = _match.Groups["domainName"].Value; + var topicName = _match.Groups["topicName"].Value; + var eventSubscriptionName = _match.Groups["eventSubscriptionName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/domains/" + + domainName + + "/topics/" + + topicName + + "/eventSubscriptions/" + + eventSubscriptionName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DomainTopicEventSubscriptionsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DomainTopicEventSubscriptionsDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_finalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the top level domain. + /// Name of the domain topic. + /// Name of the event subscription to be deleted. Event subscription names must be between + /// 3 and 100 characters in length and use alphanumeric letters only. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DomainTopicEventSubscriptionsDelete_Validate(string subscriptionId, string resourceGroupName, string domainName, string topicName, string eventSubscriptionName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(domainName),domainName); + await eventListener.AssertNotNull(nameof(topicName),topicName); + await eventListener.AssertNotNull(nameof(eventSubscriptionName),eventSubscriptionName); + } + } + + /// Get properties of a nested event subscription for a domain topic. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the top level domain. + /// Name of the domain topic. + /// Name of the event subscription. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DomainTopicEventSubscriptionsGet(string subscriptionId, string resourceGroupName, string domainName, string topicName, string eventSubscriptionName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/domains/" + + global::System.Uri.EscapeDataString(domainName) + + "/topics/" + + global::System.Uri.EscapeDataString(topicName) + + "/eventSubscriptions/" + + global::System.Uri.EscapeDataString(eventSubscriptionName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DomainTopicEventSubscriptionsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Get all delivery attributes for an event subscription for domain topic. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the top level domain. + /// Name of the domain topic. + /// Name of the event subscription. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DomainTopicEventSubscriptionsGetDeliveryAttributes(string subscriptionId, string resourceGroupName, string domainName, string topicName, string eventSubscriptionName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/domains/" + + global::System.Uri.EscapeDataString(domainName) + + "/topics/" + + global::System.Uri.EscapeDataString(topicName) + + "/eventSubscriptions/" + + global::System.Uri.EscapeDataString(eventSubscriptionName) + + "/getDeliveryAttributes" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DomainTopicEventSubscriptionsGetDeliveryAttributes_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Get all delivery attributes for an event subscription for domain topic. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DomainTopicEventSubscriptionsGetDeliveryAttributesViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/domains/(?[^/]+)/topics/(?[^/]+)/eventSubscriptions/(?[^/]+)/getDeliveryAttributes$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/topics/{topicName}/eventSubscriptions/{eventSubscriptionName}/getDeliveryAttributes'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var domainName = _match.Groups["domainName"].Value; + var topicName = _match.Groups["topicName"].Value; + var eventSubscriptionName = _match.Groups["eventSubscriptionName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/domains/" + + domainName + + "/topics/" + + topicName + + "/eventSubscriptions/" + + eventSubscriptionName + + "/getDeliveryAttributes" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DomainTopicEventSubscriptionsGetDeliveryAttributes_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DomainTopicEventSubscriptionsGetDeliveryAttributes_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeliveryAttributeListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual + /// call, but you will get validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the top level domain. + /// Name of the domain topic. + /// Name of the event subscription. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DomainTopicEventSubscriptionsGetDeliveryAttributes_Validate(string subscriptionId, string resourceGroupName, string domainName, string topicName, string eventSubscriptionName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(domainName),domainName); + await eventListener.AssertNotNull(nameof(topicName),topicName); + await eventListener.AssertNotNull(nameof(eventSubscriptionName),eventSubscriptionName); + } + } + + /// Get the full endpoint URL for a nested event subscription for domain topic. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the top level domain. + /// Name of the domain topic. + /// Name of the event subscription. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DomainTopicEventSubscriptionsGetFullUrl(string subscriptionId, string resourceGroupName, string domainName, string topicName, string eventSubscriptionName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/domains/" + + global::System.Uri.EscapeDataString(domainName) + + "/topics/" + + global::System.Uri.EscapeDataString(topicName) + + "/eventSubscriptions/" + + global::System.Uri.EscapeDataString(eventSubscriptionName) + + "/getFullUrl" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DomainTopicEventSubscriptionsGetFullUrl_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Get the full endpoint URL for a nested event subscription for domain topic. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DomainTopicEventSubscriptionsGetFullUrlViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/domains/(?[^/]+)/topics/(?[^/]+)/eventSubscriptions/(?[^/]+)/getFullUrl$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/topics/{topicName}/eventSubscriptions/{eventSubscriptionName}/getFullUrl'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var domainName = _match.Groups["domainName"].Value; + var topicName = _match.Groups["topicName"].Value; + var eventSubscriptionName = _match.Groups["eventSubscriptionName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/domains/" + + domainName + + "/topics/" + + topicName + + "/eventSubscriptions/" + + eventSubscriptionName + + "/getFullUrl" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DomainTopicEventSubscriptionsGetFullUrl_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DomainTopicEventSubscriptionsGetFullUrl_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionFullUrl.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but + /// you will get validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the top level domain. + /// Name of the domain topic. + /// Name of the event subscription. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DomainTopicEventSubscriptionsGetFullUrl_Validate(string subscriptionId, string resourceGroupName, string domainName, string topicName, string eventSubscriptionName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(domainName),domainName); + await eventListener.AssertNotNull(nameof(topicName),topicName); + await eventListener.AssertNotNull(nameof(eventSubscriptionName),eventSubscriptionName); + } + } + + /// Get properties of a nested event subscription for a domain topic. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DomainTopicEventSubscriptionsGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/domains/(?[^/]+)/topics/(?[^/]+)/eventSubscriptions/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/topics/{topicName}/eventSubscriptions/{eventSubscriptionName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var domainName = _match.Groups["domainName"].Value; + var topicName = _match.Groups["topicName"].Value; + var eventSubscriptionName = _match.Groups["eventSubscriptionName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/domains/" + + domainName + + "/topics/" + + topicName + + "/eventSubscriptions/" + + eventSubscriptionName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DomainTopicEventSubscriptionsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DomainTopicEventSubscriptionsGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscription.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the top level domain. + /// Name of the domain topic. + /// Name of the event subscription. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DomainTopicEventSubscriptionsGet_Validate(string subscriptionId, string resourceGroupName, string domainName, string topicName, string eventSubscriptionName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(domainName),domainName); + await eventListener.AssertNotNull(nameof(topicName),topicName); + await eventListener.AssertNotNull(nameof(eventSubscriptionName),eventSubscriptionName); + } + } + + /// + /// List all event subscriptions that have been created for a specific domain topic. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the top level domain. + /// Name of the domain topic. + /// 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'. + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DomainTopicEventSubscriptionsList(string subscriptionId, string resourceGroupName, string domainName, string topicName, string Filter, int? Top, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/domains/" + + global::System.Uri.EscapeDataString(domainName) + + "/topics/" + + global::System.Uri.EscapeDataString(topicName) + + "/eventSubscriptions" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DomainTopicEventSubscriptionsList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// List all event subscriptions that have been created for a specific domain topic. + /// + /// + /// 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'. + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DomainTopicEventSubscriptionsListViaIdentity(global::System.String viaIdentity, string Filter, int? Top, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/domains/(?[^/]+)/topics/(?[^/]+)/eventSubscriptions$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/topics/{topicName}/eventSubscriptions'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var domainName = _match.Groups["domainName"].Value; + var topicName = _match.Groups["topicName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/domains/" + + domainName + + "/topics/" + + topicName + + "/eventSubscriptions" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DomainTopicEventSubscriptionsList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DomainTopicEventSubscriptionsList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionsListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the top level domain. + /// Name of the domain topic. + /// 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'. + /// 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. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DomainTopicEventSubscriptionsList_Validate(string subscriptionId, string resourceGroupName, string domainName, string topicName, string Filter, int? Top, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(domainName),domainName); + await eventListener.AssertNotNull(nameof(topicName),topicName); + await eventListener.AssertNotNull(nameof(Filter),Filter); + } + } + + /// Update an existing event subscription for a domain topic. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the domain. + /// Name of the topic. + /// Name of the event subscription to be updated. + /// Updated event subscription information. + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DomainTopicEventSubscriptionsUpdate(string subscriptionId, string resourceGroupName, string domainName, string topicName, string eventSubscriptionName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParameters body, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/domains/" + + global::System.Uri.EscapeDataString(domainName) + + "/topics/" + + global::System.Uri.EscapeDataString(topicName) + + "/eventSubscriptions/" + + global::System.Uri.EscapeDataString(eventSubscriptionName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DomainTopicEventSubscriptionsUpdate_Call(request,onDefault,eventListener,sender); + } + } + + /// Update an existing event subscription for a domain topic. + /// + /// Updated event subscription information. + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DomainTopicEventSubscriptionsUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParameters body, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/domains/(?[^/]+)/topics/(?[^/]+)/eventSubscriptions/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/topics/{topicName}/eventSubscriptions/{eventSubscriptionName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var domainName = _match.Groups["domainName"].Value; + var topicName = _match.Groups["topicName"].Value; + var eventSubscriptionName = _match.Groups["eventSubscriptionName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/domains/" + + domainName + + "/topics/" + + topicName + + "/eventSubscriptions/" + + eventSubscriptionName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DomainTopicEventSubscriptionsUpdate_Call(request,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DomainTopicEventSubscriptionsUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the domain. + /// Name of the topic. + /// Name of the event subscription to be updated. + /// Updated event subscription information. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DomainTopicEventSubscriptionsUpdate_Validate(string subscriptionId, string resourceGroupName, string domainName, string topicName, string eventSubscriptionName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParameters body, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(domainName),domainName); + await eventListener.AssertNotNull(nameof(topicName),topicName); + await eventListener.AssertNotNull(nameof(eventSubscriptionName),eventSubscriptionName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// + /// Asynchronously creates or updates a new domain topic with the specified parameters. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the domain. + /// Name of the domain topic. + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DomainTopicsCreateOrUpdate(string subscriptionId, string resourceGroupName, string domainName, string domainTopicName, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/domains/" + + global::System.Uri.EscapeDataString(domainName) + + "/topics/" + + global::System.Uri.EscapeDataString(domainTopicName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DomainTopicsCreateOrUpdate_Call(request,onDefault,eventListener,sender); + } + } + + /// + /// Asynchronously creates or updates a new domain topic with the specified parameters. + /// + /// + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DomainTopicsCreateOrUpdateViaIdentity(global::System.String viaIdentity, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/domains/(?[^/]+)/topics/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/topics/{domainTopicName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var domainName = _match.Groups["domainName"].Value; + var domainTopicName = _match.Groups["domainTopicName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/domains/" + + domainName + + "/topics/" + + domainTopicName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DomainTopicsCreateOrUpdate_Call(request,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DomainTopicsCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the domain. + /// Name of the domain topic. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DomainTopicsCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string domainName, string domainTopicName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(domainName),domainName); + await eventListener.AssertNotNull(nameof(domainTopicName),domainTopicName); + } + } + + /// Delete existing domain topic. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the domain. + /// Name of the domain topic. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DomainTopicsDelete(string subscriptionId, string resourceGroupName, string domainName, string domainTopicName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/domains/" + + global::System.Uri.EscapeDataString(domainName) + + "/topics/" + + global::System.Uri.EscapeDataString(domainTopicName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DomainTopicsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Delete existing domain topic. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DomainTopicsDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/domains/(?[^/]+)/topics/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/topics/{domainTopicName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var domainName = _match.Groups["domainName"].Value; + var domainTopicName = _match.Groups["domainTopicName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/domains/" + + domainName + + "/topics/" + + domainTopicName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DomainTopicsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DomainTopicsDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_finalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the domain. + /// Name of the domain topic. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DomainTopicsDelete_Validate(string subscriptionId, string resourceGroupName, string domainName, string domainTopicName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(domainName),domainName); + await eventListener.AssertNotNull(nameof(domainTopicName),domainTopicName); + } + } + + /// Get properties of a domain topic. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the domain. + /// Name of the topic. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DomainTopicsGet(string subscriptionId, string resourceGroupName, string domainName, string domainTopicName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/domains/" + + global::System.Uri.EscapeDataString(domainName) + + "/topics/" + + global::System.Uri.EscapeDataString(domainTopicName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DomainTopicsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Get properties of a domain topic. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DomainTopicsGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/domains/(?[^/]+)/topics/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/topics/{domainTopicName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var domainName = _match.Groups["domainName"].Value; + var domainTopicName = _match.Groups["domainTopicName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/domains/" + + domainName + + "/topics/" + + domainTopicName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DomainTopicsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DomainTopicsGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DomainTopic.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the domain. + /// Name of the topic. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DomainTopicsGet_Validate(string subscriptionId, string resourceGroupName, string domainName, string domainTopicName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(domainName),domainName); + await eventListener.AssertNotNull(nameof(domainTopicName),domainTopicName); + } + } + + /// List all the topics in a domain. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Domain name. + /// 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'. + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DomainTopicsListByDomain(string subscriptionId, string resourceGroupName, string domainName, string Filter, int? Top, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/domains/" + + global::System.Uri.EscapeDataString(domainName) + + "/topics" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DomainTopicsListByDomain_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// List all the topics in a domain. + /// + /// 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'. + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DomainTopicsListByDomainViaIdentity(global::System.String viaIdentity, string Filter, int? Top, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/domains/(?[^/]+)/topics$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/topics'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var domainName = _match.Groups["domainName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/domains/" + + domainName + + "/topics" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DomainTopicsListByDomain_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DomainTopicsListByDomain_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DomainTopicsListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Domain name. + /// 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'. + /// 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. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DomainTopicsListByDomain_Validate(string subscriptionId, string resourceGroupName, string domainName, string Filter, int? Top, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(domainName),domainName); + await eventListener.AssertNotNull(nameof(Filter),Filter); + } + } + + /// Asynchronously creates or updates a new domain with the specified parameters. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the domain. + /// Domain information. + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DomainsCreateOrUpdate(string subscriptionId, string resourceGroupName, string domainName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomain body, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/domains/" + + global::System.Uri.EscapeDataString(domainName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DomainsCreateOrUpdate_Call(request,onDefault,eventListener,sender); + } + } + + /// Asynchronously creates or updates a new domain with the specified parameters. + /// + /// Domain information. + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DomainsCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomain body, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/domains/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var domainName = _match.Groups["domainName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/domains/" + + domainName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DomainsCreateOrUpdate_Call(request,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DomainsCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the domain. + /// Domain information. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DomainsCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string domainName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomain body, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(domainName),domainName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Delete existing domain. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the domain. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DomainsDelete(string subscriptionId, string resourceGroupName, string domainName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/domains/" + + global::System.Uri.EscapeDataString(domainName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DomainsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Delete existing domain. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DomainsDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/domains/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var domainName = _match.Groups["domainName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/domains/" + + domainName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DomainsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DomainsDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_finalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the domain. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DomainsDelete_Validate(string subscriptionId, string resourceGroupName, string domainName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(domainName),domainName); + } + } + + /// Get properties of a domain. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the domain. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DomainsGet(string subscriptionId, string resourceGroupName, string domainName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/domains/" + + global::System.Uri.EscapeDataString(domainName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DomainsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Get properties of a domain. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DomainsGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/domains/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var domainName = _match.Groups["domainName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/domains/" + + domainName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DomainsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DomainsGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.Domain.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation events + /// back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the domain. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DomainsGet_Validate(string subscriptionId, string resourceGroupName, string domainName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(domainName),domainName); + } + } + + /// List all the domains under a resource group. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// 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'. + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DomainsListByResourceGroup(string subscriptionId, string resourceGroupName, string Filter, int? Top, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/domains" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DomainsListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// List all the domains under a resource group. + /// + /// 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'. + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DomainsListByResourceGroupViaIdentity(global::System.String viaIdentity, string Filter, int? Top, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/domains$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/domains" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DomainsListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DomainsListByResourceGroup_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DomainsListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// 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'. + /// 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. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DomainsListByResourceGroup_Validate(string subscriptionId, string resourceGroupName, string Filter, int? Top, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(Filter),Filter); + } + } + + /// List all the domains under an Azure subscription. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// 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'. + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DomainsListBySubscription(string subscriptionId, string Filter, int? Top, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.EventGrid/domains" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DomainsListBySubscription_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// List all the domains under an Azure subscription. + /// + /// 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'. + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DomainsListBySubscriptionViaIdentity(global::System.String viaIdentity, string Filter, int? Top, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.EventGrid/domains$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/domains'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/providers/Microsoft.EventGrid/domains" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DomainsListBySubscription_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DomainsListBySubscription_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DomainsListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// 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'. + /// 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. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DomainsListBySubscription_Validate(string subscriptionId, string Filter, int? Top, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(Filter),Filter); + } + } + + /// List the two keys used to publish to a domain. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the domain. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DomainsListSharedAccessKeys(string subscriptionId, string resourceGroupName, string domainName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/domains/" + + global::System.Uri.EscapeDataString(domainName) + + "/listKeys" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DomainsListSharedAccessKeys_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// List the two keys used to publish to a domain. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DomainsListSharedAccessKeysViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/domains/(?[^/]+)/listKeys$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/listKeys'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var domainName = _match.Groups["domainName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/domains/" + + domainName + + "/listKeys" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DomainsListSharedAccessKeys_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DomainsListSharedAccessKeys_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DomainSharedAccessKeys.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the domain. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DomainsListSharedAccessKeys_Validate(string subscriptionId, string resourceGroupName, string domainName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(domainName),domainName); + } + } + + /// Regenerate a shared access key for a domain. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the domain. + /// Request body to regenerate key. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DomainsRegenerateKey(string subscriptionId, string resourceGroupName, string domainName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainRegenerateKeyRequest body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/domains/" + + global::System.Uri.EscapeDataString(domainName) + + "/regenerateKey" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DomainsRegenerateKey_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Regenerate a shared access key for a domain. + /// + /// Request body to regenerate key. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DomainsRegenerateKeyViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainRegenerateKeyRequest body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/domains/(?[^/]+)/regenerateKey$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/regenerateKey'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var domainName = _match.Groups["domainName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/domains/" + + domainName + + "/regenerateKey" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DomainsRegenerateKey_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DomainsRegenerateKey_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DomainSharedAccessKeys.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the domain. + /// Request body to regenerate key. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DomainsRegenerateKey_Validate(string subscriptionId, string resourceGroupName, string domainName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainRegenerateKeyRequest body, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(domainName),domainName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Asynchronously updates a domain with the specified parameters. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the domain. + /// Domain update information. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DomainsUpdate(string subscriptionId, string resourceGroupName, string domainName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParameters body, global::System.Func onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/domains/" + + global::System.Uri.EscapeDataString(domainName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DomainsUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Asynchronously updates a domain with the specified parameters. + /// + /// Domain update information. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DomainsUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParameters body, global::System.Func onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/domains/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var domainName = _match.Groups["domainName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/domains/" + + domainName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DomainsUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DomainsUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the domain. + /// Domain update information. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DomainsUpdate_Validate(string subscriptionId, string resourceGroupName, string domainName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParameters body, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(domainName),domainName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Asynchronously creates a new event channel with the specified parameters. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the partner namespace. + /// Name of the event channel. + /// EventChannel information. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task EventChannelsCreateOrUpdate(string subscriptionId, string resourceGroupName, string partnerNamespaceName, string eventChannelName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannel body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/partnerNamespaces/" + + global::System.Uri.EscapeDataString(partnerNamespaceName) + + "/eventChannels/" + + global::System.Uri.EscapeDataString(eventChannelName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.EventChannelsCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Asynchronously creates a new event channel with the specified parameters. + /// + /// EventChannel information. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task EventChannelsCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannel body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/partnerNamespaces/(?[^/]+)/eventChannels/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerNamespaces/{partnerNamespaceName}/eventChannels/{eventChannelName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var partnerNamespaceName = _match.Groups["partnerNamespaceName"].Value; + var eventChannelName = _match.Groups["eventChannelName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/partnerNamespaces/" + + partnerNamespaceName + + "/eventChannels/" + + eventChannelName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.EventChannelsCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task EventChannelsCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventChannel.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the partner namespace. + /// Name of the event channel. + /// EventChannel information. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task EventChannelsCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string partnerNamespaceName, string eventChannelName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannel body, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(partnerNamespaceName),partnerNamespaceName); + await eventListener.AssertNotNull(nameof(eventChannelName),eventChannelName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Delete existing event channel. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the partner namespace. + /// Name of the event channel. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task EventChannelsDelete(string subscriptionId, string resourceGroupName, string partnerNamespaceName, string eventChannelName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/partnerNamespaces/" + + global::System.Uri.EscapeDataString(partnerNamespaceName) + + "/eventChannels/" + + global::System.Uri.EscapeDataString(eventChannelName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.EventChannelsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Delete existing event channel. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task EventChannelsDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/partnerNamespaces/(?[^/]+)/eventChannels/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerNamespaces/{partnerNamespaceName}/eventChannels/{eventChannelName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var partnerNamespaceName = _match.Groups["partnerNamespaceName"].Value; + var eventChannelName = _match.Groups["eventChannelName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/partnerNamespaces/" + + partnerNamespaceName + + "/eventChannels/" + + eventChannelName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.EventChannelsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task EventChannelsDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_finalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the partner namespace. + /// Name of the event channel. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task EventChannelsDelete_Validate(string subscriptionId, string resourceGroupName, string partnerNamespaceName, string eventChannelName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(partnerNamespaceName),partnerNamespaceName); + await eventListener.AssertNotNull(nameof(eventChannelName),eventChannelName); + } + } + + /// Get properties of an event channel. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the partner namespace. + /// Name of the event channel. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task EventChannelsGet(string subscriptionId, string resourceGroupName, string partnerNamespaceName, string eventChannelName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/partnerNamespaces/" + + global::System.Uri.EscapeDataString(partnerNamespaceName) + + "/eventChannels/" + + global::System.Uri.EscapeDataString(eventChannelName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.EventChannelsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Get properties of an event channel. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task EventChannelsGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/partnerNamespaces/(?[^/]+)/eventChannels/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerNamespaces/{partnerNamespaceName}/eventChannels/{eventChannelName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var partnerNamespaceName = _match.Groups["partnerNamespaceName"].Value; + var eventChannelName = _match.Groups["eventChannelName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/partnerNamespaces/" + + partnerNamespaceName + + "/eventChannels/" + + eventChannelName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.EventChannelsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task EventChannelsGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventChannel.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the partner namespace. + /// Name of the event channel. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task EventChannelsGet_Validate(string subscriptionId, string resourceGroupName, string partnerNamespaceName, string eventChannelName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(partnerNamespaceName),partnerNamespaceName); + await eventListener.AssertNotNull(nameof(eventChannelName),eventChannelName); + } + } + + /// List all the event channels in a partner namespace. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the partner namespace. + /// 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'. + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task EventChannelsListByPartnerNamespace(string subscriptionId, string resourceGroupName, string partnerNamespaceName, string Filter, int? Top, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/partnerNamespaces/" + + global::System.Uri.EscapeDataString(partnerNamespaceName) + + "/eventChannels" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.EventChannelsListByPartnerNamespace_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// List all the event channels in a partner namespace. + /// + /// 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'. + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task EventChannelsListByPartnerNamespaceViaIdentity(global::System.String viaIdentity, string Filter, int? Top, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/partnerNamespaces/(?[^/]+)/eventChannels$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerNamespaces/{partnerNamespaceName}/eventChannels'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var partnerNamespaceName = _match.Groups["partnerNamespaceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/partnerNamespaces/" + + partnerNamespaceName + + "/eventChannels" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.EventChannelsListByPartnerNamespace_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task EventChannelsListByPartnerNamespace_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventChannelsListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the partner namespace. + /// 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'. + /// 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. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task EventChannelsListByPartnerNamespace_Validate(string subscriptionId, string resourceGroupName, string partnerNamespaceName, string Filter, int? Top, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(partnerNamespaceName),partnerNamespaceName); + await eventListener.AssertNotNull(nameof(Filter),Filter); + } + } + + /// + /// Asynchronously creates a new event subscription or updates an existing event subscription based on the specified 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}' + /// for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' + /// for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' + /// for an EventGrid topic. + /// Name of the event subscription. Event subscription names must be between 3 and 64 + /// characters in length and should use alphanumeric letters only. + /// Event subscription properties containing the destination and filter information. + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task EventSubscriptionsCreateOrUpdate(string scope, string eventSubscriptionName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription body, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (scope) + + "/providers/Microsoft.EventGrid/eventSubscriptions/" + + global::System.Uri.EscapeDataString(eventSubscriptionName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.EventSubscriptionsCreateOrUpdate_Call(request,onDefault,eventListener,sender); + } + } + + /// + /// Asynchronously creates a new event subscription or updates an existing event subscription based on the specified scope. + /// + /// + /// Event subscription properties containing the destination and filter information. + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task EventSubscriptionsCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription body, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.EventGrid/eventSubscriptions/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}'"); + } + + // replace URI parameters with values from identity + var scope = _match.Groups["scope"].Value; + var eventSubscriptionName = _match.Groups["eventSubscriptionName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + scope + + "/providers/Microsoft.EventGrid/eventSubscriptions/" + + eventSubscriptionName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.EventSubscriptionsCreateOrUpdate_Call(request,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task EventSubscriptionsCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// 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}' + /// for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' + /// for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' + /// for an EventGrid topic. + /// Name of the event subscription. Event subscription names must be between 3 and 64 + /// characters in length and should use alphanumeric letters only. + /// Event subscription properties containing the destination and filter information. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task EventSubscriptionsCreateOrUpdate_Validate(string scope, string eventSubscriptionName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription body, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(scope),scope); + await eventListener.AssertNotNull(nameof(eventSubscriptionName),eventSubscriptionName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Delete an existing event subscription. + /// 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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' + /// for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' + /// for an EventGrid topic. + /// Name of the event subscription. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task EventSubscriptionsDelete(string scope, string eventSubscriptionName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (scope) + + "/providers/Microsoft.EventGrid/eventSubscriptions/" + + global::System.Uri.EscapeDataString(eventSubscriptionName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.EventSubscriptionsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Delete an existing event subscription. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task EventSubscriptionsDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.EventGrid/eventSubscriptions/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}'"); + } + + // replace URI parameters with values from identity + var scope = _match.Groups["scope"].Value; + var eventSubscriptionName = _match.Groups["eventSubscriptionName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + scope + + "/providers/Microsoft.EventGrid/eventSubscriptions/" + + eventSubscriptionName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.EventSubscriptionsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task EventSubscriptionsDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_finalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// 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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' + /// for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' + /// for an EventGrid topic. + /// Name of the event subscription. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task EventSubscriptionsDelete_Validate(string scope, string eventSubscriptionName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(scope),scope); + await eventListener.AssertNotNull(nameof(eventSubscriptionName),eventSubscriptionName); + } + } + + /// Get properties of an event subscription. + /// 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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' + /// for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' + /// for an EventGrid topic. + /// Name of the event subscription. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task EventSubscriptionsGet(string scope, string eventSubscriptionName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (scope) + + "/providers/Microsoft.EventGrid/eventSubscriptions/" + + global::System.Uri.EscapeDataString(eventSubscriptionName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.EventSubscriptionsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Get all delivery attributes for an event subscription. + /// 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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' + /// for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' + /// for an EventGrid topic. + /// Name of the event subscription. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task EventSubscriptionsGetDeliveryAttributes(string scope, string eventSubscriptionName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (scope) + + "/providers/Microsoft.EventGrid/eventSubscriptions/" + + global::System.Uri.EscapeDataString(eventSubscriptionName) + + "/getDeliveryAttributes" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.EventSubscriptionsGetDeliveryAttributes_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Get all delivery attributes for an event subscription. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task EventSubscriptionsGetDeliveryAttributesViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.EventGrid/eventSubscriptions/(?[^/]+)/getDeliveryAttributes$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}/getDeliveryAttributes'"); + } + + // replace URI parameters with values from identity + var scope = _match.Groups["scope"].Value; + var eventSubscriptionName = _match.Groups["eventSubscriptionName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + scope + + "/providers/Microsoft.EventGrid/eventSubscriptions/" + + eventSubscriptionName + + "/getDeliveryAttributes" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.EventSubscriptionsGetDeliveryAttributes_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task EventSubscriptionsGetDeliveryAttributes_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeliveryAttributeListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but + /// you will get validation events back. + /// + /// 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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' + /// for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' + /// for an EventGrid topic. + /// Name of the event subscription. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task EventSubscriptionsGetDeliveryAttributes_Validate(string scope, string eventSubscriptionName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(scope),scope); + await eventListener.AssertNotNull(nameof(eventSubscriptionName),eventSubscriptionName); + } + } + + /// Get the full endpoint URL for an event subscription. + /// 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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' + /// for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' + /// for an EventGrid topic. + /// Name of the event subscription. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task EventSubscriptionsGetFullUrl(string scope, string eventSubscriptionName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (scope) + + "/providers/Microsoft.EventGrid/eventSubscriptions/" + + global::System.Uri.EscapeDataString(eventSubscriptionName) + + "/getFullUrl" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.EventSubscriptionsGetFullUrl_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Get the full endpoint URL for an event subscription. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task EventSubscriptionsGetFullUrlViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.EventGrid/eventSubscriptions/(?[^/]+)/getFullUrl$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}/getFullUrl'"); + } + + // replace URI parameters with values from identity + var scope = _match.Groups["scope"].Value; + var eventSubscriptionName = _match.Groups["eventSubscriptionName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + scope + + "/providers/Microsoft.EventGrid/eventSubscriptions/" + + eventSubscriptionName + + "/getFullUrl" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.EventSubscriptionsGetFullUrl_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task EventSubscriptionsGetFullUrl_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionFullUrl.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// 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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' + /// for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' + /// for an EventGrid topic. + /// Name of the event subscription. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task EventSubscriptionsGetFullUrl_Validate(string scope, string eventSubscriptionName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(scope),scope); + await eventListener.AssertNotNull(nameof(eventSubscriptionName),eventSubscriptionName); + } + } + + /// Get properties of an event subscription. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task EventSubscriptionsGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.EventGrid/eventSubscriptions/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}'"); + } + + // replace URI parameters with values from identity + var scope = _match.Groups["scope"].Value; + var eventSubscriptionName = _match.Groups["eventSubscriptionName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + scope + + "/providers/Microsoft.EventGrid/eventSubscriptions/" + + eventSubscriptionName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.EventSubscriptionsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task EventSubscriptionsGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscription.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// 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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' + /// for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' + /// for an EventGrid topic. + /// Name of the event subscription. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task EventSubscriptionsGet_Validate(string scope, string eventSubscriptionName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(scope),scope); + await eventListener.AssertNotNull(nameof(eventSubscriptionName),eventSubscriptionName); + } + } + + /// + /// List all event subscriptions that have been created for a specific domain topic. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the top level domain. + /// Name of the domain topic. + /// 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'. + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task EventSubscriptionsListByDomainTopic(string subscriptionId, string resourceGroupName, string domainName, string topicName, string Filter, int? Top, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/domains/" + + global::System.Uri.EscapeDataString(domainName) + + "/topics/" + + global::System.Uri.EscapeDataString(topicName) + + "/providers/Microsoft.EventGrid/eventSubscriptions" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.EventSubscriptionsListByDomainTopic_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// List all event subscriptions that have been created for a specific domain topic. + /// + /// + /// 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'. + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task EventSubscriptionsListByDomainTopicViaIdentity(global::System.String viaIdentity, string Filter, int? Top, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/domains/(?[^/]+)/topics/(?[^/]+)/providers/Microsoft.EventGrid/eventSubscriptions$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/topics/{topicName}/providers/Microsoft.EventGrid/eventSubscriptions'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var domainName = _match.Groups["domainName"].Value; + var topicName = _match.Groups["topicName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/domains/" + + domainName + + "/topics/" + + topicName + + "/providers/Microsoft.EventGrid/eventSubscriptions" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.EventSubscriptionsListByDomainTopic_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task EventSubscriptionsListByDomainTopic_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionsListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the top level domain. + /// Name of the domain topic. + /// 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'. + /// 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. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task EventSubscriptionsListByDomainTopic_Validate(string subscriptionId, string resourceGroupName, string domainName, string topicName, string Filter, int? Top, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(domainName),domainName); + await eventListener.AssertNotNull(nameof(topicName),topicName); + await eventListener.AssertNotNull(nameof(Filter),Filter); + } + } + + /// List all event subscriptions that have been created for a specific resource. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Namespace of the provider of the topic. + /// Name of the resource type. + /// Name of the resource. + /// 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'. + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task EventSubscriptionsListByResource(string subscriptionId, string resourceGroupName, string providerNamespace, string resourceTypeName, string resourceName, string Filter, int? Top, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/" + + global::System.Uri.EscapeDataString(providerNamespace) + + "/" + + global::System.Uri.EscapeDataString(resourceTypeName) + + "/" + + global::System.Uri.EscapeDataString(resourceName) + + "/providers/Microsoft.EventGrid/eventSubscriptions" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.EventSubscriptionsListByResource_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// List all event subscriptions that have been created for a specific resource. + /// + /// 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'. + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task EventSubscriptionsListByResourceViaIdentity(global::System.String viaIdentity, string Filter, int? Top, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/(?[^/]+)/(?[^/]+)/(?[^/]+)/providers/Microsoft.EventGrid/eventSubscriptions$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{providerNamespace}/{resourceTypeName}/{resourceName}/providers/Microsoft.EventGrid/eventSubscriptions'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var providerNamespace = _match.Groups["providerNamespace"].Value; + var resourceTypeName = _match.Groups["resourceTypeName"].Value; + var resourceName = _match.Groups["resourceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/" + + providerNamespace + + "/" + + resourceTypeName + + "/" + + resourceName + + "/providers/Microsoft.EventGrid/eventSubscriptions" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.EventSubscriptionsListByResource_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task EventSubscriptionsListByResource_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionsListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Namespace of the provider of the topic. + /// Name of the resource type. + /// Name of the resource. + /// 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'. + /// 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. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task EventSubscriptionsListByResource_Validate(string subscriptionId, string resourceGroupName, string providerNamespace, string resourceTypeName, string resourceName, string Filter, int? Top, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(providerNamespace),providerNamespace); + await eventListener.AssertNotNull(nameof(resourceTypeName),resourceTypeName); + await eventListener.AssertNotNull(nameof(resourceName),resourceName); + await eventListener.AssertNotNull(nameof(Filter),Filter); + } + } + + /// + /// List all global event subscriptions under a specific Azure subscription and resource group. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// 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'. + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task EventSubscriptionsListGlobalByResourceGroup(string subscriptionId, string resourceGroupName, string Filter, int? Top, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/eventSubscriptions" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.EventSubscriptionsListGlobalByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// List all global event subscriptions under a resource group for a specific topic type. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the topic type. + /// 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'. + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task EventSubscriptionsListGlobalByResourceGroupForTopicType(string subscriptionId, string resourceGroupName, string topicTypeName, string Filter, int? Top, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/topicTypes/" + + global::System.Uri.EscapeDataString(topicTypeName) + + "/eventSubscriptions" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.EventSubscriptionsListGlobalByResourceGroupForTopicType_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// List all global event subscriptions under a resource group for a specific topic type. + /// + /// + /// 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'. + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task EventSubscriptionsListGlobalByResourceGroupForTopicTypeViaIdentity(global::System.String viaIdentity, string Filter, int? Top, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/topicTypes/(?[^/]+)/eventSubscriptions$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topicTypes/{topicTypeName}/eventSubscriptions'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var topicTypeName = _match.Groups["topicTypeName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/topicTypes/" + + topicTypeName + + "/eventSubscriptions" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.EventSubscriptionsListGlobalByResourceGroupForTopicType_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task EventSubscriptionsListGlobalByResourceGroupForTopicType_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionsListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the + /// actual call, but you will get validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the topic type. + /// 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'. + /// 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. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task EventSubscriptionsListGlobalByResourceGroupForTopicType_Validate(string subscriptionId, string resourceGroupName, string topicTypeName, string Filter, int? Top, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(topicTypeName),topicTypeName); + await eventListener.AssertNotNull(nameof(Filter),Filter); + } + } + + /// + /// List all global event subscriptions under a specific Azure subscription and resource group. + /// + /// + /// 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'. + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task EventSubscriptionsListGlobalByResourceGroupViaIdentity(global::System.String viaIdentity, string Filter, int? Top, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/eventSubscriptions$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/eventSubscriptions'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/eventSubscriptions" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.EventSubscriptionsListGlobalByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task EventSubscriptionsListGlobalByResourceGroup_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionsListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, + /// but you will get validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// 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'. + /// 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. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task EventSubscriptionsListGlobalByResourceGroup_Validate(string subscriptionId, string resourceGroupName, string Filter, int? Top, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(Filter),Filter); + } + } + + /// + /// List all aggregated global event subscriptions under a specific Azure subscription. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// 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'. + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task EventSubscriptionsListGlobalBySubscription(string subscriptionId, string Filter, int? Top, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.EventGrid/eventSubscriptions" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.EventSubscriptionsListGlobalBySubscription_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// List all global event subscriptions under an Azure subscription for a topic type. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// Name of the topic type. + /// 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'. + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task EventSubscriptionsListGlobalBySubscriptionForTopicType(string subscriptionId, string topicTypeName, string Filter, int? Top, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.EventGrid/topicTypes/" + + global::System.Uri.EscapeDataString(topicTypeName) + + "/eventSubscriptions" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.EventSubscriptionsListGlobalBySubscriptionForTopicType_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// List all global event subscriptions under an Azure subscription for a topic type. + /// + /// + /// 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'. + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task EventSubscriptionsListGlobalBySubscriptionForTopicTypeViaIdentity(global::System.String viaIdentity, string Filter, int? Top, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.EventGrid/topicTypes/(?[^/]+)/eventSubscriptions$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/topicTypes/{topicTypeName}/eventSubscriptions'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var topicTypeName = _match.Groups["topicTypeName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/providers/Microsoft.EventGrid/topicTypes/" + + topicTypeName + + "/eventSubscriptions" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.EventSubscriptionsListGlobalBySubscriptionForTopicType_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task EventSubscriptionsListGlobalBySubscriptionForTopicType_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionsListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the + /// actual call, but you will get validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// Name of the topic type. + /// 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'. + /// 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. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task EventSubscriptionsListGlobalBySubscriptionForTopicType_Validate(string subscriptionId, string topicTypeName, string Filter, int? Top, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(topicTypeName),topicTypeName); + await eventListener.AssertNotNull(nameof(Filter),Filter); + } + } + + /// + /// List all aggregated global event subscriptions under a specific Azure subscription. + /// + /// + /// 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'. + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task EventSubscriptionsListGlobalBySubscriptionViaIdentity(global::System.String viaIdentity, string Filter, int? Top, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.EventGrid/eventSubscriptions$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/eventSubscriptions'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/providers/Microsoft.EventGrid/eventSubscriptions" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.EventSubscriptionsListGlobalBySubscription_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task EventSubscriptionsListGlobalBySubscription_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionsListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, + /// but you will get validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// 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'. + /// 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. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task EventSubscriptionsListGlobalBySubscription_Validate(string subscriptionId, string Filter, int? Top, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(Filter),Filter); + } + } + + /// + /// List all event subscriptions from the given location under a specific Azure subscription and resource group. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the location. + /// 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'. + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task EventSubscriptionsListRegionalByResourceGroup(string subscriptionId, string resourceGroupName, string location, string Filter, int? Top, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/locations/" + + global::System.Uri.EscapeDataString(location) + + "/eventSubscriptions" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.EventSubscriptionsListRegionalByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// List all event subscriptions from the given location under a specific Azure subscription and resource group and topic + /// type. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the location. + /// Name of the topic type. + /// 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'. + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task EventSubscriptionsListRegionalByResourceGroupForTopicType(string subscriptionId, string resourceGroupName, string location, string topicTypeName, string Filter, int? Top, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/locations/" + + global::System.Uri.EscapeDataString(location) + + "/topicTypes/" + + global::System.Uri.EscapeDataString(topicTypeName) + + "/eventSubscriptions" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.EventSubscriptionsListRegionalByResourceGroupForTopicType_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// List all event subscriptions from the given location under a specific Azure subscription and resource group and topic + /// type. + /// + /// + /// 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'. + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task EventSubscriptionsListRegionalByResourceGroupForTopicTypeViaIdentity(global::System.String viaIdentity, string Filter, int? Top, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/locations/(?[^/]+)/topicTypes/(?[^/]+)/eventSubscriptions$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/locations/{location}/topicTypes/{topicTypeName}/eventSubscriptions'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var location = _match.Groups["location"].Value; + var topicTypeName = _match.Groups["topicTypeName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/locations/" + + location + + "/topicTypes/" + + topicTypeName + + "/eventSubscriptions" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.EventSubscriptionsListRegionalByResourceGroupForTopicType_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task EventSubscriptionsListRegionalByResourceGroupForTopicType_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionsListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like + /// the actual call, but you will get validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the location. + /// Name of the topic type. + /// 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'. + /// 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. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task EventSubscriptionsListRegionalByResourceGroupForTopicType_Validate(string subscriptionId, string resourceGroupName, string location, string topicTypeName, string Filter, int? Top, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(location),location); + await eventListener.AssertNotNull(nameof(topicTypeName),topicTypeName); + await eventListener.AssertNotNull(nameof(Filter),Filter); + } + } + + /// + /// List all event subscriptions from the given location under a specific Azure subscription and resource group. + /// + /// + /// 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'. + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task EventSubscriptionsListRegionalByResourceGroupViaIdentity(global::System.String viaIdentity, string Filter, int? Top, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/locations/(?[^/]+)/eventSubscriptions$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/locations/{location}/eventSubscriptions'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var location = _match.Groups["location"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/locations/" + + location + + "/eventSubscriptions" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.EventSubscriptionsListRegionalByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task EventSubscriptionsListRegionalByResourceGroup_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionsListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, + /// but you will get validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the location. + /// 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'. + /// 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. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task EventSubscriptionsListRegionalByResourceGroup_Validate(string subscriptionId, string resourceGroupName, string location, string Filter, int? Top, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(location),location); + await eventListener.AssertNotNull(nameof(Filter),Filter); + } + } + + /// + /// List all event subscriptions from the given location under a specific Azure subscription. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// Name of the location. + /// 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'. + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task EventSubscriptionsListRegionalBySubscription(string subscriptionId, string location, string Filter, int? Top, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.EventGrid/locations/" + + global::System.Uri.EscapeDataString(location) + + "/eventSubscriptions" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.EventSubscriptionsListRegionalBySubscription_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// List all event subscriptions from the given location under a specific Azure subscription and topic type. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// Name of the location. + /// Name of the topic type. + /// 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'. + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task EventSubscriptionsListRegionalBySubscriptionForTopicType(string subscriptionId, string location, string topicTypeName, string Filter, int? Top, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.EventGrid/locations/" + + global::System.Uri.EscapeDataString(location) + + "/topicTypes/" + + global::System.Uri.EscapeDataString(topicTypeName) + + "/eventSubscriptions" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.EventSubscriptionsListRegionalBySubscriptionForTopicType_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// List all event subscriptions from the given location under a specific Azure subscription and topic type. + /// + /// + /// 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'. + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task EventSubscriptionsListRegionalBySubscriptionForTopicTypeViaIdentity(global::System.String viaIdentity, string Filter, int? Top, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.EventGrid/locations/(?[^/]+)/topicTypes/(?[^/]+)/eventSubscriptions$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/locations/{location}/topicTypes/{topicTypeName}/eventSubscriptions'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var location = _match.Groups["location"].Value; + var topicTypeName = _match.Groups["topicTypeName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/providers/Microsoft.EventGrid/locations/" + + location + + "/topicTypes/" + + topicTypeName + + "/eventSubscriptions" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.EventSubscriptionsListRegionalBySubscriptionForTopicType_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task EventSubscriptionsListRegionalBySubscriptionForTopicType_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionsListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the + /// actual call, but you will get validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// Name of the location. + /// Name of the topic type. + /// 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'. + /// 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. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task EventSubscriptionsListRegionalBySubscriptionForTopicType_Validate(string subscriptionId, string location, string topicTypeName, string Filter, int? Top, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(location),location); + await eventListener.AssertNotNull(nameof(topicTypeName),topicTypeName); + await eventListener.AssertNotNull(nameof(Filter),Filter); + } + } + + /// + /// List all event subscriptions from the given location under a specific Azure subscription. + /// + /// + /// 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'. + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task EventSubscriptionsListRegionalBySubscriptionViaIdentity(global::System.String viaIdentity, string Filter, int? Top, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.EventGrid/locations/(?[^/]+)/eventSubscriptions$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/locations/{location}/eventSubscriptions'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var location = _match.Groups["location"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/providers/Microsoft.EventGrid/locations/" + + location + + "/eventSubscriptions" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.EventSubscriptionsListRegionalBySubscription_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task EventSubscriptionsListRegionalBySubscription_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionsListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, + /// but you will get validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// Name of the location. + /// 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'. + /// 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. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task EventSubscriptionsListRegionalBySubscription_Validate(string subscriptionId, string location, string Filter, int? Top, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(location),location); + await eventListener.AssertNotNull(nameof(Filter),Filter); + } + } + + /// Asynchronously updates an existing event subscription. + /// 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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' + /// for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' + /// for an EventGrid topic. + /// Name of the event subscription to be updated. + /// Updated event subscription information. + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task EventSubscriptionsUpdate(string scope, string eventSubscriptionName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParameters body, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (scope) + + "/providers/Microsoft.EventGrid/eventSubscriptions/" + + global::System.Uri.EscapeDataString(eventSubscriptionName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.EventSubscriptionsUpdate_Call(request,onDefault,eventListener,sender); + } + } + + /// Asynchronously updates an existing event subscription. + /// + /// Updated event subscription information. + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task EventSubscriptionsUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParameters body, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.EventGrid/eventSubscriptions/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}'"); + } + + // replace URI parameters with values from identity + var scope = _match.Groups["scope"].Value; + var eventSubscriptionName = _match.Groups["eventSubscriptionName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + scope + + "/providers/Microsoft.EventGrid/eventSubscriptions/" + + eventSubscriptionName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.EventSubscriptionsUpdate_Call(request,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task EventSubscriptionsUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// 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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' + /// for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' + /// for an EventGrid topic. + /// Name of the event subscription to be updated. + /// Updated event subscription information. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task EventSubscriptionsUpdate_Validate(string scope, string eventSubscriptionName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParameters body, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(scope),scope); + await eventListener.AssertNotNull(nameof(eventSubscriptionName),eventSubscriptionName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Get the properties of an extension topic. + /// 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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' + /// for Azure resource. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ExtensionTopicsGet(string scope, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + global::System.Uri.EscapeDataString(scope) + + "/providers/Microsoft.EventGrid/extensionTopics/default" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ExtensionTopicsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Get the properties of an extension topic. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ExtensionTopicsGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.EventGrid/extensionTopics/default$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.EventGrid/extensionTopics/default'"); + } + + // replace URI parameters with values from identity + var scope = _match.Groups["scope"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + scope + + "/providers/Microsoft.EventGrid/extensionTopics/default" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ExtensionTopicsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ExtensionTopicsGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ExtensionTopic.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// 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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' + /// for Azure resource. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ExtensionTopicsGet_Validate(string scope, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(scope),scope); + } + } + + /// + /// List the available operations supported by the Microsoft.EventGrid resource provider. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task OperationsList(global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.EventGrid/operations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.OperationsList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// List the available operations supported by the Microsoft.EventGrid resource provider. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task OperationsListViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.EventGrid/operations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.EventGrid/operations'"); + } + + // replace URI parameters with values from identity + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.EventGrid/operations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.OperationsList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task OperationsList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.OperationsListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task OperationsList_Validate(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + + } + } + + /// + /// Authorize a single partner either by partner registration immutable Id or by partner name. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// The information of the partner to be authorized. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PartnerConfigurationsAuthorizePartner(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartner body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/partnerConfigurations/default/authorizePartner" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PartnerConfigurationsAuthorizePartner_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Authorize a single partner either by partner registration immutable Id or by partner name. + /// + /// + /// The information of the partner to be authorized. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PartnerConfigurationsAuthorizePartnerViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartner body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/partnerConfigurations/default/authorizePartner$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerConfigurations/default/authorizePartner'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/partnerConfigurations/default/authorizePartner" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PartnerConfigurationsAuthorizePartner_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PartnerConfigurationsAuthorizePartner_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerConfiguration.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but + /// you will get validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// The information of the partner to be authorized. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PartnerConfigurationsAuthorizePartner_Validate(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartner body, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// + /// Synchronously creates or updates a partner configuration with the specified parameters. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Partner configuration information. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PartnerConfigurationsCreateOrUpdate(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfiguration body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/partnerConfigurations/default" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PartnerConfigurationsCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Synchronously creates or updates a partner configuration with the specified parameters. + /// + /// + /// Partner configuration information. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PartnerConfigurationsCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfiguration body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/partnerConfigurations/default$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerConfigurations/default'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/partnerConfigurations/default" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PartnerConfigurationsCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PartnerConfigurationsCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerConfiguration.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Partner configuration information. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PartnerConfigurationsCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfiguration body, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Delete existing partner configuration. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PartnerConfigurationsDelete(string subscriptionId, string resourceGroupName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/partnerConfigurations/default" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PartnerConfigurationsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Delete existing partner configuration. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PartnerConfigurationsDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/partnerConfigurations/default$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerConfigurations/default'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/partnerConfigurations/default" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PartnerConfigurationsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PartnerConfigurationsDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_finalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PartnerConfigurationsDelete_Validate(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + } + } + + /// Get properties of a partner configuration. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PartnerConfigurationsGet(string subscriptionId, string resourceGroupName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/partnerConfigurations/default" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PartnerConfigurationsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Get properties of a partner configuration. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PartnerConfigurationsGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/partnerConfigurations/default$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerConfigurations/default'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/partnerConfigurations/default" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PartnerConfigurationsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PartnerConfigurationsGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerConfiguration.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PartnerConfigurationsGet_Validate(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + } + } + + /// List all the partner configurations under a resource group. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PartnerConfigurationsListByResourceGroup(string subscriptionId, string resourceGroupName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/partnerConfigurations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PartnerConfigurationsListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// List all the partner configurations under a resource group. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PartnerConfigurationsListByResourceGroupViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/partnerConfigurations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerConfigurations'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/partnerConfigurations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PartnerConfigurationsListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PartnerConfigurationsListByResourceGroup_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerConfigurationsListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, + /// but you will get validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PartnerConfigurationsListByResourceGroup_Validate(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + } + } + + /// List all the partner configurations under an Azure subscription. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// 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'. + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PartnerConfigurationsListBySubscription(string subscriptionId, string Filter, int? Top, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.EventGrid/partnerConfigurations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PartnerConfigurationsListBySubscription_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// List all the partner configurations under an Azure subscription. + /// + /// 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'. + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PartnerConfigurationsListBySubscriptionViaIdentity(global::System.String viaIdentity, string Filter, int? Top, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.EventGrid/partnerConfigurations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/partnerConfigurations'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/providers/Microsoft.EventGrid/partnerConfigurations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PartnerConfigurationsListBySubscription_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PartnerConfigurationsListBySubscription_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerConfigurationsListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but + /// you will get validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// 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'. + /// 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. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PartnerConfigurationsListBySubscription_Validate(string subscriptionId, string Filter, int? Top, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(Filter),Filter); + } + } + + /// + /// Unauthorize a single partner either by partner registration immutable Id or by partner name. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// The information of the partner to be unauthorized. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PartnerConfigurationsUnauthorizePartner(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartner body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/partnerConfigurations/default/unauthorizePartner" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PartnerConfigurationsUnauthorizePartner_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Unauthorize a single partner either by partner registration immutable Id or by partner name. + /// + /// + /// The information of the partner to be unauthorized. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PartnerConfigurationsUnauthorizePartnerViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartner body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/partnerConfigurations/default/unauthorizePartner$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerConfigurations/default/unauthorizePartner'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/partnerConfigurations/default/unauthorizePartner" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PartnerConfigurationsUnauthorizePartner_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PartnerConfigurationsUnauthorizePartner_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerConfiguration.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but + /// you will get validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// The information of the partner to be unauthorized. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PartnerConfigurationsUnauthorizePartner_Validate(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartner body, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Synchronously updates a partner configuration with the specified parameters. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Partner configuration update information. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PartnerConfigurationsUpdate(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationUpdateParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/partnerConfigurations/default" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PartnerConfigurationsUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Synchronously updates a partner configuration with the specified parameters. + /// + /// Partner configuration update information. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PartnerConfigurationsUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationUpdateParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/partnerConfigurations/default$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerConfigurations/default'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/partnerConfigurations/default" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PartnerConfigurationsUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PartnerConfigurationsUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerConfiguration.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Partner configuration update information. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PartnerConfigurationsUpdate_Validate(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationUpdateParameters body, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Activate a newly created partner destination. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the partner destination. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PartnerDestinationsActivate(string subscriptionId, string resourceGroupName, string partnerDestinationName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/partnerDestinations/" + + global::System.Uri.EscapeDataString(partnerDestinationName) + + "/activate" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PartnerDestinationsActivate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Activate a newly created partner destination. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PartnerDestinationsActivateViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/partnerDestinations/(?[^/]+)/activate$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerDestinations/{partnerDestinationName}/activate'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var partnerDestinationName = _match.Groups["partnerDestinationName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/partnerDestinations/" + + partnerDestinationName + + "/activate" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PartnerDestinationsActivate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PartnerDestinationsActivate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerDestination.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the partner destination. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PartnerDestinationsActivate_Validate(string subscriptionId, string resourceGroupName, string partnerDestinationName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(partnerDestinationName),partnerDestinationName); + } + } + + /// Asynchronously creates a new partner destination with the specified parameters. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the partner destination. + /// Partner destination create information. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PartnerDestinationsCreateOrUpdate(string subscriptionId, string resourceGroupName, string partnerDestinationName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestination body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/partnerDestinations/" + + global::System.Uri.EscapeDataString(partnerDestinationName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PartnerDestinationsCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Asynchronously creates a new partner destination with the specified parameters. + /// + /// Partner destination create information. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PartnerDestinationsCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestination body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/partnerDestinations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerDestinations/{partnerDestinationName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var partnerDestinationName = _match.Groups["partnerDestinationName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/partnerDestinations/" + + partnerDestinationName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PartnerDestinationsCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PartnerDestinationsCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerDestination.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerDestination.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the partner destination. + /// Partner destination create information. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PartnerDestinationsCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string partnerDestinationName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestination body, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(partnerDestinationName),partnerDestinationName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Delete existing partner destination. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the partner destination. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PartnerDestinationsDelete(string subscriptionId, string resourceGroupName, string partnerDestinationName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/partnerDestinations/" + + global::System.Uri.EscapeDataString(partnerDestinationName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PartnerDestinationsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Delete existing partner destination. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PartnerDestinationsDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/partnerDestinations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerDestinations/{partnerDestinationName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var partnerDestinationName = _match.Groups["partnerDestinationName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/partnerDestinations/" + + partnerDestinationName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PartnerDestinationsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PartnerDestinationsDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_finalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the partner destination. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PartnerDestinationsDelete_Validate(string subscriptionId, string resourceGroupName, string partnerDestinationName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(partnerDestinationName),partnerDestinationName); + } + } + + /// Get properties of a partner destination. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the partner destination. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PartnerDestinationsGet(string subscriptionId, string resourceGroupName, string partnerDestinationName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/partnerDestinations/" + + global::System.Uri.EscapeDataString(partnerDestinationName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PartnerDestinationsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Get properties of a partner destination. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PartnerDestinationsGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/partnerDestinations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerDestinations/{partnerDestinationName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var partnerDestinationName = _match.Groups["partnerDestinationName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/partnerDestinations/" + + partnerDestinationName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PartnerDestinationsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PartnerDestinationsGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerDestination.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the partner destination. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PartnerDestinationsGet_Validate(string subscriptionId, string resourceGroupName, string partnerDestinationName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(partnerDestinationName),partnerDestinationName); + } + } + + /// List all the partner destinations under a resource group. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// 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'. + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PartnerDestinationsListByResourceGroup(string subscriptionId, string resourceGroupName, string Filter, int? Top, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/partnerDestinations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PartnerDestinationsListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// List all the partner destinations under a resource group. + /// + /// 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'. + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PartnerDestinationsListByResourceGroupViaIdentity(global::System.String viaIdentity, string Filter, int? Top, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/partnerDestinations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerDestinations'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/partnerDestinations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PartnerDestinationsListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PartnerDestinationsListByResourceGroup_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerDestinationsListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but + /// you will get validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// 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'. + /// 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. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PartnerDestinationsListByResourceGroup_Validate(string subscriptionId, string resourceGroupName, string Filter, int? Top, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(Filter),Filter); + } + } + + /// List all the partner destinations under an Azure subscription. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// 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'. + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PartnerDestinationsListBySubscription(string subscriptionId, string Filter, int? Top, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.EventGrid/partnerDestinations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PartnerDestinationsListBySubscription_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// List all the partner destinations under an Azure subscription. + /// + /// 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'. + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PartnerDestinationsListBySubscriptionViaIdentity(global::System.String viaIdentity, string Filter, int? Top, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.EventGrid/partnerDestinations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/partnerDestinations'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/providers/Microsoft.EventGrid/partnerDestinations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PartnerDestinationsListBySubscription_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PartnerDestinationsListBySubscription_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerDestinationsListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but + /// you will get validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// 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'. + /// 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. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PartnerDestinationsListBySubscription_Validate(string subscriptionId, string Filter, int? Top, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(Filter),Filter); + } + } + + /// Asynchronously updates a partner destination with the specified parameters. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the partner destination. + /// Partner destination update information. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PartnerDestinationsUpdate(string subscriptionId, string resourceGroupName, string partnerDestinationName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationUpdateParameters body, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/partnerDestinations/" + + global::System.Uri.EscapeDataString(partnerDestinationName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PartnerDestinationsUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Asynchronously updates a partner destination with the specified parameters. + /// + /// Partner destination update information. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PartnerDestinationsUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationUpdateParameters body, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/partnerDestinations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerDestinations/{partnerDestinationName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var partnerDestinationName = _match.Groups["partnerDestinationName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/partnerDestinations/" + + partnerDestinationName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PartnerDestinationsUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PartnerDestinationsUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerDestination.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the partner destination. + /// Partner destination update information. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PartnerDestinationsUpdate_Validate(string subscriptionId, string resourceGroupName, string partnerDestinationName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationUpdateParameters body, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(partnerDestinationName),partnerDestinationName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Asynchronously creates a new partner namespace with the specified parameters. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the partner namespace. + /// PartnerNamespace information. + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PartnerNamespacesCreateOrUpdate(string subscriptionId, string resourceGroupName, string partnerNamespaceName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespace body, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/partnerNamespaces/" + + global::System.Uri.EscapeDataString(partnerNamespaceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PartnerNamespacesCreateOrUpdate_Call(request,onDefault,eventListener,sender); + } + } + + /// Asynchronously creates a new partner namespace with the specified parameters. + /// + /// PartnerNamespace information. + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PartnerNamespacesCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespace body, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/partnerNamespaces/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerNamespaces/{partnerNamespaceName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var partnerNamespaceName = _match.Groups["partnerNamespaceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/partnerNamespaces/" + + partnerNamespaceName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PartnerNamespacesCreateOrUpdate_Call(request,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PartnerNamespacesCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the partner namespace. + /// PartnerNamespace information. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PartnerNamespacesCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string partnerNamespaceName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespace body, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(partnerNamespaceName),partnerNamespaceName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Delete existing partner namespace. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the partner namespace. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PartnerNamespacesDelete(string subscriptionId, string resourceGroupName, string partnerNamespaceName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/partnerNamespaces/" + + global::System.Uri.EscapeDataString(partnerNamespaceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PartnerNamespacesDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Delete existing partner namespace. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PartnerNamespacesDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/partnerNamespaces/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerNamespaces/{partnerNamespaceName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var partnerNamespaceName = _match.Groups["partnerNamespaceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/partnerNamespaces/" + + partnerNamespaceName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PartnerNamespacesDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PartnerNamespacesDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_finalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the partner namespace. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PartnerNamespacesDelete_Validate(string subscriptionId, string resourceGroupName, string partnerNamespaceName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(partnerNamespaceName),partnerNamespaceName); + } + } + + /// Get properties of a partner namespace. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the partner namespace. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PartnerNamespacesGet(string subscriptionId, string resourceGroupName, string partnerNamespaceName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/partnerNamespaces/" + + global::System.Uri.EscapeDataString(partnerNamespaceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PartnerNamespacesGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Get properties of a partner namespace. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PartnerNamespacesGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/partnerNamespaces/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerNamespaces/{partnerNamespaceName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var partnerNamespaceName = _match.Groups["partnerNamespaceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/partnerNamespaces/" + + partnerNamespaceName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PartnerNamespacesGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PartnerNamespacesGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerNamespace.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the partner namespace. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PartnerNamespacesGet_Validate(string subscriptionId, string resourceGroupName, string partnerNamespaceName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(partnerNamespaceName),partnerNamespaceName); + } + } + + /// List all the partner namespaces under a resource group. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// 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'. + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PartnerNamespacesListByResourceGroup(string subscriptionId, string resourceGroupName, string Filter, int? Top, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/partnerNamespaces" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PartnerNamespacesListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// List all the partner namespaces under a resource group. + /// + /// 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'. + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PartnerNamespacesListByResourceGroupViaIdentity(global::System.String viaIdentity, string Filter, int? Top, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/partnerNamespaces$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerNamespaces'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/partnerNamespaces" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PartnerNamespacesListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PartnerNamespacesListByResourceGroup_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerNamespacesListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but + /// you will get validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// 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'. + /// 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. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PartnerNamespacesListByResourceGroup_Validate(string subscriptionId, string resourceGroupName, string Filter, int? Top, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(Filter),Filter); + } + } + + /// List all the partner namespaces under an Azure subscription. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// 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'. + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PartnerNamespacesListBySubscription(string subscriptionId, string Filter, int? Top, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.EventGrid/partnerNamespaces" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PartnerNamespacesListBySubscription_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// List all the partner namespaces under an Azure subscription. + /// + /// 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'. + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PartnerNamespacesListBySubscriptionViaIdentity(global::System.String viaIdentity, string Filter, int? Top, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.EventGrid/partnerNamespaces$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/partnerNamespaces'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/providers/Microsoft.EventGrid/partnerNamespaces" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PartnerNamespacesListBySubscription_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PartnerNamespacesListBySubscription_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerNamespacesListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// 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'. + /// 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. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PartnerNamespacesListBySubscription_Validate(string subscriptionId, string Filter, int? Top, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(Filter),Filter); + } + } + + /// List the two keys used to publish to a partner namespace. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the partner namespace. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PartnerNamespacesListSharedAccessKeys(string subscriptionId, string resourceGroupName, string partnerNamespaceName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/partnerNamespaces/" + + global::System.Uri.EscapeDataString(partnerNamespaceName) + + "/listKeys" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PartnerNamespacesListSharedAccessKeys_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// List the two keys used to publish to a partner namespace. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PartnerNamespacesListSharedAccessKeysViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/partnerNamespaces/(?[^/]+)/listKeys$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerNamespaces/{partnerNamespaceName}/listKeys'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var partnerNamespaceName = _match.Groups["partnerNamespaceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/partnerNamespaces/" + + partnerNamespaceName + + "/listKeys" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PartnerNamespacesListSharedAccessKeys_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PartnerNamespacesListSharedAccessKeys_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerNamespaceSharedAccessKeys.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but + /// you will get validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the partner namespace. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PartnerNamespacesListSharedAccessKeys_Validate(string subscriptionId, string resourceGroupName, string partnerNamespaceName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(partnerNamespaceName),partnerNamespaceName); + } + } + + /// Regenerate a shared access key for a partner namespace. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the partner namespace. + /// Request body to regenerate key. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PartnerNamespacesRegenerateKey(string subscriptionId, string resourceGroupName, string partnerNamespaceName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceRegenerateKeyRequest body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/partnerNamespaces/" + + global::System.Uri.EscapeDataString(partnerNamespaceName) + + "/regenerateKey" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PartnerNamespacesRegenerateKey_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Regenerate a shared access key for a partner namespace. + /// + /// Request body to regenerate key. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PartnerNamespacesRegenerateKeyViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceRegenerateKeyRequest body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/partnerNamespaces/(?[^/]+)/regenerateKey$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerNamespaces/{partnerNamespaceName}/regenerateKey'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var partnerNamespaceName = _match.Groups["partnerNamespaceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/partnerNamespaces/" + + partnerNamespaceName + + "/regenerateKey" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PartnerNamespacesRegenerateKey_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PartnerNamespacesRegenerateKey_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerNamespaceSharedAccessKeys.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the partner namespace. + /// Request body to regenerate key. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PartnerNamespacesRegenerateKey_Validate(string subscriptionId, string resourceGroupName, string partnerNamespaceName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceRegenerateKeyRequest body, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(partnerNamespaceName),partnerNamespaceName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Asynchronously updates a partner namespace with the specified parameters. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the partner namespace. + /// Partner namespace update information. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PartnerNamespacesUpdate(string subscriptionId, string resourceGroupName, string partnerNamespaceName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParameters body, global::System.Func onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/partnerNamespaces/" + + global::System.Uri.EscapeDataString(partnerNamespaceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PartnerNamespacesUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Asynchronously updates a partner namespace with the specified parameters. + /// + /// Partner namespace update information. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PartnerNamespacesUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParameters body, global::System.Func onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/partnerNamespaces/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerNamespaces/{partnerNamespaceName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var partnerNamespaceName = _match.Groups["partnerNamespaceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/partnerNamespaces/" + + partnerNamespaceName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PartnerNamespacesUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PartnerNamespacesUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the partner namespace. + /// Partner namespace update information. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PartnerNamespacesUpdate_Validate(string subscriptionId, string resourceGroupName, string partnerNamespaceName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParameters body, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(partnerNamespaceName),partnerNamespaceName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Creates a new partner registration with the specified parameters. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the partner registration. + /// PartnerRegistration information. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PartnerRegistrationsCreateOrUpdate(string subscriptionId, string resourceGroupName, string partnerRegistrationName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistration body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/partnerRegistrations/" + + global::System.Uri.EscapeDataString(partnerRegistrationName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PartnerRegistrationsCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Creates a new partner registration with the specified parameters. + /// + /// PartnerRegistration information. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PartnerRegistrationsCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistration body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/partnerRegistrations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerRegistrations/{partnerRegistrationName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var partnerRegistrationName = _match.Groups["partnerRegistrationName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/partnerRegistrations/" + + partnerRegistrationName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PartnerRegistrationsCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PartnerRegistrationsCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerRegistration.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the partner registration. + /// PartnerRegistration information. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PartnerRegistrationsCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string partnerRegistrationName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistration body, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(partnerRegistrationName),partnerRegistrationName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes a partner registration with the specified parameters. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the partner registration. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PartnerRegistrationsDelete(string subscriptionId, string resourceGroupName, string partnerRegistrationName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/partnerRegistrations/" + + global::System.Uri.EscapeDataString(partnerRegistrationName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PartnerRegistrationsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes a partner registration with the specified parameters. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PartnerRegistrationsDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/partnerRegistrations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerRegistrations/{partnerRegistrationName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var partnerRegistrationName = _match.Groups["partnerRegistrationName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/partnerRegistrations/" + + partnerRegistrationName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PartnerRegistrationsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PartnerRegistrationsDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_finalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the partner registration. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PartnerRegistrationsDelete_Validate(string subscriptionId, string resourceGroupName, string partnerRegistrationName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(partnerRegistrationName),partnerRegistrationName); + } + } + + /// Gets a partner registration with the specified parameters. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the partner registration. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PartnerRegistrationsGet(string subscriptionId, string resourceGroupName, string partnerRegistrationName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/partnerRegistrations/" + + global::System.Uri.EscapeDataString(partnerRegistrationName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PartnerRegistrationsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets a partner registration with the specified parameters. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PartnerRegistrationsGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/partnerRegistrations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerRegistrations/{partnerRegistrationName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var partnerRegistrationName = _match.Groups["partnerRegistrationName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/partnerRegistrations/" + + partnerRegistrationName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PartnerRegistrationsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PartnerRegistrationsGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerRegistration.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the partner registration. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PartnerRegistrationsGet_Validate(string subscriptionId, string resourceGroupName, string partnerRegistrationName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(partnerRegistrationName),partnerRegistrationName); + } + } + + /// List all the partner registrations under a resource group. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// 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'. + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PartnerRegistrationsListByResourceGroup(string subscriptionId, string resourceGroupName, string Filter, int? Top, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/partnerRegistrations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PartnerRegistrationsListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// List all the partner registrations under a resource group. + /// + /// 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'. + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PartnerRegistrationsListByResourceGroupViaIdentity(global::System.String viaIdentity, string Filter, int? Top, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/partnerRegistrations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerRegistrations'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/partnerRegistrations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PartnerRegistrationsListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PartnerRegistrationsListByResourceGroup_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerRegistrationsListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but + /// you will get validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// 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'. + /// 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. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PartnerRegistrationsListByResourceGroup_Validate(string subscriptionId, string resourceGroupName, string Filter, int? Top, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(Filter),Filter); + } + } + + /// List all the partner registrations under an Azure subscription. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// 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'. + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PartnerRegistrationsListBySubscription(string subscriptionId, string Filter, int? Top, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.EventGrid/partnerRegistrations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PartnerRegistrationsListBySubscription_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// List all the partner registrations under an Azure subscription. + /// + /// 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'. + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PartnerRegistrationsListBySubscriptionViaIdentity(global::System.String viaIdentity, string Filter, int? Top, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.EventGrid/partnerRegistrations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/partnerRegistrations'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/providers/Microsoft.EventGrid/partnerRegistrations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PartnerRegistrationsListBySubscription_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PartnerRegistrationsListBySubscription_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerRegistrationsListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but + /// you will get validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// 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'. + /// 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. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PartnerRegistrationsListBySubscription_Validate(string subscriptionId, string Filter, int? Top, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(Filter),Filter); + } + } + + /// Updates a partner registration with the specified parameters. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the partner registration. + /// Partner registration update information. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PartnerRegistrationsUpdate(string subscriptionId, string resourceGroupName, string partnerRegistrationName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationUpdateParameters body, global::System.Func onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/partnerRegistrations/" + + global::System.Uri.EscapeDataString(partnerRegistrationName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PartnerRegistrationsUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Updates a partner registration with the specified parameters. + /// + /// Partner registration update information. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PartnerRegistrationsUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationUpdateParameters body, global::System.Func onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/partnerRegistrations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerRegistrations/{partnerRegistrationName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var partnerRegistrationName = _match.Groups["partnerRegistrationName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/partnerRegistrations/" + + partnerRegistrationName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PartnerRegistrationsUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PartnerRegistrationsUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the partner registration. + /// Partner registration update information. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PartnerRegistrationsUpdate_Validate(string subscriptionId, string resourceGroupName, string partnerRegistrationName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationUpdateParameters body, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(partnerRegistrationName),partnerRegistrationName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// + /// Asynchronously creates or updates an event subscription of a partner topic with the specified parameters. Existing event + /// subscriptions will be updated with this API. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the partner topic. + /// 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. + /// Event subscription properties containing the destination and filter information. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PartnerTopicEventSubscriptionsCreateOrUpdate(string subscriptionId, string resourceGroupName, string partnerTopicName, string eventSubscriptionName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/partnerTopics/" + + global::System.Uri.EscapeDataString(partnerTopicName) + + "/eventSubscriptions/" + + global::System.Uri.EscapeDataString(eventSubscriptionName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PartnerTopicEventSubscriptionsCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Asynchronously creates or updates an event subscription of a partner topic with the specified parameters. Existing event + /// subscriptions will be updated with this API. + /// + /// + /// Event subscription properties containing the destination and filter information. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PartnerTopicEventSubscriptionsCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/partnerTopics/(?[^/]+)/eventSubscriptions/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerTopics/{partnerTopicName}/eventSubscriptions/{eventSubscriptionName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var partnerTopicName = _match.Groups["partnerTopicName"].Value; + var eventSubscriptionName = _match.Groups["eventSubscriptionName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/partnerTopics/" + + partnerTopicName + + "/eventSubscriptions/" + + eventSubscriptionName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PartnerTopicEventSubscriptionsCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PartnerTopicEventSubscriptionsCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscription.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, + /// but you will get validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the partner topic. + /// 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. + /// Event subscription properties containing the destination and filter information. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PartnerTopicEventSubscriptionsCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string partnerTopicName, string eventSubscriptionName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription body, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(partnerTopicName),partnerTopicName); + await eventListener.AssertNotNull(nameof(eventSubscriptionName),eventSubscriptionName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Delete an existing event subscription of a partner topic. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the partner topic. + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PartnerTopicEventSubscriptionsDelete(string subscriptionId, string resourceGroupName, string partnerTopicName, string eventSubscriptionName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/partnerTopics/" + + global::System.Uri.EscapeDataString(partnerTopicName) + + "/eventSubscriptions/" + + global::System.Uri.EscapeDataString(eventSubscriptionName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PartnerTopicEventSubscriptionsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Delete an existing event subscription of a partner topic. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PartnerTopicEventSubscriptionsDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/partnerTopics/(?[^/]+)/eventSubscriptions/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerTopics/{partnerTopicName}/eventSubscriptions/{eventSubscriptionName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var partnerTopicName = _match.Groups["partnerTopicName"].Value; + var eventSubscriptionName = _match.Groups["eventSubscriptionName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/partnerTopics/" + + partnerTopicName + + "/eventSubscriptions/" + + eventSubscriptionName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PartnerTopicEventSubscriptionsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PartnerTopicEventSubscriptionsDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_finalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but + /// you will get validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the partner topic. + /// 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. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PartnerTopicEventSubscriptionsDelete_Validate(string subscriptionId, string resourceGroupName, string partnerTopicName, string eventSubscriptionName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(partnerTopicName),partnerTopicName); + await eventListener.AssertNotNull(nameof(eventSubscriptionName),eventSubscriptionName); + } + } + + /// Get properties of an event subscription of a partner topic. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the partner topic. + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PartnerTopicEventSubscriptionsGet(string subscriptionId, string resourceGroupName, string partnerTopicName, string eventSubscriptionName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/partnerTopics/" + + global::System.Uri.EscapeDataString(partnerTopicName) + + "/eventSubscriptions/" + + global::System.Uri.EscapeDataString(eventSubscriptionName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PartnerTopicEventSubscriptionsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Get all delivery attributes for an event subscription of a partner topic. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the partner topic. + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PartnerTopicEventSubscriptionsGetDeliveryAttributes(string subscriptionId, string resourceGroupName, string partnerTopicName, string eventSubscriptionName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/partnerTopics/" + + global::System.Uri.EscapeDataString(partnerTopicName) + + "/eventSubscriptions/" + + global::System.Uri.EscapeDataString(eventSubscriptionName) + + "/getDeliveryAttributes" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PartnerTopicEventSubscriptionsGetDeliveryAttributes_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Get all delivery attributes for an event subscription of a partner topic. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PartnerTopicEventSubscriptionsGetDeliveryAttributesViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/partnerTopics/(?[^/]+)/eventSubscriptions/(?[^/]+)/getDeliveryAttributes$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerTopics/{partnerTopicName}/eventSubscriptions/{eventSubscriptionName}/getDeliveryAttributes'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var partnerTopicName = _match.Groups["partnerTopicName"].Value; + var eventSubscriptionName = _match.Groups["eventSubscriptionName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/partnerTopics/" + + partnerTopicName + + "/eventSubscriptions/" + + eventSubscriptionName + + "/getDeliveryAttributes" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PartnerTopicEventSubscriptionsGetDeliveryAttributes_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PartnerTopicEventSubscriptionsGetDeliveryAttributes_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeliveryAttributeListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual + /// call, but you will get validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the partner topic. + /// 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. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PartnerTopicEventSubscriptionsGetDeliveryAttributes_Validate(string subscriptionId, string resourceGroupName, string partnerTopicName, string eventSubscriptionName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(partnerTopicName),partnerTopicName); + await eventListener.AssertNotNull(nameof(eventSubscriptionName),eventSubscriptionName); + } + } + + /// Get the full endpoint URL for an event subscription of a partner topic. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the partner topic. + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PartnerTopicEventSubscriptionsGetFullUrl(string subscriptionId, string resourceGroupName, string partnerTopicName, string eventSubscriptionName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/partnerTopics/" + + global::System.Uri.EscapeDataString(partnerTopicName) + + "/eventSubscriptions/" + + global::System.Uri.EscapeDataString(eventSubscriptionName) + + "/getFullUrl" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PartnerTopicEventSubscriptionsGetFullUrl_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Get the full endpoint URL for an event subscription of a partner topic. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PartnerTopicEventSubscriptionsGetFullUrlViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/partnerTopics/(?[^/]+)/eventSubscriptions/(?[^/]+)/getFullUrl$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerTopics/{partnerTopicName}/eventSubscriptions/{eventSubscriptionName}/getFullUrl'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var partnerTopicName = _match.Groups["partnerTopicName"].Value; + var eventSubscriptionName = _match.Groups["eventSubscriptionName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/partnerTopics/" + + partnerTopicName + + "/eventSubscriptions/" + + eventSubscriptionName + + "/getFullUrl" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PartnerTopicEventSubscriptionsGetFullUrl_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PartnerTopicEventSubscriptionsGetFullUrl_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionFullUrl.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, + /// but you will get validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the partner topic. + /// 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. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PartnerTopicEventSubscriptionsGetFullUrl_Validate(string subscriptionId, string resourceGroupName, string partnerTopicName, string eventSubscriptionName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(partnerTopicName),partnerTopicName); + await eventListener.AssertNotNull(nameof(eventSubscriptionName),eventSubscriptionName); + } + } + + /// Get properties of an event subscription of a partner topic. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PartnerTopicEventSubscriptionsGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/partnerTopics/(?[^/]+)/eventSubscriptions/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerTopics/{partnerTopicName}/eventSubscriptions/{eventSubscriptionName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var partnerTopicName = _match.Groups["partnerTopicName"].Value; + var eventSubscriptionName = _match.Groups["eventSubscriptionName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/partnerTopics/" + + partnerTopicName + + "/eventSubscriptions/" + + eventSubscriptionName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PartnerTopicEventSubscriptionsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PartnerTopicEventSubscriptionsGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscription.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the partner topic. + /// 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. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PartnerTopicEventSubscriptionsGet_Validate(string subscriptionId, string resourceGroupName, string partnerTopicName, string eventSubscriptionName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(partnerTopicName),partnerTopicName); + await eventListener.AssertNotNull(nameof(eventSubscriptionName),eventSubscriptionName); + } + } + + /// List event subscriptions that belong to a specific partner topic. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the partner topic. + /// 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'. + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PartnerTopicEventSubscriptionsListByPartnerTopic(string subscriptionId, string resourceGroupName, string partnerTopicName, string Filter, int? Top, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/partnerTopics/" + + global::System.Uri.EscapeDataString(partnerTopicName) + + "/eventSubscriptions" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PartnerTopicEventSubscriptionsListByPartnerTopic_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// List event subscriptions that belong to a specific partner topic. + /// + /// 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'. + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PartnerTopicEventSubscriptionsListByPartnerTopicViaIdentity(global::System.String viaIdentity, string Filter, int? Top, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/partnerTopics/(?[^/]+)/eventSubscriptions$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerTopics/{partnerTopicName}/eventSubscriptions'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var partnerTopicName = _match.Groups["partnerTopicName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/partnerTopics/" + + partnerTopicName + + "/eventSubscriptions" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PartnerTopicEventSubscriptionsListByPartnerTopic_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PartnerTopicEventSubscriptionsListByPartnerTopic_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionsListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual + /// call, but you will get validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the partner topic. + /// 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'. + /// 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. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PartnerTopicEventSubscriptionsListByPartnerTopic_Validate(string subscriptionId, string resourceGroupName, string partnerTopicName, string Filter, int? Top, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(partnerTopicName),partnerTopicName); + await eventListener.AssertNotNull(nameof(Filter),Filter); + } + } + + /// Update an existing event subscription of a partner topic. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the partner topic. + /// 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. + /// Updated event subscription information. + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PartnerTopicEventSubscriptionsUpdate(string subscriptionId, string resourceGroupName, string partnerTopicName, string eventSubscriptionName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParameters body, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/partnerTopics/" + + global::System.Uri.EscapeDataString(partnerTopicName) + + "/eventSubscriptions/" + + global::System.Uri.EscapeDataString(eventSubscriptionName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PartnerTopicEventSubscriptionsUpdate_Call(request,onDefault,eventListener,sender); + } + } + + /// Update an existing event subscription of a partner topic. + /// + /// Updated event subscription information. + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PartnerTopicEventSubscriptionsUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParameters body, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/partnerTopics/(?[^/]+)/eventSubscriptions/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerTopics/{partnerTopicName}/eventSubscriptions/{eventSubscriptionName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var partnerTopicName = _match.Groups["partnerTopicName"].Value; + var eventSubscriptionName = _match.Groups["eventSubscriptionName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/partnerTopics/" + + partnerTopicName + + "/eventSubscriptions/" + + eventSubscriptionName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PartnerTopicEventSubscriptionsUpdate_Call(request,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PartnerTopicEventSubscriptionsUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but + /// you will get validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the partner topic. + /// 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. + /// Updated event subscription information. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PartnerTopicEventSubscriptionsUpdate_Validate(string subscriptionId, string resourceGroupName, string partnerTopicName, string eventSubscriptionName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParameters body, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(partnerTopicName),partnerTopicName); + await eventListener.AssertNotNull(nameof(eventSubscriptionName),eventSubscriptionName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Activate a newly created partner topic. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the partner topic. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PartnerTopicsActivate(string subscriptionId, string resourceGroupName, string partnerTopicName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/partnerTopics/" + + global::System.Uri.EscapeDataString(partnerTopicName) + + "/activate" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PartnerTopicsActivate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Activate a newly created partner topic. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PartnerTopicsActivateViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/partnerTopics/(?[^/]+)/activate$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerTopics/{partnerTopicName}/activate'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var partnerTopicName = _match.Groups["partnerTopicName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/partnerTopics/" + + partnerTopicName + + "/activate" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PartnerTopicsActivate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PartnerTopicsActivate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerTopic.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the partner topic. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PartnerTopicsActivate_Validate(string subscriptionId, string resourceGroupName, string partnerTopicName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(partnerTopicName),partnerTopicName); + } + } + + /// Asynchronously creates a new partner topic with the specified parameters. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the partner topic. + /// Partner Topic information. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PartnerTopicsCreateOrUpdate(string subscriptionId, string resourceGroupName, string partnerTopicName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopic body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/partnerTopics/" + + global::System.Uri.EscapeDataString(partnerTopicName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PartnerTopicsCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Asynchronously creates a new partner topic with the specified parameters. + /// + /// Partner Topic information. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PartnerTopicsCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopic body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/partnerTopics/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerTopics/{partnerTopicName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var partnerTopicName = _match.Groups["partnerTopicName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/partnerTopics/" + + partnerTopicName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PartnerTopicsCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PartnerTopicsCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerTopic.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerTopic.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the partner topic. + /// Partner Topic information. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PartnerTopicsCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string partnerTopicName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopic body, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(partnerTopicName),partnerTopicName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deactivate specific partner topic. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the partner topic. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PartnerTopicsDeactivate(string subscriptionId, string resourceGroupName, string partnerTopicName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/partnerTopics/" + + global::System.Uri.EscapeDataString(partnerTopicName) + + "/deactivate" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PartnerTopicsDeactivate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Deactivate specific partner topic. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PartnerTopicsDeactivateViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/partnerTopics/(?[^/]+)/deactivate$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerTopics/{partnerTopicName}/deactivate'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var partnerTopicName = _match.Groups["partnerTopicName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/partnerTopics/" + + partnerTopicName + + "/deactivate" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PartnerTopicsDeactivate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PartnerTopicsDeactivate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerTopic.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the partner topic. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PartnerTopicsDeactivate_Validate(string subscriptionId, string resourceGroupName, string partnerTopicName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(partnerTopicName),partnerTopicName); + } + } + + /// Delete existing partner topic. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the partner topic. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PartnerTopicsDelete(string subscriptionId, string resourceGroupName, string partnerTopicName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/partnerTopics/" + + global::System.Uri.EscapeDataString(partnerTopicName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PartnerTopicsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Delete existing partner topic. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PartnerTopicsDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/partnerTopics/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerTopics/{partnerTopicName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var partnerTopicName = _match.Groups["partnerTopicName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/partnerTopics/" + + partnerTopicName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PartnerTopicsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PartnerTopicsDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_finalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the partner topic. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PartnerTopicsDelete_Validate(string subscriptionId, string resourceGroupName, string partnerTopicName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(partnerTopicName),partnerTopicName); + } + } + + /// Get properties of a partner topic. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the partner topic. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PartnerTopicsGet(string subscriptionId, string resourceGroupName, string partnerTopicName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/partnerTopics/" + + global::System.Uri.EscapeDataString(partnerTopicName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PartnerTopicsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Get properties of a partner topic. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PartnerTopicsGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/partnerTopics/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerTopics/{partnerTopicName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var partnerTopicName = _match.Groups["partnerTopicName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/partnerTopics/" + + partnerTopicName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PartnerTopicsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PartnerTopicsGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerTopic.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the partner topic. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PartnerTopicsGet_Validate(string subscriptionId, string resourceGroupName, string partnerTopicName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(partnerTopicName),partnerTopicName); + } + } + + /// List all the partner topics under a resource group. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// 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'. + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PartnerTopicsListByResourceGroup(string subscriptionId, string resourceGroupName, string Filter, int? Top, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/partnerTopics" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PartnerTopicsListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// List all the partner topics under a resource group. + /// + /// 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'. + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PartnerTopicsListByResourceGroupViaIdentity(global::System.String viaIdentity, string Filter, int? Top, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/partnerTopics$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerTopics'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/partnerTopics" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PartnerTopicsListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PartnerTopicsListByResourceGroup_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerTopicsListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// 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'. + /// 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. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PartnerTopicsListByResourceGroup_Validate(string subscriptionId, string resourceGroupName, string Filter, int? Top, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(Filter),Filter); + } + } + + /// List all the partner topics under an Azure subscription. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// 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'. + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PartnerTopicsListBySubscription(string subscriptionId, string Filter, int? Top, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.EventGrid/partnerTopics" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PartnerTopicsListBySubscription_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// List all the partner topics under an Azure subscription. + /// + /// 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'. + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PartnerTopicsListBySubscriptionViaIdentity(global::System.String viaIdentity, string Filter, int? Top, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.EventGrid/partnerTopics$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/partnerTopics'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/providers/Microsoft.EventGrid/partnerTopics" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PartnerTopicsListBySubscription_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PartnerTopicsListBySubscription_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerTopicsListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// 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'. + /// 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. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PartnerTopicsListBySubscription_Validate(string subscriptionId, string Filter, int? Top, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(Filter),Filter); + } + } + + /// Asynchronously updates a partner topic with the specified parameters. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the partner topic. + /// PartnerTopic update information. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PartnerTopicsUpdate(string subscriptionId, string resourceGroupName, string partnerTopicName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicUpdateParameters body, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/partnerTopics/" + + global::System.Uri.EscapeDataString(partnerTopicName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PartnerTopicsUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Asynchronously updates a partner topic with the specified parameters. + /// + /// PartnerTopic update information. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PartnerTopicsUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicUpdateParameters body, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/partnerTopics/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerTopics/{partnerTopicName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var partnerTopicName = _match.Groups["partnerTopicName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/partnerTopics/" + + partnerTopicName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PartnerTopicsUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PartnerTopicsUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerTopic.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the partner topic. + /// PartnerTopic update information. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PartnerTopicsUpdate_Validate(string subscriptionId, string resourceGroupName, string partnerTopicName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicUpdateParameters body, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(partnerTopicName),partnerTopicName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// + /// Delete a specific private endpoint connection under a topic, domain, or partner namespace. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// The type of the parent resource. This can be either \'topics\', \'domains\', or \'partnerNamespaces\'. + /// The name of the parent resource (namely, either, the topic name, domain name, or partner namespace + /// name). + /// The name of the private endpoint connection connection. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PrivateEndpointConnectionsDelete(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ParentType parentType, string parentName, string privateEndpointConnectionName, global::System.Func onNoContent, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/" + + global::System.Uri.EscapeDataString(parentType) + + "/" + + global::System.Uri.EscapeDataString(parentName) + + "/privateEndpointConnections/" + + global::System.Uri.EscapeDataString(privateEndpointConnectionName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PrivateEndpointConnectionsDelete_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// + /// Delete a specific private endpoint connection under a topic, domain, or partner namespace. + /// + /// + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PrivateEndpointConnectionsDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onNoContent, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/(?[^/]+)/(?[^/]+)/privateEndpointConnections/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/{parentType}/{parentName}/privateEndpointConnections/{privateEndpointConnectionName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var parentType = _match.Groups["parentType"].Value; + var parentName = _match.Groups["parentName"].Value; + var privateEndpointConnectionName = _match.Groups["privateEndpointConnectionName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/" + + parentType + + "/" + + parentName + + "/privateEndpointConnections/" + + privateEndpointConnectionName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PrivateEndpointConnectionsDelete_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PrivateEndpointConnectionsDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_finalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// The type of the parent resource. This can be either \'topics\', \'domains\', or \'partnerNamespaces\'. + /// The name of the parent resource (namely, either, the topic name, domain name, or partner namespace + /// name). + /// The name of the private endpoint connection connection. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PrivateEndpointConnectionsDelete_Validate(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ParentType parentType, string parentName, string privateEndpointConnectionName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(parentType),parentType); + await eventListener.AssertEnum(nameof(parentType),parentType,@"topics", @"domains", @"partnerNamespaces"); + await eventListener.AssertNotNull(nameof(parentName),parentName); + await eventListener.AssertNotNull(nameof(privateEndpointConnectionName),privateEndpointConnectionName); + } + } + + /// + /// Get a specific private endpoint connection under a topic, domain, or partner namespace. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// The type of the parent resource. This can be either \'topics\', \'domains\', or \'partnerNamespaces\'. + /// The name of the parent resource (namely, either, the topic name, domain name, or partner namespace + /// name). + /// The name of the private endpoint connection connection. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PrivateEndpointConnectionsGet(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ParentType parentType, string parentName, string privateEndpointConnectionName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/" + + global::System.Uri.EscapeDataString(parentType) + + "/" + + global::System.Uri.EscapeDataString(parentName) + + "/privateEndpointConnections/" + + global::System.Uri.EscapeDataString(privateEndpointConnectionName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PrivateEndpointConnectionsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Get a specific private endpoint connection under a topic, domain, or partner namespace. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PrivateEndpointConnectionsGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/(?[^/]+)/(?[^/]+)/privateEndpointConnections/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/{parentType}/{parentName}/privateEndpointConnections/{privateEndpointConnectionName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var parentType = _match.Groups["parentType"].Value; + var parentName = _match.Groups["parentName"].Value; + var privateEndpointConnectionName = _match.Groups["privateEndpointConnectionName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/" + + parentType + + "/" + + parentName + + "/privateEndpointConnections/" + + privateEndpointConnectionName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PrivateEndpointConnectionsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PrivateEndpointConnectionsGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PrivateEndpointConnection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// The type of the parent resource. This can be either \'topics\', \'domains\', or \'partnerNamespaces\'. + /// The name of the parent resource (namely, either, the topic name, domain name, or partner namespace + /// name). + /// The name of the private endpoint connection connection. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PrivateEndpointConnectionsGet_Validate(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ParentType parentType, string parentName, string privateEndpointConnectionName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(parentType),parentType); + await eventListener.AssertEnum(nameof(parentType),parentType,@"topics", @"domains", @"partnerNamespaces"); + await eventListener.AssertNotNull(nameof(parentName),parentName); + await eventListener.AssertNotNull(nameof(privateEndpointConnectionName),privateEndpointConnectionName); + } + } + + /// + /// Get all private endpoint connections under a topic, domain, or partner namespace. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// The type of the parent resource. This can be either \'topics\', \'domains\', or \'partnerNamespaces\'. + /// The name of the parent resource (namely, either, the topic name, domain name, or partner namespace + /// name). + /// 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'. + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PrivateEndpointConnectionsListByResource(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ParentType parentType, string parentName, string Filter, int? Top, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/" + + global::System.Uri.EscapeDataString(parentType) + + "/" + + global::System.Uri.EscapeDataString(parentName) + + "/privateEndpointConnections" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PrivateEndpointConnectionsListByResource_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Get all private endpoint connections under a topic, domain, or partner namespace. + /// + /// + /// 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'. + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PrivateEndpointConnectionsListByResourceViaIdentity(global::System.String viaIdentity, string Filter, int? Top, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/(?[^/]+)/(?[^/]+)/privateEndpointConnections$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/{parentType}/{parentName}/privateEndpointConnections'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var parentType = _match.Groups["parentType"].Value; + var parentName = _match.Groups["parentName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/" + + parentType + + "/" + + parentName + + "/privateEndpointConnections" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PrivateEndpointConnectionsListByResource_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PrivateEndpointConnectionsListByResource_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PrivateEndpointConnectionListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, + /// but you will get validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// The type of the parent resource. This can be either \'topics\', \'domains\', or \'partnerNamespaces\'. + /// The name of the parent resource (namely, either, the topic name, domain name, or partner namespace + /// name). + /// 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'. + /// 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. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PrivateEndpointConnectionsListByResource_Validate(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ParentType parentType, string parentName, string Filter, int? Top, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(parentType),parentType); + await eventListener.AssertEnum(nameof(parentType),parentType,@"topics", @"domains", @"partnerNamespaces"); + await eventListener.AssertNotNull(nameof(parentName),parentName); + await eventListener.AssertNotNull(nameof(Filter),Filter); + } + } + + /// + /// Update a specific private endpoint connection under a topic, domain or partner namespace. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// The type of the parent resource. This can be either \'topics\', \'domains\', or \'partnerNamespaces\'. + /// The name of the parent resource (namely, either, the topic name, domain name, or partner namespace + /// name). + /// The name of the private endpoint connection connection. + /// The private endpoint connection object to update. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PrivateEndpointConnectionsUpdate(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ParentType parentType, string parentName, string privateEndpointConnectionName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnection body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/" + + global::System.Uri.EscapeDataString(parentType) + + "/" + + global::System.Uri.EscapeDataString(parentName) + + "/privateEndpointConnections/" + + global::System.Uri.EscapeDataString(privateEndpointConnectionName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PrivateEndpointConnectionsUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Update a specific private endpoint connection under a topic, domain or partner namespace. + /// + /// + /// The private endpoint connection object to update. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PrivateEndpointConnectionsUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnection body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/(?[^/]+)/(?[^/]+)/privateEndpointConnections/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/{parentType}/{parentName}/privateEndpointConnections/{privateEndpointConnectionName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var parentType = _match.Groups["parentType"].Value; + var parentName = _match.Groups["parentName"].Value; + var privateEndpointConnectionName = _match.Groups["privateEndpointConnectionName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/" + + parentType + + "/" + + parentName + + "/privateEndpointConnections/" + + privateEndpointConnectionName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PrivateEndpointConnectionsUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PrivateEndpointConnectionsUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PrivateEndpointConnection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// The type of the parent resource. This can be either \'topics\', \'domains\', or \'partnerNamespaces\'. + /// The name of the parent resource (namely, either, the topic name, domain name, or partner namespace + /// name). + /// The name of the private endpoint connection connection. + /// The private endpoint connection object to update. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PrivateEndpointConnectionsUpdate_Validate(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ParentType parentType, string parentName, string privateEndpointConnectionName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnection body, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(parentType),parentType); + await eventListener.AssertEnum(nameof(parentType),parentType,@"topics", @"domains", @"partnerNamespaces"); + await eventListener.AssertNotNull(nameof(parentName),parentName); + await eventListener.AssertNotNull(nameof(privateEndpointConnectionName),privateEndpointConnectionName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Get properties of a private link resource. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// The type of the parent resource. This can be either \'topics\', \'domains\', or \'partnerNamespaces\'. + /// The name of the parent resource (namely, either, the topic name, domain name, or partner namespace + /// name). + /// The name of private link resource. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PrivateLinkResourcesGet(string subscriptionId, string resourceGroupName, string parentType, string parentName, string privateLinkResourceName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/" + + global::System.Uri.EscapeDataString(parentType) + + "/" + + global::System.Uri.EscapeDataString(parentName) + + "/privateLinkResources/" + + global::System.Uri.EscapeDataString(privateLinkResourceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PrivateLinkResourcesGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Get properties of a private link resource. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PrivateLinkResourcesGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/(?[^/]+)/(?[^/]+)/privateLinkResources/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/{parentType}/{parentName}/privateLinkResources/{privateLinkResourceName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var parentType = _match.Groups["parentType"].Value; + var parentName = _match.Groups["parentName"].Value; + var privateLinkResourceName = _match.Groups["privateLinkResourceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/" + + parentType + + "/" + + parentName + + "/privateLinkResources/" + + privateLinkResourceName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PrivateLinkResourcesGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PrivateLinkResourcesGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PrivateLinkResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// The type of the parent resource. This can be either \'topics\', \'domains\', or \'partnerNamespaces\'. + /// The name of the parent resource (namely, either, the topic name, domain name, or partner namespace + /// name). + /// The name of private link resource. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PrivateLinkResourcesGet_Validate(string subscriptionId, string resourceGroupName, string parentType, string parentName, string privateLinkResourceName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(parentType),parentType); + await eventListener.AssertNotNull(nameof(parentName),parentName); + await eventListener.AssertNotNull(nameof(privateLinkResourceName),privateLinkResourceName); + } + } + + /// + /// List all the private link resources under a topic, domain, or partner namespace. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// The type of the parent resource. This can be either \'topics\', \'domains\', or \'partnerNamespaces\'. + /// The name of the parent resource (namely, either, the topic name, domain name, or partner namespace + /// name). + /// 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'. + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PrivateLinkResourcesListByResource(string subscriptionId, string resourceGroupName, string parentType, string parentName, string Filter, int? Top, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/" + + global::System.Uri.EscapeDataString(parentType) + + "/" + + global::System.Uri.EscapeDataString(parentName) + + "/privateLinkResources" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PrivateLinkResourcesListByResource_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// List all the private link resources under a topic, domain, or partner namespace. + /// + /// + /// 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'. + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PrivateLinkResourcesListByResourceViaIdentity(global::System.String viaIdentity, string Filter, int? Top, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/(?[^/]+)/(?[^/]+)/privateLinkResources$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/{parentType}/{parentName}/privateLinkResources'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var parentType = _match.Groups["parentType"].Value; + var parentName = _match.Groups["parentName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/" + + parentType + + "/" + + parentName + + "/privateLinkResources" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PrivateLinkResourcesListByResource_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PrivateLinkResourcesListByResource_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PrivateLinkResourcesListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// The type of the parent resource. This can be either \'topics\', \'domains\', or \'partnerNamespaces\'. + /// The name of the parent resource (namely, either, the topic name, domain name, or partner namespace + /// name). + /// 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'. + /// 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. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PrivateLinkResourcesListByResource_Validate(string subscriptionId, string resourceGroupName, string parentType, string parentName, string Filter, int? Top, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(parentType),parentType); + await eventListener.AssertNotNull(nameof(parentName),parentName); + await eventListener.AssertNotNull(nameof(Filter),Filter); + } + } + + /// + /// Asynchronously creates or updates an event subscription with the specified parameters. Existing event subscriptions will + /// be updated with this API. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the system topic. + /// 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. + /// Event subscription properties containing the destination and filter information. + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SystemTopicEventSubscriptionsCreateOrUpdate(string subscriptionId, string resourceGroupName, string systemTopicName, string eventSubscriptionName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription body, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/systemTopics/" + + global::System.Uri.EscapeDataString(systemTopicName) + + "/eventSubscriptions/" + + global::System.Uri.EscapeDataString(eventSubscriptionName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SystemTopicEventSubscriptionsCreateOrUpdate_Call(request,onDefault,eventListener,sender); + } + } + + /// + /// Asynchronously creates or updates an event subscription with the specified parameters. Existing event subscriptions will + /// be updated with this API. + /// + /// + /// Event subscription properties containing the destination and filter information. + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SystemTopicEventSubscriptionsCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription body, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/systemTopics/(?[^/]+)/eventSubscriptions/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/systemTopics/{systemTopicName}/eventSubscriptions/{eventSubscriptionName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var systemTopicName = _match.Groups["systemTopicName"].Value; + var eventSubscriptionName = _match.Groups["eventSubscriptionName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/systemTopics/" + + systemTopicName + + "/eventSubscriptions/" + + eventSubscriptionName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SystemTopicEventSubscriptionsCreateOrUpdate_Call(request,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SystemTopicEventSubscriptionsCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, + /// but you will get validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the system topic. + /// 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. + /// Event subscription properties containing the destination and filter information. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SystemTopicEventSubscriptionsCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string systemTopicName, string eventSubscriptionName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription body, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(systemTopicName),systemTopicName); + await eventListener.AssertNotNull(nameof(eventSubscriptionName),eventSubscriptionName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Delete an existing event subscription of a system topic. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the system topic. + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SystemTopicEventSubscriptionsDelete(string subscriptionId, string resourceGroupName, string systemTopicName, string eventSubscriptionName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/systemTopics/" + + global::System.Uri.EscapeDataString(systemTopicName) + + "/eventSubscriptions/" + + global::System.Uri.EscapeDataString(eventSubscriptionName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SystemTopicEventSubscriptionsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Delete an existing event subscription of a system topic. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SystemTopicEventSubscriptionsDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/systemTopics/(?[^/]+)/eventSubscriptions/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/systemTopics/{systemTopicName}/eventSubscriptions/{eventSubscriptionName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var systemTopicName = _match.Groups["systemTopicName"].Value; + var eventSubscriptionName = _match.Groups["eventSubscriptionName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/systemTopics/" + + systemTopicName + + "/eventSubscriptions/" + + eventSubscriptionName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SystemTopicEventSubscriptionsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SystemTopicEventSubscriptionsDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_finalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the system topic. + /// 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. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SystemTopicEventSubscriptionsDelete_Validate(string subscriptionId, string resourceGroupName, string systemTopicName, string eventSubscriptionName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(systemTopicName),systemTopicName); + await eventListener.AssertNotNull(nameof(eventSubscriptionName),eventSubscriptionName); + } + } + + /// Get an event subscription. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the system topic. + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SystemTopicEventSubscriptionsGet(string subscriptionId, string resourceGroupName, string systemTopicName, string eventSubscriptionName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/systemTopics/" + + global::System.Uri.EscapeDataString(systemTopicName) + + "/eventSubscriptions/" + + global::System.Uri.EscapeDataString(eventSubscriptionName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SystemTopicEventSubscriptionsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Get all delivery attributes for an event subscription. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the system topic. + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SystemTopicEventSubscriptionsGetDeliveryAttributes(string subscriptionId, string resourceGroupName, string systemTopicName, string eventSubscriptionName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/systemTopics/" + + global::System.Uri.EscapeDataString(systemTopicName) + + "/eventSubscriptions/" + + global::System.Uri.EscapeDataString(eventSubscriptionName) + + "/getDeliveryAttributes" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SystemTopicEventSubscriptionsGetDeliveryAttributes_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Get all delivery attributes for an event subscription. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SystemTopicEventSubscriptionsGetDeliveryAttributesViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/systemTopics/(?[^/]+)/eventSubscriptions/(?[^/]+)/getDeliveryAttributes$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/systemTopics/{systemTopicName}/eventSubscriptions/{eventSubscriptionName}/getDeliveryAttributes'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var systemTopicName = _match.Groups["systemTopicName"].Value; + var eventSubscriptionName = _match.Groups["eventSubscriptionName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/systemTopics/" + + systemTopicName + + "/eventSubscriptions/" + + eventSubscriptionName + + "/getDeliveryAttributes" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SystemTopicEventSubscriptionsGetDeliveryAttributes_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SystemTopicEventSubscriptionsGetDeliveryAttributes_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeliveryAttributeListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual + /// call, but you will get validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the system topic. + /// 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. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SystemTopicEventSubscriptionsGetDeliveryAttributes_Validate(string subscriptionId, string resourceGroupName, string systemTopicName, string eventSubscriptionName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(systemTopicName),systemTopicName); + await eventListener.AssertNotNull(nameof(eventSubscriptionName),eventSubscriptionName); + } + } + + /// Get the full endpoint URL for an event subscription of a system topic. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the system topic. + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SystemTopicEventSubscriptionsGetFullUrl(string subscriptionId, string resourceGroupName, string systemTopicName, string eventSubscriptionName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/systemTopics/" + + global::System.Uri.EscapeDataString(systemTopicName) + + "/eventSubscriptions/" + + global::System.Uri.EscapeDataString(eventSubscriptionName) + + "/getFullUrl" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SystemTopicEventSubscriptionsGetFullUrl_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Get the full endpoint URL for an event subscription of a system topic. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SystemTopicEventSubscriptionsGetFullUrlViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/systemTopics/(?[^/]+)/eventSubscriptions/(?[^/]+)/getFullUrl$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/systemTopics/{systemTopicName}/eventSubscriptions/{eventSubscriptionName}/getFullUrl'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var systemTopicName = _match.Groups["systemTopicName"].Value; + var eventSubscriptionName = _match.Groups["eventSubscriptionName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/systemTopics/" + + systemTopicName + + "/eventSubscriptions/" + + eventSubscriptionName + + "/getFullUrl" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SystemTopicEventSubscriptionsGetFullUrl_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SystemTopicEventSubscriptionsGetFullUrl_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionFullUrl.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but + /// you will get validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the system topic. + /// 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. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SystemTopicEventSubscriptionsGetFullUrl_Validate(string subscriptionId, string resourceGroupName, string systemTopicName, string eventSubscriptionName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(systemTopicName),systemTopicName); + await eventListener.AssertNotNull(nameof(eventSubscriptionName),eventSubscriptionName); + } + } + + /// Get an event subscription. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SystemTopicEventSubscriptionsGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/systemTopics/(?[^/]+)/eventSubscriptions/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/systemTopics/{systemTopicName}/eventSubscriptions/{eventSubscriptionName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var systemTopicName = _match.Groups["systemTopicName"].Value; + var eventSubscriptionName = _match.Groups["eventSubscriptionName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/systemTopics/" + + systemTopicName + + "/eventSubscriptions/" + + eventSubscriptionName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SystemTopicEventSubscriptionsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SystemTopicEventSubscriptionsGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscription.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the system topic. + /// 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. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SystemTopicEventSubscriptionsGet_Validate(string subscriptionId, string resourceGroupName, string systemTopicName, string eventSubscriptionName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(systemTopicName),systemTopicName); + await eventListener.AssertNotNull(nameof(eventSubscriptionName),eventSubscriptionName); + } + } + + /// List event subscriptions that belong to a specific system topic. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the system topic. + /// 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'. + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SystemTopicEventSubscriptionsListBySystemTopic(string subscriptionId, string resourceGroupName, string systemTopicName, string Filter, int? Top, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/systemTopics/" + + global::System.Uri.EscapeDataString(systemTopicName) + + "/eventSubscriptions" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SystemTopicEventSubscriptionsListBySystemTopic_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// List event subscriptions that belong to a specific system topic. + /// + /// 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'. + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SystemTopicEventSubscriptionsListBySystemTopicViaIdentity(global::System.String viaIdentity, string Filter, int? Top, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/systemTopics/(?[^/]+)/eventSubscriptions$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/systemTopics/{systemTopicName}/eventSubscriptions'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var systemTopicName = _match.Groups["systemTopicName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/systemTopics/" + + systemTopicName + + "/eventSubscriptions" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SystemTopicEventSubscriptionsListBySystemTopic_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SystemTopicEventSubscriptionsListBySystemTopic_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionsListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual + /// call, but you will get validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the system topic. + /// 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'. + /// 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. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SystemTopicEventSubscriptionsListBySystemTopic_Validate(string subscriptionId, string resourceGroupName, string systemTopicName, string Filter, int? Top, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(systemTopicName),systemTopicName); + await eventListener.AssertNotNull(nameof(Filter),Filter); + } + } + + /// Update an existing event subscription of a system topic. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the system topic. + /// 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. + /// Updated event subscription information. + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SystemTopicEventSubscriptionsUpdate(string subscriptionId, string resourceGroupName, string systemTopicName, string eventSubscriptionName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParameters body, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/systemTopics/" + + global::System.Uri.EscapeDataString(systemTopicName) + + "/eventSubscriptions/" + + global::System.Uri.EscapeDataString(eventSubscriptionName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SystemTopicEventSubscriptionsUpdate_Call(request,onDefault,eventListener,sender); + } + } + + /// Update an existing event subscription of a system topic. + /// + /// Updated event subscription information. + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SystemTopicEventSubscriptionsUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParameters body, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/systemTopics/(?[^/]+)/eventSubscriptions/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/systemTopics/{systemTopicName}/eventSubscriptions/{eventSubscriptionName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var systemTopicName = _match.Groups["systemTopicName"].Value; + var eventSubscriptionName = _match.Groups["eventSubscriptionName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/systemTopics/" + + systemTopicName + + "/eventSubscriptions/" + + eventSubscriptionName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SystemTopicEventSubscriptionsUpdate_Call(request,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SystemTopicEventSubscriptionsUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the system topic. + /// 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. + /// Updated event subscription information. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SystemTopicEventSubscriptionsUpdate_Validate(string subscriptionId, string resourceGroupName, string systemTopicName, string eventSubscriptionName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParameters body, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(systemTopicName),systemTopicName); + await eventListener.AssertNotNull(nameof(eventSubscriptionName),eventSubscriptionName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Asynchronously creates a new system topic with the specified parameters. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the system topic. + /// System Topic information. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SystemTopicsCreateOrUpdate(string subscriptionId, string resourceGroupName, string systemTopicName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopic body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/systemTopics/" + + global::System.Uri.EscapeDataString(systemTopicName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SystemTopicsCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Asynchronously creates a new system topic with the specified parameters. + /// + /// System Topic information. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SystemTopicsCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopic body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/systemTopics/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/systemTopics/{systemTopicName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var systemTopicName = _match.Groups["systemTopicName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/systemTopics/" + + systemTopicName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SystemTopicsCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SystemTopicsCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.SystemTopic.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the system topic. + /// System Topic information. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SystemTopicsCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string systemTopicName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopic body, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(systemTopicName),systemTopicName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Delete existing system topic. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the system topic. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SystemTopicsDelete(string subscriptionId, string resourceGroupName, string systemTopicName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/systemTopics/" + + global::System.Uri.EscapeDataString(systemTopicName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SystemTopicsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Delete existing system topic. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SystemTopicsDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/systemTopics/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/systemTopics/{systemTopicName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var systemTopicName = _match.Groups["systemTopicName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/systemTopics/" + + systemTopicName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SystemTopicsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SystemTopicsDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_finalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the system topic. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SystemTopicsDelete_Validate(string subscriptionId, string resourceGroupName, string systemTopicName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(systemTopicName),systemTopicName); + } + } + + /// Get properties of a system topic. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the system topic. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SystemTopicsGet(string subscriptionId, string resourceGroupName, string systemTopicName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/systemTopics/" + + global::System.Uri.EscapeDataString(systemTopicName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SystemTopicsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Get properties of a system topic. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SystemTopicsGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/systemTopics/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/systemTopics/{systemTopicName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var systemTopicName = _match.Groups["systemTopicName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/systemTopics/" + + systemTopicName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SystemTopicsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SystemTopicsGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.SystemTopic.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the system topic. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SystemTopicsGet_Validate(string subscriptionId, string resourceGroupName, string systemTopicName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(systemTopicName),systemTopicName); + } + } + + /// List all the system topics under a resource group. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// 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'. + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SystemTopicsListByResourceGroup(string subscriptionId, string resourceGroupName, string Filter, int? Top, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/systemTopics" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SystemTopicsListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// List all the system topics under a resource group. + /// + /// 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'. + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SystemTopicsListByResourceGroupViaIdentity(global::System.String viaIdentity, string Filter, int? Top, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/systemTopics$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/systemTopics'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/systemTopics" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SystemTopicsListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SystemTopicsListByResourceGroup_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.SystemTopicsListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// 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'. + /// 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. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SystemTopicsListByResourceGroup_Validate(string subscriptionId, string resourceGroupName, string Filter, int? Top, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(Filter),Filter); + } + } + + /// List all the system topics under an Azure subscription. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// 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'. + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SystemTopicsListBySubscription(string subscriptionId, string Filter, int? Top, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.EventGrid/systemTopics" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SystemTopicsListBySubscription_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// List all the system topics under an Azure subscription. + /// + /// 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'. + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SystemTopicsListBySubscriptionViaIdentity(global::System.String viaIdentity, string Filter, int? Top, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.EventGrid/systemTopics$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/systemTopics'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/providers/Microsoft.EventGrid/systemTopics" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SystemTopicsListBySubscription_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SystemTopicsListBySubscription_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.SystemTopicsListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// 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'. + /// 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. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SystemTopicsListBySubscription_Validate(string subscriptionId, string Filter, int? Top, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(Filter),Filter); + } + } + + /// Asynchronously updates a system topic with the specified parameters. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the system topic. + /// SystemTopic update information. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SystemTopicsUpdate(string subscriptionId, string resourceGroupName, string systemTopicName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicUpdateParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/systemTopics/" + + global::System.Uri.EscapeDataString(systemTopicName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SystemTopicsUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Asynchronously updates a system topic with the specified parameters. + /// + /// SystemTopic update information. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SystemTopicsUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicUpdateParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/systemTopics/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/systemTopics/{systemTopicName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var systemTopicName = _match.Groups["systemTopicName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/systemTopics/" + + systemTopicName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SystemTopicsUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SystemTopicsUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.SystemTopic.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the system topic. + /// SystemTopic update information. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SystemTopicsUpdate_Validate(string subscriptionId, string resourceGroupName, string systemTopicName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicUpdateParameters body, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(systemTopicName),systemTopicName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// + /// Asynchronously creates a new event subscription or updates an existing event subscription. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the domain topic. + /// 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. + /// Event subscription properties containing the destination and filter information. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TopicEventSubscriptionsCreateOrUpdate(string subscriptionId, string resourceGroupName, string topicName, string eventSubscriptionName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/topics/" + + global::System.Uri.EscapeDataString(topicName) + + "/eventSubscriptions/" + + global::System.Uri.EscapeDataString(eventSubscriptionName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TopicEventSubscriptionsCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Asynchronously creates a new event subscription or updates an existing event subscription. + /// + /// + /// Event subscription properties containing the destination and filter information. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TopicEventSubscriptionsCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/topics/(?[^/]+)/eventSubscriptions/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}/eventSubscriptions/{eventSubscriptionName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var topicName = _match.Groups["topicName"].Value; + var eventSubscriptionName = _match.Groups["eventSubscriptionName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/topics/" + + topicName + + "/eventSubscriptions/" + + eventSubscriptionName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TopicEventSubscriptionsCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TopicEventSubscriptionsCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscription.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but + /// you will get validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the domain topic. + /// 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. + /// Event subscription properties containing the destination and filter information. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TopicEventSubscriptionsCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string topicName, string eventSubscriptionName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription body, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(topicName),topicName); + await eventListener.AssertNotNull(nameof(eventSubscriptionName),eventSubscriptionName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Delete an existing event subscription for a topic. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the topic. + /// Name of the event subscription to be deleted. Event subscription names must be between + /// 3 and 100 characters in length and use alphanumeric letters only. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TopicEventSubscriptionsDelete(string subscriptionId, string resourceGroupName, string topicName, string eventSubscriptionName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/topics/" + + global::System.Uri.EscapeDataString(topicName) + + "/eventSubscriptions/" + + global::System.Uri.EscapeDataString(eventSubscriptionName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TopicEventSubscriptionsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Delete an existing event subscription for a topic. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TopicEventSubscriptionsDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/topics/(?[^/]+)/eventSubscriptions/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}/eventSubscriptions/{eventSubscriptionName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var topicName = _match.Groups["topicName"].Value; + var eventSubscriptionName = _match.Groups["eventSubscriptionName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/topics/" + + topicName + + "/eventSubscriptions/" + + eventSubscriptionName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TopicEventSubscriptionsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TopicEventSubscriptionsDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_finalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the topic. + /// Name of the event subscription to be deleted. Event subscription names must be between + /// 3 and 100 characters in length and use alphanumeric letters only. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TopicEventSubscriptionsDelete_Validate(string subscriptionId, string resourceGroupName, string topicName, string eventSubscriptionName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(topicName),topicName); + await eventListener.AssertNotNull(nameof(eventSubscriptionName),eventSubscriptionName); + } + } + + /// Get properties of an event subscription of a topic. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the partner topic. + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TopicEventSubscriptionsGet(string subscriptionId, string resourceGroupName, string topicName, string eventSubscriptionName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/topics/" + + global::System.Uri.EscapeDataString(topicName) + + "/eventSubscriptions/" + + global::System.Uri.EscapeDataString(eventSubscriptionName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TopicEventSubscriptionsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Get all delivery attributes for an event subscription for topic. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the domain topic. + /// Name of the event subscription. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TopicEventSubscriptionsGetDeliveryAttributes(string subscriptionId, string resourceGroupName, string topicName, string eventSubscriptionName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/topics/" + + global::System.Uri.EscapeDataString(topicName) + + "/eventSubscriptions/" + + global::System.Uri.EscapeDataString(eventSubscriptionName) + + "/getDeliveryAttributes" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TopicEventSubscriptionsGetDeliveryAttributes_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Get all delivery attributes for an event subscription for topic. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TopicEventSubscriptionsGetDeliveryAttributesViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/topics/(?[^/]+)/eventSubscriptions/(?[^/]+)/getDeliveryAttributes$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}/eventSubscriptions/{eventSubscriptionName}/getDeliveryAttributes'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var topicName = _match.Groups["topicName"].Value; + var eventSubscriptionName = _match.Groups["eventSubscriptionName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/topics/" + + topicName + + "/eventSubscriptions/" + + eventSubscriptionName + + "/getDeliveryAttributes" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TopicEventSubscriptionsGetDeliveryAttributes_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TopicEventSubscriptionsGetDeliveryAttributes_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeliveryAttributeListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, + /// but you will get validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the domain topic. + /// Name of the event subscription. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TopicEventSubscriptionsGetDeliveryAttributes_Validate(string subscriptionId, string resourceGroupName, string topicName, string eventSubscriptionName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(topicName),topicName); + await eventListener.AssertNotNull(nameof(eventSubscriptionName),eventSubscriptionName); + } + } + + /// Get the full endpoint URL for an event subscription for topic. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the domain topic. + /// Name of the event subscription. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TopicEventSubscriptionsGetFullUrl(string subscriptionId, string resourceGroupName, string topicName, string eventSubscriptionName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/topics/" + + global::System.Uri.EscapeDataString(topicName) + + "/eventSubscriptions/" + + global::System.Uri.EscapeDataString(eventSubscriptionName) + + "/getFullUrl" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TopicEventSubscriptionsGetFullUrl_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Get the full endpoint URL for an event subscription for topic. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TopicEventSubscriptionsGetFullUrlViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/topics/(?[^/]+)/eventSubscriptions/(?[^/]+)/getFullUrl$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}/eventSubscriptions/{eventSubscriptionName}/getFullUrl'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var topicName = _match.Groups["topicName"].Value; + var eventSubscriptionName = _match.Groups["eventSubscriptionName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/topics/" + + topicName + + "/eventSubscriptions/" + + eventSubscriptionName + + "/getFullUrl" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TopicEventSubscriptionsGetFullUrl_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TopicEventSubscriptionsGetFullUrl_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionFullUrl.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the domain topic. + /// Name of the event subscription. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TopicEventSubscriptionsGetFullUrl_Validate(string subscriptionId, string resourceGroupName, string topicName, string eventSubscriptionName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(topicName),topicName); + await eventListener.AssertNotNull(nameof(eventSubscriptionName),eventSubscriptionName); + } + } + + /// Get properties of an event subscription of a topic. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TopicEventSubscriptionsGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/topics/(?[^/]+)/eventSubscriptions/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}/eventSubscriptions/{eventSubscriptionName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var topicName = _match.Groups["topicName"].Value; + var eventSubscriptionName = _match.Groups["eventSubscriptionName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/topics/" + + topicName + + "/eventSubscriptions/" + + eventSubscriptionName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TopicEventSubscriptionsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TopicEventSubscriptionsGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscription.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the partner topic. + /// 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. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TopicEventSubscriptionsGet_Validate(string subscriptionId, string resourceGroupName, string topicName, string eventSubscriptionName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(topicName),topicName); + await eventListener.AssertNotNull(nameof(eventSubscriptionName),eventSubscriptionName); + } + } + + /// List all event subscriptions that have been created for a specific topic. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the topic. + /// 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'. + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TopicEventSubscriptionsList(string subscriptionId, string resourceGroupName, string topicName, string Filter, int? Top, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/topics/" + + global::System.Uri.EscapeDataString(topicName) + + "/eventSubscriptions" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TopicEventSubscriptionsList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// List all event subscriptions that have been created for a specific topic. + /// + /// 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'. + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TopicEventSubscriptionsListViaIdentity(global::System.String viaIdentity, string Filter, int? Top, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/topics/(?[^/]+)/eventSubscriptions$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}/eventSubscriptions'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var topicName = _match.Groups["topicName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/topics/" + + topicName + + "/eventSubscriptions" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TopicEventSubscriptionsList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TopicEventSubscriptionsList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionsListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the topic. + /// 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'. + /// 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. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TopicEventSubscriptionsList_Validate(string subscriptionId, string resourceGroupName, string topicName, string Filter, int? Top, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(topicName),topicName); + await eventListener.AssertNotNull(nameof(Filter),Filter); + } + } + + /// Update an existing event subscription for a topic. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the domain. + /// Name of the event subscription to be updated. + /// Updated event subscription information. + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TopicEventSubscriptionsUpdate(string subscriptionId, string resourceGroupName, string topicName, string eventSubscriptionName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParameters body, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/topics/" + + global::System.Uri.EscapeDataString(topicName) + + "/eventSubscriptions/" + + global::System.Uri.EscapeDataString(eventSubscriptionName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TopicEventSubscriptionsUpdate_Call(request,onDefault,eventListener,sender); + } + } + + /// Update an existing event subscription for a topic. + /// + /// Updated event subscription information. + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TopicEventSubscriptionsUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParameters body, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/topics/(?[^/]+)/eventSubscriptions/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}/eventSubscriptions/{eventSubscriptionName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var topicName = _match.Groups["topicName"].Value; + var eventSubscriptionName = _match.Groups["eventSubscriptionName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/topics/" + + topicName + + "/eventSubscriptions/" + + eventSubscriptionName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TopicEventSubscriptionsUpdate_Call(request,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TopicEventSubscriptionsUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the domain. + /// Name of the event subscription to be updated. + /// Updated event subscription information. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TopicEventSubscriptionsUpdate_Validate(string subscriptionId, string resourceGroupName, string topicName, string eventSubscriptionName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParameters body, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(topicName),topicName); + await eventListener.AssertNotNull(nameof(eventSubscriptionName),eventSubscriptionName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Get information about a topic type. + /// Name of the topic type. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TopicTypesGet(string topicTypeName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.EventGrid/topicTypes/" + + global::System.Uri.EscapeDataString(topicTypeName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TopicTypesGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Get information about a topic type. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TopicTypesGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.EventGrid/topicTypes/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.EventGrid/topicTypes/{topicTypeName}'"); + } + + // replace URI parameters with values from identity + var topicTypeName = _match.Groups["topicTypeName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.EventGrid/topicTypes/" + + topicTypeName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TopicTypesGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TopicTypesGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.TopicTypeInfo.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// Name of the topic type. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TopicTypesGet_Validate(string topicTypeName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(topicTypeName),topicTypeName); + } + } + + /// List all registered topic types. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TopicTypesList(global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.EventGrid/topicTypes" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TopicTypesList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// List event types for a topic type. + /// Name of the topic type. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TopicTypesListEventTypes(string topicTypeName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.EventGrid/topicTypes/" + + global::System.Uri.EscapeDataString(topicTypeName) + + "/eventTypes" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TopicTypesListEventTypes_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// List event types for a topic type. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TopicTypesListEventTypesViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.EventGrid/topicTypes/(?[^/]+)/eventTypes$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.EventGrid/topicTypes/{topicTypeName}/eventTypes'"); + } + + // replace URI parameters with values from identity + var topicTypeName = _match.Groups["topicTypeName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.EventGrid/topicTypes/" + + topicTypeName + + "/eventTypes" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TopicTypesListEventTypes_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TopicTypesListEventTypes_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventTypesListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// Name of the topic type. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TopicTypesListEventTypes_Validate(string topicTypeName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(topicTypeName),topicTypeName); + } + } + + /// List all registered topic types. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TopicTypesListViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.EventGrid/topicTypes$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.EventGrid/topicTypes'"); + } + + // replace URI parameters with values from identity + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.EventGrid/topicTypes" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TopicTypesList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TopicTypesList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.TopicTypesListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TopicTypesList_Validate(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + + } + } + + /// Asynchronously creates a new topic with the specified parameters. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the topic. + /// Topic information. + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TopicsCreateOrUpdate(string subscriptionId, string resourceGroupName, string topicName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopic body, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/topics/" + + global::System.Uri.EscapeDataString(topicName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TopicsCreateOrUpdate_Call(request,onDefault,eventListener,sender); + } + } + + /// Asynchronously creates a new topic with the specified parameters. + /// + /// Topic information. + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TopicsCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopic body, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/topics/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var topicName = _match.Groups["topicName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/topics/" + + topicName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TopicsCreateOrUpdate_Call(request,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TopicsCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the topic. + /// Topic information. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TopicsCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string topicName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopic body, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(topicName),topicName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Delete existing topic. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the topic. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TopicsDelete(string subscriptionId, string resourceGroupName, string topicName, global::System.Func onNoContent, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/topics/" + + global::System.Uri.EscapeDataString(topicName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TopicsDelete_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Delete existing topic. + /// + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TopicsDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onNoContent, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/topics/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var topicName = _match.Groups["topicName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/topics/" + + topicName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TopicsDelete_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TopicsDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_finalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the topic. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TopicsDelete_Validate(string subscriptionId, string resourceGroupName, string topicName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(topicName),topicName); + } + } + + /// Get properties of a topic. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the topic. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TopicsGet(string subscriptionId, string resourceGroupName, string topicName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/topics/" + + global::System.Uri.EscapeDataString(topicName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TopicsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Get properties of a topic. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TopicsGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/topics/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var topicName = _match.Groups["topicName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/topics/" + + topicName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TopicsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TopicsGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.Topic.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation events + /// back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the topic. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TopicsGet_Validate(string subscriptionId, string resourceGroupName, string topicName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(topicName),topicName); + } + } + + /// List all the topics under a resource group. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// 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'. + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TopicsListByResourceGroup(string subscriptionId, string resourceGroupName, string Filter, int? Top, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/topics" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TopicsListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// List all the topics under a resource group. + /// + /// 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'. + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TopicsListByResourceGroupViaIdentity(global::System.String viaIdentity, string Filter, int? Top, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/topics$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/topics" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TopicsListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TopicsListByResourceGroup_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.TopicsListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// 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'. + /// 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. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TopicsListByResourceGroup_Validate(string subscriptionId, string resourceGroupName, string Filter, int? Top, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(Filter),Filter); + } + } + + /// List all the topics under an Azure subscription. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// 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'. + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TopicsListBySubscription(string subscriptionId, string Filter, int? Top, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.EventGrid/topics" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TopicsListBySubscription_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// List all the topics under an Azure subscription. + /// + /// 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'. + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TopicsListBySubscriptionViaIdentity(global::System.String viaIdentity, string Filter, int? Top, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.EventGrid/topics$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/topics'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/providers/Microsoft.EventGrid/topics" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TopicsListBySubscription_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TopicsListBySubscription_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.TopicsListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// 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'. + /// 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. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TopicsListBySubscription_Validate(string subscriptionId, string Filter, int? Top, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(Filter),Filter); + } + } + + /// List event types for a topic. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Namespace of the provider of the topic. + /// Name of the topic type. + /// Name of the topic. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TopicsListEventTypes(string subscriptionId, string resourceGroupName, string providerNamespace, string resourceTypeName, string resourceName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/" + + global::System.Uri.EscapeDataString(providerNamespace) + + "/" + + global::System.Uri.EscapeDataString(resourceTypeName) + + "/" + + global::System.Uri.EscapeDataString(resourceName) + + "/providers/Microsoft.EventGrid/eventTypes" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TopicsListEventTypes_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// List event types for a topic. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TopicsListEventTypesViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/(?[^/]+)/(?[^/]+)/(?[^/]+)/providers/Microsoft.EventGrid/eventTypes$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{providerNamespace}/{resourceTypeName}/{resourceName}/providers/Microsoft.EventGrid/eventTypes'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var providerNamespace = _match.Groups["providerNamespace"].Value; + var resourceTypeName = _match.Groups["resourceTypeName"].Value; + var resourceName = _match.Groups["resourceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/" + + providerNamespace + + "/" + + resourceTypeName + + "/" + + resourceName + + "/providers/Microsoft.EventGrid/eventTypes" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TopicsListEventTypes_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TopicsListEventTypes_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventTypesListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Namespace of the provider of the topic. + /// Name of the topic type. + /// Name of the topic. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TopicsListEventTypes_Validate(string subscriptionId, string resourceGroupName, string providerNamespace, string resourceTypeName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(providerNamespace),providerNamespace); + await eventListener.AssertNotNull(nameof(resourceTypeName),resourceTypeName); + await eventListener.AssertNotNull(nameof(resourceName),resourceName); + } + } + + /// List the two keys used to publish to a topic. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the topic. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TopicsListSharedAccessKeys(string subscriptionId, string resourceGroupName, string topicName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/topics/" + + global::System.Uri.EscapeDataString(topicName) + + "/listKeys" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TopicsListSharedAccessKeys_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// List the two keys used to publish to a topic. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TopicsListSharedAccessKeysViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/topics/(?[^/]+)/listKeys$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}/listKeys'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var topicName = _match.Groups["topicName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/topics/" + + topicName + + "/listKeys" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TopicsListSharedAccessKeys_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TopicsListSharedAccessKeys_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.TopicSharedAccessKeys.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the topic. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TopicsListSharedAccessKeys_Validate(string subscriptionId, string resourceGroupName, string topicName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(topicName),topicName); + } + } + + /// Regenerate a shared access key for a topic. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the topic. + /// Request body to regenerate key. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TopicsRegenerateKey(string subscriptionId, string resourceGroupName, string topicName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicRegenerateKeyRequest body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/topics/" + + global::System.Uri.EscapeDataString(topicName) + + "/regenerateKey" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TopicsRegenerateKey_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Regenerate a shared access key for a topic. + /// + /// Request body to regenerate key. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TopicsRegenerateKeyViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicRegenerateKeyRequest body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/topics/(?[^/]+)/regenerateKey$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}/regenerateKey'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var topicName = _match.Groups["topicName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/topics/" + + topicName + + "/regenerateKey" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TopicsRegenerateKey_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TopicsRegenerateKey_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_finalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.TopicSharedAccessKeys.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the topic. + /// Request body to regenerate key. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TopicsRegenerateKey_Validate(string subscriptionId, string resourceGroupName, string topicName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicRegenerateKeyRequest body, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(topicName),topicName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Asynchronously updates a topic with the specified parameters. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the topic. + /// Topic update information. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TopicsUpdate(string subscriptionId, string resourceGroupName, string topicName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParameters body, global::System.Func onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.EventGrid/topics/" + + global::System.Uri.EscapeDataString(topicName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TopicsUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Asynchronously updates a topic with the specified parameters. + /// + /// Topic update information. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TopicsUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParameters body, global::System.Func onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.EventGrid/topics/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var topicName = _match.Groups["topicName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.EventGrid/topics/" + + topicName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TopicsUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TopicsUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription + /// ID forms part of the URI for every service call. + /// The name of the resource group within the user's subscription. + /// Name of the topic. + /// Topic update information. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TopicsUpdate_Validate(string subscriptionId, string resourceGroupName, string topicName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParameters body, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(topicName),topicName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Get properties of a verified partner. + /// Name of the verified partner. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task VerifiedPartnersGet(string verifiedPartnerName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.EventGrid/verifiedPartners/" + + global::System.Uri.EscapeDataString(verifiedPartnerName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.VerifiedPartnersGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Get properties of a verified partner. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task VerifiedPartnersGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.EventGrid/verifiedPartners/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.EventGrid/verifiedPartners/{verifiedPartnerName}'"); + } + + // replace URI parameters with values from identity + var verifiedPartnerName = _match.Groups["verifiedPartnerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.EventGrid/verifiedPartners/" + + verifiedPartnerName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.VerifiedPartnersGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task VerifiedPartnersGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.VerifiedPartner.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// Name of the verified partner. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task VerifiedPartnersGet_Validate(string verifiedPartnerName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(verifiedPartnerName),verifiedPartnerName); + } + } + + /// Get a list of all verified partners. + /// 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'. + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task VerifiedPartnersList(string Filter, int? Top, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.EventGrid/verifiedPartners" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.VerifiedPartnersList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Get a list of all verified partners. + /// + /// 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'. + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task VerifiedPartnersListViaIdentity(global::System.String viaIdentity, string Filter, int? Top, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-15-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.EventGrid/verifiedPartners$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.EventGrid/verifiedPartners'"); + } + + // replace URI parameters with values from identity + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.EventGrid/verifiedPartners" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.VerifiedPartnersList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task VerifiedPartnersList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onDefault, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.VerifiedPartnersListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// 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'. + /// 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. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task VerifiedPartnersList_Validate(string Filter, int? Top, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(Filter),Filter); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Any.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Any.PowerShell.cs new file mode 100644 index 000000000000..5315d5261243 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Any.PowerShell.cs @@ -0,0 +1,134 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Any object + [System.ComponentModel.TypeConverter(typeof(AnyTypeConverter))] + public partial class Any + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal Any(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal Any(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IAny DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new Any(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IAny DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new Any(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IAny FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Any object + [System.ComponentModel.TypeConverter(typeof(AnyTypeConverter))] + public partial interface IAny + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Any.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Any.TypeConverter.cs new file mode 100644 index 000000000000..4b18d1503f5d --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Any.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AnyTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IAny ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IAny).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return Any.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return Any.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return Any.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Any.cs b/swaggerci/eventgrid/generated/api/Models/Any.cs new file mode 100644 index 000000000000..666d184f39d3 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Any.cs @@ -0,0 +1,34 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Any object + public partial class Any : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IAny, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IAnyInternal + { + + /// Creates an new instance. + public Any() + { + + } + } + /// Any object + public partial interface IAny : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + + } + /// Any object + internal partial interface IAnyInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Any.json.cs b/swaggerci/eventgrid/generated/api/Models/Any.json.cs new file mode 100644 index 000000000000..9fca156bf2b9 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Any.json.cs @@ -0,0 +1,102 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Any object + public partial class Any + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal Any(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IAny. + /// + /// a to deserialize from. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IAny. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IAny FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new Any(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20/SystemData.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20/SystemData.PowerShell.cs new file mode 100644 index 000000000000..d015152bfb5a --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20/SystemData.PowerShell.cs @@ -0,0 +1,182 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20 +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Metadata pertaining to creation and last modification of the resource. + [System.ComponentModel.TypeConverter(typeof(SystemDataTypeConverter))] + public partial class SystemData + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new SystemData(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new SystemData(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal SystemData(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("CreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)this).CreatedBy = (string) content.GetValueForProperty("CreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)this).CreatedBy, global::System.Convert.ToString); + } + if (content.Contains("CreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)this).CreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType?) content.GetValueForProperty("CreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)this).CreatedByType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType.CreateFrom); + } + if (content.Contains("CreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)this).CreatedAt = (global::System.DateTime?) content.GetValueForProperty("CreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)this).CreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)this).LastModifiedBy = (string) content.GetValueForProperty("LastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)this).LastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("LastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)this).LastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType?) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)this).LastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType.CreateFrom); + } + if (content.Contains("LastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)this).LastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("LastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)this).LastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal SystemData(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("CreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)this).CreatedBy = (string) content.GetValueForProperty("CreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)this).CreatedBy, global::System.Convert.ToString); + } + if (content.Contains("CreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)this).CreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType?) content.GetValueForProperty("CreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)this).CreatedByType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType.CreateFrom); + } + if (content.Contains("CreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)this).CreatedAt = (global::System.DateTime?) content.GetValueForProperty("CreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)this).CreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)this).LastModifiedBy = (string) content.GetValueForProperty("LastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)this).LastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("LastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)this).LastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType?) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)this).LastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType.CreateFrom); + } + if (content.Contains("LastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)this).LastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("LastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)this).LastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Metadata pertaining to creation and last modification of the resource. + [System.ComponentModel.TypeConverter(typeof(SystemDataTypeConverter))] + public partial interface ISystemData + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20/SystemData.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20/SystemData.TypeConverter.cs new file mode 100644 index 000000000000..e1bac6dfb0c0 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20/SystemData.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20 +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class SystemDataTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return SystemData.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return SystemData.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return SystemData.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20/SystemData.cs b/swaggerci/eventgrid/generated/api/Models/Api20/SystemData.cs new file mode 100644 index 000000000000..fb6090f104a0 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20/SystemData.cs @@ -0,0 +1,136 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Metadata pertaining to creation and last modification of the resource. + public partial class SystemData : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal + { + + /// Backing field for property. + private global::System.DateTime? _createdAt; + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public global::System.DateTime? CreatedAt { get => this._createdAt; set => this._createdAt = value; } + + /// Backing field for property. + private string _createdBy; + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string CreatedBy { get => this._createdBy; set => this._createdBy = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType? _createdByType; + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType? CreatedByType { get => this._createdByType; set => this._createdByType = value; } + + /// Backing field for property. + private global::System.DateTime? _lastModifiedAt; + + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public global::System.DateTime? LastModifiedAt { get => this._lastModifiedAt; set => this._lastModifiedAt = value; } + + /// Backing field for property. + private string _lastModifiedBy; + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string LastModifiedBy { get => this._lastModifiedBy; set => this._lastModifiedBy = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType? _lastModifiedByType; + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType? LastModifiedByType { get => this._lastModifiedByType; set => this._lastModifiedByType = value; } + + /// Creates an new instance. + public SystemData() + { + + } + } + /// Metadata pertaining to creation and last modification of the resource. + public partial interface ISystemData : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timestamp of resource creation (UTC).", + SerializedName = @"createdAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? CreatedAt { get; set; } + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identity that created the resource.", + SerializedName = @"createdBy", + PossibleTypes = new [] { typeof(string) })] + string CreatedBy { get; set; } + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of identity that created the resource.", + SerializedName = @"createdByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType? CreatedByType { get; set; } + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timestamp of resource last modification (UTC)", + SerializedName = @"lastModifiedAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? LastModifiedAt { get; set; } + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identity that last modified the resource.", + SerializedName = @"lastModifiedBy", + PossibleTypes = new [] { typeof(string) })] + string LastModifiedBy { get; set; } + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of identity that last modified the resource.", + SerializedName = @"lastModifiedByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType? LastModifiedByType { get; set; } + + } + /// Metadata pertaining to creation and last modification of the resource. + internal partial interface ISystemDataInternal + + { + /// The timestamp of resource creation (UTC). + global::System.DateTime? CreatedAt { get; set; } + /// The identity that created the resource. + string CreatedBy { get; set; } + /// The type of identity that created the resource. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType? CreatedByType { get; set; } + /// The timestamp of resource last modification (UTC) + global::System.DateTime? LastModifiedAt { get; set; } + /// The identity that last modified the resource. + string LastModifiedBy { get; set; } + /// The type of identity that last modified the resource. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType? LastModifiedByType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20/SystemData.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20/SystemData.json.cs new file mode 100644 index 000000000000..c1c4e0cda55f --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20/SystemData.json.cs @@ -0,0 +1,116 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Metadata pertaining to creation and last modification of the resource. + public partial class SystemData + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new SystemData(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal SystemData(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_createdBy = If( json?.PropertyT("createdBy"), out var __jsonCreatedBy) ? (string)__jsonCreatedBy : (string)CreatedBy;} + {_createdByType = If( json?.PropertyT("createdByType"), out var __jsonCreatedByType) ? (string)__jsonCreatedByType : (string)CreatedByType;} + {_createdAt = If( json?.PropertyT("createdAt"), out var __jsonCreatedAt) ? global::System.DateTime.TryParse((string)__jsonCreatedAt, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonCreatedAtValue) ? __jsonCreatedAtValue : CreatedAt : CreatedAt;} + {_lastModifiedBy = If( json?.PropertyT("lastModifiedBy"), out var __jsonLastModifiedBy) ? (string)__jsonLastModifiedBy : (string)LastModifiedBy;} + {_lastModifiedByType = If( json?.PropertyT("lastModifiedByType"), out var __jsonLastModifiedByType) ? (string)__jsonLastModifiedByType : (string)LastModifiedByType;} + {_lastModifiedAt = If( json?.PropertyT("lastModifiedAt"), out var __jsonLastModifiedAt) ? global::System.DateTime.TryParse((string)__jsonLastModifiedAt, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLastModifiedAtValue) ? __jsonLastModifiedAtValue : LastModifiedAt : LastModifiedAt;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._createdBy)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._createdBy.ToString()) : null, "createdBy" ,container.Add ); + AddIf( null != (((object)this._createdByType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._createdByType.ToString()) : null, "createdByType" ,container.Add ); + AddIf( null != this._createdAt ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._createdAt?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "createdAt" ,container.Add ); + AddIf( null != (((object)this._lastModifiedBy)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._lastModifiedBy.ToString()) : null, "lastModifiedBy" ,container.Add ); + AddIf( null != (((object)this._lastModifiedByType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._lastModifiedByType.ToString()) : null, "lastModifiedByType" ,container.Add ); + AddIf( null != this._lastModifiedAt ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._lastModifiedAt?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "lastModifiedAt" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/AdvancedFilter.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/AdvancedFilter.PowerShell.cs new file mode 100644 index 000000000000..4bdd59b20797 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/AdvancedFilter.PowerShell.cs @@ -0,0 +1,156 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// This is the base type that represents an advanced filter. To configure an advanced filter, do not directly instantiate + /// an object of this class. Instead, instantiate an object of a derived class such as BoolEqualsAdvancedFilter, NumberInAdvancedFilter, + /// StringEqualsAdvancedFilter etc. depending on the type of the key based on which you want to filter. + /// + [System.ComponentModel.TypeConverter(typeof(AdvancedFilterTypeConverter))] + public partial class AdvancedFilter + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AdvancedFilter(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("OperatorType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).OperatorType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType) content.GetValueForProperty("OperatorType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).OperatorType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType.CreateFrom); + } + if (content.Contains("Key")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).Key = (string) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).Key, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AdvancedFilter(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("OperatorType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).OperatorType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType) content.GetValueForProperty("OperatorType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).OperatorType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType.CreateFrom); + } + if (content.Contains("Key")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).Key = (string) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).Key, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AdvancedFilter(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AdvancedFilter(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// This is the base type that represents an advanced filter. To configure an advanced filter, do not directly instantiate + /// an object of this class. Instead, instantiate an object of a derived class such as BoolEqualsAdvancedFilter, NumberInAdvancedFilter, + /// StringEqualsAdvancedFilter etc. depending on the type of the key based on which you want to filter. + [System.ComponentModel.TypeConverter(typeof(AdvancedFilterTypeConverter))] + public partial interface IAdvancedFilter + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/AdvancedFilter.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/AdvancedFilter.TypeConverter.cs new file mode 100644 index 000000000000..95104bd598a3 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/AdvancedFilter.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AdvancedFilterTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AdvancedFilter.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AdvancedFilter.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AdvancedFilter.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/AdvancedFilter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/AdvancedFilter.cs new file mode 100644 index 000000000000..78c9e034e788 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/AdvancedFilter.cs @@ -0,0 +1,82 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// + /// This is the base type that represents an advanced filter. To configure an advanced filter, do not directly instantiate + /// an object of this class. Instead, instantiate an object of a derived class such as BoolEqualsAdvancedFilter, NumberInAdvancedFilter, + /// StringEqualsAdvancedFilter etc. depending on the type of the key based on which you want to filter. + /// + public partial class AdvancedFilter : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal + { + + /// Backing field for property. + private string _key; + + /// The field/property in the event based on which you want to filter. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string Key { get => this._key; set => this._key = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType _operatorType; + + /// + /// The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType OperatorType { get => this._operatorType; set => this._operatorType = value; } + + /// Creates an new instance. + public AdvancedFilter() + { + + } + } + /// This is the base type that represents an advanced filter. To configure an advanced filter, do not directly instantiate + /// an object of this class. Instead, instantiate an object of a derived class such as BoolEqualsAdvancedFilter, NumberInAdvancedFilter, + /// StringEqualsAdvancedFilter etc. depending on the type of the key based on which you want to filter. + public partial interface IAdvancedFilter : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// The field/property in the event based on which you want to filter. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The field/property in the event based on which you want to filter.", + SerializedName = @"key", + PossibleTypes = new [] { typeof(string) })] + string Key { get; set; } + /// + /// The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others.", + SerializedName = @"operatorType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType OperatorType { get; set; } + + } + /// This is the base type that represents an advanced filter. To configure an advanced filter, do not directly instantiate + /// an object of this class. Instead, instantiate an object of a derived class such as BoolEqualsAdvancedFilter, NumberInAdvancedFilter, + /// StringEqualsAdvancedFilter etc. depending on the type of the key based on which you want to filter. + internal partial interface IAdvancedFilterInternal + + { + /// The field/property in the event based on which you want to filter. + string Key { get; set; } + /// + /// The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType OperatorType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/AdvancedFilter.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/AdvancedFilter.json.cs new file mode 100644 index 000000000000..f1b65c432e82 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/AdvancedFilter.json.cs @@ -0,0 +1,199 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// + /// This is the base type that represents an advanced filter. To configure an advanced filter, do not directly instantiate + /// an object of this class. Instead, instantiate an object of a derived class such as BoolEqualsAdvancedFilter, NumberInAdvancedFilter, + /// StringEqualsAdvancedFilter etc. depending on the type of the key based on which you want to filter. + /// + public partial class AdvancedFilter + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal AdvancedFilter(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_operatorType = If( json?.PropertyT("operatorType"), out var __jsonOperatorType) ? (string)__jsonOperatorType : (string)OperatorType;} + {_key = If( json?.PropertyT("key"), out var __jsonKey) ? (string)__jsonKey : (string)Key;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter interface is polymorphic, + /// and the precise model class that will get deserialized is determined at runtime based on the payload. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + if (!(node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json)) + { + return null; + } + // Polymorphic type -- select the appropriate constructor using the discriminator + + switch ( json.StringProperty("operatorType") ) + { + case "NumberIn": + { + return new NumberInAdvancedFilter(json); + } + case "NumberNotIn": + { + return new NumberNotInAdvancedFilter(json); + } + case "NumberLessThan": + { + return new NumberLessThanAdvancedFilter(json); + } + case "NumberGreaterThan": + { + return new NumberGreaterThanAdvancedFilter(json); + } + case "NumberLessThanOrEquals": + { + return new NumberLessThanOrEqualsAdvancedFilter(json); + } + case "NumberGreaterThanOrEquals": + { + return new NumberGreaterThanOrEqualsAdvancedFilter(json); + } + case "BoolEquals": + { + return new BoolEqualsAdvancedFilter(json); + } + case "StringIn": + { + return new StringInAdvancedFilter(json); + } + case "StringNotIn": + { + return new StringNotInAdvancedFilter(json); + } + case "StringBeginsWith": + { + return new StringBeginsWithAdvancedFilter(json); + } + case "StringEndsWith": + { + return new StringEndsWithAdvancedFilter(json); + } + case "StringContains": + { + return new StringContainsAdvancedFilter(json); + } + case "NumberInRange": + { + return new NumberInRangeAdvancedFilter(json); + } + case "NumberNotInRange": + { + return new NumberNotInRangeAdvancedFilter(json); + } + case "StringNotBeginsWith": + { + return new StringNotBeginsWithAdvancedFilter(json); + } + case "StringNotEndsWith": + { + return new StringNotEndsWithAdvancedFilter(json); + } + case "StringNotContains": + { + return new StringNotContainsAdvancedFilter(json); + } + case "IsNullOrUndefined": + { + return new IsNullOrUndefinedAdvancedFilter(json); + } + case "IsNotNull": + { + return new IsNotNullAdvancedFilter(json); + } + } + return new AdvancedFilter(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._operatorType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._operatorType.ToString()) : null, "operatorType" ,container.Add ); + AddIf( null != (((object)this._key)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._key.ToString()) : null, "key" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/AzureAdPartnerClientAuthentication.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/AzureAdPartnerClientAuthentication.PowerShell.cs new file mode 100644 index 000000000000..18af82513f56 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/AzureAdPartnerClientAuthentication.PowerShell.cs @@ -0,0 +1,168 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Azure Active Directory Partner Client Authentication + [System.ComponentModel.TypeConverter(typeof(AzureAdPartnerClientAuthenticationTypeConverter))] + public partial class AzureAdPartnerClientAuthentication + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AzureAdPartnerClientAuthentication(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureAdPartnerClientAuthenticationInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureAdPartnerClientAuthenticationProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureAdPartnerClientAuthenticationInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.AzureAdPartnerClientAuthenticationPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("ClientAuthenticationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerClientAuthenticationInternal)this).ClientAuthenticationType = (string) content.GetValueForProperty("ClientAuthenticationType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerClientAuthenticationInternal)this).ClientAuthenticationType, global::System.Convert.ToString); + } + if (content.Contains("AzureActiveDirectoryTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureAdPartnerClientAuthenticationInternal)this).AzureActiveDirectoryTenantId = (string) content.GetValueForProperty("AzureActiveDirectoryTenantId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureAdPartnerClientAuthenticationInternal)this).AzureActiveDirectoryTenantId, global::System.Convert.ToString); + } + if (content.Contains("AzureActiveDirectoryApplicationIdOrUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureAdPartnerClientAuthenticationInternal)this).AzureActiveDirectoryApplicationIdOrUri = (string) content.GetValueForProperty("AzureActiveDirectoryApplicationIdOrUri",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureAdPartnerClientAuthenticationInternal)this).AzureActiveDirectoryApplicationIdOrUri, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AzureAdPartnerClientAuthentication(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureAdPartnerClientAuthenticationInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureAdPartnerClientAuthenticationProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureAdPartnerClientAuthenticationInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.AzureAdPartnerClientAuthenticationPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("ClientAuthenticationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerClientAuthenticationInternal)this).ClientAuthenticationType = (string) content.GetValueForProperty("ClientAuthenticationType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerClientAuthenticationInternal)this).ClientAuthenticationType, global::System.Convert.ToString); + } + if (content.Contains("AzureActiveDirectoryTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureAdPartnerClientAuthenticationInternal)this).AzureActiveDirectoryTenantId = (string) content.GetValueForProperty("AzureActiveDirectoryTenantId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureAdPartnerClientAuthenticationInternal)this).AzureActiveDirectoryTenantId, global::System.Convert.ToString); + } + if (content.Contains("AzureActiveDirectoryApplicationIdOrUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureAdPartnerClientAuthenticationInternal)this).AzureActiveDirectoryApplicationIdOrUri = (string) content.GetValueForProperty("AzureActiveDirectoryApplicationIdOrUri",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureAdPartnerClientAuthenticationInternal)this).AzureActiveDirectoryApplicationIdOrUri, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureAdPartnerClientAuthentication DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AzureAdPartnerClientAuthentication(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureAdPartnerClientAuthentication DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AzureAdPartnerClientAuthentication(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureAdPartnerClientAuthentication FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Azure Active Directory Partner Client Authentication + [System.ComponentModel.TypeConverter(typeof(AzureAdPartnerClientAuthenticationTypeConverter))] + public partial interface IAzureAdPartnerClientAuthentication + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/AzureAdPartnerClientAuthentication.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/AzureAdPartnerClientAuthentication.TypeConverter.cs new file mode 100644 index 000000000000..830da27bc31b --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/AzureAdPartnerClientAuthentication.TypeConverter.cs @@ -0,0 +1,148 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AzureAdPartnerClientAuthenticationTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureAdPartnerClientAuthentication ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureAdPartnerClientAuthentication).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AzureAdPartnerClientAuthentication.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AzureAdPartnerClientAuthentication.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AzureAdPartnerClientAuthentication.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/AzureAdPartnerClientAuthentication.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/AzureAdPartnerClientAuthentication.cs new file mode 100644 index 000000000000..5d10dfa4cdd2 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/AzureAdPartnerClientAuthentication.cs @@ -0,0 +1,115 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Azure Active Directory Partner Client Authentication + public partial class AzureAdPartnerClientAuthentication : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureAdPartnerClientAuthentication, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureAdPartnerClientAuthenticationInternal, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerClientAuthentication __partnerClientAuthentication = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerClientAuthentication(); + + /// + /// The Azure Active Directory Application ID or URI to get the access token that will be included as the bearer token in + /// delivery requests. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string AzureActiveDirectoryApplicationIdOrUri { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureAdPartnerClientAuthenticationPropertiesInternal)Property).AzureActiveDirectoryApplicationIdOrUri; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureAdPartnerClientAuthenticationPropertiesInternal)Property).AzureActiveDirectoryApplicationIdOrUri = value ?? null; } + + /// + /// The Azure Active Directory Tenant ID to get the access token that will be included as the bearer token in delivery requests. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string AzureActiveDirectoryTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureAdPartnerClientAuthenticationPropertiesInternal)Property).AzureActiveDirectoryTenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureAdPartnerClientAuthenticationPropertiesInternal)Property).AzureActiveDirectoryTenantId = value ?? null; } + + /// Type of client authentication + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public string ClientAuthenticationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerClientAuthenticationInternal)__partnerClientAuthentication).ClientAuthenticationType; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureAdPartnerClientAuthenticationProperties Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureAdPartnerClientAuthenticationInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.AzureAdPartnerClientAuthenticationProperties()); set { {_property = value;} } } + + /// Internal Acessors for ClientAuthenticationType + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerClientAuthenticationInternal.ClientAuthenticationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerClientAuthenticationInternal)__partnerClientAuthentication).ClientAuthenticationType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerClientAuthenticationInternal)__partnerClientAuthentication).ClientAuthenticationType = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureAdPartnerClientAuthenticationProperties _property; + + /// AzureAD ClientAuthentication Properties + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureAdPartnerClientAuthenticationProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.AzureAdPartnerClientAuthenticationProperties()); set => this._property = value; } + + /// Creates an new instance. + public AzureAdPartnerClientAuthentication() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__partnerClientAuthentication), __partnerClientAuthentication); + await eventListener.AssertObjectIsValid(nameof(__partnerClientAuthentication), __partnerClientAuthentication); + } + } + /// Azure Active Directory Partner Client Authentication + public partial interface IAzureAdPartnerClientAuthentication : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerClientAuthentication + { + /// + /// The Azure Active Directory Application ID or URI to get the access token that will be included as the bearer token in + /// delivery requests. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Azure Active Directory Application ID or URI to get the access token that will be included as the bearer token in delivery requests.", + SerializedName = @"azureActiveDirectoryApplicationIdOrUri", + PossibleTypes = new [] { typeof(string) })] + string AzureActiveDirectoryApplicationIdOrUri { get; set; } + /// + /// The Azure Active Directory Tenant ID to get the access token that will be included as the bearer token in delivery requests. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Azure Active Directory Tenant ID to get the access token that will be included as the bearer token in delivery requests.", + SerializedName = @"azureActiveDirectoryTenantId", + PossibleTypes = new [] { typeof(string) })] + string AzureActiveDirectoryTenantId { get; set; } + + } + /// Azure Active Directory Partner Client Authentication + internal partial interface IAzureAdPartnerClientAuthenticationInternal : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerClientAuthenticationInternal + { + /// + /// The Azure Active Directory Application ID or URI to get the access token that will be included as the bearer token in + /// delivery requests. + /// + string AzureActiveDirectoryApplicationIdOrUri { get; set; } + /// + /// The Azure Active Directory Tenant ID to get the access token that will be included as the bearer token in delivery requests. + /// + string AzureActiveDirectoryTenantId { get; set; } + /// AzureAD ClientAuthentication Properties + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureAdPartnerClientAuthenticationProperties Property { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/AzureAdPartnerClientAuthentication.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/AzureAdPartnerClientAuthentication.json.cs new file mode 100644 index 000000000000..468d459c154c --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/AzureAdPartnerClientAuthentication.json.cs @@ -0,0 +1,109 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Azure Active Directory Partner Client Authentication + public partial class AzureAdPartnerClientAuthentication + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal AzureAdPartnerClientAuthentication(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __partnerClientAuthentication = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerClientAuthentication(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.AzureAdPartnerClientAuthenticationProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureAdPartnerClientAuthentication. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureAdPartnerClientAuthentication. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureAdPartnerClientAuthentication FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new AzureAdPartnerClientAuthentication(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __partnerClientAuthentication?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/AzureAdPartnerClientAuthenticationProperties.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/AzureAdPartnerClientAuthenticationProperties.PowerShell.cs new file mode 100644 index 000000000000..1995440e8411 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/AzureAdPartnerClientAuthenticationProperties.PowerShell.cs @@ -0,0 +1,153 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Properties of an Azure Active Directory Partner Client Authentication. + [System.ComponentModel.TypeConverter(typeof(AzureAdPartnerClientAuthenticationPropertiesTypeConverter))] + public partial class AzureAdPartnerClientAuthenticationProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AzureAdPartnerClientAuthenticationProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AzureActiveDirectoryTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureAdPartnerClientAuthenticationPropertiesInternal)this).AzureActiveDirectoryTenantId = (string) content.GetValueForProperty("AzureActiveDirectoryTenantId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureAdPartnerClientAuthenticationPropertiesInternal)this).AzureActiveDirectoryTenantId, global::System.Convert.ToString); + } + if (content.Contains("AzureActiveDirectoryApplicationIdOrUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureAdPartnerClientAuthenticationPropertiesInternal)this).AzureActiveDirectoryApplicationIdOrUri = (string) content.GetValueForProperty("AzureActiveDirectoryApplicationIdOrUri",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureAdPartnerClientAuthenticationPropertiesInternal)this).AzureActiveDirectoryApplicationIdOrUri, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AzureAdPartnerClientAuthenticationProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AzureActiveDirectoryTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureAdPartnerClientAuthenticationPropertiesInternal)this).AzureActiveDirectoryTenantId = (string) content.GetValueForProperty("AzureActiveDirectoryTenantId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureAdPartnerClientAuthenticationPropertiesInternal)this).AzureActiveDirectoryTenantId, global::System.Convert.ToString); + } + if (content.Contains("AzureActiveDirectoryApplicationIdOrUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureAdPartnerClientAuthenticationPropertiesInternal)this).AzureActiveDirectoryApplicationIdOrUri = (string) content.GetValueForProperty("AzureActiveDirectoryApplicationIdOrUri",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureAdPartnerClientAuthenticationPropertiesInternal)this).AzureActiveDirectoryApplicationIdOrUri, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureAdPartnerClientAuthenticationProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AzureAdPartnerClientAuthenticationProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureAdPartnerClientAuthenticationProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AzureAdPartnerClientAuthenticationProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from + /// a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureAdPartnerClientAuthenticationProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties of an Azure Active Directory Partner Client Authentication. + [System.ComponentModel.TypeConverter(typeof(AzureAdPartnerClientAuthenticationPropertiesTypeConverter))] + public partial interface IAzureAdPartnerClientAuthenticationProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/AzureAdPartnerClientAuthenticationProperties.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/AzureAdPartnerClientAuthenticationProperties.TypeConverter.cs new file mode 100644 index 000000000000..07e05bf6a119 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/AzureAdPartnerClientAuthenticationProperties.TypeConverter.cs @@ -0,0 +1,150 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AzureAdPartnerClientAuthenticationPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, + /// otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureAdPartnerClientAuthenticationProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureAdPartnerClientAuthenticationProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AzureAdPartnerClientAuthenticationProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AzureAdPartnerClientAuthenticationProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AzureAdPartnerClientAuthenticationProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/AzureAdPartnerClientAuthenticationProperties.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/AzureAdPartnerClientAuthenticationProperties.cs new file mode 100644 index 000000000000..c718b5956d91 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/AzureAdPartnerClientAuthenticationProperties.cs @@ -0,0 +1,87 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Properties of an Azure Active Directory Partner Client Authentication. + public partial class AzureAdPartnerClientAuthenticationProperties : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureAdPartnerClientAuthenticationProperties, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureAdPartnerClientAuthenticationPropertiesInternal + { + + /// + /// Backing field for property. + /// + private string _azureActiveDirectoryApplicationIdOrUri; + + /// + /// The Azure Active Directory Application ID or URI to get the access token that will be included as the bearer token in + /// delivery requests. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string AzureActiveDirectoryApplicationIdOrUri { get => this._azureActiveDirectoryApplicationIdOrUri; set => this._azureActiveDirectoryApplicationIdOrUri = value; } + + /// Backing field for property. + private string _azureActiveDirectoryTenantId; + + /// + /// The Azure Active Directory Tenant ID to get the access token that will be included as the bearer token in delivery requests. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string AzureActiveDirectoryTenantId { get => this._azureActiveDirectoryTenantId; set => this._azureActiveDirectoryTenantId = value; } + + /// + /// Creates an new instance. + /// + public AzureAdPartnerClientAuthenticationProperties() + { + + } + } + /// Properties of an Azure Active Directory Partner Client Authentication. + public partial interface IAzureAdPartnerClientAuthenticationProperties : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// + /// The Azure Active Directory Application ID or URI to get the access token that will be included as the bearer token in + /// delivery requests. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Azure Active Directory Application ID or URI to get the access token that will be included as the bearer token in delivery requests.", + SerializedName = @"azureActiveDirectoryApplicationIdOrUri", + PossibleTypes = new [] { typeof(string) })] + string AzureActiveDirectoryApplicationIdOrUri { get; set; } + /// + /// The Azure Active Directory Tenant ID to get the access token that will be included as the bearer token in delivery requests. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Azure Active Directory Tenant ID to get the access token that will be included as the bearer token in delivery requests.", + SerializedName = @"azureActiveDirectoryTenantId", + PossibleTypes = new [] { typeof(string) })] + string AzureActiveDirectoryTenantId { get; set; } + + } + /// Properties of an Azure Active Directory Partner Client Authentication. + internal partial interface IAzureAdPartnerClientAuthenticationPropertiesInternal + + { + /// + /// The Azure Active Directory Application ID or URI to get the access token that will be included as the bearer token in + /// delivery requests. + /// + string AzureActiveDirectoryApplicationIdOrUri { get; set; } + /// + /// The Azure Active Directory Tenant ID to get the access token that will be included as the bearer token in delivery requests. + /// + string AzureActiveDirectoryTenantId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/AzureAdPartnerClientAuthenticationProperties.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/AzureAdPartnerClientAuthenticationProperties.json.cs new file mode 100644 index 000000000000..e015e7b11503 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/AzureAdPartnerClientAuthenticationProperties.json.cs @@ -0,0 +1,111 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Properties of an Azure Active Directory Partner Client Authentication. + public partial class AzureAdPartnerClientAuthenticationProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal AzureAdPartnerClientAuthenticationProperties(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_azureActiveDirectoryTenantId = If( json?.PropertyT("azureActiveDirectoryTenantId"), out var __jsonAzureActiveDirectoryTenantId) ? (string)__jsonAzureActiveDirectoryTenantId : (string)AzureActiveDirectoryTenantId;} + {_azureActiveDirectoryApplicationIdOrUri = If( json?.PropertyT("azureActiveDirectoryApplicationIdOrUri"), out var __jsonAzureActiveDirectoryApplicationIdOrUri) ? (string)__jsonAzureActiveDirectoryApplicationIdOrUri : (string)AzureActiveDirectoryApplicationIdOrUri;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureAdPartnerClientAuthenticationProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureAdPartnerClientAuthenticationProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureAdPartnerClientAuthenticationProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new AzureAdPartnerClientAuthenticationProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._azureActiveDirectoryTenantId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._azureActiveDirectoryTenantId.ToString()) : null, "azureActiveDirectoryTenantId" ,container.Add ); + AddIf( null != (((object)this._azureActiveDirectoryApplicationIdOrUri)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._azureActiveDirectoryApplicationIdOrUri.ToString()) : null, "azureActiveDirectoryApplicationIdOrUri" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/AzureFunctionEventSubscriptionDestination.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/AzureFunctionEventSubscriptionDestination.PowerShell.cs new file mode 100644 index 000000000000..9c92cebf5e98 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/AzureFunctionEventSubscriptionDestination.PowerShell.cs @@ -0,0 +1,185 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Information about the azure function destination for an event subscription. + [System.ComponentModel.TypeConverter(typeof(AzureFunctionEventSubscriptionDestinationTypeConverter))] + public partial class AzureFunctionEventSubscriptionDestination + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AzureFunctionEventSubscriptionDestination(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureFunctionEventSubscriptionDestinationInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureFunctionEventSubscriptionDestinationProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureFunctionEventSubscriptionDestinationInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.AzureFunctionEventSubscriptionDestinationPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("EndpointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestinationInternal)this).EndpointType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType) content.GetValueForProperty("EndpointType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestinationInternal)this).EndpointType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType.CreateFrom); + } + if (content.Contains("ResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureFunctionEventSubscriptionDestinationInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureFunctionEventSubscriptionDestinationInternal)this).ResourceId, global::System.Convert.ToString); + } + if (content.Contains("MaxEventsPerBatch")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureFunctionEventSubscriptionDestinationInternal)this).MaxEventsPerBatch = (int?) content.GetValueForProperty("MaxEventsPerBatch",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureFunctionEventSubscriptionDestinationInternal)this).MaxEventsPerBatch, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("PreferredBatchSizeInKilobyte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureFunctionEventSubscriptionDestinationInternal)this).PreferredBatchSizeInKilobyte = (int?) content.GetValueForProperty("PreferredBatchSizeInKilobyte",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureFunctionEventSubscriptionDestinationInternal)this).PreferredBatchSizeInKilobyte, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("DeliveryAttributeMapping")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureFunctionEventSubscriptionDestinationInternal)this).DeliveryAttributeMapping = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping[]) content.GetValueForProperty("DeliveryAttributeMapping",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureFunctionEventSubscriptionDestinationInternal)this).DeliveryAttributeMapping, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeliveryAttributeMappingTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AzureFunctionEventSubscriptionDestination(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureFunctionEventSubscriptionDestinationInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureFunctionEventSubscriptionDestinationProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureFunctionEventSubscriptionDestinationInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.AzureFunctionEventSubscriptionDestinationPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("EndpointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestinationInternal)this).EndpointType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType) content.GetValueForProperty("EndpointType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestinationInternal)this).EndpointType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType.CreateFrom); + } + if (content.Contains("ResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureFunctionEventSubscriptionDestinationInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureFunctionEventSubscriptionDestinationInternal)this).ResourceId, global::System.Convert.ToString); + } + if (content.Contains("MaxEventsPerBatch")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureFunctionEventSubscriptionDestinationInternal)this).MaxEventsPerBatch = (int?) content.GetValueForProperty("MaxEventsPerBatch",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureFunctionEventSubscriptionDestinationInternal)this).MaxEventsPerBatch, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("PreferredBatchSizeInKilobyte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureFunctionEventSubscriptionDestinationInternal)this).PreferredBatchSizeInKilobyte = (int?) content.GetValueForProperty("PreferredBatchSizeInKilobyte",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureFunctionEventSubscriptionDestinationInternal)this).PreferredBatchSizeInKilobyte, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("DeliveryAttributeMapping")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureFunctionEventSubscriptionDestinationInternal)this).DeliveryAttributeMapping = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping[]) content.GetValueForProperty("DeliveryAttributeMapping",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureFunctionEventSubscriptionDestinationInternal)this).DeliveryAttributeMapping, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeliveryAttributeMappingTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureFunctionEventSubscriptionDestination DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AzureFunctionEventSubscriptionDestination(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureFunctionEventSubscriptionDestination DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AzureFunctionEventSubscriptionDestination(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json + /// string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureFunctionEventSubscriptionDestination FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Information about the azure function destination for an event subscription. + [System.ComponentModel.TypeConverter(typeof(AzureFunctionEventSubscriptionDestinationTypeConverter))] + public partial interface IAzureFunctionEventSubscriptionDestination + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/AzureFunctionEventSubscriptionDestination.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/AzureFunctionEventSubscriptionDestination.TypeConverter.cs new file mode 100644 index 000000000000..2c465c4ac4c1 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/AzureFunctionEventSubscriptionDestination.TypeConverter.cs @@ -0,0 +1,150 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AzureFunctionEventSubscriptionDestinationTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureFunctionEventSubscriptionDestination ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureFunctionEventSubscriptionDestination).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AzureFunctionEventSubscriptionDestination.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AzureFunctionEventSubscriptionDestination.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AzureFunctionEventSubscriptionDestination.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/AzureFunctionEventSubscriptionDestination.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/AzureFunctionEventSubscriptionDestination.cs new file mode 100644 index 000000000000..a64b07bfcc7b --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/AzureFunctionEventSubscriptionDestination.cs @@ -0,0 +1,133 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Information about the azure function destination for an event subscription. + public partial class AzureFunctionEventSubscriptionDestination : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureFunctionEventSubscriptionDestination, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureFunctionEventSubscriptionDestinationInternal, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestination __eventSubscriptionDestination = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionDestination(); + + /// Delivery attribute details. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping[] DeliveryAttributeMapping { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureFunctionEventSubscriptionDestinationPropertiesInternal)Property).DeliveryAttributeMapping; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureFunctionEventSubscriptionDestinationPropertiesInternal)Property).DeliveryAttributeMapping = value ?? null /* arrayOf */; } + + /// Type of the endpoint for the event subscription destination. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType EndpointType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestinationInternal)__eventSubscriptionDestination).EndpointType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestinationInternal)__eventSubscriptionDestination).EndpointType = value ; } + + /// Maximum number of events per batch. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public int? MaxEventsPerBatch { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureFunctionEventSubscriptionDestinationPropertiesInternal)Property).MaxEventsPerBatch; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureFunctionEventSubscriptionDestinationPropertiesInternal)Property).MaxEventsPerBatch = value ?? default(int); } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureFunctionEventSubscriptionDestinationProperties Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureFunctionEventSubscriptionDestinationInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.AzureFunctionEventSubscriptionDestinationProperties()); set { {_property = value;} } } + + /// Preferred batch size in Kilobytes. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public int? PreferredBatchSizeInKilobyte { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureFunctionEventSubscriptionDestinationPropertiesInternal)Property).PreferredBatchSizeInKilobyte; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureFunctionEventSubscriptionDestinationPropertiesInternal)Property).PreferredBatchSizeInKilobyte = value ?? default(int); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureFunctionEventSubscriptionDestinationProperties _property; + + /// Azure Function Properties of the event subscription destination. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureFunctionEventSubscriptionDestinationProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.AzureFunctionEventSubscriptionDestinationProperties()); set => this._property = value; } + + /// + /// The Azure Resource Id that represents the endpoint of the Azure Function destination of an event subscription. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string ResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureFunctionEventSubscriptionDestinationPropertiesInternal)Property).ResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureFunctionEventSubscriptionDestinationPropertiesInternal)Property).ResourceId = value ?? null; } + + /// + /// Creates an new instance. + /// + public AzureFunctionEventSubscriptionDestination() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__eventSubscriptionDestination), __eventSubscriptionDestination); + await eventListener.AssertObjectIsValid(nameof(__eventSubscriptionDestination), __eventSubscriptionDestination); + } + } + /// Information about the azure function destination for an event subscription. + public partial interface IAzureFunctionEventSubscriptionDestination : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestination + { + /// Delivery attribute details. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Delivery attribute details.", + SerializedName = @"deliveryAttributeMappings", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping),typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStaticDeliveryAttributeMapping),typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDynamicDeliveryAttributeMapping) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping[] DeliveryAttributeMapping { get; set; } + /// Maximum number of events per batch. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Maximum number of events per batch.", + SerializedName = @"maxEventsPerBatch", + PossibleTypes = new [] { typeof(int) })] + int? MaxEventsPerBatch { get; set; } + /// Preferred batch size in Kilobytes. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Preferred batch size in Kilobytes.", + SerializedName = @"preferredBatchSizeInKilobytes", + PossibleTypes = new [] { typeof(int) })] + int? PreferredBatchSizeInKilobyte { get; set; } + /// + /// The Azure Resource Id that represents the endpoint of the Azure Function destination of an event subscription. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Azure Resource Id that represents the endpoint of the Azure Function destination of an event subscription.", + SerializedName = @"resourceId", + PossibleTypes = new [] { typeof(string) })] + string ResourceId { get; set; } + + } + /// Information about the azure function destination for an event subscription. + internal partial interface IAzureFunctionEventSubscriptionDestinationInternal : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestinationInternal + { + /// Delivery attribute details. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping[] DeliveryAttributeMapping { get; set; } + /// Maximum number of events per batch. + int? MaxEventsPerBatch { get; set; } + /// Preferred batch size in Kilobytes. + int? PreferredBatchSizeInKilobyte { get; set; } + /// Azure Function Properties of the event subscription destination. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureFunctionEventSubscriptionDestinationProperties Property { get; set; } + /// + /// The Azure Resource Id that represents the endpoint of the Azure Function destination of an event subscription. + /// + string ResourceId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/AzureFunctionEventSubscriptionDestination.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/AzureFunctionEventSubscriptionDestination.json.cs new file mode 100644 index 000000000000..0bbf2b1ac22d --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/AzureFunctionEventSubscriptionDestination.json.cs @@ -0,0 +1,110 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Information about the azure function destination for an event subscription. + public partial class AzureFunctionEventSubscriptionDestination + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal AzureFunctionEventSubscriptionDestination(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __eventSubscriptionDestination = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionDestination(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.AzureFunctionEventSubscriptionDestinationProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureFunctionEventSubscriptionDestination. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureFunctionEventSubscriptionDestination. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureFunctionEventSubscriptionDestination FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new AzureFunctionEventSubscriptionDestination(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __eventSubscriptionDestination?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/AzureFunctionEventSubscriptionDestinationProperties.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/AzureFunctionEventSubscriptionDestinationProperties.PowerShell.cs new file mode 100644 index 000000000000..77cd5c4eeb66 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/AzureFunctionEventSubscriptionDestinationProperties.PowerShell.cs @@ -0,0 +1,171 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// The properties that represent the Azure Function destination of an event subscription. + /// + [System.ComponentModel.TypeConverter(typeof(AzureFunctionEventSubscriptionDestinationPropertiesTypeConverter))] + public partial class AzureFunctionEventSubscriptionDestinationProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AzureFunctionEventSubscriptionDestinationProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureFunctionEventSubscriptionDestinationPropertiesInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureFunctionEventSubscriptionDestinationPropertiesInternal)this).ResourceId, global::System.Convert.ToString); + } + if (content.Contains("MaxEventsPerBatch")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureFunctionEventSubscriptionDestinationPropertiesInternal)this).MaxEventsPerBatch = (int?) content.GetValueForProperty("MaxEventsPerBatch",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureFunctionEventSubscriptionDestinationPropertiesInternal)this).MaxEventsPerBatch, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("PreferredBatchSizeInKilobyte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureFunctionEventSubscriptionDestinationPropertiesInternal)this).PreferredBatchSizeInKilobyte = (int?) content.GetValueForProperty("PreferredBatchSizeInKilobyte",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureFunctionEventSubscriptionDestinationPropertiesInternal)this).PreferredBatchSizeInKilobyte, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("DeliveryAttributeMapping")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureFunctionEventSubscriptionDestinationPropertiesInternal)this).DeliveryAttributeMapping = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping[]) content.GetValueForProperty("DeliveryAttributeMapping",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureFunctionEventSubscriptionDestinationPropertiesInternal)this).DeliveryAttributeMapping, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeliveryAttributeMappingTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AzureFunctionEventSubscriptionDestinationProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureFunctionEventSubscriptionDestinationPropertiesInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureFunctionEventSubscriptionDestinationPropertiesInternal)this).ResourceId, global::System.Convert.ToString); + } + if (content.Contains("MaxEventsPerBatch")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureFunctionEventSubscriptionDestinationPropertiesInternal)this).MaxEventsPerBatch = (int?) content.GetValueForProperty("MaxEventsPerBatch",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureFunctionEventSubscriptionDestinationPropertiesInternal)this).MaxEventsPerBatch, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("PreferredBatchSizeInKilobyte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureFunctionEventSubscriptionDestinationPropertiesInternal)this).PreferredBatchSizeInKilobyte = (int?) content.GetValueForProperty("PreferredBatchSizeInKilobyte",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureFunctionEventSubscriptionDestinationPropertiesInternal)this).PreferredBatchSizeInKilobyte, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("DeliveryAttributeMapping")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureFunctionEventSubscriptionDestinationPropertiesInternal)this).DeliveryAttributeMapping = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping[]) content.GetValueForProperty("DeliveryAttributeMapping",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureFunctionEventSubscriptionDestinationPropertiesInternal)this).DeliveryAttributeMapping, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeliveryAttributeMappingTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureFunctionEventSubscriptionDestinationProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AzureFunctionEventSubscriptionDestinationProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureFunctionEventSubscriptionDestinationProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AzureFunctionEventSubscriptionDestinationProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content + /// from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureFunctionEventSubscriptionDestinationProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The properties that represent the Azure Function destination of an event subscription. + [System.ComponentModel.TypeConverter(typeof(AzureFunctionEventSubscriptionDestinationPropertiesTypeConverter))] + public partial interface IAzureFunctionEventSubscriptionDestinationProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/AzureFunctionEventSubscriptionDestinationProperties.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/AzureFunctionEventSubscriptionDestinationProperties.TypeConverter.cs new file mode 100644 index 000000000000..8c01576b9555 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/AzureFunctionEventSubscriptionDestinationProperties.TypeConverter.cs @@ -0,0 +1,152 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AzureFunctionEventSubscriptionDestinationPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a + /// type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureFunctionEventSubscriptionDestinationProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureFunctionEventSubscriptionDestinationProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AzureFunctionEventSubscriptionDestinationProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AzureFunctionEventSubscriptionDestinationProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AzureFunctionEventSubscriptionDestinationProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/AzureFunctionEventSubscriptionDestinationProperties.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/AzureFunctionEventSubscriptionDestinationProperties.cs new file mode 100644 index 000000000000..789a9685b589 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/AzureFunctionEventSubscriptionDestinationProperties.cs @@ -0,0 +1,112 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// + /// The properties that represent the Azure Function destination of an event subscription. + /// + public partial class AzureFunctionEventSubscriptionDestinationProperties : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureFunctionEventSubscriptionDestinationProperties, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureFunctionEventSubscriptionDestinationPropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping[] _deliveryAttributeMapping; + + /// Delivery attribute details. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping[] DeliveryAttributeMapping { get => this._deliveryAttributeMapping; set => this._deliveryAttributeMapping = value; } + + /// Backing field for property. + private int? _maxEventsPerBatch; + + /// Maximum number of events per batch. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public int? MaxEventsPerBatch { get => this._maxEventsPerBatch; set => this._maxEventsPerBatch = value; } + + /// Backing field for property. + private int? _preferredBatchSizeInKilobyte; + + /// Preferred batch size in Kilobytes. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public int? PreferredBatchSizeInKilobyte { get => this._preferredBatchSizeInKilobyte; set => this._preferredBatchSizeInKilobyte = value; } + + /// Backing field for property. + private string _resourceId; + + /// + /// The Azure Resource Id that represents the endpoint of the Azure Function destination of an event subscription. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string ResourceId { get => this._resourceId; set => this._resourceId = value; } + + /// + /// Creates an new instance. + /// + public AzureFunctionEventSubscriptionDestinationProperties() + { + + } + } + /// The properties that represent the Azure Function destination of an event subscription. + public partial interface IAzureFunctionEventSubscriptionDestinationProperties : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// Delivery attribute details. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Delivery attribute details.", + SerializedName = @"deliveryAttributeMappings", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping),typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStaticDeliveryAttributeMapping),typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDynamicDeliveryAttributeMapping) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping[] DeliveryAttributeMapping { get; set; } + /// Maximum number of events per batch. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Maximum number of events per batch.", + SerializedName = @"maxEventsPerBatch", + PossibleTypes = new [] { typeof(int) })] + int? MaxEventsPerBatch { get; set; } + /// Preferred batch size in Kilobytes. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Preferred batch size in Kilobytes.", + SerializedName = @"preferredBatchSizeInKilobytes", + PossibleTypes = new [] { typeof(int) })] + int? PreferredBatchSizeInKilobyte { get; set; } + /// + /// The Azure Resource Id that represents the endpoint of the Azure Function destination of an event subscription. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Azure Resource Id that represents the endpoint of the Azure Function destination of an event subscription.", + SerializedName = @"resourceId", + PossibleTypes = new [] { typeof(string) })] + string ResourceId { get; set; } + + } + /// The properties that represent the Azure Function destination of an event subscription. + internal partial interface IAzureFunctionEventSubscriptionDestinationPropertiesInternal + + { + /// Delivery attribute details. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping[] DeliveryAttributeMapping { get; set; } + /// Maximum number of events per batch. + int? MaxEventsPerBatch { get; set; } + /// Preferred batch size in Kilobytes. + int? PreferredBatchSizeInKilobyte { get; set; } + /// + /// The Azure Resource Id that represents the endpoint of the Azure Function destination of an event subscription. + /// + string ResourceId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/AzureFunctionEventSubscriptionDestinationProperties.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/AzureFunctionEventSubscriptionDestinationProperties.json.cs new file mode 100644 index 000000000000..03a02ad392b5 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/AzureFunctionEventSubscriptionDestinationProperties.json.cs @@ -0,0 +1,125 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// + /// The properties that represent the Azure Function destination of an event subscription. + /// + public partial class AzureFunctionEventSubscriptionDestinationProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal AzureFunctionEventSubscriptionDestinationProperties(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_resourceId = If( json?.PropertyT("resourceId"), out var __jsonResourceId) ? (string)__jsonResourceId : (string)ResourceId;} + {_maxEventsPerBatch = If( json?.PropertyT("maxEventsPerBatch"), out var __jsonMaxEventsPerBatch) ? (int?)__jsonMaxEventsPerBatch : MaxEventsPerBatch;} + {_preferredBatchSizeInKilobyte = If( json?.PropertyT("preferredBatchSizeInKilobytes"), out var __jsonPreferredBatchSizeInKilobytes) ? (int?)__jsonPreferredBatchSizeInKilobytes : PreferredBatchSizeInKilobyte;} + {_deliveryAttributeMapping = If( json?.PropertyT("deliveryAttributeMappings"), out var __jsonDeliveryAttributeMappings) ? If( __jsonDeliveryAttributeMappings as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping) (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeliveryAttributeMapping.FromJson(__u) )) ))() : null : DeliveryAttributeMapping;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureFunctionEventSubscriptionDestinationProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureFunctionEventSubscriptionDestinationProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAzureFunctionEventSubscriptionDestinationProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new AzureFunctionEventSubscriptionDestinationProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._resourceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._resourceId.ToString()) : null, "resourceId" ,container.Add ); + AddIf( null != this._maxEventsPerBatch ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNumber((int)this._maxEventsPerBatch) : null, "maxEventsPerBatch" ,container.Add ); + AddIf( null != this._preferredBatchSizeInKilobyte ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNumber((int)this._preferredBatchSizeInKilobyte) : null, "preferredBatchSizeInKilobytes" ,container.Add ); + if (null != this._deliveryAttributeMapping) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.XNodeArray(); + foreach( var __x in this._deliveryAttributeMapping ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("deliveryAttributeMappings",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/BoolEqualsAdvancedFilter.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/BoolEqualsAdvancedFilter.PowerShell.cs new file mode 100644 index 000000000000..054782dbd223 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/BoolEqualsAdvancedFilter.PowerShell.cs @@ -0,0 +1,160 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// BoolEquals Advanced Filter. + [System.ComponentModel.TypeConverter(typeof(BoolEqualsAdvancedFilterTypeConverter))] + public partial class BoolEqualsAdvancedFilter + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal BoolEqualsAdvancedFilter(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IBoolEqualsAdvancedFilterInternal)this).Value = (bool?) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IBoolEqualsAdvancedFilterInternal)this).Value, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("OperatorType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).OperatorType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType) content.GetValueForProperty("OperatorType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).OperatorType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType.CreateFrom); + } + if (content.Contains("Key")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).Key = (string) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).Key, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal BoolEqualsAdvancedFilter(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IBoolEqualsAdvancedFilterInternal)this).Value = (bool?) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IBoolEqualsAdvancedFilterInternal)this).Value, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("OperatorType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).OperatorType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType) content.GetValueForProperty("OperatorType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).OperatorType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType.CreateFrom); + } + if (content.Contains("Key")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).Key = (string) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).Key, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IBoolEqualsAdvancedFilter DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new BoolEqualsAdvancedFilter(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IBoolEqualsAdvancedFilter DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new BoolEqualsAdvancedFilter(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IBoolEqualsAdvancedFilter FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// BoolEquals Advanced Filter. + [System.ComponentModel.TypeConverter(typeof(BoolEqualsAdvancedFilterTypeConverter))] + public partial interface IBoolEqualsAdvancedFilter + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/BoolEqualsAdvancedFilter.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/BoolEqualsAdvancedFilter.TypeConverter.cs new file mode 100644 index 000000000000..ffcf17819c85 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/BoolEqualsAdvancedFilter.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class BoolEqualsAdvancedFilterTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IBoolEqualsAdvancedFilter ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IBoolEqualsAdvancedFilter).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return BoolEqualsAdvancedFilter.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return BoolEqualsAdvancedFilter.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return BoolEqualsAdvancedFilter.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/BoolEqualsAdvancedFilter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/BoolEqualsAdvancedFilter.cs new file mode 100644 index 000000000000..d77a7160f8de --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/BoolEqualsAdvancedFilter.cs @@ -0,0 +1,80 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// BoolEquals Advanced Filter. + public partial class BoolEqualsAdvancedFilter : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IBoolEqualsAdvancedFilter, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IBoolEqualsAdvancedFilterInternal, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter __advancedFilter = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.AdvancedFilter(); + + /// The field/property in the event based on which you want to filter. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public string Key { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)__advancedFilter).Key; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)__advancedFilter).Key = value ?? null; } + + /// + /// The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType OperatorType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)__advancedFilter).OperatorType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)__advancedFilter).OperatorType = value ; } + + /// Backing field for property. + private bool? _value; + + /// The boolean filter value. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public bool? Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public BoolEqualsAdvancedFilter() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__advancedFilter), __advancedFilter); + await eventListener.AssertObjectIsValid(nameof(__advancedFilter), __advancedFilter); + } + } + /// BoolEquals Advanced Filter. + public partial interface IBoolEqualsAdvancedFilter : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter + { + /// The boolean filter value. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The boolean filter value.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(bool) })] + bool? Value { get; set; } + + } + /// BoolEquals Advanced Filter. + internal partial interface IBoolEqualsAdvancedFilterInternal : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal + { + /// The boolean filter value. + bool? Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/BoolEqualsAdvancedFilter.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/BoolEqualsAdvancedFilter.json.cs new file mode 100644 index 000000000000..a0dfc3217a89 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/BoolEqualsAdvancedFilter.json.cs @@ -0,0 +1,108 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// BoolEquals Advanced Filter. + public partial class BoolEqualsAdvancedFilter + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal BoolEqualsAdvancedFilter(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __advancedFilter = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.AdvancedFilter(json); + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? (bool?)__jsonValue : Value;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IBoolEqualsAdvancedFilter. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IBoolEqualsAdvancedFilter. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IBoolEqualsAdvancedFilter FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new BoolEqualsAdvancedFilter(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __advancedFilter?.ToJson(container, serializationMode); + AddIf( null != this._value ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonBoolean((bool)this._value) : null, "value" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/Channel.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/Channel.PowerShell.cs new file mode 100644 index 000000000000..2e99456ed3eb --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/Channel.PowerShell.cs @@ -0,0 +1,382 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Channel info. + [System.ComponentModel.TypeConverter(typeof(ChannelTypeConverter))] + public partial class Channel + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal Channel(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ChannelPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("ChannelType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).ChannelType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ChannelType?) content.GetValueForProperty("ChannelType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).ChannelType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ChannelType.CreateFrom); + } + if (content.Contains("ReadinessState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).ReadinessState = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ReadinessState?) content.GetValueForProperty("ReadinessState",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).ReadinessState, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ReadinessState.CreateFrom); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("PartnerTopicInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).PartnerTopicInfo = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInfo) content.GetValueForProperty("PartnerTopicInfo",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).PartnerTopicInfo, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerTopicInfoTypeConverter.ConvertFrom); + } + if (content.Contains("PartnerDestinationInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).PartnerDestinationInfo = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfo) content.GetValueForProperty("PartnerDestinationInfo",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).PartnerDestinationInfo, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerDestinationInfoTypeConverter.ConvertFrom); + } + if (content.Contains("MessageForActivation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).MessageForActivation = (string) content.GetValueForProperty("MessageForActivation",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).MessageForActivation, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ChannelProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ChannelProvisioningState.CreateFrom); + } + if (content.Contains("ExpirationTimeIfNotActivatedUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).ExpirationTimeIfNotActivatedUtc = (global::System.DateTime?) content.GetValueForProperty("ExpirationTimeIfNotActivatedUtc",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).ExpirationTimeIfNotActivatedUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("PartnerTopicInfoName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).PartnerTopicInfoName = (string) content.GetValueForProperty("PartnerTopicInfoName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).PartnerTopicInfoName, global::System.Convert.ToString); + } + if (content.Contains("PartnerTopicInfoSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).PartnerTopicInfoSource = (string) content.GetValueForProperty("PartnerTopicInfoSource",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).PartnerTopicInfoSource, global::System.Convert.ToString); + } + if (content.Contains("PartnerDestinationInfoName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).PartnerDestinationInfoName = (string) content.GetValueForProperty("PartnerDestinationInfoName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).PartnerDestinationInfoName, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("PartnerTopicInfoEventTypeInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).PartnerTopicInfoEventTypeInfo = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfo) content.GetValueForProperty("PartnerTopicInfoEventTypeInfo",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).PartnerTopicInfoEventTypeInfo, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventTypeInfoTypeConverter.ConvertFrom); + } + if (content.Contains("PartnerTopicInfoAzureSubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).PartnerTopicInfoAzureSubscriptionId = (string) content.GetValueForProperty("PartnerTopicInfoAzureSubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).PartnerTopicInfoAzureSubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("PartnerTopicInfoResourceGroupName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).PartnerTopicInfoResourceGroupName = (string) content.GetValueForProperty("PartnerTopicInfoResourceGroupName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).PartnerTopicInfoResourceGroupName, global::System.Convert.ToString); + } + if (content.Contains("PartnerDestinationInfoAzureSubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).PartnerDestinationInfoAzureSubscriptionId = (string) content.GetValueForProperty("PartnerDestinationInfoAzureSubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).PartnerDestinationInfoAzureSubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("PartnerDestinationInfoResourceGroupName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).PartnerDestinationInfoResourceGroupName = (string) content.GetValueForProperty("PartnerDestinationInfoResourceGroupName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).PartnerDestinationInfoResourceGroupName, global::System.Convert.ToString); + } + if (content.Contains("PartnerDestinationInfoEndpointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).PartnerDestinationInfoEndpointType = (string) content.GetValueForProperty("PartnerDestinationInfoEndpointType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).PartnerDestinationInfoEndpointType, global::System.Convert.ToString); + } + if (content.Contains("PartnerDestinationInfoEndpointServiceContext")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).PartnerDestinationInfoEndpointServiceContext = (string) content.GetValueForProperty("PartnerDestinationInfoEndpointServiceContext",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).PartnerDestinationInfoEndpointServiceContext, global::System.Convert.ToString); + } + if (content.Contains("PartnerDestinationInfoResourceMoveChangeHistory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).PartnerDestinationInfoResourceMoveChangeHistory = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceMoveChangeHistory[]) content.GetValueForProperty("PartnerDestinationInfoResourceMoveChangeHistory",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).PartnerDestinationInfoResourceMoveChangeHistory, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ResourceMoveChangeHistoryTypeConverter.ConvertFrom)); + } + if (content.Contains("EventTypeInfoKind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).EventTypeInfoKind = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind?) content.GetValueForProperty("EventTypeInfoKind",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).EventTypeInfoKind, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind.CreateFrom); + } + if (content.Contains("EventTypeInfoInlineEventType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).EventTypeInfoInlineEventType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInlineEventTypes) content.GetValueForProperty("EventTypeInfoInlineEventType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).EventTypeInfoInlineEventType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventTypeInfoInlineEventTypesTypeConverter.ConvertFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal Channel(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ChannelPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("ChannelType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).ChannelType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ChannelType?) content.GetValueForProperty("ChannelType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).ChannelType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ChannelType.CreateFrom); + } + if (content.Contains("ReadinessState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).ReadinessState = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ReadinessState?) content.GetValueForProperty("ReadinessState",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).ReadinessState, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ReadinessState.CreateFrom); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("PartnerTopicInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).PartnerTopicInfo = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInfo) content.GetValueForProperty("PartnerTopicInfo",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).PartnerTopicInfo, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerTopicInfoTypeConverter.ConvertFrom); + } + if (content.Contains("PartnerDestinationInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).PartnerDestinationInfo = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfo) content.GetValueForProperty("PartnerDestinationInfo",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).PartnerDestinationInfo, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerDestinationInfoTypeConverter.ConvertFrom); + } + if (content.Contains("MessageForActivation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).MessageForActivation = (string) content.GetValueForProperty("MessageForActivation",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).MessageForActivation, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ChannelProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ChannelProvisioningState.CreateFrom); + } + if (content.Contains("ExpirationTimeIfNotActivatedUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).ExpirationTimeIfNotActivatedUtc = (global::System.DateTime?) content.GetValueForProperty("ExpirationTimeIfNotActivatedUtc",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).ExpirationTimeIfNotActivatedUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("PartnerTopicInfoName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).PartnerTopicInfoName = (string) content.GetValueForProperty("PartnerTopicInfoName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).PartnerTopicInfoName, global::System.Convert.ToString); + } + if (content.Contains("PartnerTopicInfoSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).PartnerTopicInfoSource = (string) content.GetValueForProperty("PartnerTopicInfoSource",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).PartnerTopicInfoSource, global::System.Convert.ToString); + } + if (content.Contains("PartnerDestinationInfoName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).PartnerDestinationInfoName = (string) content.GetValueForProperty("PartnerDestinationInfoName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).PartnerDestinationInfoName, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("PartnerTopicInfoEventTypeInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).PartnerTopicInfoEventTypeInfo = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfo) content.GetValueForProperty("PartnerTopicInfoEventTypeInfo",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).PartnerTopicInfoEventTypeInfo, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventTypeInfoTypeConverter.ConvertFrom); + } + if (content.Contains("PartnerTopicInfoAzureSubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).PartnerTopicInfoAzureSubscriptionId = (string) content.GetValueForProperty("PartnerTopicInfoAzureSubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).PartnerTopicInfoAzureSubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("PartnerTopicInfoResourceGroupName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).PartnerTopicInfoResourceGroupName = (string) content.GetValueForProperty("PartnerTopicInfoResourceGroupName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).PartnerTopicInfoResourceGroupName, global::System.Convert.ToString); + } + if (content.Contains("PartnerDestinationInfoAzureSubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).PartnerDestinationInfoAzureSubscriptionId = (string) content.GetValueForProperty("PartnerDestinationInfoAzureSubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).PartnerDestinationInfoAzureSubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("PartnerDestinationInfoResourceGroupName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).PartnerDestinationInfoResourceGroupName = (string) content.GetValueForProperty("PartnerDestinationInfoResourceGroupName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).PartnerDestinationInfoResourceGroupName, global::System.Convert.ToString); + } + if (content.Contains("PartnerDestinationInfoEndpointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).PartnerDestinationInfoEndpointType = (string) content.GetValueForProperty("PartnerDestinationInfoEndpointType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).PartnerDestinationInfoEndpointType, global::System.Convert.ToString); + } + if (content.Contains("PartnerDestinationInfoEndpointServiceContext")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).PartnerDestinationInfoEndpointServiceContext = (string) content.GetValueForProperty("PartnerDestinationInfoEndpointServiceContext",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).PartnerDestinationInfoEndpointServiceContext, global::System.Convert.ToString); + } + if (content.Contains("PartnerDestinationInfoResourceMoveChangeHistory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).PartnerDestinationInfoResourceMoveChangeHistory = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceMoveChangeHistory[]) content.GetValueForProperty("PartnerDestinationInfoResourceMoveChangeHistory",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).PartnerDestinationInfoResourceMoveChangeHistory, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ResourceMoveChangeHistoryTypeConverter.ConvertFrom)); + } + if (content.Contains("EventTypeInfoKind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).EventTypeInfoKind = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind?) content.GetValueForProperty("EventTypeInfoKind",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).EventTypeInfoKind, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind.CreateFrom); + } + if (content.Contains("EventTypeInfoInlineEventType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).EventTypeInfoInlineEventType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInlineEventTypes) content.GetValueForProperty("EventTypeInfoInlineEventType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal)this).EventTypeInfoInlineEventType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventTypeInfoInlineEventTypesTypeConverter.ConvertFrom); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannel DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new Channel(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannel DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new Channel(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannel FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Channel info. + [System.ComponentModel.TypeConverter(typeof(ChannelTypeConverter))] + public partial interface IChannel + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/Channel.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/Channel.TypeConverter.cs new file mode 100644 index 000000000000..82898cf49224 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/Channel.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ChannelTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannel ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannel).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return Channel.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return Channel.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return Channel.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/Channel.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/Channel.cs new file mode 100644 index 000000000000..01f6d5ad5941 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/Channel.cs @@ -0,0 +1,537 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Channel info. + public partial class Channel : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannel, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.Resource(); + + /// The type of the event channel which represents the direction flow of events. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ChannelType? ChannelType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)Property).ChannelType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)Property).ChannelType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ChannelType)""); } + + /// + /// A collection of inline event types for the resource. The inline event type keys are of type string which represents the + /// name of the event. + /// An example of a valid inline event name is "Contoso.OrderCreated". + /// The inline event type values are of type InlineEventProperties and will contain additional information for every inline + /// event type. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInlineEventTypes EventTypeInfoInlineEventType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)Property).EventTypeInfoInlineEventType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)Property).EventTypeInfoInlineEventType = value ?? null /* model class */; } + + /// The kind of event type used. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind? EventTypeInfoKind { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)Property).EventTypeInfoKind; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)Property).EventTypeInfoKind = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind)""); } + + /// + /// Expiration time of the channel. If this timer expires while the corresponding partner topic is never activated, + /// the channel and corresponding partner topic are deleted. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public global::System.DateTime? ExpirationTimeIfNotActivatedUtc { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)Property).ExpirationTimeIfNotActivatedUtc; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)Property).ExpirationTimeIfNotActivatedUtc = value ?? default(global::System.DateTime); } + + /// Fully qualified identifier of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Id; } + + /// + /// Context or helpful message that can be used during the approval process by the subscriber. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string MessageForActivation { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)Property).MessageForActivation; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)Property).MessageForActivation = value ?? null; } + + /// Internal Acessors for PartnerDestinationInfo + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfo Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal.PartnerDestinationInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)Property).PartnerDestinationInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)Property).PartnerDestinationInfo = value; } + + /// Internal Acessors for PartnerDestinationInfoEndpointType + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal.PartnerDestinationInfoEndpointType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)Property).PartnerDestinationInfoEndpointType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)Property).PartnerDestinationInfoEndpointType = value; } + + /// Internal Acessors for PartnerTopicInfo + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInfo Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal.PartnerTopicInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)Property).PartnerTopicInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)Property).PartnerTopicInfo = value; } + + /// Internal Acessors for PartnerTopicInfoEventTypeInfo + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfo Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal.PartnerTopicInfoEventTypeInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)Property).PartnerTopicInfoEventTypeInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)Property).PartnerTopicInfoEventTypeInfo = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelProperties Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ChannelProperties()); set { {_property = value;} } } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.SystemData()); set { {_systemData = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Type = value; } + + /// Name of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Name; } + + /// + /// Azure subscription ID of the subscriber. The partner destination associated with the channel will be + /// created under this Azure subscription. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string PartnerDestinationInfoAzureSubscriptionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)Property).PartnerDestinationInfoAzureSubscriptionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)Property).PartnerDestinationInfoAzureSubscriptionId = value ?? null; } + + /// Additional context of the partner destination endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string PartnerDestinationInfoEndpointServiceContext { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)Property).PartnerDestinationInfoEndpointServiceContext; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)Property).PartnerDestinationInfoEndpointServiceContext = value ?? null; } + + /// Type of the endpoint for the partner destination + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string PartnerDestinationInfoEndpointType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)Property).PartnerDestinationInfoEndpointType; } + + /// Name of the partner destination associated with the channel. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string PartnerDestinationInfoName { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)Property).PartnerDestinationInfoName; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)Property).PartnerDestinationInfoName = value ?? null; } + + /// + /// Azure Resource Group of the subscriber. The partner destination associated with the channel will be + /// created under this resource group. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string PartnerDestinationInfoResourceGroupName { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)Property).PartnerDestinationInfoResourceGroupName; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)Property).PartnerDestinationInfoResourceGroupName = value ?? null; } + + /// Change history of the resource move. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceMoveChangeHistory[] PartnerDestinationInfoResourceMoveChangeHistory { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)Property).PartnerDestinationInfoResourceMoveChangeHistory; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)Property).PartnerDestinationInfoResourceMoveChangeHistory = value ?? null /* arrayOf */; } + + /// + /// Azure subscription ID of the subscriber. The partner topic associated with the channel will be + /// created under this Azure subscription. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string PartnerTopicInfoAzureSubscriptionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)Property).PartnerTopicInfoAzureSubscriptionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)Property).PartnerTopicInfoAzureSubscriptionId = value ?? null; } + + /// Name of the partner topic associated with the channel. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string PartnerTopicInfoName { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)Property).PartnerTopicInfoName; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)Property).PartnerTopicInfoName = value ?? null; } + + /// + /// Azure Resource Group of the subscriber. The partner topic associated with the channel will be + /// created under this resource group. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string PartnerTopicInfoResourceGroupName { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)Property).PartnerTopicInfoResourceGroupName; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)Property).PartnerTopicInfoResourceGroupName = value ?? null; } + + /// + /// The source information is provided by the publisher to determine the scope or context from which the events + /// are originating. This information can be used by the subscriber during the approval process of the + /// created partner topic. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string PartnerTopicInfoSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)Property).PartnerTopicInfoSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)Property).PartnerTopicInfoSource = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelProperties _property; + + /// Properties of the Channel. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ChannelProperties()); set => this._property = value; } + + /// Provisioning state of the channel. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ChannelProvisioningState? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)Property).ProvisioningState = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ChannelProvisioningState)""); } + + /// The readiness state of the corresponding partner topic. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ReadinessState? ReadinessState { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)Property).ReadinessState; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)Property).ReadinessState = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ReadinessState)""); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData _systemData; + + /// The system metadata relating to Channel resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.SystemData()); } + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).CreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType)""); } + + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType)""); } + + /// Type of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public Channel() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// Channel info. + public partial interface IChannel : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResource + { + /// The type of the event channel which represents the direction flow of events. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of the event channel which represents the direction flow of events.", + SerializedName = @"channelType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ChannelType) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ChannelType? ChannelType { get; set; } + /// + /// A collection of inline event types for the resource. The inline event type keys are of type string which represents the + /// name of the event. + /// An example of a valid inline event name is "Contoso.OrderCreated". + /// The inline event type values are of type InlineEventProperties and will contain additional information for every inline + /// event type. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A collection of inline event types for the resource. The inline event type keys are of type string which represents the name of the event. + An example of a valid inline event name is ""Contoso.OrderCreated"". + The inline event type values are of type InlineEventProperties and will contain additional information for every inline event type.", + SerializedName = @"inlineEventTypes", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInlineEventTypes) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInlineEventTypes EventTypeInfoInlineEventType { get; set; } + /// The kind of event type used. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The kind of event type used.", + SerializedName = @"kind", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind? EventTypeInfoKind { get; set; } + /// + /// Expiration time of the channel. If this timer expires while the corresponding partner topic is never activated, + /// the channel and corresponding partner topic are deleted. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Expiration time of the channel. If this timer expires while the corresponding partner topic is never activated, + the channel and corresponding partner topic are deleted.", + SerializedName = @"expirationTimeIfNotActivatedUtc", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ExpirationTimeIfNotActivatedUtc { get; set; } + /// + /// Context or helpful message that can be used during the approval process by the subscriber. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Context or helpful message that can be used during the approval process by the subscriber.", + SerializedName = @"messageForActivation", + PossibleTypes = new [] { typeof(string) })] + string MessageForActivation { get; set; } + /// + /// Azure subscription ID of the subscriber. The partner destination associated with the channel will be + /// created under this Azure subscription. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Azure subscription ID of the subscriber. The partner destination associated with the channel will be + created under this Azure subscription.", + SerializedName = @"azureSubscriptionId", + PossibleTypes = new [] { typeof(string) })] + string PartnerDestinationInfoAzureSubscriptionId { get; set; } + /// Additional context of the partner destination endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Additional context of the partner destination endpoint.", + SerializedName = @"endpointServiceContext", + PossibleTypes = new [] { typeof(string) })] + string PartnerDestinationInfoEndpointServiceContext { get; set; } + /// Type of the endpoint for the partner destination + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Type of the endpoint for the partner destination", + SerializedName = @"endpointType", + PossibleTypes = new [] { typeof(string) })] + string PartnerDestinationInfoEndpointType { get; } + /// Name of the partner destination associated with the channel. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the partner destination associated with the channel.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string PartnerDestinationInfoName { get; set; } + /// + /// Azure Resource Group of the subscriber. The partner destination associated with the channel will be + /// created under this resource group. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Azure Resource Group of the subscriber. The partner destination associated with the channel will be + created under this resource group.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + string PartnerDestinationInfoResourceGroupName { get; set; } + /// Change history of the resource move. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Change history of the resource move.", + SerializedName = @"resourceMoveChangeHistory", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceMoveChangeHistory) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceMoveChangeHistory[] PartnerDestinationInfoResourceMoveChangeHistory { get; set; } + /// + /// Azure subscription ID of the subscriber. The partner topic associated with the channel will be + /// created under this Azure subscription. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Azure subscription ID of the subscriber. The partner topic associated with the channel will be + created under this Azure subscription.", + SerializedName = @"azureSubscriptionId", + PossibleTypes = new [] { typeof(string) })] + string PartnerTopicInfoAzureSubscriptionId { get; set; } + /// Name of the partner topic associated with the channel. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the partner topic associated with the channel.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string PartnerTopicInfoName { get; set; } + /// + /// Azure Resource Group of the subscriber. The partner topic associated with the channel will be + /// created under this resource group. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Azure Resource Group of the subscriber. The partner topic associated with the channel will be + created under this resource group.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + string PartnerTopicInfoResourceGroupName { get; set; } + /// + /// The source information is provided by the publisher to determine the scope or context from which the events + /// are originating. This information can be used by the subscriber during the approval process of the + /// created partner topic. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The source information is provided by the publisher to determine the scope or context from which the events + are originating. This information can be used by the subscriber during the approval process of the + created partner topic.", + SerializedName = @"source", + PossibleTypes = new [] { typeof(string) })] + string PartnerTopicInfoSource { get; set; } + /// Provisioning state of the channel. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Provisioning state of the channel.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ChannelProvisioningState) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ChannelProvisioningState? ProvisioningState { get; set; } + /// The readiness state of the corresponding partner topic. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The readiness state of the corresponding partner topic.", + SerializedName = @"readinessState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ReadinessState) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ReadinessState? ReadinessState { get; set; } + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timestamp of resource creation (UTC).", + SerializedName = @"createdAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SystemDataCreatedAt { get; set; } + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identity that created the resource.", + SerializedName = @"createdBy", + PossibleTypes = new [] { typeof(string) })] + string SystemDataCreatedBy { get; set; } + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of identity that created the resource.", + SerializedName = @"createdByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType? SystemDataCreatedByType { get; set; } + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timestamp of resource last modification (UTC)", + SerializedName = @"lastModifiedAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SystemDataLastModifiedAt { get; set; } + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identity that last modified the resource.", + SerializedName = @"lastModifiedBy", + PossibleTypes = new [] { typeof(string) })] + string SystemDataLastModifiedBy { get; set; } + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of identity that last modified the resource.", + SerializedName = @"lastModifiedByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + + } + /// Channel info. + internal partial interface IChannelInternal : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal + { + /// The type of the event channel which represents the direction flow of events. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ChannelType? ChannelType { get; set; } + /// + /// A collection of inline event types for the resource. The inline event type keys are of type string which represents the + /// name of the event. + /// An example of a valid inline event name is "Contoso.OrderCreated". + /// The inline event type values are of type InlineEventProperties and will contain additional information for every inline + /// event type. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInlineEventTypes EventTypeInfoInlineEventType { get; set; } + /// The kind of event type used. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind? EventTypeInfoKind { get; set; } + /// + /// Expiration time of the channel. If this timer expires while the corresponding partner topic is never activated, + /// the channel and corresponding partner topic are deleted. + /// + global::System.DateTime? ExpirationTimeIfNotActivatedUtc { get; set; } + /// + /// Context or helpful message that can be used during the approval process by the subscriber. + /// + string MessageForActivation { get; set; } + /// + /// This property should be populated when channelType is PartnerDestination and represents information about the partner + /// destination resource corresponding to the channel. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfo PartnerDestinationInfo { get; set; } + /// + /// Azure subscription ID of the subscriber. The partner destination associated with the channel will be + /// created under this Azure subscription. + /// + string PartnerDestinationInfoAzureSubscriptionId { get; set; } + /// Additional context of the partner destination endpoint. + string PartnerDestinationInfoEndpointServiceContext { get; set; } + /// Type of the endpoint for the partner destination + string PartnerDestinationInfoEndpointType { get; set; } + /// Name of the partner destination associated with the channel. + string PartnerDestinationInfoName { get; set; } + /// + /// Azure Resource Group of the subscriber. The partner destination associated with the channel will be + /// created under this resource group. + /// + string PartnerDestinationInfoResourceGroupName { get; set; } + /// Change history of the resource move. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceMoveChangeHistory[] PartnerDestinationInfoResourceMoveChangeHistory { get; set; } + /// + /// This property should be populated when channelType is PartnerTopic and represents information about the partner topic + /// resource corresponding to the channel. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInfo PartnerTopicInfo { get; set; } + /// + /// Azure subscription ID of the subscriber. The partner topic associated with the channel will be + /// created under this Azure subscription. + /// + string PartnerTopicInfoAzureSubscriptionId { get; set; } + /// + /// Event Type Information for the partner topic. This information is provided by the publisher and can be used by the + /// subscriber to view different types of events that are published. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfo PartnerTopicInfoEventTypeInfo { get; set; } + /// Name of the partner topic associated with the channel. + string PartnerTopicInfoName { get; set; } + /// + /// Azure Resource Group of the subscriber. The partner topic associated with the channel will be + /// created under this resource group. + /// + string PartnerTopicInfoResourceGroupName { get; set; } + /// + /// The source information is provided by the publisher to determine the scope or context from which the events + /// are originating. This information can be used by the subscriber during the approval process of the + /// created partner topic. + /// + string PartnerTopicInfoSource { get; set; } + /// Properties of the Channel. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelProperties Property { get; set; } + /// Provisioning state of the channel. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ChannelProvisioningState? ProvisioningState { get; set; } + /// The readiness state of the corresponding partner topic. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ReadinessState? ReadinessState { get; set; } + /// The system metadata relating to Channel resource. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData SystemData { get; set; } + /// The timestamp of resource creation (UTC). + global::System.DateTime? SystemDataCreatedAt { get; set; } + /// The identity that created the resource. + string SystemDataCreatedBy { get; set; } + /// The type of identity that created the resource. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType? SystemDataCreatedByType { get; set; } + /// The timestamp of resource last modification (UTC) + global::System.DateTime? SystemDataLastModifiedAt { get; set; } + /// The identity that last modified the resource. + string SystemDataLastModifiedBy { get; set; } + /// The type of identity that last modified the resource. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/Channel.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/Channel.json.cs new file mode 100644 index 000000000000..806b7f835e7d --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/Channel.json.cs @@ -0,0 +1,113 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Channel info. + public partial class Channel + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal Channel(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ChannelProperties.FromJson(__jsonProperties) : Property;} + {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.SystemData.FromJson(__jsonSystemData) : SystemData;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannel. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannel. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannel FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new Channel(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._systemData ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._systemData.ToJson(null,serializationMode) : null, "systemData" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ChannelProperties.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ChannelProperties.PowerShell.cs new file mode 100644 index 000000000000..04f56bbc797a --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ChannelProperties.PowerShell.cs @@ -0,0 +1,294 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Properties of the Channel. + [System.ComponentModel.TypeConverter(typeof(ChannelPropertiesTypeConverter))] + public partial class ChannelProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ChannelProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("PartnerTopicInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)this).PartnerTopicInfo = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInfo) content.GetValueForProperty("PartnerTopicInfo",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)this).PartnerTopicInfo, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerTopicInfoTypeConverter.ConvertFrom); + } + if (content.Contains("PartnerDestinationInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)this).PartnerDestinationInfo = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfo) content.GetValueForProperty("PartnerDestinationInfo",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)this).PartnerDestinationInfo, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerDestinationInfoTypeConverter.ConvertFrom); + } + if (content.Contains("ChannelType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)this).ChannelType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ChannelType?) content.GetValueForProperty("ChannelType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)this).ChannelType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ChannelType.CreateFrom); + } + if (content.Contains("MessageForActivation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)this).MessageForActivation = (string) content.GetValueForProperty("MessageForActivation",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)this).MessageForActivation, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ChannelProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ChannelProvisioningState.CreateFrom); + } + if (content.Contains("ReadinessState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)this).ReadinessState = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ReadinessState?) content.GetValueForProperty("ReadinessState",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)this).ReadinessState, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ReadinessState.CreateFrom); + } + if (content.Contains("ExpirationTimeIfNotActivatedUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)this).ExpirationTimeIfNotActivatedUtc = (global::System.DateTime?) content.GetValueForProperty("ExpirationTimeIfNotActivatedUtc",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)this).ExpirationTimeIfNotActivatedUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("PartnerTopicInfoName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)this).PartnerTopicInfoName = (string) content.GetValueForProperty("PartnerTopicInfoName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)this).PartnerTopicInfoName, global::System.Convert.ToString); + } + if (content.Contains("PartnerTopicInfoSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)this).PartnerTopicInfoSource = (string) content.GetValueForProperty("PartnerTopicInfoSource",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)this).PartnerTopicInfoSource, global::System.Convert.ToString); + } + if (content.Contains("PartnerDestinationInfoName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)this).PartnerDestinationInfoName = (string) content.GetValueForProperty("PartnerDestinationInfoName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)this).PartnerDestinationInfoName, global::System.Convert.ToString); + } + if (content.Contains("PartnerTopicInfoEventTypeInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)this).PartnerTopicInfoEventTypeInfo = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfo) content.GetValueForProperty("PartnerTopicInfoEventTypeInfo",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)this).PartnerTopicInfoEventTypeInfo, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventTypeInfoTypeConverter.ConvertFrom); + } + if (content.Contains("PartnerTopicInfoAzureSubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)this).PartnerTopicInfoAzureSubscriptionId = (string) content.GetValueForProperty("PartnerTopicInfoAzureSubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)this).PartnerTopicInfoAzureSubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("PartnerTopicInfoResourceGroupName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)this).PartnerTopicInfoResourceGroupName = (string) content.GetValueForProperty("PartnerTopicInfoResourceGroupName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)this).PartnerTopicInfoResourceGroupName, global::System.Convert.ToString); + } + if (content.Contains("PartnerDestinationInfoAzureSubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)this).PartnerDestinationInfoAzureSubscriptionId = (string) content.GetValueForProperty("PartnerDestinationInfoAzureSubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)this).PartnerDestinationInfoAzureSubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("PartnerDestinationInfoResourceGroupName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)this).PartnerDestinationInfoResourceGroupName = (string) content.GetValueForProperty("PartnerDestinationInfoResourceGroupName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)this).PartnerDestinationInfoResourceGroupName, global::System.Convert.ToString); + } + if (content.Contains("PartnerDestinationInfoEndpointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)this).PartnerDestinationInfoEndpointType = (string) content.GetValueForProperty("PartnerDestinationInfoEndpointType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)this).PartnerDestinationInfoEndpointType, global::System.Convert.ToString); + } + if (content.Contains("PartnerDestinationInfoEndpointServiceContext")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)this).PartnerDestinationInfoEndpointServiceContext = (string) content.GetValueForProperty("PartnerDestinationInfoEndpointServiceContext",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)this).PartnerDestinationInfoEndpointServiceContext, global::System.Convert.ToString); + } + if (content.Contains("PartnerDestinationInfoResourceMoveChangeHistory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)this).PartnerDestinationInfoResourceMoveChangeHistory = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceMoveChangeHistory[]) content.GetValueForProperty("PartnerDestinationInfoResourceMoveChangeHistory",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)this).PartnerDestinationInfoResourceMoveChangeHistory, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ResourceMoveChangeHistoryTypeConverter.ConvertFrom)); + } + if (content.Contains("EventTypeInfoKind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)this).EventTypeInfoKind = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind?) content.GetValueForProperty("EventTypeInfoKind",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)this).EventTypeInfoKind, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind.CreateFrom); + } + if (content.Contains("EventTypeInfoInlineEventType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)this).EventTypeInfoInlineEventType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInlineEventTypes) content.GetValueForProperty("EventTypeInfoInlineEventType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)this).EventTypeInfoInlineEventType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventTypeInfoInlineEventTypesTypeConverter.ConvertFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ChannelProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("PartnerTopicInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)this).PartnerTopicInfo = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInfo) content.GetValueForProperty("PartnerTopicInfo",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)this).PartnerTopicInfo, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerTopicInfoTypeConverter.ConvertFrom); + } + if (content.Contains("PartnerDestinationInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)this).PartnerDestinationInfo = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfo) content.GetValueForProperty("PartnerDestinationInfo",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)this).PartnerDestinationInfo, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerDestinationInfoTypeConverter.ConvertFrom); + } + if (content.Contains("ChannelType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)this).ChannelType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ChannelType?) content.GetValueForProperty("ChannelType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)this).ChannelType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ChannelType.CreateFrom); + } + if (content.Contains("MessageForActivation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)this).MessageForActivation = (string) content.GetValueForProperty("MessageForActivation",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)this).MessageForActivation, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ChannelProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ChannelProvisioningState.CreateFrom); + } + if (content.Contains("ReadinessState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)this).ReadinessState = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ReadinessState?) content.GetValueForProperty("ReadinessState",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)this).ReadinessState, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ReadinessState.CreateFrom); + } + if (content.Contains("ExpirationTimeIfNotActivatedUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)this).ExpirationTimeIfNotActivatedUtc = (global::System.DateTime?) content.GetValueForProperty("ExpirationTimeIfNotActivatedUtc",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)this).ExpirationTimeIfNotActivatedUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("PartnerTopicInfoName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)this).PartnerTopicInfoName = (string) content.GetValueForProperty("PartnerTopicInfoName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)this).PartnerTopicInfoName, global::System.Convert.ToString); + } + if (content.Contains("PartnerTopicInfoSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)this).PartnerTopicInfoSource = (string) content.GetValueForProperty("PartnerTopicInfoSource",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)this).PartnerTopicInfoSource, global::System.Convert.ToString); + } + if (content.Contains("PartnerDestinationInfoName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)this).PartnerDestinationInfoName = (string) content.GetValueForProperty("PartnerDestinationInfoName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)this).PartnerDestinationInfoName, global::System.Convert.ToString); + } + if (content.Contains("PartnerTopicInfoEventTypeInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)this).PartnerTopicInfoEventTypeInfo = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfo) content.GetValueForProperty("PartnerTopicInfoEventTypeInfo",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)this).PartnerTopicInfoEventTypeInfo, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventTypeInfoTypeConverter.ConvertFrom); + } + if (content.Contains("PartnerTopicInfoAzureSubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)this).PartnerTopicInfoAzureSubscriptionId = (string) content.GetValueForProperty("PartnerTopicInfoAzureSubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)this).PartnerTopicInfoAzureSubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("PartnerTopicInfoResourceGroupName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)this).PartnerTopicInfoResourceGroupName = (string) content.GetValueForProperty("PartnerTopicInfoResourceGroupName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)this).PartnerTopicInfoResourceGroupName, global::System.Convert.ToString); + } + if (content.Contains("PartnerDestinationInfoAzureSubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)this).PartnerDestinationInfoAzureSubscriptionId = (string) content.GetValueForProperty("PartnerDestinationInfoAzureSubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)this).PartnerDestinationInfoAzureSubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("PartnerDestinationInfoResourceGroupName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)this).PartnerDestinationInfoResourceGroupName = (string) content.GetValueForProperty("PartnerDestinationInfoResourceGroupName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)this).PartnerDestinationInfoResourceGroupName, global::System.Convert.ToString); + } + if (content.Contains("PartnerDestinationInfoEndpointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)this).PartnerDestinationInfoEndpointType = (string) content.GetValueForProperty("PartnerDestinationInfoEndpointType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)this).PartnerDestinationInfoEndpointType, global::System.Convert.ToString); + } + if (content.Contains("PartnerDestinationInfoEndpointServiceContext")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)this).PartnerDestinationInfoEndpointServiceContext = (string) content.GetValueForProperty("PartnerDestinationInfoEndpointServiceContext",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)this).PartnerDestinationInfoEndpointServiceContext, global::System.Convert.ToString); + } + if (content.Contains("PartnerDestinationInfoResourceMoveChangeHistory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)this).PartnerDestinationInfoResourceMoveChangeHistory = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceMoveChangeHistory[]) content.GetValueForProperty("PartnerDestinationInfoResourceMoveChangeHistory",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)this).PartnerDestinationInfoResourceMoveChangeHistory, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ResourceMoveChangeHistoryTypeConverter.ConvertFrom)); + } + if (content.Contains("EventTypeInfoKind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)this).EventTypeInfoKind = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind?) content.GetValueForProperty("EventTypeInfoKind",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)this).EventTypeInfoKind, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind.CreateFrom); + } + if (content.Contains("EventTypeInfoInlineEventType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)this).EventTypeInfoInlineEventType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInlineEventTypes) content.GetValueForProperty("EventTypeInfoInlineEventType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal)this).EventTypeInfoInlineEventType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventTypeInfoInlineEventTypesTypeConverter.ConvertFrom); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ChannelProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ChannelProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties of the Channel. + [System.ComponentModel.TypeConverter(typeof(ChannelPropertiesTypeConverter))] + public partial interface IChannelProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ChannelProperties.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ChannelProperties.TypeConverter.cs new file mode 100644 index 000000000000..153a6ea3404c --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ChannelProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ChannelPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ChannelProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ChannelProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ChannelProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ChannelProperties.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ChannelProperties.cs new file mode 100644 index 000000000000..c05ed80c22bf --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ChannelProperties.cs @@ -0,0 +1,424 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Properties of the Channel. + public partial class ChannelProperties : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelProperties, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ChannelType? _channelType; + + /// The type of the event channel which represents the direction flow of events. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ChannelType? ChannelType { get => this._channelType; set => this._channelType = value; } + + /// + /// A collection of inline event types for the resource. The inline event type keys are of type string which represents the + /// name of the event. + /// An example of a valid inline event name is "Contoso.OrderCreated". + /// The inline event type values are of type InlineEventProperties and will contain additional information for every inline + /// event type. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInlineEventTypes EventTypeInfoInlineEventType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInfoInternal)PartnerTopicInfo).EventTypeInfoInlineEventType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInfoInternal)PartnerTopicInfo).EventTypeInfoInlineEventType = value ?? null /* model class */; } + + /// The kind of event type used. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind? EventTypeInfoKind { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInfoInternal)PartnerTopicInfo).EventTypeInfoKind; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInfoInternal)PartnerTopicInfo).EventTypeInfoKind = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind)""); } + + /// Backing field for property. + private global::System.DateTime? _expirationTimeIfNotActivatedUtc; + + /// + /// Expiration time of the channel. If this timer expires while the corresponding partner topic is never activated, + /// the channel and corresponding partner topic are deleted. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public global::System.DateTime? ExpirationTimeIfNotActivatedUtc { get => this._expirationTimeIfNotActivatedUtc; set => this._expirationTimeIfNotActivatedUtc = value; } + + /// Backing field for property. + private string _messageForActivation; + + /// + /// Context or helpful message that can be used during the approval process by the subscriber. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string MessageForActivation { get => this._messageForActivation; set => this._messageForActivation = value; } + + /// Internal Acessors for PartnerDestinationInfo + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfo Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal.PartnerDestinationInfo { get => (this._partnerDestinationInfo = this._partnerDestinationInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerDestinationInfo()); set { {_partnerDestinationInfo = value;} } } + + /// Internal Acessors for PartnerDestinationInfoEndpointType + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal.PartnerDestinationInfoEndpointType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfoInternal)PartnerDestinationInfo).EndpointType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfoInternal)PartnerDestinationInfo).EndpointType = value; } + + /// Internal Acessors for PartnerTopicInfo + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInfo Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal.PartnerTopicInfo { get => (this._partnerTopicInfo = this._partnerTopicInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerTopicInfo()); set { {_partnerTopicInfo = value;} } } + + /// Internal Acessors for PartnerTopicInfoEventTypeInfo + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfo Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelPropertiesInternal.PartnerTopicInfoEventTypeInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInfoInternal)PartnerTopicInfo).EventTypeInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInfoInternal)PartnerTopicInfo).EventTypeInfo = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfo _partnerDestinationInfo; + + /// + /// This property should be populated when channelType is PartnerDestination and represents information about the partner + /// destination resource corresponding to the channel. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfo PartnerDestinationInfo { get => (this._partnerDestinationInfo = this._partnerDestinationInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerDestinationInfo()); set => this._partnerDestinationInfo = value; } + + /// + /// Azure subscription ID of the subscriber. The partner destination associated with the channel will be + /// created under this Azure subscription. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string PartnerDestinationInfoAzureSubscriptionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfoInternal)PartnerDestinationInfo).AzureSubscriptionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfoInternal)PartnerDestinationInfo).AzureSubscriptionId = value ?? null; } + + /// Additional context of the partner destination endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string PartnerDestinationInfoEndpointServiceContext { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfoInternal)PartnerDestinationInfo).EndpointServiceContext; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfoInternal)PartnerDestinationInfo).EndpointServiceContext = value ?? null; } + + /// Type of the endpoint for the partner destination + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string PartnerDestinationInfoEndpointType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfoInternal)PartnerDestinationInfo).EndpointType; } + + /// Name of the partner destination associated with the channel. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string PartnerDestinationInfoName { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfoInternal)PartnerDestinationInfo).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfoInternal)PartnerDestinationInfo).Name = value ?? null; } + + /// + /// Azure Resource Group of the subscriber. The partner destination associated with the channel will be + /// created under this resource group. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string PartnerDestinationInfoResourceGroupName { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfoInternal)PartnerDestinationInfo).ResourceGroupName; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfoInternal)PartnerDestinationInfo).ResourceGroupName = value ?? null; } + + /// Change history of the resource move. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceMoveChangeHistory[] PartnerDestinationInfoResourceMoveChangeHistory { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfoInternal)PartnerDestinationInfo).ResourceMoveChangeHistory; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfoInternal)PartnerDestinationInfo).ResourceMoveChangeHistory = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInfo _partnerTopicInfo; + + /// + /// This property should be populated when channelType is PartnerTopic and represents information about the partner topic + /// resource corresponding to the channel. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInfo PartnerTopicInfo { get => (this._partnerTopicInfo = this._partnerTopicInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerTopicInfo()); set => this._partnerTopicInfo = value; } + + /// + /// Azure subscription ID of the subscriber. The partner topic associated with the channel will be + /// created under this Azure subscription. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string PartnerTopicInfoAzureSubscriptionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInfoInternal)PartnerTopicInfo).AzureSubscriptionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInfoInternal)PartnerTopicInfo).AzureSubscriptionId = value ?? null; } + + /// Name of the partner topic associated with the channel. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string PartnerTopicInfoName { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInfoInternal)PartnerTopicInfo).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInfoInternal)PartnerTopicInfo).Name = value ?? null; } + + /// + /// Azure Resource Group of the subscriber. The partner topic associated with the channel will be + /// created under this resource group. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string PartnerTopicInfoResourceGroupName { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInfoInternal)PartnerTopicInfo).ResourceGroupName; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInfoInternal)PartnerTopicInfo).ResourceGroupName = value ?? null; } + + /// + /// The source information is provided by the publisher to determine the scope or context from which the events + /// are originating. This information can be used by the subscriber during the approval process of the + /// created partner topic. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string PartnerTopicInfoSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInfoInternal)PartnerTopicInfo).Source; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInfoInternal)PartnerTopicInfo).Source = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ChannelProvisioningState? _provisioningState; + + /// Provisioning state of the channel. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ChannelProvisioningState? ProvisioningState { get => this._provisioningState; set => this._provisioningState = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ReadinessState? _readinessState; + + /// The readiness state of the corresponding partner topic. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ReadinessState? ReadinessState { get => this._readinessState; set => this._readinessState = value; } + + /// Creates an new instance. + public ChannelProperties() + { + + } + } + /// Properties of the Channel. + public partial interface IChannelProperties : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// The type of the event channel which represents the direction flow of events. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of the event channel which represents the direction flow of events.", + SerializedName = @"channelType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ChannelType) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ChannelType? ChannelType { get; set; } + /// + /// A collection of inline event types for the resource. The inline event type keys are of type string which represents the + /// name of the event. + /// An example of a valid inline event name is "Contoso.OrderCreated". + /// The inline event type values are of type InlineEventProperties and will contain additional information for every inline + /// event type. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A collection of inline event types for the resource. The inline event type keys are of type string which represents the name of the event. + An example of a valid inline event name is ""Contoso.OrderCreated"". + The inline event type values are of type InlineEventProperties and will contain additional information for every inline event type.", + SerializedName = @"inlineEventTypes", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInlineEventTypes) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInlineEventTypes EventTypeInfoInlineEventType { get; set; } + /// The kind of event type used. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The kind of event type used.", + SerializedName = @"kind", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind? EventTypeInfoKind { get; set; } + /// + /// Expiration time of the channel. If this timer expires while the corresponding partner topic is never activated, + /// the channel and corresponding partner topic are deleted. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Expiration time of the channel. If this timer expires while the corresponding partner topic is never activated, + the channel and corresponding partner topic are deleted.", + SerializedName = @"expirationTimeIfNotActivatedUtc", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ExpirationTimeIfNotActivatedUtc { get; set; } + /// + /// Context or helpful message that can be used during the approval process by the subscriber. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Context or helpful message that can be used during the approval process by the subscriber.", + SerializedName = @"messageForActivation", + PossibleTypes = new [] { typeof(string) })] + string MessageForActivation { get; set; } + /// + /// Azure subscription ID of the subscriber. The partner destination associated with the channel will be + /// created under this Azure subscription. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Azure subscription ID of the subscriber. The partner destination associated with the channel will be + created under this Azure subscription.", + SerializedName = @"azureSubscriptionId", + PossibleTypes = new [] { typeof(string) })] + string PartnerDestinationInfoAzureSubscriptionId { get; set; } + /// Additional context of the partner destination endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Additional context of the partner destination endpoint.", + SerializedName = @"endpointServiceContext", + PossibleTypes = new [] { typeof(string) })] + string PartnerDestinationInfoEndpointServiceContext { get; set; } + /// Type of the endpoint for the partner destination + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Type of the endpoint for the partner destination", + SerializedName = @"endpointType", + PossibleTypes = new [] { typeof(string) })] + string PartnerDestinationInfoEndpointType { get; } + /// Name of the partner destination associated with the channel. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the partner destination associated with the channel.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string PartnerDestinationInfoName { get; set; } + /// + /// Azure Resource Group of the subscriber. The partner destination associated with the channel will be + /// created under this resource group. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Azure Resource Group of the subscriber. The partner destination associated with the channel will be + created under this resource group.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + string PartnerDestinationInfoResourceGroupName { get; set; } + /// Change history of the resource move. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Change history of the resource move.", + SerializedName = @"resourceMoveChangeHistory", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceMoveChangeHistory) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceMoveChangeHistory[] PartnerDestinationInfoResourceMoveChangeHistory { get; set; } + /// + /// Azure subscription ID of the subscriber. The partner topic associated with the channel will be + /// created under this Azure subscription. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Azure subscription ID of the subscriber. The partner topic associated with the channel will be + created under this Azure subscription.", + SerializedName = @"azureSubscriptionId", + PossibleTypes = new [] { typeof(string) })] + string PartnerTopicInfoAzureSubscriptionId { get; set; } + /// Name of the partner topic associated with the channel. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the partner topic associated with the channel.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string PartnerTopicInfoName { get; set; } + /// + /// Azure Resource Group of the subscriber. The partner topic associated with the channel will be + /// created under this resource group. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Azure Resource Group of the subscriber. The partner topic associated with the channel will be + created under this resource group.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + string PartnerTopicInfoResourceGroupName { get; set; } + /// + /// The source information is provided by the publisher to determine the scope or context from which the events + /// are originating. This information can be used by the subscriber during the approval process of the + /// created partner topic. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The source information is provided by the publisher to determine the scope or context from which the events + are originating. This information can be used by the subscriber during the approval process of the + created partner topic.", + SerializedName = @"source", + PossibleTypes = new [] { typeof(string) })] + string PartnerTopicInfoSource { get; set; } + /// Provisioning state of the channel. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Provisioning state of the channel.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ChannelProvisioningState) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ChannelProvisioningState? ProvisioningState { get; set; } + /// The readiness state of the corresponding partner topic. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The readiness state of the corresponding partner topic.", + SerializedName = @"readinessState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ReadinessState) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ReadinessState? ReadinessState { get; set; } + + } + /// Properties of the Channel. + internal partial interface IChannelPropertiesInternal + + { + /// The type of the event channel which represents the direction flow of events. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ChannelType? ChannelType { get; set; } + /// + /// A collection of inline event types for the resource. The inline event type keys are of type string which represents the + /// name of the event. + /// An example of a valid inline event name is "Contoso.OrderCreated". + /// The inline event type values are of type InlineEventProperties and will contain additional information for every inline + /// event type. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInlineEventTypes EventTypeInfoInlineEventType { get; set; } + /// The kind of event type used. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind? EventTypeInfoKind { get; set; } + /// + /// Expiration time of the channel. If this timer expires while the corresponding partner topic is never activated, + /// the channel and corresponding partner topic are deleted. + /// + global::System.DateTime? ExpirationTimeIfNotActivatedUtc { get; set; } + /// + /// Context or helpful message that can be used during the approval process by the subscriber. + /// + string MessageForActivation { get; set; } + /// + /// This property should be populated when channelType is PartnerDestination and represents information about the partner + /// destination resource corresponding to the channel. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfo PartnerDestinationInfo { get; set; } + /// + /// Azure subscription ID of the subscriber. The partner destination associated with the channel will be + /// created under this Azure subscription. + /// + string PartnerDestinationInfoAzureSubscriptionId { get; set; } + /// Additional context of the partner destination endpoint. + string PartnerDestinationInfoEndpointServiceContext { get; set; } + /// Type of the endpoint for the partner destination + string PartnerDestinationInfoEndpointType { get; set; } + /// Name of the partner destination associated with the channel. + string PartnerDestinationInfoName { get; set; } + /// + /// Azure Resource Group of the subscriber. The partner destination associated with the channel will be + /// created under this resource group. + /// + string PartnerDestinationInfoResourceGroupName { get; set; } + /// Change history of the resource move. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceMoveChangeHistory[] PartnerDestinationInfoResourceMoveChangeHistory { get; set; } + /// + /// This property should be populated when channelType is PartnerTopic and represents information about the partner topic + /// resource corresponding to the channel. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInfo PartnerTopicInfo { get; set; } + /// + /// Azure subscription ID of the subscriber. The partner topic associated with the channel will be + /// created under this Azure subscription. + /// + string PartnerTopicInfoAzureSubscriptionId { get; set; } + /// + /// Event Type Information for the partner topic. This information is provided by the publisher and can be used by the + /// subscriber to view different types of events that are published. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfo PartnerTopicInfoEventTypeInfo { get; set; } + /// Name of the partner topic associated with the channel. + string PartnerTopicInfoName { get; set; } + /// + /// Azure Resource Group of the subscriber. The partner topic associated with the channel will be + /// created under this resource group. + /// + string PartnerTopicInfoResourceGroupName { get; set; } + /// + /// The source information is provided by the publisher to determine the scope or context from which the events + /// are originating. This information can be used by the subscriber during the approval process of the + /// created partner topic. + /// + string PartnerTopicInfoSource { get; set; } + /// Provisioning state of the channel. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ChannelProvisioningState? ProvisioningState { get; set; } + /// The readiness state of the corresponding partner topic. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ReadinessState? ReadinessState { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ChannelProperties.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ChannelProperties.json.cs new file mode 100644 index 000000000000..d71cf379fdeb --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ChannelProperties.json.cs @@ -0,0 +1,118 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Properties of the Channel. + public partial class ChannelProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal ChannelProperties(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_partnerTopicInfo = If( json?.PropertyT("partnerTopicInfo"), out var __jsonPartnerTopicInfo) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerTopicInfo.FromJson(__jsonPartnerTopicInfo) : PartnerTopicInfo;} + {_partnerDestinationInfo = If( json?.PropertyT("partnerDestinationInfo"), out var __jsonPartnerDestinationInfo) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerDestinationInfo.FromJson(__jsonPartnerDestinationInfo) : PartnerDestinationInfo;} + {_channelType = If( json?.PropertyT("channelType"), out var __jsonChannelType) ? (string)__jsonChannelType : (string)ChannelType;} + {_messageForActivation = If( json?.PropertyT("messageForActivation"), out var __jsonMessageForActivation) ? (string)__jsonMessageForActivation : (string)MessageForActivation;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} + {_readinessState = If( json?.PropertyT("readinessState"), out var __jsonReadinessState) ? (string)__jsonReadinessState : (string)ReadinessState;} + {_expirationTimeIfNotActivatedUtc = If( json?.PropertyT("expirationTimeIfNotActivatedUtc"), out var __jsonExpirationTimeIfNotActivatedUtc) ? global::System.DateTime.TryParse((string)__jsonExpirationTimeIfNotActivatedUtc, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonExpirationTimeIfNotActivatedUtcValue) ? __jsonExpirationTimeIfNotActivatedUtcValue : ExpirationTimeIfNotActivatedUtc : ExpirationTimeIfNotActivatedUtc;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new ChannelProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._partnerTopicInfo ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._partnerTopicInfo.ToJson(null,serializationMode) : null, "partnerTopicInfo" ,container.Add ); + AddIf( null != this._partnerDestinationInfo ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._partnerDestinationInfo.ToJson(null,serializationMode) : null, "partnerDestinationInfo" ,container.Add ); + AddIf( null != (((object)this._channelType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._channelType.ToString()) : null, "channelType" ,container.Add ); + AddIf( null != (((object)this._messageForActivation)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._messageForActivation.ToString()) : null, "messageForActivation" ,container.Add ); + AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); + AddIf( null != (((object)this._readinessState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._readinessState.ToString()) : null, "readinessState" ,container.Add ); + AddIf( null != this._expirationTimeIfNotActivatedUtc ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._expirationTimeIfNotActivatedUtc?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "expirationTimeIfNotActivatedUtc" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ChannelUpdateParameters.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ChannelUpdateParameters.PowerShell.cs new file mode 100644 index 000000000000..83920ef6b003 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ChannelUpdateParameters.PowerShell.cs @@ -0,0 +1,200 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Properties of the Channel update. + [System.ComponentModel.TypeConverter(typeof(ChannelUpdateParametersTypeConverter))] + public partial class ChannelUpdateParameters + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ChannelUpdateParameters(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ChannelUpdateParametersPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("PartnerDestinationInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersInternal)this).PartnerDestinationInfo = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerUpdateDestinationInfo) content.GetValueForProperty("PartnerDestinationInfo",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersInternal)this).PartnerDestinationInfo, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerUpdateDestinationInfoTypeConverter.ConvertFrom); + } + if (content.Contains("PartnerTopicInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersInternal)this).PartnerTopicInfo = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerUpdateTopicInfo) content.GetValueForProperty("PartnerTopicInfo",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersInternal)this).PartnerTopicInfo, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerUpdateTopicInfoTypeConverter.ConvertFrom); + } + if (content.Contains("ExpirationTimeIfNotActivatedUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersInternal)this).ExpirationTimeIfNotActivatedUtc = (global::System.DateTime?) content.GetValueForProperty("ExpirationTimeIfNotActivatedUtc",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersInternal)this).ExpirationTimeIfNotActivatedUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("PartnerDestinationInfoEndpointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersInternal)this).PartnerDestinationInfoEndpointType = (string) content.GetValueForProperty("PartnerDestinationInfoEndpointType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersInternal)this).PartnerDestinationInfoEndpointType, global::System.Convert.ToString); + } + if (content.Contains("PartnerTopicInfoEventTypeInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersInternal)this).PartnerTopicInfoEventTypeInfo = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfo) content.GetValueForProperty("PartnerTopicInfoEventTypeInfo",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersInternal)this).PartnerTopicInfoEventTypeInfo, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventTypeInfoTypeConverter.ConvertFrom); + } + if (content.Contains("EventTypeInfoKind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersInternal)this).EventTypeInfoKind = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind?) content.GetValueForProperty("EventTypeInfoKind",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersInternal)this).EventTypeInfoKind, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind.CreateFrom); + } + if (content.Contains("EventTypeInfoInlineEventType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersInternal)this).EventTypeInfoInlineEventType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInlineEventTypes) content.GetValueForProperty("EventTypeInfoInlineEventType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersInternal)this).EventTypeInfoInlineEventType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventTypeInfoInlineEventTypesTypeConverter.ConvertFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ChannelUpdateParameters(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ChannelUpdateParametersPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("PartnerDestinationInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersInternal)this).PartnerDestinationInfo = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerUpdateDestinationInfo) content.GetValueForProperty("PartnerDestinationInfo",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersInternal)this).PartnerDestinationInfo, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerUpdateDestinationInfoTypeConverter.ConvertFrom); + } + if (content.Contains("PartnerTopicInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersInternal)this).PartnerTopicInfo = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerUpdateTopicInfo) content.GetValueForProperty("PartnerTopicInfo",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersInternal)this).PartnerTopicInfo, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerUpdateTopicInfoTypeConverter.ConvertFrom); + } + if (content.Contains("ExpirationTimeIfNotActivatedUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersInternal)this).ExpirationTimeIfNotActivatedUtc = (global::System.DateTime?) content.GetValueForProperty("ExpirationTimeIfNotActivatedUtc",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersInternal)this).ExpirationTimeIfNotActivatedUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("PartnerDestinationInfoEndpointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersInternal)this).PartnerDestinationInfoEndpointType = (string) content.GetValueForProperty("PartnerDestinationInfoEndpointType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersInternal)this).PartnerDestinationInfoEndpointType, global::System.Convert.ToString); + } + if (content.Contains("PartnerTopicInfoEventTypeInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersInternal)this).PartnerTopicInfoEventTypeInfo = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfo) content.GetValueForProperty("PartnerTopicInfoEventTypeInfo",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersInternal)this).PartnerTopicInfoEventTypeInfo, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventTypeInfoTypeConverter.ConvertFrom); + } + if (content.Contains("EventTypeInfoKind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersInternal)this).EventTypeInfoKind = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind?) content.GetValueForProperty("EventTypeInfoKind",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersInternal)this).EventTypeInfoKind, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind.CreateFrom); + } + if (content.Contains("EventTypeInfoInlineEventType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersInternal)this).EventTypeInfoInlineEventType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInlineEventTypes) content.GetValueForProperty("EventTypeInfoInlineEventType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersInternal)this).EventTypeInfoInlineEventType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventTypeInfoInlineEventTypesTypeConverter.ConvertFrom); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ChannelUpdateParameters(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ChannelUpdateParameters(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties of the Channel update. + [System.ComponentModel.TypeConverter(typeof(ChannelUpdateParametersTypeConverter))] + public partial interface IChannelUpdateParameters + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ChannelUpdateParameters.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ChannelUpdateParameters.TypeConverter.cs new file mode 100644 index 000000000000..3cf4f94aa161 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ChannelUpdateParameters.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ChannelUpdateParametersTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParameters ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParameters).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ChannelUpdateParameters.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ChannelUpdateParameters.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ChannelUpdateParameters.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ChannelUpdateParameters.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ChannelUpdateParameters.cs new file mode 100644 index 000000000000..823d809c641e --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ChannelUpdateParameters.cs @@ -0,0 +1,157 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Properties of the Channel update. + public partial class ChannelUpdateParameters : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParameters, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersInternal + { + + /// + /// A collection of inline event types for the resource. The inline event type keys are of type string which represents the + /// name of the event. + /// An example of a valid inline event name is "Contoso.OrderCreated". + /// The inline event type values are of type InlineEventProperties and will contain additional information for every inline + /// event type. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInlineEventTypes EventTypeInfoInlineEventType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersPropertiesInternal)Property).EventTypeInfoInlineEventType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersPropertiesInternal)Property).EventTypeInfoInlineEventType = value ?? null /* model class */; } + + /// The kind of event type used. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind? EventTypeInfoKind { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersPropertiesInternal)Property).EventTypeInfoKind; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersPropertiesInternal)Property).EventTypeInfoKind = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind)""); } + + /// + /// Expiration time of the event channel. If this timer expires while the corresponding partner topic or partner destination + /// is never activated, + /// the channel and corresponding partner topic or partner destination are deleted. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public global::System.DateTime? ExpirationTimeIfNotActivatedUtc { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersPropertiesInternal)Property).ExpirationTimeIfNotActivatedUtc; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersPropertiesInternal)Property).ExpirationTimeIfNotActivatedUtc = value ?? default(global::System.DateTime); } + + /// Internal Acessors for PartnerDestinationInfo + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerUpdateDestinationInfo Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersInternal.PartnerDestinationInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersPropertiesInternal)Property).PartnerDestinationInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersPropertiesInternal)Property).PartnerDestinationInfo = value; } + + /// Internal Acessors for PartnerDestinationInfoEndpointType + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersInternal.PartnerDestinationInfoEndpointType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersPropertiesInternal)Property).PartnerDestinationInfoEndpointType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersPropertiesInternal)Property).PartnerDestinationInfoEndpointType = value; } + + /// Internal Acessors for PartnerTopicInfo + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerUpdateTopicInfo Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersInternal.PartnerTopicInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersPropertiesInternal)Property).PartnerTopicInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersPropertiesInternal)Property).PartnerTopicInfo = value; } + + /// Internal Acessors for PartnerTopicInfoEventTypeInfo + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfo Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersInternal.PartnerTopicInfoEventTypeInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersPropertiesInternal)Property).PartnerTopicInfoEventTypeInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersPropertiesInternal)Property).PartnerTopicInfoEventTypeInfo = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersProperties Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ChannelUpdateParametersProperties()); set { {_property = value;} } } + + /// Type of the endpoint for the partner destination + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string PartnerDestinationInfoEndpointType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersPropertiesInternal)Property).PartnerDestinationInfoEndpointType; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersProperties _property; + + /// Properties of the channel update parameters. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ChannelUpdateParametersProperties()); set => this._property = value; } + + /// Creates an new instance. + public ChannelUpdateParameters() + { + + } + } + /// Properties of the Channel update. + public partial interface IChannelUpdateParameters : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// + /// A collection of inline event types for the resource. The inline event type keys are of type string which represents the + /// name of the event. + /// An example of a valid inline event name is "Contoso.OrderCreated". + /// The inline event type values are of type InlineEventProperties and will contain additional information for every inline + /// event type. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A collection of inline event types for the resource. The inline event type keys are of type string which represents the name of the event. + An example of a valid inline event name is ""Contoso.OrderCreated"". + The inline event type values are of type InlineEventProperties and will contain additional information for every inline event type.", + SerializedName = @"inlineEventTypes", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInlineEventTypes) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInlineEventTypes EventTypeInfoInlineEventType { get; set; } + /// The kind of event type used. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The kind of event type used.", + SerializedName = @"kind", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind? EventTypeInfoKind { get; set; } + /// + /// Expiration time of the event channel. If this timer expires while the corresponding partner topic or partner destination + /// is never activated, + /// the channel and corresponding partner topic or partner destination are deleted. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Expiration time of the event channel. If this timer expires while the corresponding partner topic or partner destination is never activated, + the channel and corresponding partner topic or partner destination are deleted.", + SerializedName = @"expirationTimeIfNotActivatedUtc", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ExpirationTimeIfNotActivatedUtc { get; set; } + /// Type of the endpoint for the partner destination + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Type of the endpoint for the partner destination", + SerializedName = @"endpointType", + PossibleTypes = new [] { typeof(string) })] + string PartnerDestinationInfoEndpointType { get; } + + } + /// Properties of the Channel update. + internal partial interface IChannelUpdateParametersInternal + + { + /// + /// A collection of inline event types for the resource. The inline event type keys are of type string which represents the + /// name of the event. + /// An example of a valid inline event name is "Contoso.OrderCreated". + /// The inline event type values are of type InlineEventProperties and will contain additional information for every inline + /// event type. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInlineEventTypes EventTypeInfoInlineEventType { get; set; } + /// The kind of event type used. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind? EventTypeInfoKind { get; set; } + /// + /// Expiration time of the event channel. If this timer expires while the corresponding partner topic or partner destination + /// is never activated, + /// the channel and corresponding partner topic or partner destination are deleted. + /// + global::System.DateTime? ExpirationTimeIfNotActivatedUtc { get; set; } + /// + /// Partner destination properties which can be updated if the channel is of type PartnerDestination. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerUpdateDestinationInfo PartnerDestinationInfo { get; set; } + /// Type of the endpoint for the partner destination + string PartnerDestinationInfoEndpointType { get; set; } + /// + /// Partner topic properties which can be updated if the channel is of type PartnerTopic. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerUpdateTopicInfo PartnerTopicInfo { get; set; } + /// Event type info for the partner topic + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfo PartnerTopicInfoEventTypeInfo { get; set; } + /// Properties of the channel update parameters. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersProperties Property { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ChannelUpdateParameters.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ChannelUpdateParameters.json.cs new file mode 100644 index 000000000000..d2fe10914bfb --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ChannelUpdateParameters.json.cs @@ -0,0 +1,106 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Properties of the Channel update. + public partial class ChannelUpdateParameters + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal ChannelUpdateParameters(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ChannelUpdateParametersProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParameters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParameters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new ChannelUpdateParameters(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ChannelUpdateParametersProperties.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ChannelUpdateParametersProperties.PowerShell.cs new file mode 100644 index 000000000000..528bc250597f --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ChannelUpdateParametersProperties.PowerShell.cs @@ -0,0 +1,192 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Properties of the channel update parameters. + [System.ComponentModel.TypeConverter(typeof(ChannelUpdateParametersPropertiesTypeConverter))] + public partial class ChannelUpdateParametersProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ChannelUpdateParametersProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("PartnerDestinationInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersPropertiesInternal)this).PartnerDestinationInfo = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerUpdateDestinationInfo) content.GetValueForProperty("PartnerDestinationInfo",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersPropertiesInternal)this).PartnerDestinationInfo, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerUpdateDestinationInfoTypeConverter.ConvertFrom); + } + if (content.Contains("PartnerTopicInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersPropertiesInternal)this).PartnerTopicInfo = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerUpdateTopicInfo) content.GetValueForProperty("PartnerTopicInfo",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersPropertiesInternal)this).PartnerTopicInfo, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerUpdateTopicInfoTypeConverter.ConvertFrom); + } + if (content.Contains("ExpirationTimeIfNotActivatedUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersPropertiesInternal)this).ExpirationTimeIfNotActivatedUtc = (global::System.DateTime?) content.GetValueForProperty("ExpirationTimeIfNotActivatedUtc",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersPropertiesInternal)this).ExpirationTimeIfNotActivatedUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("PartnerDestinationInfoEndpointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersPropertiesInternal)this).PartnerDestinationInfoEndpointType = (string) content.GetValueForProperty("PartnerDestinationInfoEndpointType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersPropertiesInternal)this).PartnerDestinationInfoEndpointType, global::System.Convert.ToString); + } + if (content.Contains("PartnerTopicInfoEventTypeInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersPropertiesInternal)this).PartnerTopicInfoEventTypeInfo = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfo) content.GetValueForProperty("PartnerTopicInfoEventTypeInfo",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersPropertiesInternal)this).PartnerTopicInfoEventTypeInfo, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventTypeInfoTypeConverter.ConvertFrom); + } + if (content.Contains("EventTypeInfoKind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersPropertiesInternal)this).EventTypeInfoKind = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind?) content.GetValueForProperty("EventTypeInfoKind",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersPropertiesInternal)this).EventTypeInfoKind, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind.CreateFrom); + } + if (content.Contains("EventTypeInfoInlineEventType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersPropertiesInternal)this).EventTypeInfoInlineEventType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInlineEventTypes) content.GetValueForProperty("EventTypeInfoInlineEventType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersPropertiesInternal)this).EventTypeInfoInlineEventType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventTypeInfoInlineEventTypesTypeConverter.ConvertFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ChannelUpdateParametersProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("PartnerDestinationInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersPropertiesInternal)this).PartnerDestinationInfo = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerUpdateDestinationInfo) content.GetValueForProperty("PartnerDestinationInfo",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersPropertiesInternal)this).PartnerDestinationInfo, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerUpdateDestinationInfoTypeConverter.ConvertFrom); + } + if (content.Contains("PartnerTopicInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersPropertiesInternal)this).PartnerTopicInfo = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerUpdateTopicInfo) content.GetValueForProperty("PartnerTopicInfo",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersPropertiesInternal)this).PartnerTopicInfo, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerUpdateTopicInfoTypeConverter.ConvertFrom); + } + if (content.Contains("ExpirationTimeIfNotActivatedUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersPropertiesInternal)this).ExpirationTimeIfNotActivatedUtc = (global::System.DateTime?) content.GetValueForProperty("ExpirationTimeIfNotActivatedUtc",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersPropertiesInternal)this).ExpirationTimeIfNotActivatedUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("PartnerDestinationInfoEndpointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersPropertiesInternal)this).PartnerDestinationInfoEndpointType = (string) content.GetValueForProperty("PartnerDestinationInfoEndpointType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersPropertiesInternal)this).PartnerDestinationInfoEndpointType, global::System.Convert.ToString); + } + if (content.Contains("PartnerTopicInfoEventTypeInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersPropertiesInternal)this).PartnerTopicInfoEventTypeInfo = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfo) content.GetValueForProperty("PartnerTopicInfoEventTypeInfo",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersPropertiesInternal)this).PartnerTopicInfoEventTypeInfo, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventTypeInfoTypeConverter.ConvertFrom); + } + if (content.Contains("EventTypeInfoKind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersPropertiesInternal)this).EventTypeInfoKind = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind?) content.GetValueForProperty("EventTypeInfoKind",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersPropertiesInternal)this).EventTypeInfoKind, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind.CreateFrom); + } + if (content.Contains("EventTypeInfoInlineEventType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersPropertiesInternal)this).EventTypeInfoInlineEventType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInlineEventTypes) content.GetValueForProperty("EventTypeInfoInlineEventType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersPropertiesInternal)this).EventTypeInfoInlineEventType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventTypeInfoInlineEventTypesTypeConverter.ConvertFrom); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ChannelUpdateParametersProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ChannelUpdateParametersProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties of the channel update parameters. + [System.ComponentModel.TypeConverter(typeof(ChannelUpdateParametersPropertiesTypeConverter))] + public partial interface IChannelUpdateParametersProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ChannelUpdateParametersProperties.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ChannelUpdateParametersProperties.TypeConverter.cs new file mode 100644 index 000000000000..21beadd618b1 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ChannelUpdateParametersProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ChannelUpdateParametersPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ChannelUpdateParametersProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ChannelUpdateParametersProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ChannelUpdateParametersProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ChannelUpdateParametersProperties.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ChannelUpdateParametersProperties.cs new file mode 100644 index 000000000000..2f49aac0920f --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ChannelUpdateParametersProperties.cs @@ -0,0 +1,166 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Properties of the channel update parameters. + public partial class ChannelUpdateParametersProperties : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersProperties, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersPropertiesInternal + { + + /// + /// A collection of inline event types for the resource. The inline event type keys are of type string which represents the + /// name of the event. + /// An example of a valid inline event name is "Contoso.OrderCreated". + /// The inline event type values are of type InlineEventProperties and will contain additional information for every inline + /// event type. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInlineEventTypes EventTypeInfoInlineEventType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerUpdateTopicInfoInternal)PartnerTopicInfo).EventTypeInfoInlineEventType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerUpdateTopicInfoInternal)PartnerTopicInfo).EventTypeInfoInlineEventType = value ?? null /* model class */; } + + /// The kind of event type used. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind? EventTypeInfoKind { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerUpdateTopicInfoInternal)PartnerTopicInfo).EventTypeInfoKind; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerUpdateTopicInfoInternal)PartnerTopicInfo).EventTypeInfoKind = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind)""); } + + /// Backing field for property. + private global::System.DateTime? _expirationTimeIfNotActivatedUtc; + + /// + /// Expiration time of the event channel. If this timer expires while the corresponding partner topic or partner destination + /// is never activated, + /// the channel and corresponding partner topic or partner destination are deleted. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public global::System.DateTime? ExpirationTimeIfNotActivatedUtc { get => this._expirationTimeIfNotActivatedUtc; set => this._expirationTimeIfNotActivatedUtc = value; } + + /// Internal Acessors for PartnerDestinationInfo + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerUpdateDestinationInfo Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersPropertiesInternal.PartnerDestinationInfo { get => (this._partnerDestinationInfo = this._partnerDestinationInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerUpdateDestinationInfo()); set { {_partnerDestinationInfo = value;} } } + + /// Internal Acessors for PartnerDestinationInfoEndpointType + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersPropertiesInternal.PartnerDestinationInfoEndpointType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerUpdateDestinationInfoInternal)PartnerDestinationInfo).EndpointType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerUpdateDestinationInfoInternal)PartnerDestinationInfo).EndpointType = value; } + + /// Internal Acessors for PartnerTopicInfo + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerUpdateTopicInfo Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersPropertiesInternal.PartnerTopicInfo { get => (this._partnerTopicInfo = this._partnerTopicInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerUpdateTopicInfo()); set { {_partnerTopicInfo = value;} } } + + /// Internal Acessors for PartnerTopicInfoEventTypeInfo + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfo Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersPropertiesInternal.PartnerTopicInfoEventTypeInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerUpdateTopicInfoInternal)PartnerTopicInfo).EventTypeInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerUpdateTopicInfoInternal)PartnerTopicInfo).EventTypeInfo = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerUpdateDestinationInfo _partnerDestinationInfo; + + /// + /// Partner destination properties which can be updated if the channel is of type PartnerDestination. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerUpdateDestinationInfo PartnerDestinationInfo { get => (this._partnerDestinationInfo = this._partnerDestinationInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerUpdateDestinationInfo()); set => this._partnerDestinationInfo = value; } + + /// Type of the endpoint for the partner destination + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string PartnerDestinationInfoEndpointType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerUpdateDestinationInfoInternal)PartnerDestinationInfo).EndpointType; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerUpdateTopicInfo _partnerTopicInfo; + + /// + /// Partner topic properties which can be updated if the channel is of type PartnerTopic. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerUpdateTopicInfo PartnerTopicInfo { get => (this._partnerTopicInfo = this._partnerTopicInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerUpdateTopicInfo()); set => this._partnerTopicInfo = value; } + + /// Creates an new instance. + public ChannelUpdateParametersProperties() + { + + } + } + /// Properties of the channel update parameters. + public partial interface IChannelUpdateParametersProperties : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// + /// A collection of inline event types for the resource. The inline event type keys are of type string which represents the + /// name of the event. + /// An example of a valid inline event name is "Contoso.OrderCreated". + /// The inline event type values are of type InlineEventProperties and will contain additional information for every inline + /// event type. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A collection of inline event types for the resource. The inline event type keys are of type string which represents the name of the event. + An example of a valid inline event name is ""Contoso.OrderCreated"". + The inline event type values are of type InlineEventProperties and will contain additional information for every inline event type.", + SerializedName = @"inlineEventTypes", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInlineEventTypes) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInlineEventTypes EventTypeInfoInlineEventType { get; set; } + /// The kind of event type used. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The kind of event type used.", + SerializedName = @"kind", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind? EventTypeInfoKind { get; set; } + /// + /// Expiration time of the event channel. If this timer expires while the corresponding partner topic or partner destination + /// is never activated, + /// the channel and corresponding partner topic or partner destination are deleted. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Expiration time of the event channel. If this timer expires while the corresponding partner topic or partner destination is never activated, + the channel and corresponding partner topic or partner destination are deleted.", + SerializedName = @"expirationTimeIfNotActivatedUtc", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ExpirationTimeIfNotActivatedUtc { get; set; } + /// Type of the endpoint for the partner destination + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Type of the endpoint for the partner destination", + SerializedName = @"endpointType", + PossibleTypes = new [] { typeof(string) })] + string PartnerDestinationInfoEndpointType { get; } + + } + /// Properties of the channel update parameters. + internal partial interface IChannelUpdateParametersPropertiesInternal + + { + /// + /// A collection of inline event types for the resource. The inline event type keys are of type string which represents the + /// name of the event. + /// An example of a valid inline event name is "Contoso.OrderCreated". + /// The inline event type values are of type InlineEventProperties and will contain additional information for every inline + /// event type. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInlineEventTypes EventTypeInfoInlineEventType { get; set; } + /// The kind of event type used. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind? EventTypeInfoKind { get; set; } + /// + /// Expiration time of the event channel. If this timer expires while the corresponding partner topic or partner destination + /// is never activated, + /// the channel and corresponding partner topic or partner destination are deleted. + /// + global::System.DateTime? ExpirationTimeIfNotActivatedUtc { get; set; } + /// + /// Partner destination properties which can be updated if the channel is of type PartnerDestination. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerUpdateDestinationInfo PartnerDestinationInfo { get; set; } + /// Type of the endpoint for the partner destination + string PartnerDestinationInfoEndpointType { get; set; } + /// + /// Partner topic properties which can be updated if the channel is of type PartnerTopic. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerUpdateTopicInfo PartnerTopicInfo { get; set; } + /// Event type info for the partner topic + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfo PartnerTopicInfoEventTypeInfo { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ChannelUpdateParametersProperties.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ChannelUpdateParametersProperties.json.cs new file mode 100644 index 000000000000..f454ffc770c7 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ChannelUpdateParametersProperties.json.cs @@ -0,0 +1,110 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Properties of the channel update parameters. + public partial class ChannelUpdateParametersProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal ChannelUpdateParametersProperties(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_partnerDestinationInfo = If( json?.PropertyT("partnerDestinationInfo"), out var __jsonPartnerDestinationInfo) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerUpdateDestinationInfo.FromJson(__jsonPartnerDestinationInfo) : PartnerDestinationInfo;} + {_partnerTopicInfo = If( json?.PropertyT("partnerTopicInfo"), out var __jsonPartnerTopicInfo) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerUpdateTopicInfo.FromJson(__jsonPartnerTopicInfo) : PartnerTopicInfo;} + {_expirationTimeIfNotActivatedUtc = If( json?.PropertyT("expirationTimeIfNotActivatedUtc"), out var __jsonExpirationTimeIfNotActivatedUtc) ? global::System.DateTime.TryParse((string)__jsonExpirationTimeIfNotActivatedUtc, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonExpirationTimeIfNotActivatedUtcValue) ? __jsonExpirationTimeIfNotActivatedUtcValue : ExpirationTimeIfNotActivatedUtc : ExpirationTimeIfNotActivatedUtc;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParametersProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new ChannelUpdateParametersProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._partnerDestinationInfo ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._partnerDestinationInfo.ToJson(null,serializationMode) : null, "partnerDestinationInfo" ,container.Add ); + AddIf( null != this._partnerTopicInfo ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._partnerTopicInfo.ToJson(null,serializationMode) : null, "partnerTopicInfo" ,container.Add ); + AddIf( null != this._expirationTimeIfNotActivatedUtc ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._expirationTimeIfNotActivatedUtc?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "expirationTimeIfNotActivatedUtc" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ChannelsListResult.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ChannelsListResult.PowerShell.cs new file mode 100644 index 000000000000..45b38ed23de0 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ChannelsListResult.PowerShell.cs @@ -0,0 +1,152 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Result of the List Channels operation + [System.ComponentModel.TypeConverter(typeof(ChannelsListResultTypeConverter))] + public partial class ChannelsListResult + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ChannelsListResult(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelsListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannel[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelsListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ChannelTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelsListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelsListResultInternal)this).NextLink, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ChannelsListResult(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelsListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannel[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelsListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ChannelTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelsListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelsListResultInternal)this).NextLink, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelsListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ChannelsListResult(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelsListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ChannelsListResult(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelsListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Result of the List Channels operation + [System.ComponentModel.TypeConverter(typeof(ChannelsListResultTypeConverter))] + public partial interface IChannelsListResult + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ChannelsListResult.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ChannelsListResult.TypeConverter.cs new file mode 100644 index 000000000000..e51dbf0cb9ab --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ChannelsListResult.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ChannelsListResultTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelsListResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelsListResult).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ChannelsListResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ChannelsListResult.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ChannelsListResult.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ChannelsListResult.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ChannelsListResult.cs new file mode 100644 index 000000000000..cd664af7181d --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ChannelsListResult.cs @@ -0,0 +1,68 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Result of the List Channels operation + public partial class ChannelsListResult : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelsListResult, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelsListResultInternal + { + + /// Backing field for property. + private string _nextLink; + + /// A link for the next page of channels. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannel[] _value; + + /// A collection of Channels. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannel[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public ChannelsListResult() + { + + } + } + /// Result of the List Channels operation + public partial interface IChannelsListResult : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// A link for the next page of channels. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A link for the next page of channels.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// A collection of Channels. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A collection of Channels.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannel) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannel[] Value { get; set; } + + } + /// Result of the List Channels operation + internal partial interface IChannelsListResultInternal + + { + /// A link for the next page of channels. + string NextLink { get; set; } + /// A collection of Channels. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannel[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ChannelsListResult.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ChannelsListResult.json.cs new file mode 100644 index 000000000000..a241b831ed5b --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ChannelsListResult.json.cs @@ -0,0 +1,116 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Result of the List Channels operation + public partial class ChannelsListResult + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal ChannelsListResult(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannel) (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.Channel.FromJson(__u) )) ))() : null : Value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelsListResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelsListResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelsListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new ChannelsListResult(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ConnectionState.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ConnectionState.PowerShell.cs new file mode 100644 index 000000000000..a92c2f3c33f1 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ConnectionState.PowerShell.cs @@ -0,0 +1,158 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// ConnectionState information. + [System.ComponentModel.TypeConverter(typeof(ConnectionStateTypeConverter))] + public partial class ConnectionState + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ConnectionState(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IConnectionStateInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PersistedConnectionStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IConnectionStateInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PersistedConnectionStatus.CreateFrom); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IConnectionStateInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IConnectionStateInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("ActionsRequired")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IConnectionStateInternal)this).ActionsRequired = (string) content.GetValueForProperty("ActionsRequired",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IConnectionStateInternal)this).ActionsRequired, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ConnectionState(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IConnectionStateInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PersistedConnectionStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IConnectionStateInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PersistedConnectionStatus.CreateFrom); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IConnectionStateInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IConnectionStateInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("ActionsRequired")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IConnectionStateInternal)this).ActionsRequired = (string) content.GetValueForProperty("ActionsRequired",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IConnectionStateInternal)this).ActionsRequired, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IConnectionState DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ConnectionState(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IConnectionState DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ConnectionState(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IConnectionState FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// ConnectionState information. + [System.ComponentModel.TypeConverter(typeof(ConnectionStateTypeConverter))] + public partial interface IConnectionState + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ConnectionState.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ConnectionState.TypeConverter.cs new file mode 100644 index 000000000000..778dae4cb2e8 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ConnectionState.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ConnectionStateTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IConnectionState ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IConnectionState).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ConnectionState.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ConnectionState.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ConnectionState.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ConnectionState.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ConnectionState.cs new file mode 100644 index 000000000000..6f717227aca7 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ConnectionState.cs @@ -0,0 +1,85 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// ConnectionState information. + public partial class ConnectionState : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IConnectionState, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IConnectionStateInternal + { + + /// Backing field for property. + private string _actionsRequired; + + /// Actions required (if any). + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string ActionsRequired { get => this._actionsRequired; set => this._actionsRequired = value; } + + /// Backing field for property. + private string _description; + + /// Description of the connection state. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string Description { get => this._description; set => this._description = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PersistedConnectionStatus? _status; + + /// Status of the connection. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PersistedConnectionStatus? Status { get => this._status; set => this._status = value; } + + /// Creates an new instance. + public ConnectionState() + { + + } + } + /// ConnectionState information. + public partial interface IConnectionState : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// Actions required (if any). + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Actions required (if any).", + SerializedName = @"actionsRequired", + PossibleTypes = new [] { typeof(string) })] + string ActionsRequired { get; set; } + /// Description of the connection state. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Description of the connection state.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// Status of the connection. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Status of the connection.", + SerializedName = @"status", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PersistedConnectionStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PersistedConnectionStatus? Status { get; set; } + + } + /// ConnectionState information. + internal partial interface IConnectionStateInternal + + { + /// Actions required (if any). + string ActionsRequired { get; set; } + /// Description of the connection state. + string Description { get; set; } + /// Status of the connection. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PersistedConnectionStatus? Status { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ConnectionState.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ConnectionState.json.cs new file mode 100644 index 000000000000..b4672f21139c --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ConnectionState.json.cs @@ -0,0 +1,110 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// ConnectionState information. + public partial class ConnectionState + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal ConnectionState(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} + {_actionsRequired = If( json?.PropertyT("actionsRequired"), out var __jsonActionsRequired) ? (string)__jsonActionsRequired : (string)ActionsRequired;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IConnectionState. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IConnectionState. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IConnectionState FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new ConnectionState(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._status)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._status.ToString()) : null, "status" ,container.Add ); + AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._description.ToString()) : null, "description" ,container.Add ); + AddIf( null != (((object)this._actionsRequired)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._actionsRequired.ToString()) : null, "actionsRequired" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DeadLetterDestination.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DeadLetterDestination.PowerShell.cs new file mode 100644 index 000000000000..e66b8c7623b2 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DeadLetterDestination.PowerShell.cs @@ -0,0 +1,150 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// Information about the dead letter destination for an event subscription. To configure a deadletter destination, do not + /// directly instantiate an object of this class. Instead, instantiate an object of a derived class. Currently, StorageBlobDeadLetterDestination + /// is the only class that derives from this class. + /// + [System.ComponentModel.TypeConverter(typeof(DeadLetterDestinationTypeConverter))] + public partial class DeadLetterDestination + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal DeadLetterDestination(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("EndpointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterDestinationInternal)this).EndpointType = (string) content.GetValueForProperty("EndpointType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterDestinationInternal)this).EndpointType, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal DeadLetterDestination(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("EndpointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterDestinationInternal)this).EndpointType = (string) content.GetValueForProperty("EndpointType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterDestinationInternal)this).EndpointType, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterDestination DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DeadLetterDestination(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterDestination DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DeadLetterDestination(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterDestination FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Information about the dead letter destination for an event subscription. To configure a deadletter destination, do not + /// directly instantiate an object of this class. Instead, instantiate an object of a derived class. Currently, StorageBlobDeadLetterDestination + /// is the only class that derives from this class. + [System.ComponentModel.TypeConverter(typeof(DeadLetterDestinationTypeConverter))] + public partial interface IDeadLetterDestination + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DeadLetterDestination.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DeadLetterDestination.TypeConverter.cs new file mode 100644 index 000000000000..1ca27688f4ab --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DeadLetterDestination.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DeadLetterDestinationTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterDestination ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterDestination).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DeadLetterDestination.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DeadLetterDestination.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DeadLetterDestination.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DeadLetterDestination.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DeadLetterDestination.cs new file mode 100644 index 000000000000..1438d0faee95 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DeadLetterDestination.cs @@ -0,0 +1,62 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// + /// Information about the dead letter destination for an event subscription. To configure a deadletter destination, do not + /// directly instantiate an object of this class. Instead, instantiate an object of a derived class. Currently, StorageBlobDeadLetterDestination + /// is the only class that derives from this class. + /// + public partial class DeadLetterDestination : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterDestination, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterDestinationInternal + { + + /// Backing field for property. + private string _endpointType= @"StorageBlob"; + + /// Type of the endpoint for the dead letter destination + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string EndpointType { get => this._endpointType; } + + /// Internal Acessors for EndpointType + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterDestinationInternal.EndpointType { get => this._endpointType; set { {_endpointType = value;} } } + + /// Creates an new instance. + public DeadLetterDestination() + { + + } + } + /// Information about the dead letter destination for an event subscription. To configure a deadletter destination, do not + /// directly instantiate an object of this class. Instead, instantiate an object of a derived class. Currently, StorageBlobDeadLetterDestination + /// is the only class that derives from this class. + public partial interface IDeadLetterDestination : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// Type of the endpoint for the dead letter destination + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = true, + Description = @"Type of the endpoint for the dead letter destination", + SerializedName = @"endpointType", + PossibleTypes = new [] { typeof(string) })] + string EndpointType { get; } + + } + /// Information about the dead letter destination for an event subscription. To configure a deadletter destination, do not + /// directly instantiate an object of this class. Instead, instantiate an object of a derived class. Currently, StorageBlobDeadLetterDestination + /// is the only class that derives from this class. + internal partial interface IDeadLetterDestinationInternal + + { + /// Type of the endpoint for the dead letter destination + string EndpointType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DeadLetterDestination.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DeadLetterDestination.json.cs new file mode 100644 index 000000000000..15028b16370b --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DeadLetterDestination.json.cs @@ -0,0 +1,125 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// + /// Information about the dead letter destination for an event subscription. To configure a deadletter destination, do not + /// directly instantiate an object of this class. Instead, instantiate an object of a derived class. Currently, StorageBlobDeadLetterDestination + /// is the only class that derives from this class. + /// + public partial class DeadLetterDestination + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal DeadLetterDestination(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_endpointType = If( json?.PropertyT("endpointType"), out var __jsonEndpointType) ? (string)__jsonEndpointType : (string)EndpointType;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterDestination. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterDestination interface is polymorphic, + /// and the precise model class that will get deserialized is determined at runtime based on the payload. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterDestination. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterDestination FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + if (!(node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json)) + { + return null; + } + // Polymorphic type -- select the appropriate constructor using the discriminator + + switch ( json.StringProperty("endpointType") ) + { + case "StorageBlob": + { + return new StorageBlobDeadLetterDestination(json); + } + } + return new DeadLetterDestination(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._endpointType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._endpointType.ToString()) : null, "endpointType" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DeadLetterWithResourceIdentity.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DeadLetterWithResourceIdentity.PowerShell.cs new file mode 100644 index 000000000000..1374c770bf5d --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DeadLetterWithResourceIdentity.PowerShell.cs @@ -0,0 +1,176 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Information about the deadletter destination with resource identity. + [System.ComponentModel.TypeConverter(typeof(DeadLetterWithResourceIdentityTypeConverter))] + public partial class DeadLetterWithResourceIdentity + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal DeadLetterWithResourceIdentity(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Identity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterWithResourceIdentityInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionIdentity) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterWithResourceIdentityInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionIdentityTypeConverter.ConvertFrom); + } + if (content.Contains("DeadLetterDestination")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterWithResourceIdentityInternal)this).DeadLetterDestination = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterDestination) content.GetValueForProperty("DeadLetterDestination",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterWithResourceIdentityInternal)this).DeadLetterDestination, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeadLetterDestinationTypeConverter.ConvertFrom); + } + if (content.Contains("IdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterWithResourceIdentityInternal)this).IdentityType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType?) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterWithResourceIdentityInternal)this).IdentityType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType.CreateFrom); + } + if (content.Contains("IdentityUserAssignedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterWithResourceIdentityInternal)this).IdentityUserAssignedIdentity = (string) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterWithResourceIdentityInternal)this).IdentityUserAssignedIdentity, global::System.Convert.ToString); + } + if (content.Contains("DeadLetterDestinationEndpointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterWithResourceIdentityInternal)this).DeadLetterDestinationEndpointType = (string) content.GetValueForProperty("DeadLetterDestinationEndpointType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterWithResourceIdentityInternal)this).DeadLetterDestinationEndpointType, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal DeadLetterWithResourceIdentity(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Identity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterWithResourceIdentityInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionIdentity) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterWithResourceIdentityInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionIdentityTypeConverter.ConvertFrom); + } + if (content.Contains("DeadLetterDestination")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterWithResourceIdentityInternal)this).DeadLetterDestination = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterDestination) content.GetValueForProperty("DeadLetterDestination",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterWithResourceIdentityInternal)this).DeadLetterDestination, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeadLetterDestinationTypeConverter.ConvertFrom); + } + if (content.Contains("IdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterWithResourceIdentityInternal)this).IdentityType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType?) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterWithResourceIdentityInternal)this).IdentityType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType.CreateFrom); + } + if (content.Contains("IdentityUserAssignedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterWithResourceIdentityInternal)this).IdentityUserAssignedIdentity = (string) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterWithResourceIdentityInternal)this).IdentityUserAssignedIdentity, global::System.Convert.ToString); + } + if (content.Contains("DeadLetterDestinationEndpointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterWithResourceIdentityInternal)this).DeadLetterDestinationEndpointType = (string) content.GetValueForProperty("DeadLetterDestinationEndpointType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterWithResourceIdentityInternal)this).DeadLetterDestinationEndpointType, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterWithResourceIdentity DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DeadLetterWithResourceIdentity(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterWithResourceIdentity DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DeadLetterWithResourceIdentity(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterWithResourceIdentity FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Information about the deadletter destination with resource identity. + [System.ComponentModel.TypeConverter(typeof(DeadLetterWithResourceIdentityTypeConverter))] + public partial interface IDeadLetterWithResourceIdentity + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DeadLetterWithResourceIdentity.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DeadLetterWithResourceIdentity.TypeConverter.cs new file mode 100644 index 000000000000..5c9c14dfea28 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DeadLetterWithResourceIdentity.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DeadLetterWithResourceIdentityTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterWithResourceIdentity ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterWithResourceIdentity).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DeadLetterWithResourceIdentity.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DeadLetterWithResourceIdentity.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DeadLetterWithResourceIdentity.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DeadLetterWithResourceIdentity.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DeadLetterWithResourceIdentity.cs new file mode 100644 index 000000000000..8eaa6fa6e2f0 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DeadLetterWithResourceIdentity.cs @@ -0,0 +1,120 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Information about the deadletter destination with resource identity. + public partial class DeadLetterWithResourceIdentity : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterWithResourceIdentity, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterWithResourceIdentityInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterDestination _deadLetterDestination; + + /// + /// Information about the destination where events have to be delivered for the event subscription. + /// Uses the managed identity setup on the parent resource (namely, topic or domain) to acquire the authentication tokens + /// being used during delivery / dead-lettering. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterDestination DeadLetterDestination { get => (this._deadLetterDestination = this._deadLetterDestination ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeadLetterDestination()); set => this._deadLetterDestination = value; } + + /// Type of the endpoint for the dead letter destination + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string DeadLetterDestinationEndpointType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterDestinationInternal)DeadLetterDestination).EndpointType; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionIdentity _identity; + + /// The identity to use when dead-lettering events. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionIdentity Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionIdentity()); set => this._identity = value; } + + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType? IdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionIdentityInternal)Identity).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionIdentityInternal)Identity).Type = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType)""); } + + /// The user identity associated with the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionIdentityInternal)Identity).UserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionIdentityInternal)Identity).UserAssignedIdentity = value ?? null; } + + /// Internal Acessors for DeadLetterDestination + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterDestination Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterWithResourceIdentityInternal.DeadLetterDestination { get => (this._deadLetterDestination = this._deadLetterDestination ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeadLetterDestination()); set { {_deadLetterDestination = value;} } } + + /// Internal Acessors for DeadLetterDestinationEndpointType + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterWithResourceIdentityInternal.DeadLetterDestinationEndpointType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterDestinationInternal)DeadLetterDestination).EndpointType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterDestinationInternal)DeadLetterDestination).EndpointType = value; } + + /// Internal Acessors for Identity + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionIdentity Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterWithResourceIdentityInternal.Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionIdentity()); set { {_identity = value;} } } + + /// Creates an new instance. + public DeadLetterWithResourceIdentity() + { + + } + } + /// Information about the deadletter destination with resource identity. + public partial interface IDeadLetterWithResourceIdentity : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// Type of the endpoint for the dead letter destination + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Type of the endpoint for the dead letter destination", + SerializedName = @"endpointType", + PossibleTypes = new [] { typeof(string) })] + string DeadLetterDestinationEndpointType { get; } + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType? IdentityType { get; set; } + /// The user identity associated with the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The user identity associated with the resource.", + SerializedName = @"userAssignedIdentity", + PossibleTypes = new [] { typeof(string) })] + string IdentityUserAssignedIdentity { get; set; } + + } + /// Information about the deadletter destination with resource identity. + internal partial interface IDeadLetterWithResourceIdentityInternal + + { + /// + /// Information about the destination where events have to be delivered for the event subscription. + /// Uses the managed identity setup on the parent resource (namely, topic or domain) to acquire the authentication tokens + /// being used during delivery / dead-lettering. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterDestination DeadLetterDestination { get; set; } + /// Type of the endpoint for the dead letter destination + string DeadLetterDestinationEndpointType { get; set; } + /// The identity to use when dead-lettering events. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionIdentity Identity { get; set; } + /// + /// 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. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType? IdentityType { get; set; } + /// The user identity associated with the resource. + string IdentityUserAssignedIdentity { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DeadLetterWithResourceIdentity.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DeadLetterWithResourceIdentity.json.cs new file mode 100644 index 000000000000..ca9b8ba539f0 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DeadLetterWithResourceIdentity.json.cs @@ -0,0 +1,108 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Information about the deadletter destination with resource identity. + public partial class DeadLetterWithResourceIdentity + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal DeadLetterWithResourceIdentity(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_identity = If( json?.PropertyT("identity"), out var __jsonIdentity) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionIdentity.FromJson(__jsonIdentity) : Identity;} + {_deadLetterDestination = If( json?.PropertyT("deadLetterDestination"), out var __jsonDeadLetterDestination) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeadLetterDestination.FromJson(__jsonDeadLetterDestination) : DeadLetterDestination;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterWithResourceIdentity. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterWithResourceIdentity. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterWithResourceIdentity FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new DeadLetterWithResourceIdentity(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._identity ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._identity.ToJson(null,serializationMode) : null, "identity" ,container.Add ); + AddIf( null != this._deadLetterDestination ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._deadLetterDestination.ToJson(null,serializationMode) : null, "deadLetterDestination" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DeliveryAttributeListResult.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DeliveryAttributeListResult.PowerShell.cs new file mode 100644 index 000000000000..a8bedc95e725 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DeliveryAttributeListResult.PowerShell.cs @@ -0,0 +1,144 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Result of the Get delivery attributes operation. + [System.ComponentModel.TypeConverter(typeof(DeliveryAttributeListResultTypeConverter))] + public partial class DeliveryAttributeListResult + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal DeliveryAttributeListResult(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeliveryAttributeMappingTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal DeliveryAttributeListResult(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeliveryAttributeMappingTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DeliveryAttributeListResult(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DeliveryAttributeListResult(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Result of the Get delivery attributes operation. + [System.ComponentModel.TypeConverter(typeof(DeliveryAttributeListResultTypeConverter))] + public partial interface IDeliveryAttributeListResult + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DeliveryAttributeListResult.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DeliveryAttributeListResult.TypeConverter.cs new file mode 100644 index 000000000000..e04b07d4a420 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DeliveryAttributeListResult.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DeliveryAttributeListResultTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeListResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeListResult).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DeliveryAttributeListResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DeliveryAttributeListResult.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DeliveryAttributeListResult.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DeliveryAttributeListResult.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DeliveryAttributeListResult.cs new file mode 100644 index 000000000000..fa8f64426cb6 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DeliveryAttributeListResult.cs @@ -0,0 +1,51 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Result of the Get delivery attributes operation. + public partial class DeliveryAttributeListResult : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeListResult, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeListResultInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping[] _value; + + /// A collection of DeliveryAttributeMapping + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public DeliveryAttributeListResult() + { + + } + } + /// Result of the Get delivery attributes operation. + public partial interface IDeliveryAttributeListResult : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// A collection of DeliveryAttributeMapping + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A collection of DeliveryAttributeMapping", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping[] Value { get; set; } + + } + /// Result of the Get delivery attributes operation. + internal partial interface IDeliveryAttributeListResultInternal + + { + /// A collection of DeliveryAttributeMapping + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DeliveryAttributeListResult.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DeliveryAttributeListResult.json.cs new file mode 100644 index 000000000000..e6d4f9832977 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DeliveryAttributeListResult.json.cs @@ -0,0 +1,114 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Result of the Get delivery attributes operation. + public partial class DeliveryAttributeListResult + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal DeliveryAttributeListResult(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping) (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeliveryAttributeMapping.FromJson(__u) )) ))() : null : Value;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeListResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeListResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new DeliveryAttributeListResult(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DeliveryAttributeMapping.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DeliveryAttributeMapping.PowerShell.cs new file mode 100644 index 000000000000..f87ceb0c9509 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DeliveryAttributeMapping.PowerShell.cs @@ -0,0 +1,152 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Delivery attribute mapping details. + [System.ComponentModel.TypeConverter(typeof(DeliveryAttributeMappingTypeConverter))] + public partial class DeliveryAttributeMapping + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal DeliveryAttributeMapping(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMappingInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMappingInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMappingInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DeliveryAttributeMappingType) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMappingInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DeliveryAttributeMappingType.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal DeliveryAttributeMapping(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMappingInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMappingInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMappingInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DeliveryAttributeMappingType) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMappingInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DeliveryAttributeMappingType.CreateFrom); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DeliveryAttributeMapping(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DeliveryAttributeMapping(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Delivery attribute mapping details. + [System.ComponentModel.TypeConverter(typeof(DeliveryAttributeMappingTypeConverter))] + public partial interface IDeliveryAttributeMapping + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DeliveryAttributeMapping.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DeliveryAttributeMapping.TypeConverter.cs new file mode 100644 index 000000000000..d955898c5102 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DeliveryAttributeMapping.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DeliveryAttributeMappingTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DeliveryAttributeMapping.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DeliveryAttributeMapping.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DeliveryAttributeMapping.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DeliveryAttributeMapping.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DeliveryAttributeMapping.cs new file mode 100644 index 000000000000..47672ce6362a --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DeliveryAttributeMapping.cs @@ -0,0 +1,68 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Delivery attribute mapping details. + public partial class DeliveryAttributeMapping : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMappingInternal + { + + /// Backing field for property. + private string _name; + + /// Name of the delivery attribute or header. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DeliveryAttributeMappingType _type; + + /// Type of the delivery attribute or header name. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DeliveryAttributeMappingType Type { get => this._type; set => this._type = value; } + + /// Creates an new instance. + public DeliveryAttributeMapping() + { + + } + } + /// Delivery attribute mapping details. + public partial interface IDeliveryAttributeMapping : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// Name of the delivery attribute or header. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the delivery attribute or header.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + /// Type of the delivery attribute or header name. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Type of the delivery attribute or header name.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DeliveryAttributeMappingType) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DeliveryAttributeMappingType Type { get; set; } + + } + /// Delivery attribute mapping details. + internal partial interface IDeliveryAttributeMappingInternal + + { + /// Name of the delivery attribute or header. + string Name { get; set; } + /// Type of the delivery attribute or header name. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DeliveryAttributeMappingType Type { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DeliveryAttributeMapping.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DeliveryAttributeMapping.json.cs new file mode 100644 index 000000000000..b2cfbce79745 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DeliveryAttributeMapping.json.cs @@ -0,0 +1,127 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Delivery attribute mapping details. + public partial class DeliveryAttributeMapping + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal DeliveryAttributeMapping(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping interface is + /// polymorphic, and the precise model class that will get deserialized is determined at runtime based on the payload. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + if (!(node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json)) + { + return null; + } + // Polymorphic type -- select the appropriate constructor using the discriminator + + switch ( json.StringProperty("type") ) + { + case "Static": + { + return new StaticDeliveryAttributeMapping(json); + } + case "Dynamic": + { + return new DynamicDeliveryAttributeMapping(json); + } + } + return new DeliveryAttributeMapping(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DeliveryWithResourceIdentity.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DeliveryWithResourceIdentity.PowerShell.cs new file mode 100644 index 000000000000..350bd2b1be11 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DeliveryWithResourceIdentity.PowerShell.cs @@ -0,0 +1,178 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// Information about the delivery for an event subscription with resource identity. + /// + [System.ComponentModel.TypeConverter(typeof(DeliveryWithResourceIdentityTypeConverter))] + public partial class DeliveryWithResourceIdentity + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal DeliveryWithResourceIdentity(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Identity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryWithResourceIdentityInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionIdentity) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryWithResourceIdentityInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionIdentityTypeConverter.ConvertFrom); + } + if (content.Contains("Destination")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryWithResourceIdentityInternal)this).Destination = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestination) content.GetValueForProperty("Destination",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryWithResourceIdentityInternal)this).Destination, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionDestinationTypeConverter.ConvertFrom); + } + if (content.Contains("DestinationEndpointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryWithResourceIdentityInternal)this).DestinationEndpointType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType) content.GetValueForProperty("DestinationEndpointType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryWithResourceIdentityInternal)this).DestinationEndpointType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType.CreateFrom); + } + if (content.Contains("IdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryWithResourceIdentityInternal)this).IdentityType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType?) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryWithResourceIdentityInternal)this).IdentityType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType.CreateFrom); + } + if (content.Contains("IdentityUserAssignedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryWithResourceIdentityInternal)this).IdentityUserAssignedIdentity = (string) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryWithResourceIdentityInternal)this).IdentityUserAssignedIdentity, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal DeliveryWithResourceIdentity(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Identity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryWithResourceIdentityInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionIdentity) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryWithResourceIdentityInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionIdentityTypeConverter.ConvertFrom); + } + if (content.Contains("Destination")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryWithResourceIdentityInternal)this).Destination = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestination) content.GetValueForProperty("Destination",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryWithResourceIdentityInternal)this).Destination, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionDestinationTypeConverter.ConvertFrom); + } + if (content.Contains("DestinationEndpointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryWithResourceIdentityInternal)this).DestinationEndpointType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType) content.GetValueForProperty("DestinationEndpointType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryWithResourceIdentityInternal)this).DestinationEndpointType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType.CreateFrom); + } + if (content.Contains("IdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryWithResourceIdentityInternal)this).IdentityType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType?) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryWithResourceIdentityInternal)this).IdentityType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType.CreateFrom); + } + if (content.Contains("IdentityUserAssignedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryWithResourceIdentityInternal)this).IdentityUserAssignedIdentity = (string) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryWithResourceIdentityInternal)this).IdentityUserAssignedIdentity, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryWithResourceIdentity DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DeliveryWithResourceIdentity(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryWithResourceIdentity DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DeliveryWithResourceIdentity(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryWithResourceIdentity FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Information about the delivery for an event subscription with resource identity. + [System.ComponentModel.TypeConverter(typeof(DeliveryWithResourceIdentityTypeConverter))] + public partial interface IDeliveryWithResourceIdentity + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DeliveryWithResourceIdentity.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DeliveryWithResourceIdentity.TypeConverter.cs new file mode 100644 index 000000000000..ec840350eeec --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DeliveryWithResourceIdentity.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DeliveryWithResourceIdentityTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryWithResourceIdentity ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryWithResourceIdentity).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DeliveryWithResourceIdentity.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DeliveryWithResourceIdentity.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DeliveryWithResourceIdentity.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DeliveryWithResourceIdentity.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DeliveryWithResourceIdentity.cs new file mode 100644 index 000000000000..af2c167b8314 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DeliveryWithResourceIdentity.cs @@ -0,0 +1,117 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// + /// Information about the delivery for an event subscription with resource identity. + /// + public partial class DeliveryWithResourceIdentity : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryWithResourceIdentity, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryWithResourceIdentityInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestination _destination; + + /// + /// Information about the destination where events have to be delivered for the event subscription. + /// Uses Azure Event Grid's identity to acquire the authentication tokens being used during delivery / dead-lettering. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestination Destination { get => (this._destination = this._destination ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionDestination()); set => this._destination = value; } + + /// Type of the endpoint for the event subscription destination. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType? DestinationEndpointType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestinationInternal)Destination).EndpointType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestinationInternal)Destination).EndpointType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType)""); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionIdentity _identity; + + /// The identity to use when delivering events. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionIdentity Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionIdentity()); set => this._identity = value; } + + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType? IdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionIdentityInternal)Identity).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionIdentityInternal)Identity).Type = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType)""); } + + /// The user identity associated with the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionIdentityInternal)Identity).UserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionIdentityInternal)Identity).UserAssignedIdentity = value ?? null; } + + /// Internal Acessors for Destination + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestination Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryWithResourceIdentityInternal.Destination { get => (this._destination = this._destination ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionDestination()); set { {_destination = value;} } } + + /// Internal Acessors for Identity + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionIdentity Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryWithResourceIdentityInternal.Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionIdentity()); set { {_identity = value;} } } + + /// Creates an new instance. + public DeliveryWithResourceIdentity() + { + + } + } + /// Information about the delivery for an event subscription with resource identity. + public partial interface IDeliveryWithResourceIdentity : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// Type of the endpoint for the event subscription destination. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of the endpoint for the event subscription destination.", + SerializedName = @"endpointType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType? DestinationEndpointType { get; set; } + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType? IdentityType { get; set; } + /// The user identity associated with the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The user identity associated with the resource.", + SerializedName = @"userAssignedIdentity", + PossibleTypes = new [] { typeof(string) })] + string IdentityUserAssignedIdentity { get; set; } + + } + /// Information about the delivery for an event subscription with resource identity. + internal partial interface IDeliveryWithResourceIdentityInternal + + { + /// + /// Information about the destination where events have to be delivered for the event subscription. + /// Uses Azure Event Grid's identity to acquire the authentication tokens being used during delivery / dead-lettering. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestination Destination { get; set; } + /// Type of the endpoint for the event subscription destination. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType? DestinationEndpointType { get; set; } + /// The identity to use when delivering events. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionIdentity Identity { get; set; } + /// + /// 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. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType? IdentityType { get; set; } + /// The user identity associated with the resource. + string IdentityUserAssignedIdentity { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DeliveryWithResourceIdentity.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DeliveryWithResourceIdentity.json.cs new file mode 100644 index 000000000000..34736d67950b --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DeliveryWithResourceIdentity.json.cs @@ -0,0 +1,110 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// + /// Information about the delivery for an event subscription with resource identity. + /// + public partial class DeliveryWithResourceIdentity + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal DeliveryWithResourceIdentity(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_identity = If( json?.PropertyT("identity"), out var __jsonIdentity) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionIdentity.FromJson(__jsonIdentity) : Identity;} + {_destination = If( json?.PropertyT("destination"), out var __jsonDestination) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionDestination.FromJson(__jsonDestination) : Destination;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryWithResourceIdentity. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryWithResourceIdentity. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryWithResourceIdentity FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new DeliveryWithResourceIdentity(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._identity ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._identity.ToJson(null,serializationMode) : null, "identity" ,container.Add ); + AddIf( null != this._destination ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._destination.ToJson(null,serializationMode) : null, "destination" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/Domain.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/Domain.PowerShell.cs new file mode 100644 index 000000000000..e75374b40d68 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/Domain.PowerShell.cs @@ -0,0 +1,398 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// EventGrid Domain. + [System.ComponentModel.TypeConverter(typeof(DomainTypeConverter))] + public partial class Domain + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomain DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new Domain(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomain DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new Domain(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal Domain(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DomainPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Sku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceSku) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ResourceSkuTypeConverter.ConvertFrom); + } + if (content.Contains("Identity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfo) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IdentityInfoTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.TrackedResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("InputSchema")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).InputSchema = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.InputSchema?) content.GetValueForProperty("InputSchema",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).InputSchema, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.InputSchema.CreateFrom); + } + if (content.Contains("SkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).SkuName = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku?) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).SkuName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku.CreateFrom); + } + if (content.Contains("IdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).IdentityType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType?) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).IdentityType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType.CreateFrom); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("InputSchemaMapping")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).InputSchemaMapping = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInputSchemaMapping) content.GetValueForProperty("InputSchemaMapping",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).InputSchemaMapping, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.InputSchemaMappingTypeConverter.ConvertFrom); + } + if (content.Contains("PrivateEndpointConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).PrivateEndpointConnection = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnection[]) content.GetValueForProperty("PrivateEndpointConnection",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).PrivateEndpointConnection, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PrivateEndpointConnectionTypeConverter.ConvertFrom)); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DomainProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DomainProvisioningState.CreateFrom); + } + if (content.Contains("Endpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).Endpoint = (string) content.GetValueForProperty("Endpoint",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).Endpoint, global::System.Convert.ToString); + } + if (content.Contains("MetricResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).MetricResourceId = (string) content.GetValueForProperty("MetricResourceId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).MetricResourceId, global::System.Convert.ToString); + } + if (content.Contains("PublicNetworkAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).PublicNetworkAccess = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess?) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).PublicNetworkAccess, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess.CreateFrom); + } + if (content.Contains("InboundIPRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).InboundIPRule = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[]) content.GetValueForProperty("InboundIPRule",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).InboundIPRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.InboundIPRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("DisableLocalAuth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).DisableLocalAuth = (bool?) content.GetValueForProperty("DisableLocalAuth",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).DisableLocalAuth, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AutoCreateTopicWithFirstSubscription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).AutoCreateTopicWithFirstSubscription = (bool?) content.GetValueForProperty("AutoCreateTopicWithFirstSubscription",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).AutoCreateTopicWithFirstSubscription, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AutoDeleteTopicWithLastSubscription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).AutoDeleteTopicWithLastSubscription = (bool?) content.GetValueForProperty("AutoDeleteTopicWithLastSubscription",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).AutoDeleteTopicWithLastSubscription, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DataResidencyBoundary")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).DataResidencyBoundary = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary?) content.GetValueForProperty("DataResidencyBoundary",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).DataResidencyBoundary, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary.CreateFrom); + } + if (content.Contains("IdentityPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).IdentityPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("IdentityTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).IdentityTenantId, global::System.Convert.ToString); + } + if (content.Contains("IdentityUserAssignedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IdentityInfoUserAssignedIdentitiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("InputSchemaMappingInputSchemaMappingType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).InputSchemaMappingInputSchemaMappingType = (string) content.GetValueForProperty("InputSchemaMappingInputSchemaMappingType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).InputSchemaMappingInputSchemaMappingType, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal Domain(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DomainPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Sku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceSku) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ResourceSkuTypeConverter.ConvertFrom); + } + if (content.Contains("Identity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfo) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IdentityInfoTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.TrackedResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("InputSchema")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).InputSchema = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.InputSchema?) content.GetValueForProperty("InputSchema",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).InputSchema, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.InputSchema.CreateFrom); + } + if (content.Contains("SkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).SkuName = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku?) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).SkuName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku.CreateFrom); + } + if (content.Contains("IdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).IdentityType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType?) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).IdentityType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType.CreateFrom); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("InputSchemaMapping")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).InputSchemaMapping = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInputSchemaMapping) content.GetValueForProperty("InputSchemaMapping",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).InputSchemaMapping, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.InputSchemaMappingTypeConverter.ConvertFrom); + } + if (content.Contains("PrivateEndpointConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).PrivateEndpointConnection = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnection[]) content.GetValueForProperty("PrivateEndpointConnection",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).PrivateEndpointConnection, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PrivateEndpointConnectionTypeConverter.ConvertFrom)); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DomainProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DomainProvisioningState.CreateFrom); + } + if (content.Contains("Endpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).Endpoint = (string) content.GetValueForProperty("Endpoint",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).Endpoint, global::System.Convert.ToString); + } + if (content.Contains("MetricResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).MetricResourceId = (string) content.GetValueForProperty("MetricResourceId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).MetricResourceId, global::System.Convert.ToString); + } + if (content.Contains("PublicNetworkAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).PublicNetworkAccess = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess?) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).PublicNetworkAccess, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess.CreateFrom); + } + if (content.Contains("InboundIPRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).InboundIPRule = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[]) content.GetValueForProperty("InboundIPRule",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).InboundIPRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.InboundIPRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("DisableLocalAuth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).DisableLocalAuth = (bool?) content.GetValueForProperty("DisableLocalAuth",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).DisableLocalAuth, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AutoCreateTopicWithFirstSubscription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).AutoCreateTopicWithFirstSubscription = (bool?) content.GetValueForProperty("AutoCreateTopicWithFirstSubscription",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).AutoCreateTopicWithFirstSubscription, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AutoDeleteTopicWithLastSubscription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).AutoDeleteTopicWithLastSubscription = (bool?) content.GetValueForProperty("AutoDeleteTopicWithLastSubscription",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).AutoDeleteTopicWithLastSubscription, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DataResidencyBoundary")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).DataResidencyBoundary = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary?) content.GetValueForProperty("DataResidencyBoundary",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).DataResidencyBoundary, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary.CreateFrom); + } + if (content.Contains("IdentityPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).IdentityPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("IdentityTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).IdentityTenantId, global::System.Convert.ToString); + } + if (content.Contains("IdentityUserAssignedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IdentityInfoUserAssignedIdentitiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("InputSchemaMappingInputSchemaMappingType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).InputSchemaMappingInputSchemaMappingType = (string) content.GetValueForProperty("InputSchemaMappingInputSchemaMappingType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal)this).InputSchemaMappingInputSchemaMappingType, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomain FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// EventGrid Domain. + [System.ComponentModel.TypeConverter(typeof(DomainTypeConverter))] + public partial interface IDomain + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/Domain.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/Domain.TypeConverter.cs new file mode 100644 index 000000000000..1060638536d9 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/Domain.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DomainTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomain ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomain).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return Domain.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return Domain.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return Domain.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/Domain.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/Domain.cs new file mode 100644 index 000000000000..2ebeef242f09 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/Domain.cs @@ -0,0 +1,639 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// EventGrid Domain. + public partial class Domain : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomain, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResource __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.TrackedResource(); + + /// + /// This Boolean is used to specify the creation mechanism for 'all' the Event Grid Domain Topics associated with this Event + /// Grid Domain resource. + /// In this context, creation of domain topic can be auto-managed (when true) or self-managed (when false). The default value + /// for this property is true. + /// When this property is null or set to true, Event Grid is responsible of automatically creating the domain topic when the + /// first event subscription is + /// created at the scope of the domain topic. If this property is set to false, then creating the first event subscription + /// will require creating a domain topic + /// by the user. The self-management mode can be used if the user wants full control of when the domain topic is created, + /// while auto-managed mode provides the + /// flexibility to perform less operations and manage fewer resources by the user. Also, note that in auto-managed creation + /// mode, user is allowed to create the + /// domain topic on demand if needed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public bool? AutoCreateTopicWithFirstSubscription { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainPropertiesInternal)Property).AutoCreateTopicWithFirstSubscription; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainPropertiesInternal)Property).AutoCreateTopicWithFirstSubscription = value ?? default(bool); } + + /// + /// This Boolean is used to specify the deletion mechanism for 'all' the Event Grid Domain Topics associated with this Event + /// Grid Domain resource. + /// In this context, deletion of domain topic can be auto-managed (when true) or self-managed (when false). The default value + /// for this property is true. + /// When this property is set to true, Event Grid is responsible of automatically deleting the domain topic when the last + /// event subscription at the scope + /// of the domain topic is deleted. If this property is set to false, then the user needs to manually delete the domain topic + /// when it is no longer needed + /// (e.g., when last event subscription is deleted and the resource needs to be cleaned up). The self-management mode can + /// be used if the user wants full + /// control of when the domain topic needs to be deleted, while auto-managed mode provides the flexibility to perform less + /// operations and manage fewer + /// resources by the user. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public bool? AutoDeleteTopicWithLastSubscription { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainPropertiesInternal)Property).AutoDeleteTopicWithLastSubscription; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainPropertiesInternal)Property).AutoDeleteTopicWithLastSubscription = value ?? default(bool); } + + /// Data Residency Boundary of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary? DataResidencyBoundary { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainPropertiesInternal)Property).DataResidencyBoundary; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainPropertiesInternal)Property).DataResidencyBoundary = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary)""); } + + /// + /// This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD + /// token will be used to authenticate if user is allowed to publish to the domain. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public bool? DisableLocalAuth { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainPropertiesInternal)Property).DisableLocalAuth; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainPropertiesInternal)Property).DisableLocalAuth = value ?? default(bool); } + + /// + /// Endpoint for the Event Grid Domain Resource which is used for publishing the events. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string Endpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainPropertiesInternal)Property).Endpoint; } + + /// Fully qualified identifier of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__trackedResource).Id; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfo _identity; + + /// Identity information for the Event Grid Domain resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfo Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IdentityInfo()); set => this._identity = value; } + + /// The principal ID of resource identity. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoInternal)Identity).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoInternal)Identity).PrincipalId = value ?? null; } + + /// The tenant ID of resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoInternal)Identity).TenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoInternal)Identity).TenantId = value ?? null; } + + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType? IdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoInternal)Identity).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoInternal)Identity).Type = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType)""); } + + /// + /// The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource + /// ids in the form: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + /// This property is currently not used and reserved for future usage. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoInternal)Identity).UserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoInternal)Identity).UserAssignedIdentity = value ?? null /* model class */; } + + /// + /// This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess + /// is enabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[] InboundIPRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainPropertiesInternal)Property).InboundIPRule; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainPropertiesInternal)Property).InboundIPRule = value ?? null /* arrayOf */; } + + /// + /// This determines the format that Event Grid should expect for incoming events published to the Event Grid Domain Resource. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.InputSchema? InputSchema { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainPropertiesInternal)Property).InputSchema; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainPropertiesInternal)Property).InputSchema = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.InputSchema)""); } + + /// Type of the custom mapping + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string InputSchemaMappingInputSchemaMappingType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainPropertiesInternal)Property).InputSchemaMappingInputSchemaMappingType; } + + /// Location of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal)__trackedResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal)__trackedResource).Location = value ; } + + /// Metric resource id for the Event Grid Domain Resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string MetricResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainPropertiesInternal)Property).MetricResourceId; } + + /// Internal Acessors for Endpoint + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal.Endpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainPropertiesInternal)Property).Endpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainPropertiesInternal)Property).Endpoint = value; } + + /// Internal Acessors for Identity + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfo Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal.Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IdentityInfo()); set { {_identity = value;} } } + + /// Internal Acessors for InputSchemaMapping + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInputSchemaMapping Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal.InputSchemaMapping { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainPropertiesInternal)Property).InputSchemaMapping; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainPropertiesInternal)Property).InputSchemaMapping = value; } + + /// Internal Acessors for InputSchemaMappingInputSchemaMappingType + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal.InputSchemaMappingInputSchemaMappingType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainPropertiesInternal)Property).InputSchemaMappingInputSchemaMappingType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainPropertiesInternal)Property).InputSchemaMappingInputSchemaMappingType = value; } + + /// Internal Acessors for MetricResourceId + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal.MetricResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainPropertiesInternal)Property).MetricResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainPropertiesInternal)Property).MetricResourceId = value; } + + /// Internal Acessors for PrivateEndpointConnection + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnection[] Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal.PrivateEndpointConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainPropertiesInternal)Property).PrivateEndpointConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainPropertiesInternal)Property).PrivateEndpointConnection = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainProperties Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DomainProperties()); set { {_property = value;} } } + + /// Internal Acessors for ProvisioningState + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DomainProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainPropertiesInternal)Property).ProvisioningState = value; } + + /// Internal Acessors for Sku + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceSku Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal.Sku { get => (this._sku = this._sku ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ResourceSku()); set { {_sku = value;} } } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.SystemData()); set { {_systemData = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__trackedResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__trackedResource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__trackedResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__trackedResource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__trackedResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__trackedResource).Type = value; } + + /// Name of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__trackedResource).Name; } + + /// List of private endpoint connections. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnection[] PrivateEndpointConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainPropertiesInternal)Property).PrivateEndpointConnection; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainProperties _property; + + /// Properties of the Event Grid Domain resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DomainProperties()); set => this._property = value; } + + /// Provisioning state of the Event Grid Domain Resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DomainProvisioningState? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainPropertiesInternal)Property).ProvisioningState; } + + /// + /// This determines if traffic is allowed over public network. By default it is enabled. + /// You can further restrict to specific IPs by configuring + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess? PublicNetworkAccess { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainPropertiesInternal)Property).PublicNetworkAccess; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainPropertiesInternal)Property).PublicNetworkAccess = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess)""); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceSku _sku; + + /// The Sku pricing tier for the Event Grid Domain resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceSku Sku { get => (this._sku = this._sku ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ResourceSku()); set => this._sku = value; } + + /// The Sku name of the resource. The possible values are: Basic or Premium. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku? SkuName { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceSkuInternal)Sku).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceSkuInternal)Sku).Name = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku)""); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData _systemData; + + /// The system metadata relating to the Event Grid Domain resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.SystemData()); } + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).CreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType)""); } + + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType)""); } + + /// Tags of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal)__trackedResource).Tag = value ?? null /* model class */; } + + /// Type of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__trackedResource).Type; } + + /// Creates an new instance. + public Domain() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__trackedResource), __trackedResource); + await eventListener.AssertObjectIsValid(nameof(__trackedResource), __trackedResource); + } + } + /// EventGrid Domain. + public partial interface IDomain : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResource + { + /// + /// This Boolean is used to specify the creation mechanism for 'all' the Event Grid Domain Topics associated with this Event + /// Grid Domain resource. + /// In this context, creation of domain topic can be auto-managed (when true) or self-managed (when false). The default value + /// for this property is true. + /// When this property is null or set to true, Event Grid is responsible of automatically creating the domain topic when the + /// first event subscription is + /// created at the scope of the domain topic. If this property is set to false, then creating the first event subscription + /// will require creating a domain topic + /// by the user. The self-management mode can be used if the user wants full control of when the domain topic is created, + /// while auto-managed mode provides the + /// flexibility to perform less operations and manage fewer resources by the user. Also, note that in auto-managed creation + /// mode, user is allowed to create the + /// domain topic on demand if needed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This Boolean is used to specify the creation mechanism for 'all' the Event Grid Domain Topics associated with this Event Grid Domain resource. + In this context, creation of domain topic can be auto-managed (when true) or self-managed (when false). The default value for this property is true. + When this property is null or set to true, Event Grid is responsible of automatically creating the domain topic when the first event subscription is + created at the scope of the domain topic. If this property is set to false, then creating the first event subscription will require creating a domain topic + by the user. The self-management mode can be used if the user wants full control of when the domain topic is created, while auto-managed mode provides the + flexibility to perform less operations and manage fewer resources by the user. Also, note that in auto-managed creation mode, user is allowed to create the + domain topic on demand if needed.", + SerializedName = @"autoCreateTopicWithFirstSubscription", + PossibleTypes = new [] { typeof(bool) })] + bool? AutoCreateTopicWithFirstSubscription { get; set; } + /// + /// This Boolean is used to specify the deletion mechanism for 'all' the Event Grid Domain Topics associated with this Event + /// Grid Domain resource. + /// In this context, deletion of domain topic can be auto-managed (when true) or self-managed (when false). The default value + /// for this property is true. + /// When this property is set to true, Event Grid is responsible of automatically deleting the domain topic when the last + /// event subscription at the scope + /// of the domain topic is deleted. If this property is set to false, then the user needs to manually delete the domain topic + /// when it is no longer needed + /// (e.g., when last event subscription is deleted and the resource needs to be cleaned up). The self-management mode can + /// be used if the user wants full + /// control of when the domain topic needs to be deleted, while auto-managed mode provides the flexibility to perform less + /// operations and manage fewer + /// resources by the user. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This Boolean is used to specify the deletion mechanism for 'all' the Event Grid Domain Topics associated with this Event Grid Domain resource. + In this context, deletion of domain topic can be auto-managed (when true) or self-managed (when false). The default value for this property is true. + When this property is set to true, Event Grid is responsible of automatically deleting the domain topic when the last event subscription at the scope + of the domain topic is deleted. If this property is set to false, then the user needs to manually delete the domain topic when it is no longer needed + (e.g., when last event subscription is deleted and the resource needs to be cleaned up). The self-management mode can be used if the user wants full + control of when the domain topic needs to be deleted, while auto-managed mode provides the flexibility to perform less operations and manage fewer + resources by the user.", + SerializedName = @"autoDeleteTopicWithLastSubscription", + PossibleTypes = new [] { typeof(bool) })] + bool? AutoDeleteTopicWithLastSubscription { get; set; } + /// Data Residency Boundary of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Data Residency Boundary of the resource.", + SerializedName = @"dataResidencyBoundary", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary? DataResidencyBoundary { get; set; } + /// + /// This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD + /// token will be used to authenticate if user is allowed to publish to the domain. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD token will be used to authenticate if user is allowed to publish to the domain.", + SerializedName = @"disableLocalAuth", + PossibleTypes = new [] { typeof(bool) })] + bool? DisableLocalAuth { get; set; } + /// + /// Endpoint for the Event Grid Domain Resource which is used for publishing the events. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Endpoint for the Event Grid Domain Resource which is used for publishing the events.", + SerializedName = @"endpoint", + PossibleTypes = new [] { typeof(string) })] + string Endpoint { get; } + /// The principal ID of resource identity. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The principal ID of resource identity.", + SerializedName = @"principalId", + PossibleTypes = new [] { typeof(string) })] + string IdentityPrincipalId { get; set; } + /// The tenant ID of resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The tenant ID of resource.", + SerializedName = @"tenantId", + PossibleTypes = new [] { typeof(string) })] + string IdentityTenantId { get; set; } + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType? IdentityType { get; set; } + /// + /// The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource + /// ids in the form: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + /// This property is currently not used and reserved for future usage. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + This property is currently not used and reserved for future usage.", + SerializedName = @"userAssignedIdentities", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } + /// + /// This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess + /// is enabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess is enabled.", + SerializedName = @"inboundIpRules", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[] InboundIPRule { get; set; } + /// + /// This determines the format that Event Grid should expect for incoming events published to the Event Grid Domain Resource. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This determines the format that Event Grid should expect for incoming events published to the Event Grid Domain Resource.", + SerializedName = @"inputSchema", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.InputSchema) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.InputSchema? InputSchema { get; set; } + /// Type of the custom mapping + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Type of the custom mapping", + SerializedName = @"inputSchemaMappingType", + PossibleTypes = new [] { typeof(string) })] + string InputSchemaMappingInputSchemaMappingType { get; } + /// Metric resource id for the Event Grid Domain Resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Metric resource id for the Event Grid Domain Resource.", + SerializedName = @"metricResourceId", + PossibleTypes = new [] { typeof(string) })] + string MetricResourceId { get; } + /// List of private endpoint connections. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"List of private endpoint connections.", + SerializedName = @"privateEndpointConnections", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnection) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnection[] PrivateEndpointConnection { get; } + /// Provisioning state of the Event Grid Domain Resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Provisioning state of the Event Grid Domain Resource.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DomainProvisioningState) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DomainProvisioningState? ProvisioningState { get; } + /// + /// This determines if traffic is allowed over public network. By default it is enabled. + /// You can further restrict to specific IPs by configuring + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This determines if traffic is allowed over public network. By default it is enabled. + You can further restrict to specific IPs by configuring ", + SerializedName = @"publicNetworkAccess", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess? PublicNetworkAccess { get; set; } + /// The Sku name of the resource. The possible values are: Basic or Premium. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Sku name of the resource. The possible values are: Basic or Premium.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku? SkuName { get; set; } + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timestamp of resource creation (UTC).", + SerializedName = @"createdAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SystemDataCreatedAt { get; set; } + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identity that created the resource.", + SerializedName = @"createdBy", + PossibleTypes = new [] { typeof(string) })] + string SystemDataCreatedBy { get; set; } + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of identity that created the resource.", + SerializedName = @"createdByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType? SystemDataCreatedByType { get; set; } + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timestamp of resource last modification (UTC)", + SerializedName = @"lastModifiedAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SystemDataLastModifiedAt { get; set; } + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identity that last modified the resource.", + SerializedName = @"lastModifiedBy", + PossibleTypes = new [] { typeof(string) })] + string SystemDataLastModifiedBy { get; set; } + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of identity that last modified the resource.", + SerializedName = @"lastModifiedByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + + } + /// EventGrid Domain. + internal partial interface IDomainInternal : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal + { + /// + /// This Boolean is used to specify the creation mechanism for 'all' the Event Grid Domain Topics associated with this Event + /// Grid Domain resource. + /// In this context, creation of domain topic can be auto-managed (when true) or self-managed (when false). The default value + /// for this property is true. + /// When this property is null or set to true, Event Grid is responsible of automatically creating the domain topic when the + /// first event subscription is + /// created at the scope of the domain topic. If this property is set to false, then creating the first event subscription + /// will require creating a domain topic + /// by the user. The self-management mode can be used if the user wants full control of when the domain topic is created, + /// while auto-managed mode provides the + /// flexibility to perform less operations and manage fewer resources by the user. Also, note that in auto-managed creation + /// mode, user is allowed to create the + /// domain topic on demand if needed. + /// + bool? AutoCreateTopicWithFirstSubscription { get; set; } + /// + /// This Boolean is used to specify the deletion mechanism for 'all' the Event Grid Domain Topics associated with this Event + /// Grid Domain resource. + /// In this context, deletion of domain topic can be auto-managed (when true) or self-managed (when false). The default value + /// for this property is true. + /// When this property is set to true, Event Grid is responsible of automatically deleting the domain topic when the last + /// event subscription at the scope + /// of the domain topic is deleted. If this property is set to false, then the user needs to manually delete the domain topic + /// when it is no longer needed + /// (e.g., when last event subscription is deleted and the resource needs to be cleaned up). The self-management mode can + /// be used if the user wants full + /// control of when the domain topic needs to be deleted, while auto-managed mode provides the flexibility to perform less + /// operations and manage fewer + /// resources by the user. + /// + bool? AutoDeleteTopicWithLastSubscription { get; set; } + /// Data Residency Boundary of the resource. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary? DataResidencyBoundary { get; set; } + /// + /// This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD + /// token will be used to authenticate if user is allowed to publish to the domain. + /// + bool? DisableLocalAuth { get; set; } + /// + /// Endpoint for the Event Grid Domain Resource which is used for publishing the events. + /// + string Endpoint { get; set; } + /// Identity information for the Event Grid Domain resource. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfo Identity { get; set; } + /// The principal ID of resource identity. + string IdentityPrincipalId { get; set; } + /// The tenant ID of resource. + string IdentityTenantId { get; set; } + /// + /// 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. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType? IdentityType { get; set; } + /// + /// The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource + /// ids in the form: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + /// This property is currently not used and reserved for future usage. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } + /// + /// This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess + /// is enabled. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[] InboundIPRule { get; set; } + /// + /// This determines the format that Event Grid should expect for incoming events published to the Event Grid Domain Resource. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.InputSchema? InputSchema { get; set; } + /// + /// Information about the InputSchemaMapping which specified the info about mapping event payload. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInputSchemaMapping InputSchemaMapping { get; set; } + /// Type of the custom mapping + string InputSchemaMappingInputSchemaMappingType { get; set; } + /// Metric resource id for the Event Grid Domain Resource. + string MetricResourceId { get; set; } + /// List of private endpoint connections. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnection[] PrivateEndpointConnection { get; set; } + /// Properties of the Event Grid Domain resource. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainProperties Property { get; set; } + /// Provisioning state of the Event Grid Domain Resource. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DomainProvisioningState? ProvisioningState { get; set; } + /// + /// This determines if traffic is allowed over public network. By default it is enabled. + /// You can further restrict to specific IPs by configuring + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess? PublicNetworkAccess { get; set; } + /// The Sku pricing tier for the Event Grid Domain resource. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceSku Sku { get; set; } + /// The Sku name of the resource. The possible values are: Basic or Premium. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku? SkuName { get; set; } + /// The system metadata relating to the Event Grid Domain resource. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData SystemData { get; set; } + /// The timestamp of resource creation (UTC). + global::System.DateTime? SystemDataCreatedAt { get; set; } + /// The identity that created the resource. + string SystemDataCreatedBy { get; set; } + /// The type of identity that created the resource. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType? SystemDataCreatedByType { get; set; } + /// The timestamp of resource last modification (UTC) + global::System.DateTime? SystemDataLastModifiedAt { get; set; } + /// The identity that last modified the resource. + string SystemDataLastModifiedBy { get; set; } + /// The type of identity that last modified the resource. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/Domain.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/Domain.json.cs new file mode 100644 index 000000000000..5e94695debea --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/Domain.json.cs @@ -0,0 +1,117 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// EventGrid Domain. + public partial class Domain + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal Domain(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.TrackedResource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DomainProperties.FromJson(__jsonProperties) : Property;} + {_sku = If( json?.PropertyT("sku"), out var __jsonSku) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ResourceSku.FromJson(__jsonSku) : Sku;} + {_identity = If( json?.PropertyT("identity"), out var __jsonIdentity) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IdentityInfo.FromJson(__jsonIdentity) : Identity;} + {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.SystemData.FromJson(__jsonSystemData) : SystemData;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomain. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomain. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomain FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new Domain(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __trackedResource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AddIf( null != this._sku ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._sku.ToJson(null,serializationMode) : null, "sku" ,container.Add ); + AddIf( null != this._identity ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._identity.ToJson(null,serializationMode) : null, "identity" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._systemData ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._systemData.ToJson(null,serializationMode) : null, "systemData" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainProperties.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainProperties.PowerShell.cs new file mode 100644 index 000000000000..199a97cf0573 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainProperties.PowerShell.cs @@ -0,0 +1,238 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Properties of the Event Grid Domain Resource. + [System.ComponentModel.TypeConverter(typeof(DomainPropertiesTypeConverter))] + public partial class DomainProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DomainProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DomainProperties(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal DomainProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("InputSchemaMapping")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainPropertiesInternal)this).InputSchemaMapping = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInputSchemaMapping) content.GetValueForProperty("InputSchemaMapping",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainPropertiesInternal)this).InputSchemaMapping, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.InputSchemaMappingTypeConverter.ConvertFrom); + } + if (content.Contains("PrivateEndpointConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainPropertiesInternal)this).PrivateEndpointConnection = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnection[]) content.GetValueForProperty("PrivateEndpointConnection",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainPropertiesInternal)this).PrivateEndpointConnection, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PrivateEndpointConnectionTypeConverter.ConvertFrom)); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DomainProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DomainProvisioningState.CreateFrom); + } + if (content.Contains("Endpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainPropertiesInternal)this).Endpoint = (string) content.GetValueForProperty("Endpoint",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainPropertiesInternal)this).Endpoint, global::System.Convert.ToString); + } + if (content.Contains("InputSchema")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainPropertiesInternal)this).InputSchema = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.InputSchema?) content.GetValueForProperty("InputSchema",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainPropertiesInternal)this).InputSchema, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.InputSchema.CreateFrom); + } + if (content.Contains("MetricResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainPropertiesInternal)this).MetricResourceId = (string) content.GetValueForProperty("MetricResourceId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainPropertiesInternal)this).MetricResourceId, global::System.Convert.ToString); + } + if (content.Contains("PublicNetworkAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainPropertiesInternal)this).PublicNetworkAccess = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess?) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainPropertiesInternal)this).PublicNetworkAccess, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess.CreateFrom); + } + if (content.Contains("InboundIPRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainPropertiesInternal)this).InboundIPRule = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[]) content.GetValueForProperty("InboundIPRule",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainPropertiesInternal)this).InboundIPRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.InboundIPRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("DisableLocalAuth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainPropertiesInternal)this).DisableLocalAuth = (bool?) content.GetValueForProperty("DisableLocalAuth",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainPropertiesInternal)this).DisableLocalAuth, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AutoCreateTopicWithFirstSubscription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainPropertiesInternal)this).AutoCreateTopicWithFirstSubscription = (bool?) content.GetValueForProperty("AutoCreateTopicWithFirstSubscription",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainPropertiesInternal)this).AutoCreateTopicWithFirstSubscription, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AutoDeleteTopicWithLastSubscription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainPropertiesInternal)this).AutoDeleteTopicWithLastSubscription = (bool?) content.GetValueForProperty("AutoDeleteTopicWithLastSubscription",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainPropertiesInternal)this).AutoDeleteTopicWithLastSubscription, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DataResidencyBoundary")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainPropertiesInternal)this).DataResidencyBoundary = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary?) content.GetValueForProperty("DataResidencyBoundary",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainPropertiesInternal)this).DataResidencyBoundary, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary.CreateFrom); + } + if (content.Contains("InputSchemaMappingInputSchemaMappingType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainPropertiesInternal)this).InputSchemaMappingInputSchemaMappingType = (string) content.GetValueForProperty("InputSchemaMappingInputSchemaMappingType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainPropertiesInternal)this).InputSchemaMappingInputSchemaMappingType, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal DomainProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("InputSchemaMapping")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainPropertiesInternal)this).InputSchemaMapping = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInputSchemaMapping) content.GetValueForProperty("InputSchemaMapping",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainPropertiesInternal)this).InputSchemaMapping, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.InputSchemaMappingTypeConverter.ConvertFrom); + } + if (content.Contains("PrivateEndpointConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainPropertiesInternal)this).PrivateEndpointConnection = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnection[]) content.GetValueForProperty("PrivateEndpointConnection",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainPropertiesInternal)this).PrivateEndpointConnection, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PrivateEndpointConnectionTypeConverter.ConvertFrom)); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DomainProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DomainProvisioningState.CreateFrom); + } + if (content.Contains("Endpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainPropertiesInternal)this).Endpoint = (string) content.GetValueForProperty("Endpoint",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainPropertiesInternal)this).Endpoint, global::System.Convert.ToString); + } + if (content.Contains("InputSchema")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainPropertiesInternal)this).InputSchema = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.InputSchema?) content.GetValueForProperty("InputSchema",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainPropertiesInternal)this).InputSchema, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.InputSchema.CreateFrom); + } + if (content.Contains("MetricResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainPropertiesInternal)this).MetricResourceId = (string) content.GetValueForProperty("MetricResourceId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainPropertiesInternal)this).MetricResourceId, global::System.Convert.ToString); + } + if (content.Contains("PublicNetworkAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainPropertiesInternal)this).PublicNetworkAccess = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess?) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainPropertiesInternal)this).PublicNetworkAccess, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess.CreateFrom); + } + if (content.Contains("InboundIPRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainPropertiesInternal)this).InboundIPRule = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[]) content.GetValueForProperty("InboundIPRule",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainPropertiesInternal)this).InboundIPRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.InboundIPRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("DisableLocalAuth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainPropertiesInternal)this).DisableLocalAuth = (bool?) content.GetValueForProperty("DisableLocalAuth",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainPropertiesInternal)this).DisableLocalAuth, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AutoCreateTopicWithFirstSubscription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainPropertiesInternal)this).AutoCreateTopicWithFirstSubscription = (bool?) content.GetValueForProperty("AutoCreateTopicWithFirstSubscription",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainPropertiesInternal)this).AutoCreateTopicWithFirstSubscription, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AutoDeleteTopicWithLastSubscription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainPropertiesInternal)this).AutoDeleteTopicWithLastSubscription = (bool?) content.GetValueForProperty("AutoDeleteTopicWithLastSubscription",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainPropertiesInternal)this).AutoDeleteTopicWithLastSubscription, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DataResidencyBoundary")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainPropertiesInternal)this).DataResidencyBoundary = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary?) content.GetValueForProperty("DataResidencyBoundary",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainPropertiesInternal)this).DataResidencyBoundary, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary.CreateFrom); + } + if (content.Contains("InputSchemaMappingInputSchemaMappingType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainPropertiesInternal)this).InputSchemaMappingInputSchemaMappingType = (string) content.GetValueForProperty("InputSchemaMappingInputSchemaMappingType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainPropertiesInternal)this).InputSchemaMappingInputSchemaMappingType, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties of the Event Grid Domain Resource. + [System.ComponentModel.TypeConverter(typeof(DomainPropertiesTypeConverter))] + public partial interface IDomainProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainProperties.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainProperties.TypeConverter.cs new file mode 100644 index 000000000000..e736e9d8b3c6 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DomainPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DomainProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DomainProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DomainProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainProperties.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainProperties.cs new file mode 100644 index 000000000000..9c1714acae58 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainProperties.cs @@ -0,0 +1,405 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Properties of the Event Grid Domain Resource. + public partial class DomainProperties : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainProperties, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainPropertiesInternal + { + + /// Backing field for property. + private bool? _autoCreateTopicWithFirstSubscription; + + /// + /// This Boolean is used to specify the creation mechanism for 'all' the Event Grid Domain Topics associated with this Event + /// Grid Domain resource. + /// In this context, creation of domain topic can be auto-managed (when true) or self-managed (when false). The default value + /// for this property is true. + /// When this property is null or set to true, Event Grid is responsible of automatically creating the domain topic when the + /// first event subscription is + /// created at the scope of the domain topic. If this property is set to false, then creating the first event subscription + /// will require creating a domain topic + /// by the user. The self-management mode can be used if the user wants full control of when the domain topic is created, + /// while auto-managed mode provides the + /// flexibility to perform less operations and manage fewer resources by the user. Also, note that in auto-managed creation + /// mode, user is allowed to create the + /// domain topic on demand if needed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public bool? AutoCreateTopicWithFirstSubscription { get => this._autoCreateTopicWithFirstSubscription; set => this._autoCreateTopicWithFirstSubscription = value; } + + /// Backing field for property. + private bool? _autoDeleteTopicWithLastSubscription; + + /// + /// This Boolean is used to specify the deletion mechanism for 'all' the Event Grid Domain Topics associated with this Event + /// Grid Domain resource. + /// In this context, deletion of domain topic can be auto-managed (when true) or self-managed (when false). The default value + /// for this property is true. + /// When this property is set to true, Event Grid is responsible of automatically deleting the domain topic when the last + /// event subscription at the scope + /// of the domain topic is deleted. If this property is set to false, then the user needs to manually delete the domain topic + /// when it is no longer needed + /// (e.g., when last event subscription is deleted and the resource needs to be cleaned up). The self-management mode can + /// be used if the user wants full + /// control of when the domain topic needs to be deleted, while auto-managed mode provides the flexibility to perform less + /// operations and manage fewer + /// resources by the user. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public bool? AutoDeleteTopicWithLastSubscription { get => this._autoDeleteTopicWithLastSubscription; set => this._autoDeleteTopicWithLastSubscription = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary? _dataResidencyBoundary; + + /// Data Residency Boundary of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary? DataResidencyBoundary { get => this._dataResidencyBoundary; set => this._dataResidencyBoundary = value; } + + /// Backing field for property. + private bool? _disableLocalAuth; + + /// + /// This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD + /// token will be used to authenticate if user is allowed to publish to the domain. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public bool? DisableLocalAuth { get => this._disableLocalAuth; set => this._disableLocalAuth = value; } + + /// Backing field for property. + private string _endpoint; + + /// + /// Endpoint for the Event Grid Domain Resource which is used for publishing the events. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string Endpoint { get => this._endpoint; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[] _inboundIPRule; + + /// + /// This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess + /// is enabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[] InboundIPRule { get => this._inboundIPRule; set => this._inboundIPRule = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.InputSchema? _inputSchema; + + /// + /// This determines the format that Event Grid should expect for incoming events published to the Event Grid Domain Resource. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.InputSchema? InputSchema { get => this._inputSchema; set => this._inputSchema = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInputSchemaMapping _inputSchemaMapping; + + /// + /// Information about the InputSchemaMapping which specified the info about mapping event payload. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInputSchemaMapping InputSchemaMapping { get => (this._inputSchemaMapping = this._inputSchemaMapping ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.InputSchemaMapping()); set => this._inputSchemaMapping = value; } + + /// Type of the custom mapping + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string InputSchemaMappingInputSchemaMappingType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInputSchemaMappingInternal)InputSchemaMapping).Type; } + + /// Backing field for property. + private string _metricResourceId; + + /// Metric resource id for the Event Grid Domain Resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string MetricResourceId { get => this._metricResourceId; } + + /// Internal Acessors for Endpoint + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainPropertiesInternal.Endpoint { get => this._endpoint; set { {_endpoint = value;} } } + + /// Internal Acessors for InputSchemaMapping + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInputSchemaMapping Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainPropertiesInternal.InputSchemaMapping { get => (this._inputSchemaMapping = this._inputSchemaMapping ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.InputSchemaMapping()); set { {_inputSchemaMapping = value;} } } + + /// Internal Acessors for InputSchemaMappingInputSchemaMappingType + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainPropertiesInternal.InputSchemaMappingInputSchemaMappingType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInputSchemaMappingInternal)InputSchemaMapping).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInputSchemaMappingInternal)InputSchemaMapping).Type = value; } + + /// Internal Acessors for MetricResourceId + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainPropertiesInternal.MetricResourceId { get => this._metricResourceId; set { {_metricResourceId = value;} } } + + /// Internal Acessors for PrivateEndpointConnection + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnection[] Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainPropertiesInternal.PrivateEndpointConnection { get => this._privateEndpointConnection; set { {_privateEndpointConnection = value;} } } + + /// Internal Acessors for ProvisioningState + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DomainProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnection[] _privateEndpointConnection; + + /// List of private endpoint connections. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnection[] PrivateEndpointConnection { get => this._privateEndpointConnection; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DomainProvisioningState? _provisioningState; + + /// Provisioning state of the Event Grid Domain Resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DomainProvisioningState? ProvisioningState { get => this._provisioningState; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess? _publicNetworkAccess; + + /// + /// This determines if traffic is allowed over public network. By default it is enabled. + /// You can further restrict to specific IPs by configuring + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess? PublicNetworkAccess { get => this._publicNetworkAccess; set => this._publicNetworkAccess = value; } + + /// Creates an new instance. + public DomainProperties() + { + + } + } + /// Properties of the Event Grid Domain Resource. + public partial interface IDomainProperties : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// + /// This Boolean is used to specify the creation mechanism for 'all' the Event Grid Domain Topics associated with this Event + /// Grid Domain resource. + /// In this context, creation of domain topic can be auto-managed (when true) or self-managed (when false). The default value + /// for this property is true. + /// When this property is null or set to true, Event Grid is responsible of automatically creating the domain topic when the + /// first event subscription is + /// created at the scope of the domain topic. If this property is set to false, then creating the first event subscription + /// will require creating a domain topic + /// by the user. The self-management mode can be used if the user wants full control of when the domain topic is created, + /// while auto-managed mode provides the + /// flexibility to perform less operations and manage fewer resources by the user. Also, note that in auto-managed creation + /// mode, user is allowed to create the + /// domain topic on demand if needed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This Boolean is used to specify the creation mechanism for 'all' the Event Grid Domain Topics associated with this Event Grid Domain resource. + In this context, creation of domain topic can be auto-managed (when true) or self-managed (when false). The default value for this property is true. + When this property is null or set to true, Event Grid is responsible of automatically creating the domain topic when the first event subscription is + created at the scope of the domain topic. If this property is set to false, then creating the first event subscription will require creating a domain topic + by the user. The self-management mode can be used if the user wants full control of when the domain topic is created, while auto-managed mode provides the + flexibility to perform less operations and manage fewer resources by the user. Also, note that in auto-managed creation mode, user is allowed to create the + domain topic on demand if needed.", + SerializedName = @"autoCreateTopicWithFirstSubscription", + PossibleTypes = new [] { typeof(bool) })] + bool? AutoCreateTopicWithFirstSubscription { get; set; } + /// + /// This Boolean is used to specify the deletion mechanism for 'all' the Event Grid Domain Topics associated with this Event + /// Grid Domain resource. + /// In this context, deletion of domain topic can be auto-managed (when true) or self-managed (when false). The default value + /// for this property is true. + /// When this property is set to true, Event Grid is responsible of automatically deleting the domain topic when the last + /// event subscription at the scope + /// of the domain topic is deleted. If this property is set to false, then the user needs to manually delete the domain topic + /// when it is no longer needed + /// (e.g., when last event subscription is deleted and the resource needs to be cleaned up). The self-management mode can + /// be used if the user wants full + /// control of when the domain topic needs to be deleted, while auto-managed mode provides the flexibility to perform less + /// operations and manage fewer + /// resources by the user. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This Boolean is used to specify the deletion mechanism for 'all' the Event Grid Domain Topics associated with this Event Grid Domain resource. + In this context, deletion of domain topic can be auto-managed (when true) or self-managed (when false). The default value for this property is true. + When this property is set to true, Event Grid is responsible of automatically deleting the domain topic when the last event subscription at the scope + of the domain topic is deleted. If this property is set to false, then the user needs to manually delete the domain topic when it is no longer needed + (e.g., when last event subscription is deleted and the resource needs to be cleaned up). The self-management mode can be used if the user wants full + control of when the domain topic needs to be deleted, while auto-managed mode provides the flexibility to perform less operations and manage fewer + resources by the user.", + SerializedName = @"autoDeleteTopicWithLastSubscription", + PossibleTypes = new [] { typeof(bool) })] + bool? AutoDeleteTopicWithLastSubscription { get; set; } + /// Data Residency Boundary of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Data Residency Boundary of the resource.", + SerializedName = @"dataResidencyBoundary", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary? DataResidencyBoundary { get; set; } + /// + /// This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD + /// token will be used to authenticate if user is allowed to publish to the domain. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD token will be used to authenticate if user is allowed to publish to the domain.", + SerializedName = @"disableLocalAuth", + PossibleTypes = new [] { typeof(bool) })] + bool? DisableLocalAuth { get; set; } + /// + /// Endpoint for the Event Grid Domain Resource which is used for publishing the events. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Endpoint for the Event Grid Domain Resource which is used for publishing the events.", + SerializedName = @"endpoint", + PossibleTypes = new [] { typeof(string) })] + string Endpoint { get; } + /// + /// This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess + /// is enabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess is enabled.", + SerializedName = @"inboundIpRules", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[] InboundIPRule { get; set; } + /// + /// This determines the format that Event Grid should expect for incoming events published to the Event Grid Domain Resource. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This determines the format that Event Grid should expect for incoming events published to the Event Grid Domain Resource.", + SerializedName = @"inputSchema", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.InputSchema) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.InputSchema? InputSchema { get; set; } + /// Type of the custom mapping + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Type of the custom mapping", + SerializedName = @"inputSchemaMappingType", + PossibleTypes = new [] { typeof(string) })] + string InputSchemaMappingInputSchemaMappingType { get; } + /// Metric resource id for the Event Grid Domain Resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Metric resource id for the Event Grid Domain Resource.", + SerializedName = @"metricResourceId", + PossibleTypes = new [] { typeof(string) })] + string MetricResourceId { get; } + /// List of private endpoint connections. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"List of private endpoint connections.", + SerializedName = @"privateEndpointConnections", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnection) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnection[] PrivateEndpointConnection { get; } + /// Provisioning state of the Event Grid Domain Resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Provisioning state of the Event Grid Domain Resource.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DomainProvisioningState) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DomainProvisioningState? ProvisioningState { get; } + /// + /// This determines if traffic is allowed over public network. By default it is enabled. + /// You can further restrict to specific IPs by configuring + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This determines if traffic is allowed over public network. By default it is enabled. + You can further restrict to specific IPs by configuring ", + SerializedName = @"publicNetworkAccess", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess? PublicNetworkAccess { get; set; } + + } + /// Properties of the Event Grid Domain Resource. + internal partial interface IDomainPropertiesInternal + + { + /// + /// This Boolean is used to specify the creation mechanism for 'all' the Event Grid Domain Topics associated with this Event + /// Grid Domain resource. + /// In this context, creation of domain topic can be auto-managed (when true) or self-managed (when false). The default value + /// for this property is true. + /// When this property is null or set to true, Event Grid is responsible of automatically creating the domain topic when the + /// first event subscription is + /// created at the scope of the domain topic. If this property is set to false, then creating the first event subscription + /// will require creating a domain topic + /// by the user. The self-management mode can be used if the user wants full control of when the domain topic is created, + /// while auto-managed mode provides the + /// flexibility to perform less operations and manage fewer resources by the user. Also, note that in auto-managed creation + /// mode, user is allowed to create the + /// domain topic on demand if needed. + /// + bool? AutoCreateTopicWithFirstSubscription { get; set; } + /// + /// This Boolean is used to specify the deletion mechanism for 'all' the Event Grid Domain Topics associated with this Event + /// Grid Domain resource. + /// In this context, deletion of domain topic can be auto-managed (when true) or self-managed (when false). The default value + /// for this property is true. + /// When this property is set to true, Event Grid is responsible of automatically deleting the domain topic when the last + /// event subscription at the scope + /// of the domain topic is deleted. If this property is set to false, then the user needs to manually delete the domain topic + /// when it is no longer needed + /// (e.g., when last event subscription is deleted and the resource needs to be cleaned up). The self-management mode can + /// be used if the user wants full + /// control of when the domain topic needs to be deleted, while auto-managed mode provides the flexibility to perform less + /// operations and manage fewer + /// resources by the user. + /// + bool? AutoDeleteTopicWithLastSubscription { get; set; } + /// Data Residency Boundary of the resource. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary? DataResidencyBoundary { get; set; } + /// + /// This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD + /// token will be used to authenticate if user is allowed to publish to the domain. + /// + bool? DisableLocalAuth { get; set; } + /// + /// Endpoint for the Event Grid Domain Resource which is used for publishing the events. + /// + string Endpoint { get; set; } + /// + /// This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess + /// is enabled. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[] InboundIPRule { get; set; } + /// + /// This determines the format that Event Grid should expect for incoming events published to the Event Grid Domain Resource. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.InputSchema? InputSchema { get; set; } + /// + /// Information about the InputSchemaMapping which specified the info about mapping event payload. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInputSchemaMapping InputSchemaMapping { get; set; } + /// Type of the custom mapping + string InputSchemaMappingInputSchemaMappingType { get; set; } + /// Metric resource id for the Event Grid Domain Resource. + string MetricResourceId { get; set; } + /// List of private endpoint connections. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnection[] PrivateEndpointConnection { get; set; } + /// Provisioning state of the Event Grid Domain Resource. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DomainProvisioningState? ProvisioningState { get; set; } + /// + /// This determines if traffic is allowed over public network. By default it is enabled. + /// You can further restrict to specific IPs by configuring + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess? PublicNetworkAccess { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainProperties.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainProperties.json.cs new file mode 100644 index 000000000000..2c8e5f3a0ecf --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainProperties.json.cs @@ -0,0 +1,156 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Properties of the Event Grid Domain Resource. + public partial class DomainProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal DomainProperties(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_inputSchemaMapping = If( json?.PropertyT("inputSchemaMapping"), out var __jsonInputSchemaMapping) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.InputSchemaMapping.FromJson(__jsonInputSchemaMapping) : InputSchemaMapping;} + {_privateEndpointConnection = If( json?.PropertyT("privateEndpointConnections"), out var __jsonPrivateEndpointConnections) ? If( __jsonPrivateEndpointConnections as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnection) (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PrivateEndpointConnection.FromJson(__u) )) ))() : null : PrivateEndpointConnection;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} + {_endpoint = If( json?.PropertyT("endpoint"), out var __jsonEndpoint) ? (string)__jsonEndpoint : (string)Endpoint;} + {_inputSchema = If( json?.PropertyT("inputSchema"), out var __jsonInputSchema) ? (string)__jsonInputSchema : (string)InputSchema;} + {_metricResourceId = If( json?.PropertyT("metricResourceId"), out var __jsonMetricResourceId) ? (string)__jsonMetricResourceId : (string)MetricResourceId;} + {_publicNetworkAccess = If( json?.PropertyT("publicNetworkAccess"), out var __jsonPublicNetworkAccess) ? (string)__jsonPublicNetworkAccess : (string)PublicNetworkAccess;} + {_inboundIPRule = If( json?.PropertyT("inboundIpRules"), out var __jsonInboundIPRules) ? If( __jsonInboundIPRules as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule) (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.InboundIPRule.FromJson(__p) )) ))() : null : InboundIPRule;} + {_disableLocalAuth = If( json?.PropertyT("disableLocalAuth"), out var __jsonDisableLocalAuth) ? (bool?)__jsonDisableLocalAuth : DisableLocalAuth;} + {_autoCreateTopicWithFirstSubscription = If( json?.PropertyT("autoCreateTopicWithFirstSubscription"), out var __jsonAutoCreateTopicWithFirstSubscription) ? (bool?)__jsonAutoCreateTopicWithFirstSubscription : AutoCreateTopicWithFirstSubscription;} + {_autoDeleteTopicWithLastSubscription = If( json?.PropertyT("autoDeleteTopicWithLastSubscription"), out var __jsonAutoDeleteTopicWithLastSubscription) ? (bool?)__jsonAutoDeleteTopicWithLastSubscription : AutoDeleteTopicWithLastSubscription;} + {_dataResidencyBoundary = If( json?.PropertyT("dataResidencyBoundary"), out var __jsonDataResidencyBoundary) ? (string)__jsonDataResidencyBoundary : (string)DataResidencyBoundary;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new DomainProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._inputSchemaMapping ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._inputSchemaMapping.ToJson(null,serializationMode) : null, "inputSchemaMapping" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._privateEndpointConnection) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.XNodeArray(); + foreach( var __x in this._privateEndpointConnection ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("privateEndpointConnections",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._endpoint)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._endpoint.ToString()) : null, "endpoint" ,container.Add ); + } + AddIf( null != (((object)this._inputSchema)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._inputSchema.ToString()) : null, "inputSchema" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._metricResourceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._metricResourceId.ToString()) : null, "metricResourceId" ,container.Add ); + } + AddIf( null != (((object)this._publicNetworkAccess)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._publicNetworkAccess.ToString()) : null, "publicNetworkAccess" ,container.Add ); + if (null != this._inboundIPRule) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.XNodeArray(); + foreach( var __s in this._inboundIPRule ) + { + AddIf(__s?.ToJson(null, serializationMode) ,__r.Add); + } + container.Add("inboundIpRules",__r); + } + AddIf( null != this._disableLocalAuth ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonBoolean((bool)this._disableLocalAuth) : null, "disableLocalAuth" ,container.Add ); + AddIf( null != this._autoCreateTopicWithFirstSubscription ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonBoolean((bool)this._autoCreateTopicWithFirstSubscription) : null, "autoCreateTopicWithFirstSubscription" ,container.Add ); + AddIf( null != this._autoDeleteTopicWithLastSubscription ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonBoolean((bool)this._autoDeleteTopicWithLastSubscription) : null, "autoDeleteTopicWithLastSubscription" ,container.Add ); + AddIf( null != (((object)this._dataResidencyBoundary)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._dataResidencyBoundary.ToString()) : null, "dataResidencyBoundary" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainRegenerateKeyRequest.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainRegenerateKeyRequest.PowerShell.cs new file mode 100644 index 000000000000..914cffa488fd --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainRegenerateKeyRequest.PowerShell.cs @@ -0,0 +1,144 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Domain regenerate share access key request. + [System.ComponentModel.TypeConverter(typeof(DomainRegenerateKeyRequestTypeConverter))] + public partial class DomainRegenerateKeyRequest + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainRegenerateKeyRequest DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DomainRegenerateKeyRequest(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainRegenerateKeyRequest DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DomainRegenerateKeyRequest(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal DomainRegenerateKeyRequest(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("KeyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainRegenerateKeyRequestInternal)this).KeyName = (string) content.GetValueForProperty("KeyName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainRegenerateKeyRequestInternal)this).KeyName, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal DomainRegenerateKeyRequest(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("KeyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainRegenerateKeyRequestInternal)this).KeyName = (string) content.GetValueForProperty("KeyName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainRegenerateKeyRequestInternal)this).KeyName, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainRegenerateKeyRequest FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Domain regenerate share access key request. + [System.ComponentModel.TypeConverter(typeof(DomainRegenerateKeyRequestTypeConverter))] + public partial interface IDomainRegenerateKeyRequest + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainRegenerateKeyRequest.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainRegenerateKeyRequest.TypeConverter.cs new file mode 100644 index 000000000000..68944e458a78 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainRegenerateKeyRequest.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DomainRegenerateKeyRequestTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainRegenerateKeyRequest ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainRegenerateKeyRequest).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DomainRegenerateKeyRequest.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DomainRegenerateKeyRequest.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DomainRegenerateKeyRequest.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainRegenerateKeyRequest.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainRegenerateKeyRequest.cs new file mode 100644 index 000000000000..64f5794e828b --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainRegenerateKeyRequest.cs @@ -0,0 +1,51 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Domain regenerate share access key request. + public partial class DomainRegenerateKeyRequest : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainRegenerateKeyRequest, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainRegenerateKeyRequestInternal + { + + /// Backing field for property. + private string _keyName; + + /// Key name to regenerate key1 or key2. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string KeyName { get => this._keyName; set => this._keyName = value; } + + /// Creates an new instance. + public DomainRegenerateKeyRequest() + { + + } + } + /// Domain regenerate share access key request. + public partial interface IDomainRegenerateKeyRequest : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// Key name to regenerate key1 or key2. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Key name to regenerate key1 or key2.", + SerializedName = @"keyName", + PossibleTypes = new [] { typeof(string) })] + string KeyName { get; set; } + + } + /// Domain regenerate share access key request. + internal partial interface IDomainRegenerateKeyRequestInternal + + { + /// Key name to regenerate key1 or key2. + string KeyName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainRegenerateKeyRequest.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainRegenerateKeyRequest.json.cs new file mode 100644 index 000000000000..2c72af7afb29 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainRegenerateKeyRequest.json.cs @@ -0,0 +1,106 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Domain regenerate share access key request. + public partial class DomainRegenerateKeyRequest + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal DomainRegenerateKeyRequest(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_keyName = If( json?.PropertyT("keyName"), out var __jsonKeyName) ? (string)__jsonKeyName : (string)KeyName;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainRegenerateKeyRequest. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainRegenerateKeyRequest. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainRegenerateKeyRequest FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new DomainRegenerateKeyRequest(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._keyName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._keyName.ToString()) : null, "keyName" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainSharedAccessKeys.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainSharedAccessKeys.PowerShell.cs new file mode 100644 index 000000000000..7c9cdff08fec --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainSharedAccessKeys.PowerShell.cs @@ -0,0 +1,152 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Shared access keys of the Domain. + [System.ComponentModel.TypeConverter(typeof(DomainSharedAccessKeysTypeConverter))] + public partial class DomainSharedAccessKeys + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainSharedAccessKeys DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DomainSharedAccessKeys(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainSharedAccessKeys DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DomainSharedAccessKeys(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal DomainSharedAccessKeys(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Key1")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainSharedAccessKeysInternal)this).Key1 = (string) content.GetValueForProperty("Key1",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainSharedAccessKeysInternal)this).Key1, global::System.Convert.ToString); + } + if (content.Contains("Key2")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainSharedAccessKeysInternal)this).Key2 = (string) content.GetValueForProperty("Key2",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainSharedAccessKeysInternal)this).Key2, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal DomainSharedAccessKeys(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Key1")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainSharedAccessKeysInternal)this).Key1 = (string) content.GetValueForProperty("Key1",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainSharedAccessKeysInternal)this).Key1, global::System.Convert.ToString); + } + if (content.Contains("Key2")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainSharedAccessKeysInternal)this).Key2 = (string) content.GetValueForProperty("Key2",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainSharedAccessKeysInternal)this).Key2, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainSharedAccessKeys FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Shared access keys of the Domain. + [System.ComponentModel.TypeConverter(typeof(DomainSharedAccessKeysTypeConverter))] + public partial interface IDomainSharedAccessKeys + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainSharedAccessKeys.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainSharedAccessKeys.TypeConverter.cs new file mode 100644 index 000000000000..e0cd730bf6ff --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainSharedAccessKeys.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DomainSharedAccessKeysTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainSharedAccessKeys ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainSharedAccessKeys).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DomainSharedAccessKeys.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DomainSharedAccessKeys.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DomainSharedAccessKeys.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainSharedAccessKeys.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainSharedAccessKeys.cs new file mode 100644 index 000000000000..b64174945285 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainSharedAccessKeys.cs @@ -0,0 +1,68 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Shared access keys of the Domain. + public partial class DomainSharedAccessKeys : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainSharedAccessKeys, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainSharedAccessKeysInternal + { + + /// Backing field for property. + private string _key1; + + /// Shared access key1 for the domain. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string Key1 { get => this._key1; set => this._key1 = value; } + + /// Backing field for property. + private string _key2; + + /// Shared access key2 for the domain. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string Key2 { get => this._key2; set => this._key2 = value; } + + /// Creates an new instance. + public DomainSharedAccessKeys() + { + + } + } + /// Shared access keys of the Domain. + public partial interface IDomainSharedAccessKeys : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// Shared access key1 for the domain. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Shared access key1 for the domain.", + SerializedName = @"key1", + PossibleTypes = new [] { typeof(string) })] + string Key1 { get; set; } + /// Shared access key2 for the domain. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Shared access key2 for the domain.", + SerializedName = @"key2", + PossibleTypes = new [] { typeof(string) })] + string Key2 { get; set; } + + } + /// Shared access keys of the Domain. + internal partial interface IDomainSharedAccessKeysInternal + + { + /// Shared access key1 for the domain. + string Key1 { get; set; } + /// Shared access key2 for the domain. + string Key2 { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainSharedAccessKeys.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainSharedAccessKeys.json.cs new file mode 100644 index 000000000000..dc1f2092da0c --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainSharedAccessKeys.json.cs @@ -0,0 +1,108 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Shared access keys of the Domain. + public partial class DomainSharedAccessKeys + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal DomainSharedAccessKeys(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_key1 = If( json?.PropertyT("key1"), out var __jsonKey1) ? (string)__jsonKey1 : (string)Key1;} + {_key2 = If( json?.PropertyT("key2"), out var __jsonKey2) ? (string)__jsonKey2 : (string)Key2;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainSharedAccessKeys. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainSharedAccessKeys. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainSharedAccessKeys FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new DomainSharedAccessKeys(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._key1)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._key1.ToString()) : null, "key1" ,container.Add ); + AddIf( null != (((object)this._key2)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._key2.ToString()) : null, "key2" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainTopic.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainTopic.PowerShell.cs new file mode 100644 index 000000000000..5066cbf238bb --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainTopic.PowerShell.cs @@ -0,0 +1,230 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Domain Topic. + [System.ComponentModel.TypeConverter(typeof(DomainTopicTypeConverter))] + public partial class DomainTopic + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopic DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DomainTopic(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopic DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DomainTopic(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal DomainTopic(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopicInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopicProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopicInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DomainTopicPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopicInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopicInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopicInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopicInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopicInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopicInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopicInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DomainTopicProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopicInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DomainTopicProvisioningState.CreateFrom); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopicInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopicInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopicInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopicInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopicInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopicInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopicInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopicInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal DomainTopic(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopicInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopicProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopicInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DomainTopicPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopicInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopicInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopicInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopicInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopicInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopicInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopicInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DomainTopicProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopicInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DomainTopicProvisioningState.CreateFrom); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopicInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopicInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopicInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopicInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopicInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopicInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopicInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopicInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopic FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Domain Topic. + [System.ComponentModel.TypeConverter(typeof(DomainTopicTypeConverter))] + public partial interface IDomainTopic + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainTopic.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainTopic.TypeConverter.cs new file mode 100644 index 000000000000..eb1a7c730376 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainTopic.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DomainTopicTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopic ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopic).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DomainTopic.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DomainTopic.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DomainTopic.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainTopic.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainTopic.cs new file mode 100644 index 000000000000..68561beb96e0 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainTopic.cs @@ -0,0 +1,199 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Domain Topic. + public partial class DomainTopic : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopic, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopicInternal, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.Resource(); + + /// Fully qualified identifier of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Id; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopicProperties Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopicInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DomainTopicProperties()); set { {_property = value;} } } + + /// Internal Acessors for ProvisioningState + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DomainTopicProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopicInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopicPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopicPropertiesInternal)Property).ProvisioningState = value; } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopicInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.SystemData()); set { {_systemData = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Type = value; } + + /// Name of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopicProperties _property; + + /// Properties of the Domain Topic. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopicProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DomainTopicProperties()); } + + /// Provisioning state of the domain topic. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DomainTopicProvisioningState? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopicPropertiesInternal)Property).ProvisioningState; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData _systemData; + + /// The system metadata relating to Domain Topic resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.SystemData()); } + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).CreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType)""); } + + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType)""); } + + /// Type of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public DomainTopic() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// Domain Topic. + public partial interface IDomainTopic : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResource + { + /// Provisioning state of the domain topic. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Provisioning state of the domain topic.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DomainTopicProvisioningState) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DomainTopicProvisioningState? ProvisioningState { get; } + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timestamp of resource creation (UTC).", + SerializedName = @"createdAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SystemDataCreatedAt { get; set; } + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identity that created the resource.", + SerializedName = @"createdBy", + PossibleTypes = new [] { typeof(string) })] + string SystemDataCreatedBy { get; set; } + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of identity that created the resource.", + SerializedName = @"createdByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType? SystemDataCreatedByType { get; set; } + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timestamp of resource last modification (UTC)", + SerializedName = @"lastModifiedAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SystemDataLastModifiedAt { get; set; } + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identity that last modified the resource.", + SerializedName = @"lastModifiedBy", + PossibleTypes = new [] { typeof(string) })] + string SystemDataLastModifiedBy { get; set; } + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of identity that last modified the resource.", + SerializedName = @"lastModifiedByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + + } + /// Domain Topic. + internal partial interface IDomainTopicInternal : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal + { + /// Properties of the Domain Topic. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopicProperties Property { get; set; } + /// Provisioning state of the domain topic. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DomainTopicProvisioningState? ProvisioningState { get; set; } + /// The system metadata relating to Domain Topic resource. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData SystemData { get; set; } + /// The timestamp of resource creation (UTC). + global::System.DateTime? SystemDataCreatedAt { get; set; } + /// The identity that created the resource. + string SystemDataCreatedBy { get; set; } + /// The type of identity that created the resource. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType? SystemDataCreatedByType { get; set; } + /// The timestamp of resource last modification (UTC) + global::System.DateTime? SystemDataLastModifiedAt { get; set; } + /// The identity that last modified the resource. + string SystemDataLastModifiedBy { get; set; } + /// The type of identity that last modified the resource. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainTopic.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainTopic.json.cs new file mode 100644 index 000000000000..adea28f6fb7f --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainTopic.json.cs @@ -0,0 +1,116 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Domain Topic. + public partial class DomainTopic + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal DomainTopic(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DomainTopicProperties.FromJson(__jsonProperties) : Property;} + {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.SystemData.FromJson(__jsonSystemData) : SystemData;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopic. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopic. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopic FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new DomainTopic(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._systemData ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._systemData.ToJson(null,serializationMode) : null, "systemData" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainTopicProperties.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainTopicProperties.PowerShell.cs new file mode 100644 index 000000000000..f8dd1573cb33 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainTopicProperties.PowerShell.cs @@ -0,0 +1,144 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Properties of the Domain Topic. + [System.ComponentModel.TypeConverter(typeof(DomainTopicPropertiesTypeConverter))] + public partial class DomainTopicProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopicProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DomainTopicProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopicProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DomainTopicProperties(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal DomainTopicProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopicPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DomainTopicProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopicPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DomainTopicProvisioningState.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal DomainTopicProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopicPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DomainTopicProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopicPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DomainTopicProvisioningState.CreateFrom); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopicProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties of the Domain Topic. + [System.ComponentModel.TypeConverter(typeof(DomainTopicPropertiesTypeConverter))] + public partial interface IDomainTopicProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainTopicProperties.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainTopicProperties.TypeConverter.cs new file mode 100644 index 000000000000..f5fc1dbd0ced --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainTopicProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DomainTopicPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopicProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopicProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DomainTopicProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DomainTopicProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DomainTopicProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainTopicProperties.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainTopicProperties.cs new file mode 100644 index 000000000000..c2d75e930caf --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainTopicProperties.cs @@ -0,0 +1,54 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Properties of the Domain Topic. + public partial class DomainTopicProperties : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopicProperties, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopicPropertiesInternal + { + + /// Internal Acessors for ProvisioningState + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DomainTopicProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopicPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DomainTopicProvisioningState? _provisioningState; + + /// Provisioning state of the domain topic. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DomainTopicProvisioningState? ProvisioningState { get => this._provisioningState; } + + /// Creates an new instance. + public DomainTopicProperties() + { + + } + } + /// Properties of the Domain Topic. + public partial interface IDomainTopicProperties : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// Provisioning state of the domain topic. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Provisioning state of the domain topic.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DomainTopicProvisioningState) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DomainTopicProvisioningState? ProvisioningState { get; } + + } + /// Properties of the Domain Topic. + internal partial interface IDomainTopicPropertiesInternal + + { + /// Provisioning state of the domain topic. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DomainTopicProvisioningState? ProvisioningState { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainTopicProperties.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainTopicProperties.json.cs new file mode 100644 index 000000000000..e46bbc565620 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainTopicProperties.json.cs @@ -0,0 +1,109 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Properties of the Domain Topic. + public partial class DomainTopicProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal DomainTopicProperties(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopicProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopicProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopicProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new DomainTopicProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainTopicsListResult.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainTopicsListResult.PowerShell.cs new file mode 100644 index 000000000000..c65cd96bffe2 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainTopicsListResult.PowerShell.cs @@ -0,0 +1,152 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Result of the List Domain Topics operation. + [System.ComponentModel.TypeConverter(typeof(DomainTopicsListResultTypeConverter))] + public partial class DomainTopicsListResult + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopicsListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DomainTopicsListResult(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopicsListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DomainTopicsListResult(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal DomainTopicsListResult(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopicsListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopic[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopicsListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DomainTopicTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopicsListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopicsListResultInternal)this).NextLink, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal DomainTopicsListResult(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopicsListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopic[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopicsListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DomainTopicTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopicsListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopicsListResultInternal)this).NextLink, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopicsListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Result of the List Domain Topics operation. + [System.ComponentModel.TypeConverter(typeof(DomainTopicsListResultTypeConverter))] + public partial interface IDomainTopicsListResult + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainTopicsListResult.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainTopicsListResult.TypeConverter.cs new file mode 100644 index 000000000000..c8fb0cc6c024 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainTopicsListResult.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DomainTopicsListResultTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopicsListResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopicsListResult).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DomainTopicsListResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DomainTopicsListResult.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DomainTopicsListResult.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainTopicsListResult.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainTopicsListResult.cs new file mode 100644 index 000000000000..6ae08f26c763 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainTopicsListResult.cs @@ -0,0 +1,68 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Result of the List Domain Topics operation. + public partial class DomainTopicsListResult : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopicsListResult, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopicsListResultInternal + { + + /// Backing field for property. + private string _nextLink; + + /// A link for the next page of domain topics. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopic[] _value; + + /// A collection of Domain Topics. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopic[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public DomainTopicsListResult() + { + + } + } + /// Result of the List Domain Topics operation. + public partial interface IDomainTopicsListResult : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// A link for the next page of domain topics. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A link for the next page of domain topics.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// A collection of Domain Topics. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A collection of Domain Topics.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopic) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopic[] Value { get; set; } + + } + /// Result of the List Domain Topics operation. + internal partial interface IDomainTopicsListResultInternal + + { + /// A link for the next page of domain topics. + string NextLink { get; set; } + /// A collection of Domain Topics. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopic[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainTopicsListResult.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainTopicsListResult.json.cs new file mode 100644 index 000000000000..0f3f0730f21d --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainTopicsListResult.json.cs @@ -0,0 +1,116 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Result of the List Domain Topics operation. + public partial class DomainTopicsListResult + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal DomainTopicsListResult(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopic) (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DomainTopic.FromJson(__u) )) ))() : null : Value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopicsListResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopicsListResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopicsListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new DomainTopicsListResult(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainUpdateParameterProperties.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainUpdateParameterProperties.PowerShell.cs new file mode 100644 index 000000000000..1cfa5d7014b1 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainUpdateParameterProperties.PowerShell.cs @@ -0,0 +1,184 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Information of domain update parameter properties. + [System.ComponentModel.TypeConverter(typeof(DomainUpdateParameterPropertiesTypeConverter))] + public partial class DomainUpdateParameterProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParameterProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DomainUpdateParameterProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParameterProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DomainUpdateParameterProperties(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal DomainUpdateParameterProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("PublicNetworkAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParameterPropertiesInternal)this).PublicNetworkAccess = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess?) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParameterPropertiesInternal)this).PublicNetworkAccess, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess.CreateFrom); + } + if (content.Contains("InboundIPRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParameterPropertiesInternal)this).InboundIPRule = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[]) content.GetValueForProperty("InboundIPRule",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParameterPropertiesInternal)this).InboundIPRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.InboundIPRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("DisableLocalAuth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParameterPropertiesInternal)this).DisableLocalAuth = (bool?) content.GetValueForProperty("DisableLocalAuth",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParameterPropertiesInternal)this).DisableLocalAuth, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AutoCreateTopicWithFirstSubscription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParameterPropertiesInternal)this).AutoCreateTopicWithFirstSubscription = (bool?) content.GetValueForProperty("AutoCreateTopicWithFirstSubscription",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParameterPropertiesInternal)this).AutoCreateTopicWithFirstSubscription, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AutoDeleteTopicWithLastSubscription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParameterPropertiesInternal)this).AutoDeleteTopicWithLastSubscription = (bool?) content.GetValueForProperty("AutoDeleteTopicWithLastSubscription",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParameterPropertiesInternal)this).AutoDeleteTopicWithLastSubscription, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DataResidencyBoundary")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParameterPropertiesInternal)this).DataResidencyBoundary = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary?) content.GetValueForProperty("DataResidencyBoundary",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParameterPropertiesInternal)this).DataResidencyBoundary, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal DomainUpdateParameterProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("PublicNetworkAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParameterPropertiesInternal)this).PublicNetworkAccess = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess?) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParameterPropertiesInternal)this).PublicNetworkAccess, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess.CreateFrom); + } + if (content.Contains("InboundIPRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParameterPropertiesInternal)this).InboundIPRule = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[]) content.GetValueForProperty("InboundIPRule",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParameterPropertiesInternal)this).InboundIPRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.InboundIPRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("DisableLocalAuth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParameterPropertiesInternal)this).DisableLocalAuth = (bool?) content.GetValueForProperty("DisableLocalAuth",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParameterPropertiesInternal)this).DisableLocalAuth, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AutoCreateTopicWithFirstSubscription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParameterPropertiesInternal)this).AutoCreateTopicWithFirstSubscription = (bool?) content.GetValueForProperty("AutoCreateTopicWithFirstSubscription",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParameterPropertiesInternal)this).AutoCreateTopicWithFirstSubscription, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AutoDeleteTopicWithLastSubscription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParameterPropertiesInternal)this).AutoDeleteTopicWithLastSubscription = (bool?) content.GetValueForProperty("AutoDeleteTopicWithLastSubscription",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParameterPropertiesInternal)this).AutoDeleteTopicWithLastSubscription, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DataResidencyBoundary")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParameterPropertiesInternal)this).DataResidencyBoundary = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary?) content.GetValueForProperty("DataResidencyBoundary",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParameterPropertiesInternal)this).DataResidencyBoundary, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary.CreateFrom); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParameterProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Information of domain update parameter properties. + [System.ComponentModel.TypeConverter(typeof(DomainUpdateParameterPropertiesTypeConverter))] + public partial interface IDomainUpdateParameterProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainUpdateParameterProperties.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainUpdateParameterProperties.TypeConverter.cs new file mode 100644 index 000000000000..40d0b3d96423 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainUpdateParameterProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DomainUpdateParameterPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParameterProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParameterProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DomainUpdateParameterProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DomainUpdateParameterProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DomainUpdateParameterProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainUpdateParameterProperties.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainUpdateParameterProperties.cs new file mode 100644 index 000000000000..3b3a4a89e18b --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainUpdateParameterProperties.cs @@ -0,0 +1,263 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Information of domain update parameter properties. + public partial class DomainUpdateParameterProperties : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParameterProperties, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParameterPropertiesInternal + { + + /// Backing field for property. + private bool? _autoCreateTopicWithFirstSubscription; + + /// + /// This Boolean is used to specify the creation mechanism for 'all' the Event Grid Domain Topics associated with this Event + /// Grid Domain resource. + /// In this context, creation of domain topic can be auto-managed (when true) or self-managed (when false). The default value + /// for this property is true. + /// When this property is null or set to true, Event Grid is responsible of automatically creating the domain topic when the + /// first event subscription is + /// created at the scope of the domain topic. If this property is set to false, then creating the first event subscription + /// will require creating a domain topic + /// by the user. The self-management mode can be used if the user wants full control of when the domain topic is created, + /// while auto-managed mode provides the + /// flexibility to perform less operations and manage fewer resources by the user. Also, note that in auto-managed creation + /// mode, user is allowed to create the + /// domain topic on demand if needed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public bool? AutoCreateTopicWithFirstSubscription { get => this._autoCreateTopicWithFirstSubscription; set => this._autoCreateTopicWithFirstSubscription = value; } + + /// Backing field for property. + private bool? _autoDeleteTopicWithLastSubscription; + + /// + /// This Boolean is used to specify the deletion mechanism for 'all' the Event Grid Domain Topics associated with this Event + /// Grid Domain resource. + /// In this context, deletion of domain topic can be auto-managed (when true) or self-managed (when false). The default value + /// for this property is true. + /// When this property is set to true, Event Grid is responsible of automatically deleting the domain topic when the last + /// event subscription at the scope + /// of the domain topic is deleted. If this property is set to false, then the user needs to manually delete the domain topic + /// when it is no longer needed + /// (e.g., when last event subscription is deleted and the resource needs to be cleaned up). The self-management mode can + /// be used if the user wants full + /// control of when the domain topic needs to be deleted, while auto-managed mode provides the flexibility to perform less + /// operations and manage fewer + /// resources by the user. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public bool? AutoDeleteTopicWithLastSubscription { get => this._autoDeleteTopicWithLastSubscription; set => this._autoDeleteTopicWithLastSubscription = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary? _dataResidencyBoundary; + + /// The data residency boundary for the domain. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary? DataResidencyBoundary { get => this._dataResidencyBoundary; set => this._dataResidencyBoundary = value; } + + /// Backing field for property. + private bool? _disableLocalAuth; + + /// + /// This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD + /// token will be used to authenticate if user is allowed to publish to the domain. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public bool? DisableLocalAuth { get => this._disableLocalAuth; set => this._disableLocalAuth = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[] _inboundIPRule; + + /// + /// This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess + /// is enabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[] InboundIPRule { get => this._inboundIPRule; set => this._inboundIPRule = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess? _publicNetworkAccess; + + /// + /// This determines if traffic is allowed over public network. By default it is enabled. + /// You can further restrict to specific IPs by configuring + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess? PublicNetworkAccess { get => this._publicNetworkAccess; set => this._publicNetworkAccess = value; } + + /// Creates an new instance. + public DomainUpdateParameterProperties() + { + + } + } + /// Information of domain update parameter properties. + public partial interface IDomainUpdateParameterProperties : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// + /// This Boolean is used to specify the creation mechanism for 'all' the Event Grid Domain Topics associated with this Event + /// Grid Domain resource. + /// In this context, creation of domain topic can be auto-managed (when true) or self-managed (when false). The default value + /// for this property is true. + /// When this property is null or set to true, Event Grid is responsible of automatically creating the domain topic when the + /// first event subscription is + /// created at the scope of the domain topic. If this property is set to false, then creating the first event subscription + /// will require creating a domain topic + /// by the user. The self-management mode can be used if the user wants full control of when the domain topic is created, + /// while auto-managed mode provides the + /// flexibility to perform less operations and manage fewer resources by the user. Also, note that in auto-managed creation + /// mode, user is allowed to create the + /// domain topic on demand if needed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This Boolean is used to specify the creation mechanism for 'all' the Event Grid Domain Topics associated with this Event Grid Domain resource. + In this context, creation of domain topic can be auto-managed (when true) or self-managed (when false). The default value for this property is true. + When this property is null or set to true, Event Grid is responsible of automatically creating the domain topic when the first event subscription is + created at the scope of the domain topic. If this property is set to false, then creating the first event subscription will require creating a domain topic + by the user. The self-management mode can be used if the user wants full control of when the domain topic is created, while auto-managed mode provides the + flexibility to perform less operations and manage fewer resources by the user. Also, note that in auto-managed creation mode, user is allowed to create the + domain topic on demand if needed.", + SerializedName = @"autoCreateTopicWithFirstSubscription", + PossibleTypes = new [] { typeof(bool) })] + bool? AutoCreateTopicWithFirstSubscription { get; set; } + /// + /// This Boolean is used to specify the deletion mechanism for 'all' the Event Grid Domain Topics associated with this Event + /// Grid Domain resource. + /// In this context, deletion of domain topic can be auto-managed (when true) or self-managed (when false). The default value + /// for this property is true. + /// When this property is set to true, Event Grid is responsible of automatically deleting the domain topic when the last + /// event subscription at the scope + /// of the domain topic is deleted. If this property is set to false, then the user needs to manually delete the domain topic + /// when it is no longer needed + /// (e.g., when last event subscription is deleted and the resource needs to be cleaned up). The self-management mode can + /// be used if the user wants full + /// control of when the domain topic needs to be deleted, while auto-managed mode provides the flexibility to perform less + /// operations and manage fewer + /// resources by the user. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This Boolean is used to specify the deletion mechanism for 'all' the Event Grid Domain Topics associated with this Event Grid Domain resource. + In this context, deletion of domain topic can be auto-managed (when true) or self-managed (when false). The default value for this property is true. + When this property is set to true, Event Grid is responsible of automatically deleting the domain topic when the last event subscription at the scope + of the domain topic is deleted. If this property is set to false, then the user needs to manually delete the domain topic when it is no longer needed + (e.g., when last event subscription is deleted and the resource needs to be cleaned up). The self-management mode can be used if the user wants full + control of when the domain topic needs to be deleted, while auto-managed mode provides the flexibility to perform less operations and manage fewer + resources by the user.", + SerializedName = @"autoDeleteTopicWithLastSubscription", + PossibleTypes = new [] { typeof(bool) })] + bool? AutoDeleteTopicWithLastSubscription { get; set; } + /// The data residency boundary for the domain. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The data residency boundary for the domain.", + SerializedName = @"dataResidencyBoundary", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary? DataResidencyBoundary { get; set; } + /// + /// This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD + /// token will be used to authenticate if user is allowed to publish to the domain. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD token will be used to authenticate if user is allowed to publish to the domain.", + SerializedName = @"disableLocalAuth", + PossibleTypes = new [] { typeof(bool) })] + bool? DisableLocalAuth { get; set; } + /// + /// This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess + /// is enabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess is enabled.", + SerializedName = @"inboundIpRules", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[] InboundIPRule { get; set; } + /// + /// This determines if traffic is allowed over public network. By default it is enabled. + /// You can further restrict to specific IPs by configuring + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This determines if traffic is allowed over public network. By default it is enabled. + You can further restrict to specific IPs by configuring ", + SerializedName = @"publicNetworkAccess", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess? PublicNetworkAccess { get; set; } + + } + /// Information of domain update parameter properties. + internal partial interface IDomainUpdateParameterPropertiesInternal + + { + /// + /// This Boolean is used to specify the creation mechanism for 'all' the Event Grid Domain Topics associated with this Event + /// Grid Domain resource. + /// In this context, creation of domain topic can be auto-managed (when true) or self-managed (when false). The default value + /// for this property is true. + /// When this property is null or set to true, Event Grid is responsible of automatically creating the domain topic when the + /// first event subscription is + /// created at the scope of the domain topic. If this property is set to false, then creating the first event subscription + /// will require creating a domain topic + /// by the user. The self-management mode can be used if the user wants full control of when the domain topic is created, + /// while auto-managed mode provides the + /// flexibility to perform less operations and manage fewer resources by the user. Also, note that in auto-managed creation + /// mode, user is allowed to create the + /// domain topic on demand if needed. + /// + bool? AutoCreateTopicWithFirstSubscription { get; set; } + /// + /// This Boolean is used to specify the deletion mechanism for 'all' the Event Grid Domain Topics associated with this Event + /// Grid Domain resource. + /// In this context, deletion of domain topic can be auto-managed (when true) or self-managed (when false). The default value + /// for this property is true. + /// When this property is set to true, Event Grid is responsible of automatically deleting the domain topic when the last + /// event subscription at the scope + /// of the domain topic is deleted. If this property is set to false, then the user needs to manually delete the domain topic + /// when it is no longer needed + /// (e.g., when last event subscription is deleted and the resource needs to be cleaned up). The self-management mode can + /// be used if the user wants full + /// control of when the domain topic needs to be deleted, while auto-managed mode provides the flexibility to perform less + /// operations and manage fewer + /// resources by the user. + /// + bool? AutoDeleteTopicWithLastSubscription { get; set; } + /// The data residency boundary for the domain. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary? DataResidencyBoundary { get; set; } + /// + /// This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD + /// token will be used to authenticate if user is allowed to publish to the domain. + /// + bool? DisableLocalAuth { get; set; } + /// + /// This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess + /// is enabled. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[] InboundIPRule { get; set; } + /// + /// This determines if traffic is allowed over public network. By default it is enabled. + /// You can further restrict to specific IPs by configuring + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess? PublicNetworkAccess { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainUpdateParameterProperties.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainUpdateParameterProperties.json.cs new file mode 100644 index 000000000000..69418f0523bf --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainUpdateParameterProperties.json.cs @@ -0,0 +1,124 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Information of domain update parameter properties. + public partial class DomainUpdateParameterProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal DomainUpdateParameterProperties(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_publicNetworkAccess = If( json?.PropertyT("publicNetworkAccess"), out var __jsonPublicNetworkAccess) ? (string)__jsonPublicNetworkAccess : (string)PublicNetworkAccess;} + {_inboundIPRule = If( json?.PropertyT("inboundIpRules"), out var __jsonInboundIPRules) ? If( __jsonInboundIPRules as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule) (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.InboundIPRule.FromJson(__u) )) ))() : null : InboundIPRule;} + {_disableLocalAuth = If( json?.PropertyT("disableLocalAuth"), out var __jsonDisableLocalAuth) ? (bool?)__jsonDisableLocalAuth : DisableLocalAuth;} + {_autoCreateTopicWithFirstSubscription = If( json?.PropertyT("autoCreateTopicWithFirstSubscription"), out var __jsonAutoCreateTopicWithFirstSubscription) ? (bool?)__jsonAutoCreateTopicWithFirstSubscription : AutoCreateTopicWithFirstSubscription;} + {_autoDeleteTopicWithLastSubscription = If( json?.PropertyT("autoDeleteTopicWithLastSubscription"), out var __jsonAutoDeleteTopicWithLastSubscription) ? (bool?)__jsonAutoDeleteTopicWithLastSubscription : AutoDeleteTopicWithLastSubscription;} + {_dataResidencyBoundary = If( json?.PropertyT("dataResidencyBoundary"), out var __jsonDataResidencyBoundary) ? (string)__jsonDataResidencyBoundary : (string)DataResidencyBoundary;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParameterProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParameterProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParameterProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new DomainUpdateParameterProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._publicNetworkAccess)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._publicNetworkAccess.ToString()) : null, "publicNetworkAccess" ,container.Add ); + if (null != this._inboundIPRule) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.XNodeArray(); + foreach( var __x in this._inboundIPRule ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("inboundIpRules",__w); + } + AddIf( null != this._disableLocalAuth ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonBoolean((bool)this._disableLocalAuth) : null, "disableLocalAuth" ,container.Add ); + AddIf( null != this._autoCreateTopicWithFirstSubscription ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonBoolean((bool)this._autoCreateTopicWithFirstSubscription) : null, "autoCreateTopicWithFirstSubscription" ,container.Add ); + AddIf( null != this._autoDeleteTopicWithLastSubscription ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonBoolean((bool)this._autoDeleteTopicWithLastSubscription) : null, "autoDeleteTopicWithLastSubscription" ,container.Add ); + AddIf( null != (((object)this._dataResidencyBoundary)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._dataResidencyBoundary.ToString()) : null, "dataResidencyBoundary" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainUpdateParameters.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainUpdateParameters.PowerShell.cs new file mode 100644 index 000000000000..ffbc80f89994 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainUpdateParameters.PowerShell.cs @@ -0,0 +1,256 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Properties of the Domain update. + [System.ComponentModel.TypeConverter(typeof(DomainUpdateParametersTypeConverter))] + public partial class DomainUpdateParameters + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DomainUpdateParameters(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DomainUpdateParameters(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal DomainUpdateParameters(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParametersInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParameterProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParametersInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DomainUpdateParameterPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Identity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParametersInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfo) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParametersInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IdentityInfoTypeConverter.ConvertFrom); + } + if (content.Contains("Sku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParametersInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceSku) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParametersInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ResourceSkuTypeConverter.ConvertFrom); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DomainUpdateParametersTagsTypeConverter.ConvertFrom); + } + if (content.Contains("IdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParametersInternal)this).IdentityType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType?) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParametersInternal)this).IdentityType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType.CreateFrom); + } + if (content.Contains("SkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParametersInternal)this).SkuName = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku?) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParametersInternal)this).SkuName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku.CreateFrom); + } + if (content.Contains("PublicNetworkAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParametersInternal)this).PublicNetworkAccess = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess?) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParametersInternal)this).PublicNetworkAccess, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess.CreateFrom); + } + if (content.Contains("InboundIPRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParametersInternal)this).InboundIPRule = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[]) content.GetValueForProperty("InboundIPRule",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParametersInternal)this).InboundIPRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.InboundIPRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("DisableLocalAuth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParametersInternal)this).DisableLocalAuth = (bool?) content.GetValueForProperty("DisableLocalAuth",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParametersInternal)this).DisableLocalAuth, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AutoCreateTopicWithFirstSubscription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParametersInternal)this).AutoCreateTopicWithFirstSubscription = (bool?) content.GetValueForProperty("AutoCreateTopicWithFirstSubscription",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParametersInternal)this).AutoCreateTopicWithFirstSubscription, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AutoDeleteTopicWithLastSubscription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParametersInternal)this).AutoDeleteTopicWithLastSubscription = (bool?) content.GetValueForProperty("AutoDeleteTopicWithLastSubscription",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParametersInternal)this).AutoDeleteTopicWithLastSubscription, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DataResidencyBoundary")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParametersInternal)this).DataResidencyBoundary = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary?) content.GetValueForProperty("DataResidencyBoundary",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParametersInternal)this).DataResidencyBoundary, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary.CreateFrom); + } + if (content.Contains("IdentityPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParametersInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParametersInternal)this).IdentityPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("IdentityTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParametersInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParametersInternal)this).IdentityTenantId, global::System.Convert.ToString); + } + if (content.Contains("IdentityUserAssignedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParametersInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParametersInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IdentityInfoUserAssignedIdentitiesTypeConverter.ConvertFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal DomainUpdateParameters(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParametersInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParameterProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParametersInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DomainUpdateParameterPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Identity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParametersInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfo) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParametersInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IdentityInfoTypeConverter.ConvertFrom); + } + if (content.Contains("Sku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParametersInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceSku) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParametersInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ResourceSkuTypeConverter.ConvertFrom); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DomainUpdateParametersTagsTypeConverter.ConvertFrom); + } + if (content.Contains("IdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParametersInternal)this).IdentityType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType?) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParametersInternal)this).IdentityType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType.CreateFrom); + } + if (content.Contains("SkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParametersInternal)this).SkuName = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku?) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParametersInternal)this).SkuName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku.CreateFrom); + } + if (content.Contains("PublicNetworkAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParametersInternal)this).PublicNetworkAccess = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess?) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParametersInternal)this).PublicNetworkAccess, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess.CreateFrom); + } + if (content.Contains("InboundIPRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParametersInternal)this).InboundIPRule = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[]) content.GetValueForProperty("InboundIPRule",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParametersInternal)this).InboundIPRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.InboundIPRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("DisableLocalAuth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParametersInternal)this).DisableLocalAuth = (bool?) content.GetValueForProperty("DisableLocalAuth",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParametersInternal)this).DisableLocalAuth, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AutoCreateTopicWithFirstSubscription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParametersInternal)this).AutoCreateTopicWithFirstSubscription = (bool?) content.GetValueForProperty("AutoCreateTopicWithFirstSubscription",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParametersInternal)this).AutoCreateTopicWithFirstSubscription, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AutoDeleteTopicWithLastSubscription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParametersInternal)this).AutoDeleteTopicWithLastSubscription = (bool?) content.GetValueForProperty("AutoDeleteTopicWithLastSubscription",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParametersInternal)this).AutoDeleteTopicWithLastSubscription, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DataResidencyBoundary")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParametersInternal)this).DataResidencyBoundary = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary?) content.GetValueForProperty("DataResidencyBoundary",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParametersInternal)this).DataResidencyBoundary, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary.CreateFrom); + } + if (content.Contains("IdentityPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParametersInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParametersInternal)this).IdentityPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("IdentityTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParametersInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParametersInternal)this).IdentityTenantId, global::System.Convert.ToString); + } + if (content.Contains("IdentityUserAssignedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParametersInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParametersInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IdentityInfoUserAssignedIdentitiesTypeConverter.ConvertFrom); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties of the Domain update. + [System.ComponentModel.TypeConverter(typeof(DomainUpdateParametersTypeConverter))] + public partial interface IDomainUpdateParameters + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainUpdateParameters.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainUpdateParameters.TypeConverter.cs new file mode 100644 index 000000000000..2efcbe5d700d --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainUpdateParameters.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DomainUpdateParametersTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParameters ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParameters).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DomainUpdateParameters.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DomainUpdateParameters.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DomainUpdateParameters.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainUpdateParameters.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainUpdateParameters.cs new file mode 100644 index 000000000000..a6b0addc4f13 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainUpdateParameters.cs @@ -0,0 +1,394 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Properties of the Domain update. + public partial class DomainUpdateParameters : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParameters, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParametersInternal + { + + /// + /// This Boolean is used to specify the creation mechanism for 'all' the Event Grid Domain Topics associated with this Event + /// Grid Domain resource. + /// In this context, creation of domain topic can be auto-managed (when true) or self-managed (when false). The default value + /// for this property is true. + /// When this property is null or set to true, Event Grid is responsible of automatically creating the domain topic when the + /// first event subscription is + /// created at the scope of the domain topic. If this property is set to false, then creating the first event subscription + /// will require creating a domain topic + /// by the user. The self-management mode can be used if the user wants full control of when the domain topic is created, + /// while auto-managed mode provides the + /// flexibility to perform less operations and manage fewer resources by the user. Also, note that in auto-managed creation + /// mode, user is allowed to create the + /// domain topic on demand if needed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public bool? AutoCreateTopicWithFirstSubscription { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParameterPropertiesInternal)Property).AutoCreateTopicWithFirstSubscription; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParameterPropertiesInternal)Property).AutoCreateTopicWithFirstSubscription = value ?? default(bool); } + + /// + /// This Boolean is used to specify the deletion mechanism for 'all' the Event Grid Domain Topics associated with this Event + /// Grid Domain resource. + /// In this context, deletion of domain topic can be auto-managed (when true) or self-managed (when false). The default value + /// for this property is true. + /// When this property is set to true, Event Grid is responsible of automatically deleting the domain topic when the last + /// event subscription at the scope + /// of the domain topic is deleted. If this property is set to false, then the user needs to manually delete the domain topic + /// when it is no longer needed + /// (e.g., when last event subscription is deleted and the resource needs to be cleaned up). The self-management mode can + /// be used if the user wants full + /// control of when the domain topic needs to be deleted, while auto-managed mode provides the flexibility to perform less + /// operations and manage fewer + /// resources by the user. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public bool? AutoDeleteTopicWithLastSubscription { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParameterPropertiesInternal)Property).AutoDeleteTopicWithLastSubscription; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParameterPropertiesInternal)Property).AutoDeleteTopicWithLastSubscription = value ?? default(bool); } + + /// The data residency boundary for the domain. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary? DataResidencyBoundary { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParameterPropertiesInternal)Property).DataResidencyBoundary; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParameterPropertiesInternal)Property).DataResidencyBoundary = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary)""); } + + /// + /// This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD + /// token will be used to authenticate if user is allowed to publish to the domain. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public bool? DisableLocalAuth { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParameterPropertiesInternal)Property).DisableLocalAuth; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParameterPropertiesInternal)Property).DisableLocalAuth = value ?? default(bool); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfo _identity; + + /// Identity information for the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfo Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IdentityInfo()); set => this._identity = value; } + + /// The principal ID of resource identity. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoInternal)Identity).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoInternal)Identity).PrincipalId = value ?? null; } + + /// The tenant ID of resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoInternal)Identity).TenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoInternal)Identity).TenantId = value ?? null; } + + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType? IdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoInternal)Identity).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoInternal)Identity).Type = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType)""); } + + /// + /// The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource + /// ids in the form: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + /// This property is currently not used and reserved for future usage. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoInternal)Identity).UserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoInternal)Identity).UserAssignedIdentity = value ?? null /* model class */; } + + /// + /// This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess + /// is enabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[] InboundIPRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParameterPropertiesInternal)Property).InboundIPRule; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParameterPropertiesInternal)Property).InboundIPRule = value ?? null /* arrayOf */; } + + /// Internal Acessors for Identity + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfo Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParametersInternal.Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IdentityInfo()); set { {_identity = value;} } } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParameterProperties Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParametersInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DomainUpdateParameterProperties()); set { {_property = value;} } } + + /// Internal Acessors for Sku + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceSku Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParametersInternal.Sku { get => (this._sku = this._sku ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ResourceSku()); set { {_sku = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParameterProperties _property; + + /// Properties of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParameterProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DomainUpdateParameterProperties()); set => this._property = value; } + + /// + /// This determines if traffic is allowed over public network. By default it is enabled. + /// You can further restrict to specific IPs by configuring + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess? PublicNetworkAccess { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParameterPropertiesInternal)Property).PublicNetworkAccess; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParameterPropertiesInternal)Property).PublicNetworkAccess = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess)""); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceSku _sku; + + /// The Sku pricing tier for the domain. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceSku Sku { get => (this._sku = this._sku ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ResourceSku()); set => this._sku = value; } + + /// The Sku name of the resource. The possible values are: Basic or Premium. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku? SkuName { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceSkuInternal)Sku).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceSkuInternal)Sku).Name = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku)""); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParametersTags _tag; + + /// Tags of the domains resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParametersTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DomainUpdateParametersTags()); set => this._tag = value; } + + /// Creates an new instance. + public DomainUpdateParameters() + { + + } + } + /// Properties of the Domain update. + public partial interface IDomainUpdateParameters : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// + /// This Boolean is used to specify the creation mechanism for 'all' the Event Grid Domain Topics associated with this Event + /// Grid Domain resource. + /// In this context, creation of domain topic can be auto-managed (when true) or self-managed (when false). The default value + /// for this property is true. + /// When this property is null or set to true, Event Grid is responsible of automatically creating the domain topic when the + /// first event subscription is + /// created at the scope of the domain topic. If this property is set to false, then creating the first event subscription + /// will require creating a domain topic + /// by the user. The self-management mode can be used if the user wants full control of when the domain topic is created, + /// while auto-managed mode provides the + /// flexibility to perform less operations and manage fewer resources by the user. Also, note that in auto-managed creation + /// mode, user is allowed to create the + /// domain topic on demand if needed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This Boolean is used to specify the creation mechanism for 'all' the Event Grid Domain Topics associated with this Event Grid Domain resource. + In this context, creation of domain topic can be auto-managed (when true) or self-managed (when false). The default value for this property is true. + When this property is null or set to true, Event Grid is responsible of automatically creating the domain topic when the first event subscription is + created at the scope of the domain topic. If this property is set to false, then creating the first event subscription will require creating a domain topic + by the user. The self-management mode can be used if the user wants full control of when the domain topic is created, while auto-managed mode provides the + flexibility to perform less operations and manage fewer resources by the user. Also, note that in auto-managed creation mode, user is allowed to create the + domain topic on demand if needed.", + SerializedName = @"autoCreateTopicWithFirstSubscription", + PossibleTypes = new [] { typeof(bool) })] + bool? AutoCreateTopicWithFirstSubscription { get; set; } + /// + /// This Boolean is used to specify the deletion mechanism for 'all' the Event Grid Domain Topics associated with this Event + /// Grid Domain resource. + /// In this context, deletion of domain topic can be auto-managed (when true) or self-managed (when false). The default value + /// for this property is true. + /// When this property is set to true, Event Grid is responsible of automatically deleting the domain topic when the last + /// event subscription at the scope + /// of the domain topic is deleted. If this property is set to false, then the user needs to manually delete the domain topic + /// when it is no longer needed + /// (e.g., when last event subscription is deleted and the resource needs to be cleaned up). The self-management mode can + /// be used if the user wants full + /// control of when the domain topic needs to be deleted, while auto-managed mode provides the flexibility to perform less + /// operations and manage fewer + /// resources by the user. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This Boolean is used to specify the deletion mechanism for 'all' the Event Grid Domain Topics associated with this Event Grid Domain resource. + In this context, deletion of domain topic can be auto-managed (when true) or self-managed (when false). The default value for this property is true. + When this property is set to true, Event Grid is responsible of automatically deleting the domain topic when the last event subscription at the scope + of the domain topic is deleted. If this property is set to false, then the user needs to manually delete the domain topic when it is no longer needed + (e.g., when last event subscription is deleted and the resource needs to be cleaned up). The self-management mode can be used if the user wants full + control of when the domain topic needs to be deleted, while auto-managed mode provides the flexibility to perform less operations and manage fewer + resources by the user.", + SerializedName = @"autoDeleteTopicWithLastSubscription", + PossibleTypes = new [] { typeof(bool) })] + bool? AutoDeleteTopicWithLastSubscription { get; set; } + /// The data residency boundary for the domain. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The data residency boundary for the domain.", + SerializedName = @"dataResidencyBoundary", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary? DataResidencyBoundary { get; set; } + /// + /// This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD + /// token will be used to authenticate if user is allowed to publish to the domain. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD token will be used to authenticate if user is allowed to publish to the domain.", + SerializedName = @"disableLocalAuth", + PossibleTypes = new [] { typeof(bool) })] + bool? DisableLocalAuth { get; set; } + /// The principal ID of resource identity. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The principal ID of resource identity.", + SerializedName = @"principalId", + PossibleTypes = new [] { typeof(string) })] + string IdentityPrincipalId { get; set; } + /// The tenant ID of resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The tenant ID of resource.", + SerializedName = @"tenantId", + PossibleTypes = new [] { typeof(string) })] + string IdentityTenantId { get; set; } + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType? IdentityType { get; set; } + /// + /// The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource + /// ids in the form: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + /// This property is currently not used and reserved for future usage. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + This property is currently not used and reserved for future usage.", + SerializedName = @"userAssignedIdentities", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } + /// + /// This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess + /// is enabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess is enabled.", + SerializedName = @"inboundIpRules", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[] InboundIPRule { get; set; } + /// + /// This determines if traffic is allowed over public network. By default it is enabled. + /// You can further restrict to specific IPs by configuring + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This determines if traffic is allowed over public network. By default it is enabled. + You can further restrict to specific IPs by configuring ", + SerializedName = @"publicNetworkAccess", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess? PublicNetworkAccess { get; set; } + /// The Sku name of the resource. The possible values are: Basic or Premium. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Sku name of the resource. The possible values are: Basic or Premium.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku? SkuName { get; set; } + /// Tags of the domains resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Tags of the domains resource.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParametersTags) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParametersTags Tag { get; set; } + + } + /// Properties of the Domain update. + internal partial interface IDomainUpdateParametersInternal + + { + /// + /// This Boolean is used to specify the creation mechanism for 'all' the Event Grid Domain Topics associated with this Event + /// Grid Domain resource. + /// In this context, creation of domain topic can be auto-managed (when true) or self-managed (when false). The default value + /// for this property is true. + /// When this property is null or set to true, Event Grid is responsible of automatically creating the domain topic when the + /// first event subscription is + /// created at the scope of the domain topic. If this property is set to false, then creating the first event subscription + /// will require creating a domain topic + /// by the user. The self-management mode can be used if the user wants full control of when the domain topic is created, + /// while auto-managed mode provides the + /// flexibility to perform less operations and manage fewer resources by the user. Also, note that in auto-managed creation + /// mode, user is allowed to create the + /// domain topic on demand if needed. + /// + bool? AutoCreateTopicWithFirstSubscription { get; set; } + /// + /// This Boolean is used to specify the deletion mechanism for 'all' the Event Grid Domain Topics associated with this Event + /// Grid Domain resource. + /// In this context, deletion of domain topic can be auto-managed (when true) or self-managed (when false). The default value + /// for this property is true. + /// When this property is set to true, Event Grid is responsible of automatically deleting the domain topic when the last + /// event subscription at the scope + /// of the domain topic is deleted. If this property is set to false, then the user needs to manually delete the domain topic + /// when it is no longer needed + /// (e.g., when last event subscription is deleted and the resource needs to be cleaned up). The self-management mode can + /// be used if the user wants full + /// control of when the domain topic needs to be deleted, while auto-managed mode provides the flexibility to perform less + /// operations and manage fewer + /// resources by the user. + /// + bool? AutoDeleteTopicWithLastSubscription { get; set; } + /// The data residency boundary for the domain. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary? DataResidencyBoundary { get; set; } + /// + /// This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD + /// token will be used to authenticate if user is allowed to publish to the domain. + /// + bool? DisableLocalAuth { get; set; } + /// Identity information for the resource. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfo Identity { get; set; } + /// The principal ID of resource identity. + string IdentityPrincipalId { get; set; } + /// The tenant ID of resource. + string IdentityTenantId { get; set; } + /// + /// 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. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType? IdentityType { get; set; } + /// + /// The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource + /// ids in the form: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + /// This property is currently not used and reserved for future usage. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } + /// + /// This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess + /// is enabled. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[] InboundIPRule { get; set; } + /// Properties of the resource. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParameterProperties Property { get; set; } + /// + /// This determines if traffic is allowed over public network. By default it is enabled. + /// You can further restrict to specific IPs by configuring + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess? PublicNetworkAccess { get; set; } + /// The Sku pricing tier for the domain. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceSku Sku { get; set; } + /// The Sku name of the resource. The possible values are: Basic or Premium. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku? SkuName { get; set; } + /// Tags of the domains resource. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParametersTags Tag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainUpdateParameters.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainUpdateParameters.json.cs new file mode 100644 index 000000000000..de6c113287dc --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainUpdateParameters.json.cs @@ -0,0 +1,112 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Properties of the Domain update. + public partial class DomainUpdateParameters + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal DomainUpdateParameters(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DomainUpdateParameterProperties.FromJson(__jsonProperties) : Property;} + {_identity = If( json?.PropertyT("identity"), out var __jsonIdentity) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IdentityInfo.FromJson(__jsonIdentity) : Identity;} + {_sku = If( json?.PropertyT("sku"), out var __jsonSku) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ResourceSku.FromJson(__jsonSku) : Sku;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DomainUpdateParametersTags.FromJson(__jsonTags) : Tag;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParameters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParameters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new DomainUpdateParameters(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AddIf( null != this._identity ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._identity.ToJson(null,serializationMode) : null, "identity" ,container.Add ); + AddIf( null != this._sku ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._sku.ToJson(null,serializationMode) : null, "sku" ,container.Add ); + AddIf( null != this._tag ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._tag.ToJson(null,serializationMode) : null, "tags" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainUpdateParametersTags.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainUpdateParametersTags.PowerShell.cs new file mode 100644 index 000000000000..e70e3de535d4 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainUpdateParametersTags.PowerShell.cs @@ -0,0 +1,140 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Tags of the domains resource. + [System.ComponentModel.TypeConverter(typeof(DomainUpdateParametersTagsTypeConverter))] + public partial class DomainUpdateParametersTags + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParametersTags DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DomainUpdateParametersTags(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParametersTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DomainUpdateParametersTags(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal DomainUpdateParametersTags(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal DomainUpdateParametersTags(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParametersTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Tags of the domains resource. + [System.ComponentModel.TypeConverter(typeof(DomainUpdateParametersTagsTypeConverter))] + public partial interface IDomainUpdateParametersTags + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainUpdateParametersTags.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainUpdateParametersTags.TypeConverter.cs new file mode 100644 index 000000000000..bdb49ef22aa2 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainUpdateParametersTags.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DomainUpdateParametersTagsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParametersTags ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParametersTags).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DomainUpdateParametersTags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DomainUpdateParametersTags.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DomainUpdateParametersTags.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainUpdateParametersTags.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainUpdateParametersTags.cs new file mode 100644 index 000000000000..854c071970df --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainUpdateParametersTags.cs @@ -0,0 +1,35 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Tags of the domains resource. + public partial class DomainUpdateParametersTags : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParametersTags, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParametersTagsInternal + { + + /// Creates an new instance. + public DomainUpdateParametersTags() + { + + } + } + /// Tags of the domains resource. + public partial interface IDomainUpdateParametersTags : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray + { + + } + /// Tags of the domains resource. + internal partial interface IDomainUpdateParametersTagsInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainUpdateParametersTags.dictionary.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainUpdateParametersTags.dictionary.cs new file mode 100644 index 000000000000..3bd6ed7edf6c --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainUpdateParametersTags.dictionary.cs @@ -0,0 +1,75 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + public partial class DomainUpdateParametersTags : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DomainUpdateParametersTags source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainUpdateParametersTags.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainUpdateParametersTags.json.cs new file mode 100644 index 000000000000..86c54ec44dc6 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainUpdateParametersTags.json.cs @@ -0,0 +1,107 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Tags of the domains resource. + public partial class DomainUpdateParametersTags + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + /// + internal DomainUpdateParametersTags(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParametersTags. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParametersTags. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParametersTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new DomainUpdateParametersTags(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainsListResult.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainsListResult.PowerShell.cs new file mode 100644 index 000000000000..348c8d882b68 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainsListResult.PowerShell.cs @@ -0,0 +1,150 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Result of the List Domains operation + [System.ComponentModel.TypeConverter(typeof(DomainsListResultTypeConverter))] + public partial class DomainsListResult + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainsListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DomainsListResult(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainsListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DomainsListResult(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal DomainsListResult(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainsListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomain[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainsListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DomainTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainsListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainsListResultInternal)this).NextLink, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal DomainsListResult(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainsListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomain[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainsListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DomainTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainsListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainsListResultInternal)this).NextLink, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainsListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Result of the List Domains operation + [System.ComponentModel.TypeConverter(typeof(DomainsListResultTypeConverter))] + public partial interface IDomainsListResult + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainsListResult.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainsListResult.TypeConverter.cs new file mode 100644 index 000000000000..bcfa48343c73 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainsListResult.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DomainsListResultTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainsListResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainsListResult).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DomainsListResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DomainsListResult.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DomainsListResult.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainsListResult.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainsListResult.cs new file mode 100644 index 000000000000..a8ae2b2df24f --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainsListResult.cs @@ -0,0 +1,68 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Result of the List Domains operation + public partial class DomainsListResult : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainsListResult, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainsListResultInternal + { + + /// Backing field for property. + private string _nextLink; + + /// A link for the next page of domains + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomain[] _value; + + /// A collection of Domains + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomain[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public DomainsListResult() + { + + } + } + /// Result of the List Domains operation + public partial interface IDomainsListResult : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// A link for the next page of domains + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A link for the next page of domains", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// A collection of Domains + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A collection of Domains", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomain) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomain[] Value { get; set; } + + } + /// Result of the List Domains operation + internal partial interface IDomainsListResultInternal + + { + /// A link for the next page of domains + string NextLink { get; set; } + /// A collection of Domains + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomain[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainsListResult.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainsListResult.json.cs new file mode 100644 index 000000000000..adc0b8ceeb9e --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DomainsListResult.json.cs @@ -0,0 +1,116 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Result of the List Domains operation + public partial class DomainsListResult + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal DomainsListResult(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomain) (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.Domain.FromJson(__u) )) ))() : null : Value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainsListResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainsListResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainsListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new DomainsListResult(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DynamicDeliveryAttributeMapping.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DynamicDeliveryAttributeMapping.PowerShell.cs new file mode 100644 index 000000000000..7aae3405fccb --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DynamicDeliveryAttributeMapping.PowerShell.cs @@ -0,0 +1,168 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Dynamic delivery attribute mapping details. + [System.ComponentModel.TypeConverter(typeof(DynamicDeliveryAttributeMappingTypeConverter))] + public partial class DynamicDeliveryAttributeMapping + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDynamicDeliveryAttributeMapping DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DynamicDeliveryAttributeMapping(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDynamicDeliveryAttributeMapping DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DynamicDeliveryAttributeMapping(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal DynamicDeliveryAttributeMapping(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDynamicDeliveryAttributeMappingInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDynamicDeliveryAttributeMappingProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDynamicDeliveryAttributeMappingInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DynamicDeliveryAttributeMappingPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMappingInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMappingInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMappingInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DeliveryAttributeMappingType) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMappingInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DeliveryAttributeMappingType.CreateFrom); + } + if (content.Contains("SourceField")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDynamicDeliveryAttributeMappingInternal)this).SourceField = (string) content.GetValueForProperty("SourceField",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDynamicDeliveryAttributeMappingInternal)this).SourceField, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal DynamicDeliveryAttributeMapping(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDynamicDeliveryAttributeMappingInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDynamicDeliveryAttributeMappingProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDynamicDeliveryAttributeMappingInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DynamicDeliveryAttributeMappingPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMappingInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMappingInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMappingInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DeliveryAttributeMappingType) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMappingInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DeliveryAttributeMappingType.CreateFrom); + } + if (content.Contains("SourceField")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDynamicDeliveryAttributeMappingInternal)this).SourceField = (string) content.GetValueForProperty("SourceField",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDynamicDeliveryAttributeMappingInternal)this).SourceField, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDynamicDeliveryAttributeMapping FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Dynamic delivery attribute mapping details. + [System.ComponentModel.TypeConverter(typeof(DynamicDeliveryAttributeMappingTypeConverter))] + public partial interface IDynamicDeliveryAttributeMapping + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DynamicDeliveryAttributeMapping.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DynamicDeliveryAttributeMapping.TypeConverter.cs new file mode 100644 index 000000000000..ec5e638ffca5 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DynamicDeliveryAttributeMapping.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DynamicDeliveryAttributeMappingTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDynamicDeliveryAttributeMapping ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDynamicDeliveryAttributeMapping).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DynamicDeliveryAttributeMapping.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DynamicDeliveryAttributeMapping.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DynamicDeliveryAttributeMapping.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DynamicDeliveryAttributeMapping.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DynamicDeliveryAttributeMapping.cs new file mode 100644 index 000000000000..5939bc6f95f9 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DynamicDeliveryAttributeMapping.cs @@ -0,0 +1,87 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Dynamic delivery attribute mapping details. + public partial class DynamicDeliveryAttributeMapping : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDynamicDeliveryAttributeMapping, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDynamicDeliveryAttributeMappingInternal, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping __deliveryAttributeMapping = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeliveryAttributeMapping(); + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDynamicDeliveryAttributeMappingProperties Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDynamicDeliveryAttributeMappingInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DynamicDeliveryAttributeMappingProperties()); set { {_property = value;} } } + + /// Name of the delivery attribute or header. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMappingInternal)__deliveryAttributeMapping).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMappingInternal)__deliveryAttributeMapping).Name = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDynamicDeliveryAttributeMappingProperties _property; + + /// Properties of dynamic delivery attribute mapping. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDynamicDeliveryAttributeMappingProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DynamicDeliveryAttributeMappingProperties()); set => this._property = value; } + + /// JSON path in the event which contains attribute value. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string SourceField { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDynamicDeliveryAttributeMappingPropertiesInternal)Property).SourceField; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDynamicDeliveryAttributeMappingPropertiesInternal)Property).SourceField = value ?? null; } + + /// Type of the delivery attribute or header name. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DeliveryAttributeMappingType Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMappingInternal)__deliveryAttributeMapping).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMappingInternal)__deliveryAttributeMapping).Type = value ; } + + /// Creates an new instance. + public DynamicDeliveryAttributeMapping() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__deliveryAttributeMapping), __deliveryAttributeMapping); + await eventListener.AssertObjectIsValid(nameof(__deliveryAttributeMapping), __deliveryAttributeMapping); + } + } + /// Dynamic delivery attribute mapping details. + public partial interface IDynamicDeliveryAttributeMapping : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping + { + /// JSON path in the event which contains attribute value. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"JSON path in the event which contains attribute value.", + SerializedName = @"sourceField", + PossibleTypes = new [] { typeof(string) })] + string SourceField { get; set; } + + } + /// Dynamic delivery attribute mapping details. + internal partial interface IDynamicDeliveryAttributeMappingInternal : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMappingInternal + { + /// Properties of dynamic delivery attribute mapping. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDynamicDeliveryAttributeMappingProperties Property { get; set; } + /// JSON path in the event which contains attribute value. + string SourceField { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DynamicDeliveryAttributeMapping.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DynamicDeliveryAttributeMapping.json.cs new file mode 100644 index 000000000000..3444cc21c362 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DynamicDeliveryAttributeMapping.json.cs @@ -0,0 +1,108 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Dynamic delivery attribute mapping details. + public partial class DynamicDeliveryAttributeMapping + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal DynamicDeliveryAttributeMapping(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __deliveryAttributeMapping = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeliveryAttributeMapping(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DynamicDeliveryAttributeMappingProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDynamicDeliveryAttributeMapping. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDynamicDeliveryAttributeMapping. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDynamicDeliveryAttributeMapping FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new DynamicDeliveryAttributeMapping(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __deliveryAttributeMapping?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DynamicDeliveryAttributeMappingProperties.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DynamicDeliveryAttributeMappingProperties.PowerShell.cs new file mode 100644 index 000000000000..fbcfb5c3d95a --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DynamicDeliveryAttributeMappingProperties.PowerShell.cs @@ -0,0 +1,145 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Properties of dynamic delivery attribute mapping. + [System.ComponentModel.TypeConverter(typeof(DynamicDeliveryAttributeMappingPropertiesTypeConverter))] + public partial class DynamicDeliveryAttributeMappingProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDynamicDeliveryAttributeMappingProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DynamicDeliveryAttributeMappingProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDynamicDeliveryAttributeMappingProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DynamicDeliveryAttributeMappingProperties(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal DynamicDeliveryAttributeMappingProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SourceField")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDynamicDeliveryAttributeMappingPropertiesInternal)this).SourceField = (string) content.GetValueForProperty("SourceField",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDynamicDeliveryAttributeMappingPropertiesInternal)this).SourceField, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal DynamicDeliveryAttributeMappingProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SourceField")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDynamicDeliveryAttributeMappingPropertiesInternal)this).SourceField = (string) content.GetValueForProperty("SourceField",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDynamicDeliveryAttributeMappingPropertiesInternal)this).SourceField, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json + /// string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDynamicDeliveryAttributeMappingProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties of dynamic delivery attribute mapping. + [System.ComponentModel.TypeConverter(typeof(DynamicDeliveryAttributeMappingPropertiesTypeConverter))] + public partial interface IDynamicDeliveryAttributeMappingProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DynamicDeliveryAttributeMappingProperties.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DynamicDeliveryAttributeMappingProperties.TypeConverter.cs new file mode 100644 index 000000000000..4c3b17ae448e --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DynamicDeliveryAttributeMappingProperties.TypeConverter.cs @@ -0,0 +1,150 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DynamicDeliveryAttributeMappingPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDynamicDeliveryAttributeMappingProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDynamicDeliveryAttributeMappingProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DynamicDeliveryAttributeMappingProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DynamicDeliveryAttributeMappingProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DynamicDeliveryAttributeMappingProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DynamicDeliveryAttributeMappingProperties.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DynamicDeliveryAttributeMappingProperties.cs new file mode 100644 index 000000000000..1b197dd5f444 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DynamicDeliveryAttributeMappingProperties.cs @@ -0,0 +1,53 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Properties of dynamic delivery attribute mapping. + public partial class DynamicDeliveryAttributeMappingProperties : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDynamicDeliveryAttributeMappingProperties, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDynamicDeliveryAttributeMappingPropertiesInternal + { + + /// Backing field for property. + private string _sourceField; + + /// JSON path in the event which contains attribute value. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string SourceField { get => this._sourceField; set => this._sourceField = value; } + + /// + /// Creates an new instance. + /// + public DynamicDeliveryAttributeMappingProperties() + { + + } + } + /// Properties of dynamic delivery attribute mapping. + public partial interface IDynamicDeliveryAttributeMappingProperties : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// JSON path in the event which contains attribute value. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"JSON path in the event which contains attribute value.", + SerializedName = @"sourceField", + PossibleTypes = new [] { typeof(string) })] + string SourceField { get; set; } + + } + /// Properties of dynamic delivery attribute mapping. + internal partial interface IDynamicDeliveryAttributeMappingPropertiesInternal + + { + /// JSON path in the event which contains attribute value. + string SourceField { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DynamicDeliveryAttributeMappingProperties.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DynamicDeliveryAttributeMappingProperties.json.cs new file mode 100644 index 000000000000..295b941009e2 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/DynamicDeliveryAttributeMappingProperties.json.cs @@ -0,0 +1,108 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Properties of dynamic delivery attribute mapping. + public partial class DynamicDeliveryAttributeMappingProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal DynamicDeliveryAttributeMappingProperties(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_sourceField = If( json?.PropertyT("sourceField"), out var __jsonSourceField) ? (string)__jsonSourceField : (string)SourceField;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDynamicDeliveryAttributeMappingProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDynamicDeliveryAttributeMappingProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDynamicDeliveryAttributeMappingProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new DynamicDeliveryAttributeMappingProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._sourceField)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._sourceField.ToString()) : null, "sourceField" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventChannel.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventChannel.PowerShell.cs new file mode 100644 index 000000000000..c0142880c81e --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventChannel.PowerShell.cs @@ -0,0 +1,326 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Event Channel. + [System.ComponentModel.TypeConverter(typeof(EventChannelTypeConverter))] + public partial class EventChannel + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannel DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new EventChannel(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannel DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new EventChannel(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal EventChannel(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventChannelPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Source")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelInternal)this).Source = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelSource) content.GetValueForProperty("Source",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelInternal)this).Source, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventChannelSourceTypeConverter.ConvertFrom); + } + if (content.Contains("Destination")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelInternal)this).Destination = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelDestination) content.GetValueForProperty("Destination",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelInternal)this).Destination, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventChannelDestinationTypeConverter.ConvertFrom); + } + if (content.Contains("Filter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelInternal)this).Filter = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelFilter) content.GetValueForProperty("Filter",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelInternal)this).Filter, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventChannelFilterTypeConverter.ConvertFrom); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventChannelProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventChannelProvisioningState.CreateFrom); + } + if (content.Contains("PartnerTopicReadinessState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelInternal)this).PartnerTopicReadinessState = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicReadinessState?) content.GetValueForProperty("PartnerTopicReadinessState",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelInternal)this).PartnerTopicReadinessState, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicReadinessState.CreateFrom); + } + if (content.Contains("ExpirationTimeIfNotActivatedUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelInternal)this).ExpirationTimeIfNotActivatedUtc = (global::System.DateTime?) content.GetValueForProperty("ExpirationTimeIfNotActivatedUtc",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelInternal)this).ExpirationTimeIfNotActivatedUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("PartnerTopicFriendlyDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelInternal)this).PartnerTopicFriendlyDescription = (string) content.GetValueForProperty("PartnerTopicFriendlyDescription",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelInternal)this).PartnerTopicFriendlyDescription, global::System.Convert.ToString); + } + if (content.Contains("EventChannelSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelInternal)this).EventChannelSource = (string) content.GetValueForProperty("EventChannelSource",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelInternal)this).EventChannelSource, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("DestinationAzureSubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelInternal)this).DestinationAzureSubscriptionId = (string) content.GetValueForProperty("DestinationAzureSubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelInternal)this).DestinationAzureSubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("DestinationResourceGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelInternal)this).DestinationResourceGroup = (string) content.GetValueForProperty("DestinationResourceGroup",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelInternal)this).DestinationResourceGroup, global::System.Convert.ToString); + } + if (content.Contains("DestinationPartnerTopicName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelInternal)this).DestinationPartnerTopicName = (string) content.GetValueForProperty("DestinationPartnerTopicName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelInternal)this).DestinationPartnerTopicName, global::System.Convert.ToString); + } + if (content.Contains("FilterEnableAdvancedFilteringOnArray")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelInternal)this).FilterEnableAdvancedFilteringOnArray = (bool?) content.GetValueForProperty("FilterEnableAdvancedFilteringOnArray",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelInternal)this).FilterEnableAdvancedFilteringOnArray, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("FilterAdvancedFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelInternal)this).FilterAdvancedFilter = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[]) content.GetValueForProperty("FilterAdvancedFilter",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelInternal)this).FilterAdvancedFilter, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.AdvancedFilterTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal EventChannel(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventChannelPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Source")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelInternal)this).Source = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelSource) content.GetValueForProperty("Source",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelInternal)this).Source, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventChannelSourceTypeConverter.ConvertFrom); + } + if (content.Contains("Destination")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelInternal)this).Destination = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelDestination) content.GetValueForProperty("Destination",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelInternal)this).Destination, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventChannelDestinationTypeConverter.ConvertFrom); + } + if (content.Contains("Filter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelInternal)this).Filter = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelFilter) content.GetValueForProperty("Filter",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelInternal)this).Filter, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventChannelFilterTypeConverter.ConvertFrom); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventChannelProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventChannelProvisioningState.CreateFrom); + } + if (content.Contains("PartnerTopicReadinessState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelInternal)this).PartnerTopicReadinessState = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicReadinessState?) content.GetValueForProperty("PartnerTopicReadinessState",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelInternal)this).PartnerTopicReadinessState, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicReadinessState.CreateFrom); + } + if (content.Contains("ExpirationTimeIfNotActivatedUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelInternal)this).ExpirationTimeIfNotActivatedUtc = (global::System.DateTime?) content.GetValueForProperty("ExpirationTimeIfNotActivatedUtc",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelInternal)this).ExpirationTimeIfNotActivatedUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("PartnerTopicFriendlyDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelInternal)this).PartnerTopicFriendlyDescription = (string) content.GetValueForProperty("PartnerTopicFriendlyDescription",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelInternal)this).PartnerTopicFriendlyDescription, global::System.Convert.ToString); + } + if (content.Contains("EventChannelSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelInternal)this).EventChannelSource = (string) content.GetValueForProperty("EventChannelSource",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelInternal)this).EventChannelSource, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("DestinationAzureSubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelInternal)this).DestinationAzureSubscriptionId = (string) content.GetValueForProperty("DestinationAzureSubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelInternal)this).DestinationAzureSubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("DestinationResourceGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelInternal)this).DestinationResourceGroup = (string) content.GetValueForProperty("DestinationResourceGroup",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelInternal)this).DestinationResourceGroup, global::System.Convert.ToString); + } + if (content.Contains("DestinationPartnerTopicName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelInternal)this).DestinationPartnerTopicName = (string) content.GetValueForProperty("DestinationPartnerTopicName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelInternal)this).DestinationPartnerTopicName, global::System.Convert.ToString); + } + if (content.Contains("FilterEnableAdvancedFilteringOnArray")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelInternal)this).FilterEnableAdvancedFilteringOnArray = (bool?) content.GetValueForProperty("FilterEnableAdvancedFilteringOnArray",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelInternal)this).FilterEnableAdvancedFilteringOnArray, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("FilterAdvancedFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelInternal)this).FilterAdvancedFilter = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[]) content.GetValueForProperty("FilterAdvancedFilter",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelInternal)this).FilterAdvancedFilter, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.AdvancedFilterTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannel FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Event Channel. + [System.ComponentModel.TypeConverter(typeof(EventChannelTypeConverter))] + public partial interface IEventChannel + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventChannel.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventChannel.TypeConverter.cs new file mode 100644 index 000000000000..10b86831b7c2 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventChannel.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class EventChannelTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannel ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannel).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return EventChannel.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return EventChannel.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return EventChannel.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventChannel.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventChannel.cs new file mode 100644 index 000000000000..38d4ec856884 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventChannel.cs @@ -0,0 +1,407 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Event Channel. + public partial class EventChannel : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannel, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelInternal, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.Resource(); + + /// + /// Azure subscription ID of the customer creating the event channel. The partner topic + /// associated with the event channel will be created under this Azure subscription. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string DestinationAzureSubscriptionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelPropertiesInternal)Property).DestinationAzureSubscriptionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelPropertiesInternal)Property).DestinationAzureSubscriptionId = value ?? null; } + + /// Name of the partner topic associated with the event channel. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string DestinationPartnerTopicName { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelPropertiesInternal)Property).DestinationPartnerTopicName; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelPropertiesInternal)Property).DestinationPartnerTopicName = value ?? null; } + + /// + /// Azure Resource Group of the customer creating the event channel. The partner topic + /// associated with the event channel will be created under this resource group. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string DestinationResourceGroup { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelPropertiesInternal)Property).DestinationResourceGroup; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelPropertiesInternal)Property).DestinationResourceGroup = value ?? null; } + + /// + /// The identifier of the resource that's the source of the events. + /// This represents a unique resource in the partner's resource model. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string EventChannelSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelPropertiesInternal)Property).EventChannelSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelPropertiesInternal)Property).EventChannelSource = value ?? null; } + + /// + /// Expiration time of the event channel. If this timer expires while the corresponding partner topic is never activated, + /// the event channel and corresponding partner topic are deleted. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public global::System.DateTime? ExpirationTimeIfNotActivatedUtc { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelPropertiesInternal)Property).ExpirationTimeIfNotActivatedUtc; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelPropertiesInternal)Property).ExpirationTimeIfNotActivatedUtc = value ?? default(global::System.DateTime); } + + /// An array of advanced filters that are used for filtering event channels. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[] FilterAdvancedFilter { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelPropertiesInternal)Property).FilterAdvancedFilter; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelPropertiesInternal)Property).FilterAdvancedFilter = value ?? null /* arrayOf */; } + + /// + /// Allows advanced filters to be evaluated against an array of values instead of expecting a singular value. The default + /// value is either false or null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public bool? FilterEnableAdvancedFilteringOnArray { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelPropertiesInternal)Property).FilterEnableAdvancedFilteringOnArray; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelPropertiesInternal)Property).FilterEnableAdvancedFilteringOnArray = value ?? default(bool); } + + /// Fully qualified identifier of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Id; } + + /// Internal Acessors for Destination + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelDestination Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelInternal.Destination { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelPropertiesInternal)Property).Destination; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelPropertiesInternal)Property).Destination = value; } + + /// Internal Acessors for Filter + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelFilter Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelInternal.Filter { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelPropertiesInternal)Property).Filter; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelPropertiesInternal)Property).Filter = value; } + + /// Internal Acessors for PartnerTopicReadinessState + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicReadinessState? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelInternal.PartnerTopicReadinessState { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelPropertiesInternal)Property).PartnerTopicReadinessState; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelPropertiesInternal)Property).PartnerTopicReadinessState = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelProperties Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventChannelProperties()); set { {_property = value;} } } + + /// Internal Acessors for ProvisioningState + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventChannelProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelPropertiesInternal)Property).ProvisioningState = value; } + + /// Internal Acessors for Source + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelSource Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelInternal.Source { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelPropertiesInternal)Property).Source; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelPropertiesInternal)Property).Source = value; } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.SystemData()); set { {_systemData = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Type = value; } + + /// Name of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Name; } + + /// + /// Friendly description about the topic. This can be set by the publisher/partner to show custom description for the customer + /// partner topic. + /// This will be helpful to remove any ambiguity of the origin of creation of the partner topic for the customer. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string PartnerTopicFriendlyDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelPropertiesInternal)Property).PartnerTopicFriendlyDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelPropertiesInternal)Property).PartnerTopicFriendlyDescription = value ?? null; } + + /// The readiness state of the corresponding partner topic. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicReadinessState? PartnerTopicReadinessState { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelPropertiesInternal)Property).PartnerTopicReadinessState; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelProperties _property; + + /// Properties of the EventChannel. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventChannelProperties()); set => this._property = value; } + + /// Provisioning state of the event channel. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventChannelProvisioningState? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelPropertiesInternal)Property).ProvisioningState; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData _systemData; + + /// The system metadata relating to Event Channel resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.SystemData()); } + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).CreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType)""); } + + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType)""); } + + /// Type of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public EventChannel() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// Event Channel. + public partial interface IEventChannel : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResource + { + /// + /// Azure subscription ID of the customer creating the event channel. The partner topic + /// associated with the event channel will be created under this Azure subscription. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Azure subscription ID of the customer creating the event channel. The partner topic + associated with the event channel will be created under this Azure subscription.", + SerializedName = @"azureSubscriptionId", + PossibleTypes = new [] { typeof(string) })] + string DestinationAzureSubscriptionId { get; set; } + /// Name of the partner topic associated with the event channel. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the partner topic associated with the event channel.", + SerializedName = @"partnerTopicName", + PossibleTypes = new [] { typeof(string) })] + string DestinationPartnerTopicName { get; set; } + /// + /// Azure Resource Group of the customer creating the event channel. The partner topic + /// associated with the event channel will be created under this resource group. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Azure Resource Group of the customer creating the event channel. The partner topic + associated with the event channel will be created under this resource group.", + SerializedName = @"resourceGroup", + PossibleTypes = new [] { typeof(string) })] + string DestinationResourceGroup { get; set; } + /// + /// The identifier of the resource that's the source of the events. + /// This represents a unique resource in the partner's resource model. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identifier of the resource that's the source of the events. + This represents a unique resource in the partner's resource model.", + SerializedName = @"source", + PossibleTypes = new [] { typeof(string) })] + string EventChannelSource { get; set; } + /// + /// Expiration time of the event channel. If this timer expires while the corresponding partner topic is never activated, + /// the event channel and corresponding partner topic are deleted. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Expiration time of the event channel. If this timer expires while the corresponding partner topic is never activated, + the event channel and corresponding partner topic are deleted.", + SerializedName = @"expirationTimeIfNotActivatedUtc", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ExpirationTimeIfNotActivatedUtc { get; set; } + /// An array of advanced filters that are used for filtering event channels. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An array of advanced filters that are used for filtering event channels.", + SerializedName = @"advancedFilters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[] FilterAdvancedFilter { get; set; } + /// + /// Allows advanced filters to be evaluated against an array of values instead of expecting a singular value. The default + /// value is either false or null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allows advanced filters to be evaluated against an array of values instead of expecting a singular value. The default value is either false or null.", + SerializedName = @"enableAdvancedFilteringOnArrays", + PossibleTypes = new [] { typeof(bool) })] + bool? FilterEnableAdvancedFilteringOnArray { get; set; } + /// + /// Friendly description about the topic. This can be set by the publisher/partner to show custom description for the customer + /// partner topic. + /// This will be helpful to remove any ambiguity of the origin of creation of the partner topic for the customer. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Friendly description about the topic. This can be set by the publisher/partner to show custom description for the customer partner topic. + This will be helpful to remove any ambiguity of the origin of creation of the partner topic for the customer.", + SerializedName = @"partnerTopicFriendlyDescription", + PossibleTypes = new [] { typeof(string) })] + string PartnerTopicFriendlyDescription { get; set; } + /// The readiness state of the corresponding partner topic. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The readiness state of the corresponding partner topic.", + SerializedName = @"partnerTopicReadinessState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicReadinessState) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicReadinessState? PartnerTopicReadinessState { get; } + /// Provisioning state of the event channel. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Provisioning state of the event channel.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventChannelProvisioningState) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventChannelProvisioningState? ProvisioningState { get; } + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timestamp of resource creation (UTC).", + SerializedName = @"createdAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SystemDataCreatedAt { get; set; } + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identity that created the resource.", + SerializedName = @"createdBy", + PossibleTypes = new [] { typeof(string) })] + string SystemDataCreatedBy { get; set; } + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of identity that created the resource.", + SerializedName = @"createdByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType? SystemDataCreatedByType { get; set; } + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timestamp of resource last modification (UTC)", + SerializedName = @"lastModifiedAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SystemDataLastModifiedAt { get; set; } + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identity that last modified the resource.", + SerializedName = @"lastModifiedBy", + PossibleTypes = new [] { typeof(string) })] + string SystemDataLastModifiedBy { get; set; } + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of identity that last modified the resource.", + SerializedName = @"lastModifiedByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + + } + /// Event Channel. + internal partial interface IEventChannelInternal : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal + { + /// Represents the destination of an event channel. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelDestination Destination { get; set; } + /// + /// Azure subscription ID of the customer creating the event channel. The partner topic + /// associated with the event channel will be created under this Azure subscription. + /// + string DestinationAzureSubscriptionId { get; set; } + /// Name of the partner topic associated with the event channel. + string DestinationPartnerTopicName { get; set; } + /// + /// Azure Resource Group of the customer creating the event channel. The partner topic + /// associated with the event channel will be created under this resource group. + /// + string DestinationResourceGroup { get; set; } + /// + /// The identifier of the resource that's the source of the events. + /// This represents a unique resource in the partner's resource model. + /// + string EventChannelSource { get; set; } + /// + /// Expiration time of the event channel. If this timer expires while the corresponding partner topic is never activated, + /// the event channel and corresponding partner topic are deleted. + /// + global::System.DateTime? ExpirationTimeIfNotActivatedUtc { get; set; } + /// Information about the filter for the event channel. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelFilter Filter { get; set; } + /// An array of advanced filters that are used for filtering event channels. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[] FilterAdvancedFilter { get; set; } + /// + /// Allows advanced filters to be evaluated against an array of values instead of expecting a singular value. The default + /// value is either false or null. + /// + bool? FilterEnableAdvancedFilteringOnArray { get; set; } + /// + /// Friendly description about the topic. This can be set by the publisher/partner to show custom description for the customer + /// partner topic. + /// This will be helpful to remove any ambiguity of the origin of creation of the partner topic for the customer. + /// + string PartnerTopicFriendlyDescription { get; set; } + /// The readiness state of the corresponding partner topic. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicReadinessState? PartnerTopicReadinessState { get; set; } + /// Properties of the EventChannel. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelProperties Property { get; set; } + /// Provisioning state of the event channel. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventChannelProvisioningState? ProvisioningState { get; set; } + /// + /// Source of the event channel. This represents a unique resource in the partner's resource model. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelSource Source { get; set; } + /// The system metadata relating to Event Channel resource. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData SystemData { get; set; } + /// The timestamp of resource creation (UTC). + global::System.DateTime? SystemDataCreatedAt { get; set; } + /// The identity that created the resource. + string SystemDataCreatedBy { get; set; } + /// The type of identity that created the resource. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType? SystemDataCreatedByType { get; set; } + /// The timestamp of resource last modification (UTC) + global::System.DateTime? SystemDataLastModifiedAt { get; set; } + /// The identity that last modified the resource. + string SystemDataLastModifiedBy { get; set; } + /// The type of identity that last modified the resource. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventChannel.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventChannel.json.cs new file mode 100644 index 000000000000..39719282b46f --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventChannel.json.cs @@ -0,0 +1,113 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Event Channel. + public partial class EventChannel + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal EventChannel(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventChannelProperties.FromJson(__jsonProperties) : Property;} + {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.SystemData.FromJson(__jsonSystemData) : SystemData;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannel. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannel. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannel FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new EventChannel(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._systemData ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._systemData.ToJson(null,serializationMode) : null, "systemData" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventChannelDestination.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventChannelDestination.PowerShell.cs new file mode 100644 index 000000000000..71a504dca4b2 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventChannelDestination.PowerShell.cs @@ -0,0 +1,160 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Properties of the destination of an event channel. + [System.ComponentModel.TypeConverter(typeof(EventChannelDestinationTypeConverter))] + public partial class EventChannelDestination + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelDestination DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new EventChannelDestination(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelDestination DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new EventChannelDestination(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal EventChannelDestination(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AzureSubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelDestinationInternal)this).AzureSubscriptionId = (string) content.GetValueForProperty("AzureSubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelDestinationInternal)this).AzureSubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("ResourceGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelDestinationInternal)this).ResourceGroup = (string) content.GetValueForProperty("ResourceGroup",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelDestinationInternal)this).ResourceGroup, global::System.Convert.ToString); + } + if (content.Contains("PartnerTopicName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelDestinationInternal)this).PartnerTopicName = (string) content.GetValueForProperty("PartnerTopicName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelDestinationInternal)this).PartnerTopicName, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal EventChannelDestination(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AzureSubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelDestinationInternal)this).AzureSubscriptionId = (string) content.GetValueForProperty("AzureSubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelDestinationInternal)this).AzureSubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("ResourceGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelDestinationInternal)this).ResourceGroup = (string) content.GetValueForProperty("ResourceGroup",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelDestinationInternal)this).ResourceGroup, global::System.Convert.ToString); + } + if (content.Contains("PartnerTopicName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelDestinationInternal)this).PartnerTopicName = (string) content.GetValueForProperty("PartnerTopicName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelDestinationInternal)this).PartnerTopicName, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelDestination FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties of the destination of an event channel. + [System.ComponentModel.TypeConverter(typeof(EventChannelDestinationTypeConverter))] + public partial interface IEventChannelDestination + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventChannelDestination.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventChannelDestination.TypeConverter.cs new file mode 100644 index 000000000000..10cdd4b77a9f --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventChannelDestination.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class EventChannelDestinationTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelDestination ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelDestination).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return EventChannelDestination.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return EventChannelDestination.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return EventChannelDestination.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventChannelDestination.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventChannelDestination.cs new file mode 100644 index 000000000000..34cc386214ee --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventChannelDestination.cs @@ -0,0 +1,105 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Properties of the destination of an event channel. + public partial class EventChannelDestination : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelDestination, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelDestinationInternal + { + + /// Backing field for property. + private string _azureSubscriptionId; + + /// + /// Azure subscription ID of the customer creating the event channel. The partner topic + /// associated with the event channel will be created under this Azure subscription. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string AzureSubscriptionId { get => this._azureSubscriptionId; set => this._azureSubscriptionId = value; } + + /// Backing field for property. + private string _partnerTopicName; + + /// Name of the partner topic associated with the event channel. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string PartnerTopicName { get => this._partnerTopicName; set => this._partnerTopicName = value; } + + /// Backing field for property. + private string _resourceGroup; + + /// + /// Azure Resource Group of the customer creating the event channel. The partner topic + /// associated with the event channel will be created under this resource group. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string ResourceGroup { get => this._resourceGroup; set => this._resourceGroup = value; } + + /// Creates an new instance. + public EventChannelDestination() + { + + } + } + /// Properties of the destination of an event channel. + public partial interface IEventChannelDestination : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// + /// Azure subscription ID of the customer creating the event channel. The partner topic + /// associated with the event channel will be created under this Azure subscription. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Azure subscription ID of the customer creating the event channel. The partner topic + associated with the event channel will be created under this Azure subscription.", + SerializedName = @"azureSubscriptionId", + PossibleTypes = new [] { typeof(string) })] + string AzureSubscriptionId { get; set; } + /// Name of the partner topic associated with the event channel. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the partner topic associated with the event channel.", + SerializedName = @"partnerTopicName", + PossibleTypes = new [] { typeof(string) })] + string PartnerTopicName { get; set; } + /// + /// Azure Resource Group of the customer creating the event channel. The partner topic + /// associated with the event channel will be created under this resource group. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Azure Resource Group of the customer creating the event channel. The partner topic + associated with the event channel will be created under this resource group.", + SerializedName = @"resourceGroup", + PossibleTypes = new [] { typeof(string) })] + string ResourceGroup { get; set; } + + } + /// Properties of the destination of an event channel. + internal partial interface IEventChannelDestinationInternal + + { + /// + /// Azure subscription ID of the customer creating the event channel. The partner topic + /// associated with the event channel will be created under this Azure subscription. + /// + string AzureSubscriptionId { get; set; } + /// Name of the partner topic associated with the event channel. + string PartnerTopicName { get; set; } + /// + /// Azure Resource Group of the customer creating the event channel. The partner topic + /// associated with the event channel will be created under this resource group. + /// + string ResourceGroup { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventChannelDestination.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventChannelDestination.json.cs new file mode 100644 index 000000000000..51fe8951d485 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventChannelDestination.json.cs @@ -0,0 +1,110 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Properties of the destination of an event channel. + public partial class EventChannelDestination + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal EventChannelDestination(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_azureSubscriptionId = If( json?.PropertyT("azureSubscriptionId"), out var __jsonAzureSubscriptionId) ? (string)__jsonAzureSubscriptionId : (string)AzureSubscriptionId;} + {_resourceGroup = If( json?.PropertyT("resourceGroup"), out var __jsonResourceGroup) ? (string)__jsonResourceGroup : (string)ResourceGroup;} + {_partnerTopicName = If( json?.PropertyT("partnerTopicName"), out var __jsonPartnerTopicName) ? (string)__jsonPartnerTopicName : (string)PartnerTopicName;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelDestination. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelDestination. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelDestination FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new EventChannelDestination(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._azureSubscriptionId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._azureSubscriptionId.ToString()) : null, "azureSubscriptionId" ,container.Add ); + AddIf( null != (((object)this._resourceGroup)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._resourceGroup.ToString()) : null, "resourceGroup" ,container.Add ); + AddIf( null != (((object)this._partnerTopicName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._partnerTopicName.ToString()) : null, "partnerTopicName" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventChannelFilter.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventChannelFilter.PowerShell.cs new file mode 100644 index 000000000000..594f05e637bf --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventChannelFilter.PowerShell.cs @@ -0,0 +1,152 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Filter for the Event Channel. + [System.ComponentModel.TypeConverter(typeof(EventChannelFilterTypeConverter))] + public partial class EventChannelFilter + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelFilter DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new EventChannelFilter(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelFilter DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new EventChannelFilter(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal EventChannelFilter(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("EnableAdvancedFilteringOnArray")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelFilterInternal)this).EnableAdvancedFilteringOnArray = (bool?) content.GetValueForProperty("EnableAdvancedFilteringOnArray",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelFilterInternal)this).EnableAdvancedFilteringOnArray, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AdvancedFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelFilterInternal)this).AdvancedFilter = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[]) content.GetValueForProperty("AdvancedFilter",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelFilterInternal)this).AdvancedFilter, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.AdvancedFilterTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal EventChannelFilter(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("EnableAdvancedFilteringOnArray")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelFilterInternal)this).EnableAdvancedFilteringOnArray = (bool?) content.GetValueForProperty("EnableAdvancedFilteringOnArray",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelFilterInternal)this).EnableAdvancedFilteringOnArray, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AdvancedFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelFilterInternal)this).AdvancedFilter = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[]) content.GetValueForProperty("AdvancedFilter",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelFilterInternal)this).AdvancedFilter, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.AdvancedFilterTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelFilter FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Filter for the Event Channel. + [System.ComponentModel.TypeConverter(typeof(EventChannelFilterTypeConverter))] + public partial interface IEventChannelFilter + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventChannelFilter.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventChannelFilter.TypeConverter.cs new file mode 100644 index 000000000000..b6f0ccf8b961 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventChannelFilter.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class EventChannelFilterTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelFilter ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelFilter).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return EventChannelFilter.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return EventChannelFilter.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return EventChannelFilter.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventChannelFilter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventChannelFilter.cs new file mode 100644 index 000000000000..f2effd13b94c --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventChannelFilter.cs @@ -0,0 +1,77 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Filter for the Event Channel. + public partial class EventChannelFilter : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelFilter, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelFilterInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[] _advancedFilter; + + /// An array of advanced filters that are used for filtering event channels. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[] AdvancedFilter { get => this._advancedFilter; set => this._advancedFilter = value; } + + /// Backing field for property. + private bool? _enableAdvancedFilteringOnArray; + + /// + /// Allows advanced filters to be evaluated against an array of values instead of expecting a singular value. The default + /// value is either false or null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public bool? EnableAdvancedFilteringOnArray { get => this._enableAdvancedFilteringOnArray; set => this._enableAdvancedFilteringOnArray = value; } + + /// Creates an new instance. + public EventChannelFilter() + { + + } + } + /// Filter for the Event Channel. + public partial interface IEventChannelFilter : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// An array of advanced filters that are used for filtering event channels. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An array of advanced filters that are used for filtering event channels.", + SerializedName = @"advancedFilters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[] AdvancedFilter { get; set; } + /// + /// Allows advanced filters to be evaluated against an array of values instead of expecting a singular value. The default + /// value is either false or null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allows advanced filters to be evaluated against an array of values instead of expecting a singular value. The default value is either false or null.", + SerializedName = @"enableAdvancedFilteringOnArrays", + PossibleTypes = new [] { typeof(bool) })] + bool? EnableAdvancedFilteringOnArray { get; set; } + + } + /// Filter for the Event Channel. + internal partial interface IEventChannelFilterInternal + + { + /// An array of advanced filters that are used for filtering event channels. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[] AdvancedFilter { get; set; } + /// + /// Allows advanced filters to be evaluated against an array of values instead of expecting a singular value. The default + /// value is either false or null. + /// + bool? EnableAdvancedFilteringOnArray { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventChannelFilter.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventChannelFilter.json.cs new file mode 100644 index 000000000000..99ef58e217e8 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventChannelFilter.json.cs @@ -0,0 +1,116 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Filter for the Event Channel. + public partial class EventChannelFilter + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal EventChannelFilter(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_enableAdvancedFilteringOnArray = If( json?.PropertyT("enableAdvancedFilteringOnArrays"), out var __jsonEnableAdvancedFilteringOnArrays) ? (bool?)__jsonEnableAdvancedFilteringOnArrays : EnableAdvancedFilteringOnArray;} + {_advancedFilter = If( json?.PropertyT("advancedFilters"), out var __jsonAdvancedFilters) ? If( __jsonAdvancedFilters as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter) (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.AdvancedFilter.FromJson(__u) )) ))() : null : AdvancedFilter;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelFilter. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelFilter. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelFilter FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new EventChannelFilter(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._enableAdvancedFilteringOnArray ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonBoolean((bool)this._enableAdvancedFilteringOnArray) : null, "enableAdvancedFilteringOnArrays" ,container.Add ); + if (null != this._advancedFilter) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.XNodeArray(); + foreach( var __x in this._advancedFilter ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("advancedFilters",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventChannelProperties.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventChannelProperties.PowerShell.cs new file mode 100644 index 000000000000..7a0b8f44eefc --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventChannelProperties.PowerShell.cs @@ -0,0 +1,240 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Properties of the Event Channel. + [System.ComponentModel.TypeConverter(typeof(EventChannelPropertiesTypeConverter))] + public partial class EventChannelProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new EventChannelProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new EventChannelProperties(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal EventChannelProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Source")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelPropertiesInternal)this).Source = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelSource) content.GetValueForProperty("Source",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelPropertiesInternal)this).Source, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventChannelSourceTypeConverter.ConvertFrom); + } + if (content.Contains("Destination")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelPropertiesInternal)this).Destination = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelDestination) content.GetValueForProperty("Destination",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelPropertiesInternal)this).Destination, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventChannelDestinationTypeConverter.ConvertFrom); + } + if (content.Contains("Filter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelPropertiesInternal)this).Filter = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelFilter) content.GetValueForProperty("Filter",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelPropertiesInternal)this).Filter, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventChannelFilterTypeConverter.ConvertFrom); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventChannelProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventChannelProvisioningState.CreateFrom); + } + if (content.Contains("PartnerTopicReadinessState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelPropertiesInternal)this).PartnerTopicReadinessState = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicReadinessState?) content.GetValueForProperty("PartnerTopicReadinessState",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelPropertiesInternal)this).PartnerTopicReadinessState, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicReadinessState.CreateFrom); + } + if (content.Contains("ExpirationTimeIfNotActivatedUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelPropertiesInternal)this).ExpirationTimeIfNotActivatedUtc = (global::System.DateTime?) content.GetValueForProperty("ExpirationTimeIfNotActivatedUtc",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelPropertiesInternal)this).ExpirationTimeIfNotActivatedUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("PartnerTopicFriendlyDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelPropertiesInternal)this).PartnerTopicFriendlyDescription = (string) content.GetValueForProperty("PartnerTopicFriendlyDescription",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelPropertiesInternal)this).PartnerTopicFriendlyDescription, global::System.Convert.ToString); + } + if (content.Contains("EventChannelSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelPropertiesInternal)this).EventChannelSource = (string) content.GetValueForProperty("EventChannelSource",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelPropertiesInternal)this).EventChannelSource, global::System.Convert.ToString); + } + if (content.Contains("DestinationAzureSubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelPropertiesInternal)this).DestinationAzureSubscriptionId = (string) content.GetValueForProperty("DestinationAzureSubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelPropertiesInternal)this).DestinationAzureSubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("DestinationResourceGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelPropertiesInternal)this).DestinationResourceGroup = (string) content.GetValueForProperty("DestinationResourceGroup",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelPropertiesInternal)this).DestinationResourceGroup, global::System.Convert.ToString); + } + if (content.Contains("DestinationPartnerTopicName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelPropertiesInternal)this).DestinationPartnerTopicName = (string) content.GetValueForProperty("DestinationPartnerTopicName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelPropertiesInternal)this).DestinationPartnerTopicName, global::System.Convert.ToString); + } + if (content.Contains("FilterEnableAdvancedFilteringOnArray")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelPropertiesInternal)this).FilterEnableAdvancedFilteringOnArray = (bool?) content.GetValueForProperty("FilterEnableAdvancedFilteringOnArray",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelPropertiesInternal)this).FilterEnableAdvancedFilteringOnArray, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("FilterAdvancedFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelPropertiesInternal)this).FilterAdvancedFilter = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[]) content.GetValueForProperty("FilterAdvancedFilter",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelPropertiesInternal)this).FilterAdvancedFilter, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.AdvancedFilterTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal EventChannelProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Source")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelPropertiesInternal)this).Source = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelSource) content.GetValueForProperty("Source",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelPropertiesInternal)this).Source, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventChannelSourceTypeConverter.ConvertFrom); + } + if (content.Contains("Destination")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelPropertiesInternal)this).Destination = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelDestination) content.GetValueForProperty("Destination",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelPropertiesInternal)this).Destination, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventChannelDestinationTypeConverter.ConvertFrom); + } + if (content.Contains("Filter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelPropertiesInternal)this).Filter = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelFilter) content.GetValueForProperty("Filter",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelPropertiesInternal)this).Filter, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventChannelFilterTypeConverter.ConvertFrom); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventChannelProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventChannelProvisioningState.CreateFrom); + } + if (content.Contains("PartnerTopicReadinessState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelPropertiesInternal)this).PartnerTopicReadinessState = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicReadinessState?) content.GetValueForProperty("PartnerTopicReadinessState",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelPropertiesInternal)this).PartnerTopicReadinessState, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicReadinessState.CreateFrom); + } + if (content.Contains("ExpirationTimeIfNotActivatedUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelPropertiesInternal)this).ExpirationTimeIfNotActivatedUtc = (global::System.DateTime?) content.GetValueForProperty("ExpirationTimeIfNotActivatedUtc",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelPropertiesInternal)this).ExpirationTimeIfNotActivatedUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("PartnerTopicFriendlyDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelPropertiesInternal)this).PartnerTopicFriendlyDescription = (string) content.GetValueForProperty("PartnerTopicFriendlyDescription",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelPropertiesInternal)this).PartnerTopicFriendlyDescription, global::System.Convert.ToString); + } + if (content.Contains("EventChannelSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelPropertiesInternal)this).EventChannelSource = (string) content.GetValueForProperty("EventChannelSource",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelPropertiesInternal)this).EventChannelSource, global::System.Convert.ToString); + } + if (content.Contains("DestinationAzureSubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelPropertiesInternal)this).DestinationAzureSubscriptionId = (string) content.GetValueForProperty("DestinationAzureSubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelPropertiesInternal)this).DestinationAzureSubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("DestinationResourceGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelPropertiesInternal)this).DestinationResourceGroup = (string) content.GetValueForProperty("DestinationResourceGroup",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelPropertiesInternal)this).DestinationResourceGroup, global::System.Convert.ToString); + } + if (content.Contains("DestinationPartnerTopicName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelPropertiesInternal)this).DestinationPartnerTopicName = (string) content.GetValueForProperty("DestinationPartnerTopicName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelPropertiesInternal)this).DestinationPartnerTopicName, global::System.Convert.ToString); + } + if (content.Contains("FilterEnableAdvancedFilteringOnArray")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelPropertiesInternal)this).FilterEnableAdvancedFilteringOnArray = (bool?) content.GetValueForProperty("FilterEnableAdvancedFilteringOnArray",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelPropertiesInternal)this).FilterEnableAdvancedFilteringOnArray, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("FilterAdvancedFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelPropertiesInternal)this).FilterAdvancedFilter = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[]) content.GetValueForProperty("FilterAdvancedFilter",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelPropertiesInternal)this).FilterAdvancedFilter, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.AdvancedFilterTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties of the Event Channel. + [System.ComponentModel.TypeConverter(typeof(EventChannelPropertiesTypeConverter))] + public partial interface IEventChannelProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventChannelProperties.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventChannelProperties.TypeConverter.cs new file mode 100644 index 000000000000..c0cbe850ea35 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventChannelProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class EventChannelPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return EventChannelProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return EventChannelProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return EventChannelProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventChannelProperties.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventChannelProperties.cs new file mode 100644 index 000000000000..ecc025e4fc96 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventChannelProperties.cs @@ -0,0 +1,294 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Properties of the Event Channel. + public partial class EventChannelProperties : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelProperties, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelPropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelDestination _destination; + + /// Represents the destination of an event channel. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelDestination Destination { get => (this._destination = this._destination ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventChannelDestination()); set => this._destination = value; } + + /// + /// Azure subscription ID of the customer creating the event channel. The partner topic + /// associated with the event channel will be created under this Azure subscription. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string DestinationAzureSubscriptionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelDestinationInternal)Destination).AzureSubscriptionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelDestinationInternal)Destination).AzureSubscriptionId = value ?? null; } + + /// Name of the partner topic associated with the event channel. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string DestinationPartnerTopicName { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelDestinationInternal)Destination).PartnerTopicName; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelDestinationInternal)Destination).PartnerTopicName = value ?? null; } + + /// + /// Azure Resource Group of the customer creating the event channel. The partner topic + /// associated with the event channel will be created under this resource group. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string DestinationResourceGroup { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelDestinationInternal)Destination).ResourceGroup; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelDestinationInternal)Destination).ResourceGroup = value ?? null; } + + /// + /// The identifier of the resource that's the source of the events. + /// This represents a unique resource in the partner's resource model. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string EventChannelSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelSourceInternal)Source).Source; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelSourceInternal)Source).Source = value ?? null; } + + /// Backing field for property. + private global::System.DateTime? _expirationTimeIfNotActivatedUtc; + + /// + /// Expiration time of the event channel. If this timer expires while the corresponding partner topic is never activated, + /// the event channel and corresponding partner topic are deleted. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public global::System.DateTime? ExpirationTimeIfNotActivatedUtc { get => this._expirationTimeIfNotActivatedUtc; set => this._expirationTimeIfNotActivatedUtc = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelFilter _filter; + + /// Information about the filter for the event channel. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelFilter Filter { get => (this._filter = this._filter ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventChannelFilter()); set => this._filter = value; } + + /// An array of advanced filters that are used for filtering event channels. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[] FilterAdvancedFilter { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelFilterInternal)Filter).AdvancedFilter; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelFilterInternal)Filter).AdvancedFilter = value ?? null /* arrayOf */; } + + /// + /// Allows advanced filters to be evaluated against an array of values instead of expecting a singular value. The default + /// value is either false or null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public bool? FilterEnableAdvancedFilteringOnArray { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelFilterInternal)Filter).EnableAdvancedFilteringOnArray; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelFilterInternal)Filter).EnableAdvancedFilteringOnArray = value ?? default(bool); } + + /// Internal Acessors for Destination + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelDestination Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelPropertiesInternal.Destination { get => (this._destination = this._destination ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventChannelDestination()); set { {_destination = value;} } } + + /// Internal Acessors for Filter + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelFilter Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelPropertiesInternal.Filter { get => (this._filter = this._filter ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventChannelFilter()); set { {_filter = value;} } } + + /// Internal Acessors for PartnerTopicReadinessState + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicReadinessState? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelPropertiesInternal.PartnerTopicReadinessState { get => this._partnerTopicReadinessState; set { {_partnerTopicReadinessState = value;} } } + + /// Internal Acessors for ProvisioningState + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventChannelProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + + /// Internal Acessors for Source + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelSource Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelPropertiesInternal.Source { get => (this._source = this._source ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventChannelSource()); set { {_source = value;} } } + + /// Backing field for property. + private string _partnerTopicFriendlyDescription; + + /// + /// Friendly description about the topic. This can be set by the publisher/partner to show custom description for the customer + /// partner topic. + /// This will be helpful to remove any ambiguity of the origin of creation of the partner topic for the customer. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string PartnerTopicFriendlyDescription { get => this._partnerTopicFriendlyDescription; set => this._partnerTopicFriendlyDescription = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicReadinessState? _partnerTopicReadinessState; + + /// The readiness state of the corresponding partner topic. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicReadinessState? PartnerTopicReadinessState { get => this._partnerTopicReadinessState; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventChannelProvisioningState? _provisioningState; + + /// Provisioning state of the event channel. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventChannelProvisioningState? ProvisioningState { get => this._provisioningState; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelSource _source; + + /// + /// Source of the event channel. This represents a unique resource in the partner's resource model. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelSource Source { get => (this._source = this._source ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventChannelSource()); set => this._source = value; } + + /// Creates an new instance. + public EventChannelProperties() + { + + } + } + /// Properties of the Event Channel. + public partial interface IEventChannelProperties : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// + /// Azure subscription ID of the customer creating the event channel. The partner topic + /// associated with the event channel will be created under this Azure subscription. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Azure subscription ID of the customer creating the event channel. The partner topic + associated with the event channel will be created under this Azure subscription.", + SerializedName = @"azureSubscriptionId", + PossibleTypes = new [] { typeof(string) })] + string DestinationAzureSubscriptionId { get; set; } + /// Name of the partner topic associated with the event channel. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the partner topic associated with the event channel.", + SerializedName = @"partnerTopicName", + PossibleTypes = new [] { typeof(string) })] + string DestinationPartnerTopicName { get; set; } + /// + /// Azure Resource Group of the customer creating the event channel. The partner topic + /// associated with the event channel will be created under this resource group. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Azure Resource Group of the customer creating the event channel. The partner topic + associated with the event channel will be created under this resource group.", + SerializedName = @"resourceGroup", + PossibleTypes = new [] { typeof(string) })] + string DestinationResourceGroup { get; set; } + /// + /// The identifier of the resource that's the source of the events. + /// This represents a unique resource in the partner's resource model. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identifier of the resource that's the source of the events. + This represents a unique resource in the partner's resource model.", + SerializedName = @"source", + PossibleTypes = new [] { typeof(string) })] + string EventChannelSource { get; set; } + /// + /// Expiration time of the event channel. If this timer expires while the corresponding partner topic is never activated, + /// the event channel and corresponding partner topic are deleted. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Expiration time of the event channel. If this timer expires while the corresponding partner topic is never activated, + the event channel and corresponding partner topic are deleted.", + SerializedName = @"expirationTimeIfNotActivatedUtc", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ExpirationTimeIfNotActivatedUtc { get; set; } + /// An array of advanced filters that are used for filtering event channels. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An array of advanced filters that are used for filtering event channels.", + SerializedName = @"advancedFilters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[] FilterAdvancedFilter { get; set; } + /// + /// Allows advanced filters to be evaluated against an array of values instead of expecting a singular value. The default + /// value is either false or null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allows advanced filters to be evaluated against an array of values instead of expecting a singular value. The default value is either false or null.", + SerializedName = @"enableAdvancedFilteringOnArrays", + PossibleTypes = new [] { typeof(bool) })] + bool? FilterEnableAdvancedFilteringOnArray { get; set; } + /// + /// Friendly description about the topic. This can be set by the publisher/partner to show custom description for the customer + /// partner topic. + /// This will be helpful to remove any ambiguity of the origin of creation of the partner topic for the customer. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Friendly description about the topic. This can be set by the publisher/partner to show custom description for the customer partner topic. + This will be helpful to remove any ambiguity of the origin of creation of the partner topic for the customer.", + SerializedName = @"partnerTopicFriendlyDescription", + PossibleTypes = new [] { typeof(string) })] + string PartnerTopicFriendlyDescription { get; set; } + /// The readiness state of the corresponding partner topic. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The readiness state of the corresponding partner topic.", + SerializedName = @"partnerTopicReadinessState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicReadinessState) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicReadinessState? PartnerTopicReadinessState { get; } + /// Provisioning state of the event channel. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Provisioning state of the event channel.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventChannelProvisioningState) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventChannelProvisioningState? ProvisioningState { get; } + + } + /// Properties of the Event Channel. + internal partial interface IEventChannelPropertiesInternal + + { + /// Represents the destination of an event channel. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelDestination Destination { get; set; } + /// + /// Azure subscription ID of the customer creating the event channel. The partner topic + /// associated with the event channel will be created under this Azure subscription. + /// + string DestinationAzureSubscriptionId { get; set; } + /// Name of the partner topic associated with the event channel. + string DestinationPartnerTopicName { get; set; } + /// + /// Azure Resource Group of the customer creating the event channel. The partner topic + /// associated with the event channel will be created under this resource group. + /// + string DestinationResourceGroup { get; set; } + /// + /// The identifier of the resource that's the source of the events. + /// This represents a unique resource in the partner's resource model. + /// + string EventChannelSource { get; set; } + /// + /// Expiration time of the event channel. If this timer expires while the corresponding partner topic is never activated, + /// the event channel and corresponding partner topic are deleted. + /// + global::System.DateTime? ExpirationTimeIfNotActivatedUtc { get; set; } + /// Information about the filter for the event channel. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelFilter Filter { get; set; } + /// An array of advanced filters that are used for filtering event channels. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[] FilterAdvancedFilter { get; set; } + /// + /// Allows advanced filters to be evaluated against an array of values instead of expecting a singular value. The default + /// value is either false or null. + /// + bool? FilterEnableAdvancedFilteringOnArray { get; set; } + /// + /// Friendly description about the topic. This can be set by the publisher/partner to show custom description for the customer + /// partner topic. + /// This will be helpful to remove any ambiguity of the origin of creation of the partner topic for the customer. + /// + string PartnerTopicFriendlyDescription { get; set; } + /// The readiness state of the corresponding partner topic. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicReadinessState? PartnerTopicReadinessState { get; set; } + /// Provisioning state of the event channel. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventChannelProvisioningState? ProvisioningState { get; set; } + /// + /// Source of the event channel. This represents a unique resource in the partner's resource model. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelSource Source { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventChannelProperties.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventChannelProperties.json.cs new file mode 100644 index 000000000000..66cdc6bf0683 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventChannelProperties.json.cs @@ -0,0 +1,124 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Properties of the Event Channel. + public partial class EventChannelProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal EventChannelProperties(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_source = If( json?.PropertyT("source"), out var __jsonSource) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventChannelSource.FromJson(__jsonSource) : Source;} + {_destination = If( json?.PropertyT("destination"), out var __jsonDestination) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventChannelDestination.FromJson(__jsonDestination) : Destination;} + {_filter = If( json?.PropertyT("filter"), out var __jsonFilter) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventChannelFilter.FromJson(__jsonFilter) : Filter;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} + {_partnerTopicReadinessState = If( json?.PropertyT("partnerTopicReadinessState"), out var __jsonPartnerTopicReadinessState) ? (string)__jsonPartnerTopicReadinessState : (string)PartnerTopicReadinessState;} + {_expirationTimeIfNotActivatedUtc = If( json?.PropertyT("expirationTimeIfNotActivatedUtc"), out var __jsonExpirationTimeIfNotActivatedUtc) ? global::System.DateTime.TryParse((string)__jsonExpirationTimeIfNotActivatedUtc, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonExpirationTimeIfNotActivatedUtcValue) ? __jsonExpirationTimeIfNotActivatedUtcValue : ExpirationTimeIfNotActivatedUtc : ExpirationTimeIfNotActivatedUtc;} + {_partnerTopicFriendlyDescription = If( json?.PropertyT("partnerTopicFriendlyDescription"), out var __jsonPartnerTopicFriendlyDescription) ? (string)__jsonPartnerTopicFriendlyDescription : (string)PartnerTopicFriendlyDescription;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new EventChannelProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._source ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._source.ToJson(null,serializationMode) : null, "source" ,container.Add ); + AddIf( null != this._destination ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._destination.ToJson(null,serializationMode) : null, "destination" ,container.Add ); + AddIf( null != this._filter ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._filter.ToJson(null,serializationMode) : null, "filter" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._partnerTopicReadinessState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._partnerTopicReadinessState.ToString()) : null, "partnerTopicReadinessState" ,container.Add ); + } + AddIf( null != this._expirationTimeIfNotActivatedUtc ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._expirationTimeIfNotActivatedUtc?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "expirationTimeIfNotActivatedUtc" ,container.Add ); + AddIf( null != (((object)this._partnerTopicFriendlyDescription)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._partnerTopicFriendlyDescription.ToString()) : null, "partnerTopicFriendlyDescription" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventChannelSource.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventChannelSource.PowerShell.cs new file mode 100644 index 000000000000..37c880b2867e --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventChannelSource.PowerShell.cs @@ -0,0 +1,144 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Properties of the source of an event channel. + [System.ComponentModel.TypeConverter(typeof(EventChannelSourceTypeConverter))] + public partial class EventChannelSource + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelSource DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new EventChannelSource(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelSource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new EventChannelSource(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal EventChannelSource(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Source")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelSourceInternal)this).Source = (string) content.GetValueForProperty("Source",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelSourceInternal)this).Source, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal EventChannelSource(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Source")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelSourceInternal)this).Source = (string) content.GetValueForProperty("Source",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelSourceInternal)this).Source, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelSource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties of the source of an event channel. + [System.ComponentModel.TypeConverter(typeof(EventChannelSourceTypeConverter))] + public partial interface IEventChannelSource + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventChannelSource.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventChannelSource.TypeConverter.cs new file mode 100644 index 000000000000..c59274c89dd1 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventChannelSource.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class EventChannelSourceTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelSource ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelSource).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return EventChannelSource.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return EventChannelSource.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return EventChannelSource.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventChannelSource.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventChannelSource.cs new file mode 100644 index 000000000000..8d4f6ae124a8 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventChannelSource.cs @@ -0,0 +1,61 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Properties of the source of an event channel. + public partial class EventChannelSource : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelSource, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelSourceInternal + { + + /// Backing field for property. + private string _source; + + /// + /// The identifier of the resource that's the source of the events. + /// This represents a unique resource in the partner's resource model. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string Source { get => this._source; set => this._source = value; } + + /// Creates an new instance. + public EventChannelSource() + { + + } + } + /// Properties of the source of an event channel. + public partial interface IEventChannelSource : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// + /// The identifier of the resource that's the source of the events. + /// This represents a unique resource in the partner's resource model. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identifier of the resource that's the source of the events. + This represents a unique resource in the partner's resource model.", + SerializedName = @"source", + PossibleTypes = new [] { typeof(string) })] + string Source { get; set; } + + } + /// Properties of the source of an event channel. + internal partial interface IEventChannelSourceInternal + + { + /// + /// The identifier of the resource that's the source of the events. + /// This represents a unique resource in the partner's resource model. + /// + string Source { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventChannelSource.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventChannelSource.json.cs new file mode 100644 index 000000000000..ab670914bb94 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventChannelSource.json.cs @@ -0,0 +1,106 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Properties of the source of an event channel. + public partial class EventChannelSource + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal EventChannelSource(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_source = If( json?.PropertyT("source"), out var __jsonSource) ? (string)__jsonSource : (string)Source;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelSource. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelSource. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelSource FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new EventChannelSource(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._source)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._source.ToString()) : null, "source" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventChannelsListResult.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventChannelsListResult.PowerShell.cs new file mode 100644 index 000000000000..8f53ad912fa3 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventChannelsListResult.PowerShell.cs @@ -0,0 +1,152 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Result of the List Event Channels operation + [System.ComponentModel.TypeConverter(typeof(EventChannelsListResultTypeConverter))] + public partial class EventChannelsListResult + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelsListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new EventChannelsListResult(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelsListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new EventChannelsListResult(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal EventChannelsListResult(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelsListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannel[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelsListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventChannelTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelsListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelsListResultInternal)this).NextLink, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal EventChannelsListResult(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelsListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannel[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelsListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventChannelTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelsListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelsListResultInternal)this).NextLink, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelsListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Result of the List Event Channels operation + [System.ComponentModel.TypeConverter(typeof(EventChannelsListResultTypeConverter))] + public partial interface IEventChannelsListResult + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventChannelsListResult.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventChannelsListResult.TypeConverter.cs new file mode 100644 index 000000000000..ff64e6f0a0e5 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventChannelsListResult.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class EventChannelsListResultTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelsListResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelsListResult).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return EventChannelsListResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return EventChannelsListResult.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return EventChannelsListResult.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventChannelsListResult.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventChannelsListResult.cs new file mode 100644 index 000000000000..d44b3e9a825d --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventChannelsListResult.cs @@ -0,0 +1,68 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Result of the List Event Channels operation + public partial class EventChannelsListResult : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelsListResult, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelsListResultInternal + { + + /// Backing field for property. + private string _nextLink; + + /// A link for the next page of event channels + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannel[] _value; + + /// A collection of Event Channels + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannel[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public EventChannelsListResult() + { + + } + } + /// Result of the List Event Channels operation + public partial interface IEventChannelsListResult : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// A link for the next page of event channels + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A link for the next page of event channels", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// A collection of Event Channels + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A collection of Event Channels", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannel) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannel[] Value { get; set; } + + } + /// Result of the List Event Channels operation + internal partial interface IEventChannelsListResultInternal + + { + /// A link for the next page of event channels + string NextLink { get; set; } + /// A collection of Event Channels + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannel[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventChannelsListResult.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventChannelsListResult.json.cs new file mode 100644 index 000000000000..fc08a0792a1a --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventChannelsListResult.json.cs @@ -0,0 +1,116 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Result of the List Event Channels operation + public partial class EventChannelsListResult + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal EventChannelsListResult(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannel) (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventChannel.FromJson(__u) )) ))() : null : Value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelsListResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelsListResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannelsListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new EventChannelsListResult(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventHubEventSubscriptionDestination.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventHubEventSubscriptionDestination.PowerShell.cs new file mode 100644 index 000000000000..f81d9d3acec8 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventHubEventSubscriptionDestination.PowerShell.cs @@ -0,0 +1,168 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Information about the event hub destination for an event subscription. + [System.ComponentModel.TypeConverter(typeof(EventHubEventSubscriptionDestinationTypeConverter))] + public partial class EventHubEventSubscriptionDestination + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventHubEventSubscriptionDestination DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new EventHubEventSubscriptionDestination(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventHubEventSubscriptionDestination DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new EventHubEventSubscriptionDestination(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal EventHubEventSubscriptionDestination(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventHubEventSubscriptionDestinationInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventHubEventSubscriptionDestinationProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventHubEventSubscriptionDestinationInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventHubEventSubscriptionDestinationPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("EndpointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestinationInternal)this).EndpointType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType) content.GetValueForProperty("EndpointType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestinationInternal)this).EndpointType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType.CreateFrom); + } + if (content.Contains("ResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventHubEventSubscriptionDestinationInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventHubEventSubscriptionDestinationInternal)this).ResourceId, global::System.Convert.ToString); + } + if (content.Contains("DeliveryAttributeMapping")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventHubEventSubscriptionDestinationInternal)this).DeliveryAttributeMapping = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping[]) content.GetValueForProperty("DeliveryAttributeMapping",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventHubEventSubscriptionDestinationInternal)this).DeliveryAttributeMapping, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeliveryAttributeMappingTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal EventHubEventSubscriptionDestination(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventHubEventSubscriptionDestinationInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventHubEventSubscriptionDestinationProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventHubEventSubscriptionDestinationInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventHubEventSubscriptionDestinationPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("EndpointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestinationInternal)this).EndpointType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType) content.GetValueForProperty("EndpointType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestinationInternal)this).EndpointType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType.CreateFrom); + } + if (content.Contains("ResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventHubEventSubscriptionDestinationInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventHubEventSubscriptionDestinationInternal)this).ResourceId, global::System.Convert.ToString); + } + if (content.Contains("DeliveryAttributeMapping")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventHubEventSubscriptionDestinationInternal)this).DeliveryAttributeMapping = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping[]) content.GetValueForProperty("DeliveryAttributeMapping",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventHubEventSubscriptionDestinationInternal)this).DeliveryAttributeMapping, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeliveryAttributeMappingTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventHubEventSubscriptionDestination FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Information about the event hub destination for an event subscription. + [System.ComponentModel.TypeConverter(typeof(EventHubEventSubscriptionDestinationTypeConverter))] + public partial interface IEventHubEventSubscriptionDestination + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventHubEventSubscriptionDestination.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventHubEventSubscriptionDestination.TypeConverter.cs new file mode 100644 index 000000000000..db837f0ffe0d --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventHubEventSubscriptionDestination.TypeConverter.cs @@ -0,0 +1,149 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class EventHubEventSubscriptionDestinationTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventHubEventSubscriptionDestination ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventHubEventSubscriptionDestination).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return EventHubEventSubscriptionDestination.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return EventHubEventSubscriptionDestination.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return EventHubEventSubscriptionDestination.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventHubEventSubscriptionDestination.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventHubEventSubscriptionDestination.cs new file mode 100644 index 000000000000..73618ad35108 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventHubEventSubscriptionDestination.cs @@ -0,0 +1,103 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Information about the event hub destination for an event subscription. + public partial class EventHubEventSubscriptionDestination : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventHubEventSubscriptionDestination, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventHubEventSubscriptionDestinationInternal, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestination __eventSubscriptionDestination = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionDestination(); + + /// Delivery attribute details. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping[] DeliveryAttributeMapping { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventHubEventSubscriptionDestinationPropertiesInternal)Property).DeliveryAttributeMapping; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventHubEventSubscriptionDestinationPropertiesInternal)Property).DeliveryAttributeMapping = value ?? null /* arrayOf */; } + + /// Type of the endpoint for the event subscription destination. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType EndpointType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestinationInternal)__eventSubscriptionDestination).EndpointType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestinationInternal)__eventSubscriptionDestination).EndpointType = value ; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventHubEventSubscriptionDestinationProperties Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventHubEventSubscriptionDestinationInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventHubEventSubscriptionDestinationProperties()); set { {_property = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventHubEventSubscriptionDestinationProperties _property; + + /// Event Hub Properties of the event subscription destination. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventHubEventSubscriptionDestinationProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventHubEventSubscriptionDestinationProperties()); set => this._property = value; } + + /// + /// The Azure Resource Id that represents the endpoint of an Event Hub destination of an event subscription. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string ResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventHubEventSubscriptionDestinationPropertiesInternal)Property).ResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventHubEventSubscriptionDestinationPropertiesInternal)Property).ResourceId = value ?? null; } + + /// Creates an new instance. + public EventHubEventSubscriptionDestination() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__eventSubscriptionDestination), __eventSubscriptionDestination); + await eventListener.AssertObjectIsValid(nameof(__eventSubscriptionDestination), __eventSubscriptionDestination); + } + } + /// Information about the event hub destination for an event subscription. + public partial interface IEventHubEventSubscriptionDestination : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestination + { + /// Delivery attribute details. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Delivery attribute details.", + SerializedName = @"deliveryAttributeMappings", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping),typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStaticDeliveryAttributeMapping),typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDynamicDeliveryAttributeMapping) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping[] DeliveryAttributeMapping { get; set; } + /// + /// The Azure Resource Id that represents the endpoint of an Event Hub destination of an event subscription. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Azure Resource Id that represents the endpoint of an Event Hub destination of an event subscription.", + SerializedName = @"resourceId", + PossibleTypes = new [] { typeof(string) })] + string ResourceId { get; set; } + + } + /// Information about the event hub destination for an event subscription. + internal partial interface IEventHubEventSubscriptionDestinationInternal : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestinationInternal + { + /// Delivery attribute details. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping[] DeliveryAttributeMapping { get; set; } + /// Event Hub Properties of the event subscription destination. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventHubEventSubscriptionDestinationProperties Property { get; set; } + /// + /// The Azure Resource Id that represents the endpoint of an Event Hub destination of an event subscription. + /// + string ResourceId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventHubEventSubscriptionDestination.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventHubEventSubscriptionDestination.json.cs new file mode 100644 index 000000000000..7ed5d9ebdf8c --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventHubEventSubscriptionDestination.json.cs @@ -0,0 +1,109 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Information about the event hub destination for an event subscription. + public partial class EventHubEventSubscriptionDestination + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal EventHubEventSubscriptionDestination(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __eventSubscriptionDestination = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionDestination(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventHubEventSubscriptionDestinationProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventHubEventSubscriptionDestination. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventHubEventSubscriptionDestination. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventHubEventSubscriptionDestination FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new EventHubEventSubscriptionDestination(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __eventSubscriptionDestination?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventHubEventSubscriptionDestinationProperties.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventHubEventSubscriptionDestinationProperties.PowerShell.cs new file mode 100644 index 000000000000..af9f8bc3ea85 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventHubEventSubscriptionDestinationProperties.PowerShell.cs @@ -0,0 +1,153 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// The properties for a event hub destination. + [System.ComponentModel.TypeConverter(typeof(EventHubEventSubscriptionDestinationPropertiesTypeConverter))] + public partial class EventHubEventSubscriptionDestinationProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventHubEventSubscriptionDestinationProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new EventHubEventSubscriptionDestinationProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventHubEventSubscriptionDestinationProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new EventHubEventSubscriptionDestinationProperties(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal EventHubEventSubscriptionDestinationProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventHubEventSubscriptionDestinationPropertiesInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventHubEventSubscriptionDestinationPropertiesInternal)this).ResourceId, global::System.Convert.ToString); + } + if (content.Contains("DeliveryAttributeMapping")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventHubEventSubscriptionDestinationPropertiesInternal)this).DeliveryAttributeMapping = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping[]) content.GetValueForProperty("DeliveryAttributeMapping",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventHubEventSubscriptionDestinationPropertiesInternal)this).DeliveryAttributeMapping, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeliveryAttributeMappingTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal EventHubEventSubscriptionDestinationProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventHubEventSubscriptionDestinationPropertiesInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventHubEventSubscriptionDestinationPropertiesInternal)this).ResourceId, global::System.Convert.ToString); + } + if (content.Contains("DeliveryAttributeMapping")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventHubEventSubscriptionDestinationPropertiesInternal)this).DeliveryAttributeMapping = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping[]) content.GetValueForProperty("DeliveryAttributeMapping",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventHubEventSubscriptionDestinationPropertiesInternal)this).DeliveryAttributeMapping, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeliveryAttributeMappingTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from + /// a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventHubEventSubscriptionDestinationProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The properties for a event hub destination. + [System.ComponentModel.TypeConverter(typeof(EventHubEventSubscriptionDestinationPropertiesTypeConverter))] + public partial interface IEventHubEventSubscriptionDestinationProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventHubEventSubscriptionDestinationProperties.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventHubEventSubscriptionDestinationProperties.TypeConverter.cs new file mode 100644 index 000000000000..2c825811a4f4 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventHubEventSubscriptionDestinationProperties.TypeConverter.cs @@ -0,0 +1,150 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class EventHubEventSubscriptionDestinationPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, + /// otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventHubEventSubscriptionDestinationProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventHubEventSubscriptionDestinationProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return EventHubEventSubscriptionDestinationProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return EventHubEventSubscriptionDestinationProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return EventHubEventSubscriptionDestinationProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventHubEventSubscriptionDestinationProperties.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventHubEventSubscriptionDestinationProperties.cs new file mode 100644 index 000000000000..fb6f452b57df --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventHubEventSubscriptionDestinationProperties.cs @@ -0,0 +1,76 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// The properties for a event hub destination. + public partial class EventHubEventSubscriptionDestinationProperties : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventHubEventSubscriptionDestinationProperties, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventHubEventSubscriptionDestinationPropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping[] _deliveryAttributeMapping; + + /// Delivery attribute details. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping[] DeliveryAttributeMapping { get => this._deliveryAttributeMapping; set => this._deliveryAttributeMapping = value; } + + /// Backing field for property. + private string _resourceId; + + /// + /// The Azure Resource Id that represents the endpoint of an Event Hub destination of an event subscription. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string ResourceId { get => this._resourceId; set => this._resourceId = value; } + + /// + /// Creates an new instance. + /// + public EventHubEventSubscriptionDestinationProperties() + { + + } + } + /// The properties for a event hub destination. + public partial interface IEventHubEventSubscriptionDestinationProperties : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// Delivery attribute details. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Delivery attribute details.", + SerializedName = @"deliveryAttributeMappings", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping),typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStaticDeliveryAttributeMapping),typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDynamicDeliveryAttributeMapping) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping[] DeliveryAttributeMapping { get; set; } + /// + /// The Azure Resource Id that represents the endpoint of an Event Hub destination of an event subscription. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Azure Resource Id that represents the endpoint of an Event Hub destination of an event subscription.", + SerializedName = @"resourceId", + PossibleTypes = new [] { typeof(string) })] + string ResourceId { get; set; } + + } + /// The properties for a event hub destination. + internal partial interface IEventHubEventSubscriptionDestinationPropertiesInternal + + { + /// Delivery attribute details. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping[] DeliveryAttributeMapping { get; set; } + /// + /// The Azure Resource Id that represents the endpoint of an Event Hub destination of an event subscription. + /// + string ResourceId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventHubEventSubscriptionDestinationProperties.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventHubEventSubscriptionDestinationProperties.json.cs new file mode 100644 index 000000000000..841f218eb30c --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventHubEventSubscriptionDestinationProperties.json.cs @@ -0,0 +1,119 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// The properties for a event hub destination. + public partial class EventHubEventSubscriptionDestinationProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal EventHubEventSubscriptionDestinationProperties(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_resourceId = If( json?.PropertyT("resourceId"), out var __jsonResourceId) ? (string)__jsonResourceId : (string)ResourceId;} + {_deliveryAttributeMapping = If( json?.PropertyT("deliveryAttributeMappings"), out var __jsonDeliveryAttributeMappings) ? If( __jsonDeliveryAttributeMappings as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping) (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeliveryAttributeMapping.FromJson(__u) )) ))() : null : DeliveryAttributeMapping;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventHubEventSubscriptionDestinationProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventHubEventSubscriptionDestinationProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventHubEventSubscriptionDestinationProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new EventHubEventSubscriptionDestinationProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._resourceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._resourceId.ToString()) : null, "resourceId" ,container.Add ); + if (null != this._deliveryAttributeMapping) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.XNodeArray(); + foreach( var __x in this._deliveryAttributeMapping ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("deliveryAttributeMappings",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscription.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscription.PowerShell.cs new file mode 100644 index 000000000000..95719f8f44bd --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscription.PowerShell.cs @@ -0,0 +1,470 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Event Subscription + [System.ComponentModel.TypeConverter(typeof(EventSubscriptionTypeConverter))] + public partial class EventSubscription + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new EventSubscription(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new EventSubscription(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal EventSubscription(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("RetryPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).RetryPolicy = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IRetryPolicy) content.GetValueForProperty("RetryPolicy",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).RetryPolicy, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.RetryPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Destination")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).Destination = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestination) content.GetValueForProperty("Destination",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).Destination, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionDestinationTypeConverter.ConvertFrom); + } + if (content.Contains("PropertiesDeliveryWithResourceIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).PropertiesDeliveryWithResourceIdentity = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryWithResourceIdentity) content.GetValueForProperty("PropertiesDeliveryWithResourceIdentity",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).PropertiesDeliveryWithResourceIdentity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeliveryWithResourceIdentityTypeConverter.ConvertFrom); + } + if (content.Contains("Filter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).Filter = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFilter) content.GetValueForProperty("Filter",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).Filter, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionFilterTypeConverter.ConvertFrom); + } + if (content.Contains("DeadLetterDestination")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).DeadLetterDestination = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterDestination) content.GetValueForProperty("DeadLetterDestination",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).DeadLetterDestination, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeadLetterDestinationTypeConverter.ConvertFrom); + } + if (content.Contains("PropertiesDeadLetterWithResourceIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).PropertiesDeadLetterWithResourceIdentity = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterWithResourceIdentity) content.GetValueForProperty("PropertiesDeadLetterWithResourceIdentity",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).PropertiesDeadLetterWithResourceIdentity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeadLetterWithResourceIdentityTypeConverter.ConvertFrom); + } + if (content.Contains("Topic")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).Topic = (string) content.GetValueForProperty("Topic",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).Topic, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionProvisioningState.CreateFrom); + } + if (content.Contains("Label")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).Label = (string[]) content.GetValueForProperty("Label",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).Label, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ExpirationTimeUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).ExpirationTimeUtc = (global::System.DateTime?) content.GetValueForProperty("ExpirationTimeUtc",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).ExpirationTimeUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EventDeliverySchema")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).EventDeliverySchema = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema?) content.GetValueForProperty("EventDeliverySchema",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).EventDeliverySchema, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema.CreateFrom); + } + if (content.Contains("EndpointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).EndpointType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType) content.GetValueForProperty("EndpointType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).EndpointType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType.CreateFrom); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("PropertiesDeliveryWithResourceIdentityIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).PropertiesDeliveryWithResourceIdentityIdentity = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionIdentity) content.GetValueForProperty("PropertiesDeliveryWithResourceIdentityIdentity",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).PropertiesDeliveryWithResourceIdentityIdentity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionIdentityTypeConverter.ConvertFrom); + } + if (content.Contains("DeliveryWithResourceIdentityDestination")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).DeliveryWithResourceIdentityDestination = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestination) content.GetValueForProperty("DeliveryWithResourceIdentityDestination",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).DeliveryWithResourceIdentityDestination, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionDestinationTypeConverter.ConvertFrom); + } + if (content.Contains("DeliveryWithResourceIdentityDestinationEndpointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).DeliveryWithResourceIdentityDestinationEndpointType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType) content.GetValueForProperty("DeliveryWithResourceIdentityDestinationEndpointType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).DeliveryWithResourceIdentityDestinationEndpointType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType.CreateFrom); + } + if (content.Contains("FilterSubjectBeginsWith")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).FilterSubjectBeginsWith = (string) content.GetValueForProperty("FilterSubjectBeginsWith",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).FilterSubjectBeginsWith, global::System.Convert.ToString); + } + if (content.Contains("FilterSubjectEndsWith")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).FilterSubjectEndsWith = (string) content.GetValueForProperty("FilterSubjectEndsWith",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).FilterSubjectEndsWith, global::System.Convert.ToString); + } + if (content.Contains("FilterIncludedEventType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).FilterIncludedEventType = (string[]) content.GetValueForProperty("FilterIncludedEventType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).FilterIncludedEventType, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("FilterIsSubjectCaseSensitive")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).FilterIsSubjectCaseSensitive = (bool?) content.GetValueForProperty("FilterIsSubjectCaseSensitive",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).FilterIsSubjectCaseSensitive, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("FilterEnableAdvancedFilteringOnArray")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).FilterEnableAdvancedFilteringOnArray = (bool?) content.GetValueForProperty("FilterEnableAdvancedFilteringOnArray",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).FilterEnableAdvancedFilteringOnArray, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("FilterAdvancedFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).FilterAdvancedFilter = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[]) content.GetValueForProperty("FilterAdvancedFilter",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).FilterAdvancedFilter, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.AdvancedFilterTypeConverter.ConvertFrom)); + } + if (content.Contains("RetryPolicyMaxDeliveryAttempt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).RetryPolicyMaxDeliveryAttempt = (int?) content.GetValueForProperty("RetryPolicyMaxDeliveryAttempt",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).RetryPolicyMaxDeliveryAttempt, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("RetryPolicyEventTimeToLiveInMinute")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).RetryPolicyEventTimeToLiveInMinute = (int?) content.GetValueForProperty("RetryPolicyEventTimeToLiveInMinute",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).RetryPolicyEventTimeToLiveInMinute, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("DeadLetterEndPointTypeEndpointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).DeadLetterEndPointTypeEndpointType = (string) content.GetValueForProperty("DeadLetterEndPointTypeEndpointType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).DeadLetterEndPointTypeEndpointType, global::System.Convert.ToString); + } + if (content.Contains("PropertiesDeadLetterWithResourceIdentityIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).PropertiesDeadLetterWithResourceIdentityIdentity = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionIdentity) content.GetValueForProperty("PropertiesDeadLetterWithResourceIdentityIdentity",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).PropertiesDeadLetterWithResourceIdentityIdentity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionIdentityTypeConverter.ConvertFrom); + } + if (content.Contains("DeadLetterWithResourceIdentityDeadLetterDestination")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).DeadLetterWithResourceIdentityDeadLetterDestination = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterDestination) content.GetValueForProperty("DeadLetterWithResourceIdentityDeadLetterDestination",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).DeadLetterWithResourceIdentityDeadLetterDestination, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeadLetterDestinationTypeConverter.ConvertFrom); + } + if (content.Contains("DeliveryWithResourceIdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).DeliveryWithResourceIdentityType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType?) content.GetValueForProperty("DeliveryWithResourceIdentityType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).DeliveryWithResourceIdentityType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType.CreateFrom); + } + if (content.Contains("DeliveryWithResourceIdentityUserAssignedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).DeliveryWithResourceIdentityUserAssignedIdentity = (string) content.GetValueForProperty("DeliveryWithResourceIdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).DeliveryWithResourceIdentityUserAssignedIdentity, global::System.Convert.ToString); + } + if (content.Contains("DeadLetterWithResourceIdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).DeadLetterWithResourceIdentityType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType?) content.GetValueForProperty("DeadLetterWithResourceIdentityType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).DeadLetterWithResourceIdentityType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType.CreateFrom); + } + if (content.Contains("DeadLetterWithResourceIdentityUserAssignedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).DeadLetterWithResourceIdentityUserAssignedIdentity = (string) content.GetValueForProperty("DeadLetterWithResourceIdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).DeadLetterWithResourceIdentityUserAssignedIdentity, global::System.Convert.ToString); + } + if (content.Contains("DeadLetterWithResourceIdentityDeadLetterDestinationEndpointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).DeadLetterWithResourceIdentityDeadLetterDestinationEndpointType = (string) content.GetValueForProperty("DeadLetterWithResourceIdentityDeadLetterDestinationEndpointType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).DeadLetterWithResourceIdentityDeadLetterDestinationEndpointType, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal EventSubscription(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("RetryPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).RetryPolicy = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IRetryPolicy) content.GetValueForProperty("RetryPolicy",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).RetryPolicy, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.RetryPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Destination")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).Destination = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestination) content.GetValueForProperty("Destination",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).Destination, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionDestinationTypeConverter.ConvertFrom); + } + if (content.Contains("PropertiesDeliveryWithResourceIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).PropertiesDeliveryWithResourceIdentity = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryWithResourceIdentity) content.GetValueForProperty("PropertiesDeliveryWithResourceIdentity",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).PropertiesDeliveryWithResourceIdentity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeliveryWithResourceIdentityTypeConverter.ConvertFrom); + } + if (content.Contains("Filter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).Filter = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFilter) content.GetValueForProperty("Filter",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).Filter, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionFilterTypeConverter.ConvertFrom); + } + if (content.Contains("DeadLetterDestination")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).DeadLetterDestination = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterDestination) content.GetValueForProperty("DeadLetterDestination",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).DeadLetterDestination, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeadLetterDestinationTypeConverter.ConvertFrom); + } + if (content.Contains("PropertiesDeadLetterWithResourceIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).PropertiesDeadLetterWithResourceIdentity = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterWithResourceIdentity) content.GetValueForProperty("PropertiesDeadLetterWithResourceIdentity",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).PropertiesDeadLetterWithResourceIdentity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeadLetterWithResourceIdentityTypeConverter.ConvertFrom); + } + if (content.Contains("Topic")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).Topic = (string) content.GetValueForProperty("Topic",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).Topic, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionProvisioningState.CreateFrom); + } + if (content.Contains("Label")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).Label = (string[]) content.GetValueForProperty("Label",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).Label, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ExpirationTimeUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).ExpirationTimeUtc = (global::System.DateTime?) content.GetValueForProperty("ExpirationTimeUtc",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).ExpirationTimeUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EventDeliverySchema")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).EventDeliverySchema = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema?) content.GetValueForProperty("EventDeliverySchema",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).EventDeliverySchema, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema.CreateFrom); + } + if (content.Contains("EndpointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).EndpointType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType) content.GetValueForProperty("EndpointType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).EndpointType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType.CreateFrom); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("PropertiesDeliveryWithResourceIdentityIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).PropertiesDeliveryWithResourceIdentityIdentity = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionIdentity) content.GetValueForProperty("PropertiesDeliveryWithResourceIdentityIdentity",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).PropertiesDeliveryWithResourceIdentityIdentity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionIdentityTypeConverter.ConvertFrom); + } + if (content.Contains("DeliveryWithResourceIdentityDestination")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).DeliveryWithResourceIdentityDestination = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestination) content.GetValueForProperty("DeliveryWithResourceIdentityDestination",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).DeliveryWithResourceIdentityDestination, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionDestinationTypeConverter.ConvertFrom); + } + if (content.Contains("DeliveryWithResourceIdentityDestinationEndpointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).DeliveryWithResourceIdentityDestinationEndpointType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType) content.GetValueForProperty("DeliveryWithResourceIdentityDestinationEndpointType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).DeliveryWithResourceIdentityDestinationEndpointType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType.CreateFrom); + } + if (content.Contains("FilterSubjectBeginsWith")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).FilterSubjectBeginsWith = (string) content.GetValueForProperty("FilterSubjectBeginsWith",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).FilterSubjectBeginsWith, global::System.Convert.ToString); + } + if (content.Contains("FilterSubjectEndsWith")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).FilterSubjectEndsWith = (string) content.GetValueForProperty("FilterSubjectEndsWith",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).FilterSubjectEndsWith, global::System.Convert.ToString); + } + if (content.Contains("FilterIncludedEventType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).FilterIncludedEventType = (string[]) content.GetValueForProperty("FilterIncludedEventType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).FilterIncludedEventType, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("FilterIsSubjectCaseSensitive")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).FilterIsSubjectCaseSensitive = (bool?) content.GetValueForProperty("FilterIsSubjectCaseSensitive",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).FilterIsSubjectCaseSensitive, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("FilterEnableAdvancedFilteringOnArray")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).FilterEnableAdvancedFilteringOnArray = (bool?) content.GetValueForProperty("FilterEnableAdvancedFilteringOnArray",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).FilterEnableAdvancedFilteringOnArray, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("FilterAdvancedFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).FilterAdvancedFilter = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[]) content.GetValueForProperty("FilterAdvancedFilter",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).FilterAdvancedFilter, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.AdvancedFilterTypeConverter.ConvertFrom)); + } + if (content.Contains("RetryPolicyMaxDeliveryAttempt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).RetryPolicyMaxDeliveryAttempt = (int?) content.GetValueForProperty("RetryPolicyMaxDeliveryAttempt",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).RetryPolicyMaxDeliveryAttempt, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("RetryPolicyEventTimeToLiveInMinute")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).RetryPolicyEventTimeToLiveInMinute = (int?) content.GetValueForProperty("RetryPolicyEventTimeToLiveInMinute",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).RetryPolicyEventTimeToLiveInMinute, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("DeadLetterEndPointTypeEndpointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).DeadLetterEndPointTypeEndpointType = (string) content.GetValueForProperty("DeadLetterEndPointTypeEndpointType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).DeadLetterEndPointTypeEndpointType, global::System.Convert.ToString); + } + if (content.Contains("PropertiesDeadLetterWithResourceIdentityIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).PropertiesDeadLetterWithResourceIdentityIdentity = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionIdentity) content.GetValueForProperty("PropertiesDeadLetterWithResourceIdentityIdentity",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).PropertiesDeadLetterWithResourceIdentityIdentity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionIdentityTypeConverter.ConvertFrom); + } + if (content.Contains("DeadLetterWithResourceIdentityDeadLetterDestination")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).DeadLetterWithResourceIdentityDeadLetterDestination = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterDestination) content.GetValueForProperty("DeadLetterWithResourceIdentityDeadLetterDestination",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).DeadLetterWithResourceIdentityDeadLetterDestination, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeadLetterDestinationTypeConverter.ConvertFrom); + } + if (content.Contains("DeliveryWithResourceIdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).DeliveryWithResourceIdentityType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType?) content.GetValueForProperty("DeliveryWithResourceIdentityType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).DeliveryWithResourceIdentityType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType.CreateFrom); + } + if (content.Contains("DeliveryWithResourceIdentityUserAssignedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).DeliveryWithResourceIdentityUserAssignedIdentity = (string) content.GetValueForProperty("DeliveryWithResourceIdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).DeliveryWithResourceIdentityUserAssignedIdentity, global::System.Convert.ToString); + } + if (content.Contains("DeadLetterWithResourceIdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).DeadLetterWithResourceIdentityType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType?) content.GetValueForProperty("DeadLetterWithResourceIdentityType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).DeadLetterWithResourceIdentityType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType.CreateFrom); + } + if (content.Contains("DeadLetterWithResourceIdentityUserAssignedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).DeadLetterWithResourceIdentityUserAssignedIdentity = (string) content.GetValueForProperty("DeadLetterWithResourceIdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).DeadLetterWithResourceIdentityUserAssignedIdentity, global::System.Convert.ToString); + } + if (content.Contains("DeadLetterWithResourceIdentityDeadLetterDestinationEndpointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).DeadLetterWithResourceIdentityDeadLetterDestinationEndpointType = (string) content.GetValueForProperty("DeadLetterWithResourceIdentityDeadLetterDestinationEndpointType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal)this).DeadLetterWithResourceIdentityDeadLetterDestinationEndpointType, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Event Subscription + [System.ComponentModel.TypeConverter(typeof(EventSubscriptionTypeConverter))] + public partial interface IEventSubscription + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscription.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscription.TypeConverter.cs new file mode 100644 index 000000000000..eb8c0de8f60f --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscription.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class EventSubscriptionTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return EventSubscription.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return EventSubscription.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return EventSubscription.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscription.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscription.cs new file mode 100644 index 000000000000..d51a9ed89278 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscription.cs @@ -0,0 +1,632 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Event Subscription + public partial class EventSubscription : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.Resource(); + + /// Type of the endpoint for the dead letter destination + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string DeadLetterEndPointTypeEndpointType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)Property).DeadLetterEndPointTypeEndpointType; } + + /// Type of the endpoint for the dead letter destination + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string DeadLetterWithResourceIdentityDeadLetterDestinationEndpointType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)Property).DeadLetterWithResourceIdentityDeadLetterDestinationEndpointType; } + + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType? DeadLetterWithResourceIdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)Property).DeadLetterWithResourceIdentityType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)Property).DeadLetterWithResourceIdentityType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType)""); } + + /// The user identity associated with the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string DeadLetterWithResourceIdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)Property).DeadLetterWithResourceIdentityUserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)Property).DeadLetterWithResourceIdentityUserAssignedIdentity = value ?? null; } + + /// Type of the endpoint for the event subscription destination. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType? DeliveryWithResourceIdentityDestinationEndpointType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)Property).DeliveryWithResourceIdentityDestinationEndpointType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)Property).DeliveryWithResourceIdentityDestinationEndpointType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType)""); } + + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType? DeliveryWithResourceIdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)Property).DeliveryWithResourceIdentityType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)Property).DeliveryWithResourceIdentityType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType)""); } + + /// The user identity associated with the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string DeliveryWithResourceIdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)Property).DeliveryWithResourceIdentityUserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)Property).DeliveryWithResourceIdentityUserAssignedIdentity = value ?? null; } + + /// Type of the endpoint for the event subscription destination. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType? EndpointType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)Property).EndpointType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)Property).EndpointType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType)""); } + + /// The event delivery schema for the event subscription. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema? EventDeliverySchema { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)Property).EventDeliverySchema; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)Property).EventDeliverySchema = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema)""); } + + /// Expiration time of the event subscription. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public global::System.DateTime? ExpirationTimeUtc { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)Property).ExpirationTimeUtc; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)Property).ExpirationTimeUtc = value ?? default(global::System.DateTime); } + + /// An array of advanced filters that are used for filtering event subscriptions. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[] FilterAdvancedFilter { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)Property).FilterAdvancedFilter; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)Property).FilterAdvancedFilter = value ?? null /* arrayOf */; } + + /// + /// Allows advanced filters to be evaluated against an array of values instead of expecting a singular value. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public bool? FilterEnableAdvancedFilteringOnArray { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)Property).FilterEnableAdvancedFilteringOnArray; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)Property).FilterEnableAdvancedFilteringOnArray = value ?? default(bool); } + + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string[] FilterIncludedEventType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)Property).FilterIncludedEventType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)Property).FilterIncludedEventType = value ?? null /* arrayOf */; } + + /// + /// Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filter + /// should be compared in a case sensitive manner. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public bool? FilterIsSubjectCaseSensitive { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)Property).FilterIsSubjectCaseSensitive; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)Property).FilterIsSubjectCaseSensitive = value ?? default(bool); } + + /// + /// An optional string to filter events for an event subscription based on a resource path prefix. + /// The format of this depends on the publisher of the events. + /// Wildcard characters are not supported in this path. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string FilterSubjectBeginsWith { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)Property).FilterSubjectBeginsWith; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)Property).FilterSubjectBeginsWith = value ?? null; } + + /// + /// An optional string to filter events for an event subscription based on a resource path suffix. + /// Wildcard characters are not supported in this path. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string FilterSubjectEndsWith { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)Property).FilterSubjectEndsWith; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)Property).FilterSubjectEndsWith = value ?? null; } + + /// Fully qualified identifier of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Id; } + + /// List of user defined labels. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string[] Label { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)Property).Label; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)Property).Label = value ?? null /* arrayOf */; } + + /// Internal Acessors for DeadLetterDestination + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterDestination Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal.DeadLetterDestination { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)Property).DeadLetterDestination; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)Property).DeadLetterDestination = value; } + + /// Internal Acessors for DeadLetterEndPointTypeEndpointType + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal.DeadLetterEndPointTypeEndpointType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)Property).DeadLetterEndPointTypeEndpointType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)Property).DeadLetterEndPointTypeEndpointType = value; } + + /// Internal Acessors for DeadLetterWithResourceIdentityDeadLetterDestination + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterDestination Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal.DeadLetterWithResourceIdentityDeadLetterDestination { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)Property).DeadLetterWithResourceIdentityDeadLetterDestination; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)Property).DeadLetterWithResourceIdentityDeadLetterDestination = value; } + + /// + /// Internal Acessors for DeadLetterWithResourceIdentityDeadLetterDestinationEndpointType + /// + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal.DeadLetterWithResourceIdentityDeadLetterDestinationEndpointType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)Property).DeadLetterWithResourceIdentityDeadLetterDestinationEndpointType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)Property).DeadLetterWithResourceIdentityDeadLetterDestinationEndpointType = value; } + + /// Internal Acessors for DeliveryWithResourceIdentityDestination + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestination Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal.DeliveryWithResourceIdentityDestination { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)Property).DeliveryWithResourceIdentityDestination; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)Property).DeliveryWithResourceIdentityDestination = value; } + + /// Internal Acessors for Destination + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestination Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal.Destination { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)Property).Destination; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)Property).Destination = value; } + + /// Internal Acessors for Filter + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFilter Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal.Filter { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)Property).Filter; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)Property).Filter = value; } + + /// Internal Acessors for PropertiesDeadLetterWithResourceIdentity + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterWithResourceIdentity Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal.PropertiesDeadLetterWithResourceIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)Property).DeadLetterWithResourceIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)Property).DeadLetterWithResourceIdentity = value; } + + /// Internal Acessors for PropertiesDeadLetterWithResourceIdentityIdentity + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionIdentity Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal.PropertiesDeadLetterWithResourceIdentityIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)Property).DeadLetterWithResourceIdentityIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)Property).DeadLetterWithResourceIdentityIdentity = value; } + + /// Internal Acessors for PropertiesDeliveryWithResourceIdentity + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryWithResourceIdentity Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal.PropertiesDeliveryWithResourceIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)Property).DeliveryWithResourceIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)Property).DeliveryWithResourceIdentity = value; } + + /// Internal Acessors for PropertiesDeliveryWithResourceIdentityIdentity + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionIdentity Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal.PropertiesDeliveryWithResourceIdentityIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)Property).DeliveryWithResourceIdentityIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)Property).DeliveryWithResourceIdentityIdentity = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionProperties Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionProperties()); set { {_property = value;} } } + + /// Internal Acessors for ProvisioningState + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)Property).ProvisioningState = value; } + + /// Internal Acessors for RetryPolicy + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IRetryPolicy Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal.RetryPolicy { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)Property).RetryPolicy; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)Property).RetryPolicy = value; } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.SystemData()); set { {_systemData = value;} } } + + /// Internal Acessors for Topic + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionInternal.Topic { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)Property).Topic; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)Property).Topic = value; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Type = value; } + + /// Name of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionProperties _property; + + /// Properties of the event subscription. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionProperties()); set => this._property = value; } + + /// Provisioning state of the event subscription. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionProvisioningState? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)Property).ProvisioningState; } + + /// Time To Live (in minutes) for events. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public int? RetryPolicyEventTimeToLiveInMinute { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)Property).RetryPolicyEventTimeToLiveInMinute; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)Property).RetryPolicyEventTimeToLiveInMinute = value ?? default(int); } + + /// Maximum number of delivery retry attempts for events. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public int? RetryPolicyMaxDeliveryAttempt { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)Property).RetryPolicyMaxDeliveryAttempt; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)Property).RetryPolicyMaxDeliveryAttempt = value ?? default(int); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData _systemData; + + /// The system metadata relating to Event Subscription resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.SystemData()); } + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).CreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType)""); } + + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType)""); } + + /// Name of the topic of the event subscription. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string Topic { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)Property).Topic; } + + /// Type of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public EventSubscription() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// Event Subscription + public partial interface IEventSubscription : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResource + { + /// Type of the endpoint for the dead letter destination + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Type of the endpoint for the dead letter destination", + SerializedName = @"endpointType", + PossibleTypes = new [] { typeof(string) })] + string DeadLetterEndPointTypeEndpointType { get; } + /// Type of the endpoint for the dead letter destination + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Type of the endpoint for the dead letter destination", + SerializedName = @"endpointType", + PossibleTypes = new [] { typeof(string) })] + string DeadLetterWithResourceIdentityDeadLetterDestinationEndpointType { get; } + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType? DeadLetterWithResourceIdentityType { get; set; } + /// The user identity associated with the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The user identity associated with the resource.", + SerializedName = @"userAssignedIdentity", + PossibleTypes = new [] { typeof(string) })] + string DeadLetterWithResourceIdentityUserAssignedIdentity { get; set; } + /// Type of the endpoint for the event subscription destination. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of the endpoint for the event subscription destination.", + SerializedName = @"endpointType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType? DeliveryWithResourceIdentityDestinationEndpointType { get; set; } + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType? DeliveryWithResourceIdentityType { get; set; } + /// The user identity associated with the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The user identity associated with the resource.", + SerializedName = @"userAssignedIdentity", + PossibleTypes = new [] { typeof(string) })] + string DeliveryWithResourceIdentityUserAssignedIdentity { get; set; } + /// Type of the endpoint for the event subscription destination. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of the endpoint for the event subscription destination.", + SerializedName = @"endpointType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType? EndpointType { get; set; } + /// The event delivery schema for the event subscription. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The event delivery schema for the event subscription.", + SerializedName = @"eventDeliverySchema", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema? EventDeliverySchema { get; set; } + /// Expiration time of the event subscription. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Expiration time of the event subscription.", + SerializedName = @"expirationTimeUtc", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ExpirationTimeUtc { get; set; } + /// An array of advanced filters that are used for filtering event subscriptions. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An array of advanced filters that are used for filtering event subscriptions.", + SerializedName = @"advancedFilters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[] FilterAdvancedFilter { get; set; } + /// + /// Allows advanced filters to be evaluated against an array of values instead of expecting a singular value. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allows advanced filters to be evaluated against an array of values instead of expecting a singular value.", + SerializedName = @"enableAdvancedFilteringOnArrays", + PossibleTypes = new [] { typeof(bool) })] + bool? FilterEnableAdvancedFilteringOnArray { get; set; } + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"includedEventTypes", + PossibleTypes = new [] { typeof(string) })] + string[] FilterIncludedEventType { get; set; } + /// + /// Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filter + /// should be compared in a case sensitive manner. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filter + should be compared in a case sensitive manner.", + SerializedName = @"isSubjectCaseSensitive", + PossibleTypes = new [] { typeof(bool) })] + bool? FilterIsSubjectCaseSensitive { get; set; } + /// + /// An optional string to filter events for an event subscription based on a resource path prefix. + /// The format of this depends on the publisher of the events. + /// Wildcard characters are not supported in this path. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An optional string to filter events for an event subscription based on a resource path prefix. + The format of this depends on the publisher of the events. + Wildcard characters are not supported in this path.", + SerializedName = @"subjectBeginsWith", + PossibleTypes = new [] { typeof(string) })] + string FilterSubjectBeginsWith { get; set; } + /// + /// An optional string to filter events for an event subscription based on a resource path suffix. + /// Wildcard characters are not supported in this path. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An optional string to filter events for an event subscription based on a resource path suffix. + Wildcard characters are not supported in this path.", + SerializedName = @"subjectEndsWith", + PossibleTypes = new [] { typeof(string) })] + string FilterSubjectEndsWith { get; set; } + /// List of user defined labels. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of user defined labels.", + SerializedName = @"labels", + PossibleTypes = new [] { typeof(string) })] + string[] Label { get; set; } + /// Provisioning state of the event subscription. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Provisioning state of the event subscription.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionProvisioningState) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionProvisioningState? ProvisioningState { get; } + /// Time To Live (in minutes) for events. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Time To Live (in minutes) for events.", + SerializedName = @"eventTimeToLiveInMinutes", + PossibleTypes = new [] { typeof(int) })] + int? RetryPolicyEventTimeToLiveInMinute { get; set; } + /// Maximum number of delivery retry attempts for events. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Maximum number of delivery retry attempts for events.", + SerializedName = @"maxDeliveryAttempts", + PossibleTypes = new [] { typeof(int) })] + int? RetryPolicyMaxDeliveryAttempt { get; set; } + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timestamp of resource creation (UTC).", + SerializedName = @"createdAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SystemDataCreatedAt { get; set; } + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identity that created the resource.", + SerializedName = @"createdBy", + PossibleTypes = new [] { typeof(string) })] + string SystemDataCreatedBy { get; set; } + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of identity that created the resource.", + SerializedName = @"createdByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType? SystemDataCreatedByType { get; set; } + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timestamp of resource last modification (UTC)", + SerializedName = @"lastModifiedAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SystemDataLastModifiedAt { get; set; } + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identity that last modified the resource.", + SerializedName = @"lastModifiedBy", + PossibleTypes = new [] { typeof(string) })] + string SystemDataLastModifiedBy { get; set; } + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of identity that last modified the resource.", + SerializedName = @"lastModifiedByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + /// Name of the topic of the event subscription. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Name of the topic of the event subscription.", + SerializedName = @"topic", + PossibleTypes = new [] { typeof(string) })] + string Topic { get; } + + } + /// Event Subscription + internal partial interface IEventSubscriptionInternal : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal + { + /// + /// 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 Azure Event Grid's identity to acquire the authentication tokens being used during delivery / dead-lettering. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterDestination DeadLetterDestination { get; set; } + /// Type of the endpoint for the dead letter destination + string DeadLetterEndPointTypeEndpointType { get; set; } + /// + /// Information about the destination where events have to be delivered for the event subscription. + /// Uses the managed identity setup on the parent resource (namely, topic or domain) to acquire the authentication tokens + /// being used during delivery / dead-lettering. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterDestination DeadLetterWithResourceIdentityDeadLetterDestination { get; set; } + /// Type of the endpoint for the dead letter destination + string DeadLetterWithResourceIdentityDeadLetterDestinationEndpointType { get; set; } + /// + /// 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. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType? DeadLetterWithResourceIdentityType { get; set; } + /// The user identity associated with the resource. + string DeadLetterWithResourceIdentityUserAssignedIdentity { get; set; } + /// + /// Information about the destination where events have to be delivered for the event subscription. + /// Uses Azure Event Grid's identity to acquire the authentication tokens being used during delivery / dead-lettering. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestination DeliveryWithResourceIdentityDestination { get; set; } + /// Type of the endpoint for the event subscription destination. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType? DeliveryWithResourceIdentityDestinationEndpointType { get; set; } + /// + /// 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. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType? DeliveryWithResourceIdentityType { get; set; } + /// The user identity associated with the resource. + string DeliveryWithResourceIdentityUserAssignedIdentity { get; set; } + /// + /// Information about the destination where events have to be delivered for the event subscription. + /// Uses Azure Event Grid's identity to acquire the authentication tokens being used during delivery / dead-lettering. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestination Destination { get; set; } + /// Type of the endpoint for the event subscription destination. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType? EndpointType { get; set; } + /// The event delivery schema for the event subscription. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema? EventDeliverySchema { get; set; } + /// Expiration time of the event subscription. + global::System.DateTime? ExpirationTimeUtc { get; set; } + /// Information about the filter for the event subscription. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFilter Filter { get; set; } + /// An array of advanced filters that are used for filtering event subscriptions. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[] FilterAdvancedFilter { get; set; } + /// + /// Allows advanced filters to be evaluated against an array of values instead of expecting a singular value. + /// + bool? FilterEnableAdvancedFilteringOnArray { get; set; } + /// + /// 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. + /// + string[] FilterIncludedEventType { get; set; } + /// + /// Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filter + /// should be compared in a case sensitive manner. + /// + bool? FilterIsSubjectCaseSensitive { get; set; } + /// + /// An optional string to filter events for an event subscription based on a resource path prefix. + /// The format of this depends on the publisher of the events. + /// Wildcard characters are not supported in this path. + /// + string FilterSubjectBeginsWith { get; set; } + /// + /// An optional string to filter events for an event subscription based on a resource path suffix. + /// Wildcard characters are not supported in this path. + /// + string FilterSubjectEndsWith { get; set; } + /// List of user defined labels. + string[] Label { get; set; } + /// + /// 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 or domain) to acquire the authentication tokens + /// being used during delivery / dead-lettering. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterWithResourceIdentity PropertiesDeadLetterWithResourceIdentity { get; set; } + /// The identity to use when dead-lettering events. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionIdentity PropertiesDeadLetterWithResourceIdentityIdentity { get; set; } + /// + /// Information about the destination where events have to be delivered for the event subscription. + /// Uses the managed identity setup on the parent resource (namely, topic or domain) to acquire the authentication tokens + /// being used during delivery / dead-lettering. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryWithResourceIdentity PropertiesDeliveryWithResourceIdentity { get; set; } + /// The identity to use when delivering events. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionIdentity PropertiesDeliveryWithResourceIdentityIdentity { get; set; } + /// Properties of the event subscription. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionProperties Property { get; set; } + /// Provisioning state of the event subscription. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionProvisioningState? ProvisioningState { get; set; } + /// + /// The retry policy for events. This can be used to configure maximum number of delivery attempts and time to live for events. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IRetryPolicy RetryPolicy { get; set; } + /// Time To Live (in minutes) for events. + int? RetryPolicyEventTimeToLiveInMinute { get; set; } + /// Maximum number of delivery retry attempts for events. + int? RetryPolicyMaxDeliveryAttempt { get; set; } + /// The system metadata relating to Event Subscription resource. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData SystemData { get; set; } + /// The timestamp of resource creation (UTC). + global::System.DateTime? SystemDataCreatedAt { get; set; } + /// The identity that created the resource. + string SystemDataCreatedBy { get; set; } + /// The type of identity that created the resource. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType? SystemDataCreatedByType { get; set; } + /// The timestamp of resource last modification (UTC) + global::System.DateTime? SystemDataLastModifiedAt { get; set; } + /// The identity that last modified the resource. + string SystemDataLastModifiedBy { get; set; } + /// The type of identity that last modified the resource. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + /// Name of the topic of the event subscription. + string Topic { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscription.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscription.json.cs new file mode 100644 index 000000000000..d530a7f3d1af --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscription.json.cs @@ -0,0 +1,113 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Event Subscription + public partial class EventSubscription + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal EventSubscription(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionProperties.FromJson(__jsonProperties) : Property;} + {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.SystemData.FromJson(__jsonSystemData) : SystemData;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new EventSubscription(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._systemData ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._systemData.ToJson(null,serializationMode) : null, "systemData" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscriptionDestination.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscriptionDestination.PowerShell.cs new file mode 100644 index 000000000000..de6ee2bb3ccb --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscriptionDestination.PowerShell.cs @@ -0,0 +1,144 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Information about the destination for an event subscription. + [System.ComponentModel.TypeConverter(typeof(EventSubscriptionDestinationTypeConverter))] + public partial class EventSubscriptionDestination + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestination DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new EventSubscriptionDestination(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestination DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new EventSubscriptionDestination(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal EventSubscriptionDestination(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("EndpointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestinationInternal)this).EndpointType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType) content.GetValueForProperty("EndpointType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestinationInternal)this).EndpointType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal EventSubscriptionDestination(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("EndpointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestinationInternal)this).EndpointType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType) content.GetValueForProperty("EndpointType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestinationInternal)this).EndpointType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType.CreateFrom); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestination FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Information about the destination for an event subscription. + [System.ComponentModel.TypeConverter(typeof(EventSubscriptionDestinationTypeConverter))] + public partial interface IEventSubscriptionDestination + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscriptionDestination.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscriptionDestination.TypeConverter.cs new file mode 100644 index 000000000000..fc1fdc8c2955 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscriptionDestination.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class EventSubscriptionDestinationTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestination ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestination).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return EventSubscriptionDestination.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return EventSubscriptionDestination.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return EventSubscriptionDestination.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscriptionDestination.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscriptionDestination.cs new file mode 100644 index 000000000000..c157de1ec6a8 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscriptionDestination.cs @@ -0,0 +1,51 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Information about the destination for an event subscription. + public partial class EventSubscriptionDestination : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestination, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestinationInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType _endpointType; + + /// Type of the endpoint for the event subscription destination. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType EndpointType { get => this._endpointType; set => this._endpointType = value; } + + /// Creates an new instance. + public EventSubscriptionDestination() + { + + } + } + /// Information about the destination for an event subscription. + public partial interface IEventSubscriptionDestination : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// Type of the endpoint for the event subscription destination. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Type of the endpoint for the event subscription destination.", + SerializedName = @"endpointType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType EndpointType { get; set; } + + } + /// Information about the destination for an event subscription. + internal partial interface IEventSubscriptionDestinationInternal + + { + /// Type of the endpoint for the event subscription destination. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType EndpointType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscriptionDestination.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscriptionDestination.json.cs new file mode 100644 index 000000000000..8488c972b31e --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscriptionDestination.json.cs @@ -0,0 +1,149 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Information about the destination for an event subscription. + public partial class EventSubscriptionDestination + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal EventSubscriptionDestination(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_endpointType = If( json?.PropertyT("endpointType"), out var __jsonEndpointType) ? (string)__jsonEndpointType : (string)EndpointType;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestination. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestination interface + /// is polymorphic, and the precise model class that will get deserialized is determined at runtime based on the payload. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestination. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestination FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + if (!(node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json)) + { + return null; + } + // Polymorphic type -- select the appropriate constructor using the discriminator + + switch ( json.StringProperty("endpointType") ) + { + case "WebHook": + { + return new WebHookEventSubscriptionDestination(json); + } + case "EventHub": + { + return new EventHubEventSubscriptionDestination(json); + } + case "StorageQueue": + { + return new StorageQueueEventSubscriptionDestination(json); + } + case "HybridConnection": + { + return new HybridConnectionEventSubscriptionDestination(json); + } + case "ServiceBusQueue": + { + return new ServiceBusQueueEventSubscriptionDestination(json); + } + case "ServiceBusTopic": + { + return new ServiceBusTopicEventSubscriptionDestination(json); + } + case "AzureFunction": + { + return new AzureFunctionEventSubscriptionDestination(json); + } + case "PartnerDestination": + { + return new PartnerEventSubscriptionDestination(json); + } + } + return new EventSubscriptionDestination(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._endpointType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._endpointType.ToString()) : null, "endpointType" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscriptionFilter.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscriptionFilter.PowerShell.cs new file mode 100644 index 000000000000..6cf8ae2711e3 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscriptionFilter.PowerShell.cs @@ -0,0 +1,184 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Filter for the Event Subscription. + [System.ComponentModel.TypeConverter(typeof(EventSubscriptionFilterTypeConverter))] + public partial class EventSubscriptionFilter + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFilter DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new EventSubscriptionFilter(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFilter DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new EventSubscriptionFilter(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal EventSubscriptionFilter(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SubjectBeginsWith")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFilterInternal)this).SubjectBeginsWith = (string) content.GetValueForProperty("SubjectBeginsWith",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFilterInternal)this).SubjectBeginsWith, global::System.Convert.ToString); + } + if (content.Contains("SubjectEndsWith")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFilterInternal)this).SubjectEndsWith = (string) content.GetValueForProperty("SubjectEndsWith",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFilterInternal)this).SubjectEndsWith, global::System.Convert.ToString); + } + if (content.Contains("IncludedEventType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFilterInternal)this).IncludedEventType = (string[]) content.GetValueForProperty("IncludedEventType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFilterInternal)this).IncludedEventType, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("IsSubjectCaseSensitive")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFilterInternal)this).IsSubjectCaseSensitive = (bool?) content.GetValueForProperty("IsSubjectCaseSensitive",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFilterInternal)this).IsSubjectCaseSensitive, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("EnableAdvancedFilteringOnArray")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFilterInternal)this).EnableAdvancedFilteringOnArray = (bool?) content.GetValueForProperty("EnableAdvancedFilteringOnArray",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFilterInternal)this).EnableAdvancedFilteringOnArray, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AdvancedFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFilterInternal)this).AdvancedFilter = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[]) content.GetValueForProperty("AdvancedFilter",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFilterInternal)this).AdvancedFilter, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.AdvancedFilterTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal EventSubscriptionFilter(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SubjectBeginsWith")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFilterInternal)this).SubjectBeginsWith = (string) content.GetValueForProperty("SubjectBeginsWith",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFilterInternal)this).SubjectBeginsWith, global::System.Convert.ToString); + } + if (content.Contains("SubjectEndsWith")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFilterInternal)this).SubjectEndsWith = (string) content.GetValueForProperty("SubjectEndsWith",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFilterInternal)this).SubjectEndsWith, global::System.Convert.ToString); + } + if (content.Contains("IncludedEventType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFilterInternal)this).IncludedEventType = (string[]) content.GetValueForProperty("IncludedEventType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFilterInternal)this).IncludedEventType, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("IsSubjectCaseSensitive")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFilterInternal)this).IsSubjectCaseSensitive = (bool?) content.GetValueForProperty("IsSubjectCaseSensitive",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFilterInternal)this).IsSubjectCaseSensitive, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("EnableAdvancedFilteringOnArray")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFilterInternal)this).EnableAdvancedFilteringOnArray = (bool?) content.GetValueForProperty("EnableAdvancedFilteringOnArray",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFilterInternal)this).EnableAdvancedFilteringOnArray, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AdvancedFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFilterInternal)this).AdvancedFilter = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[]) content.GetValueForProperty("AdvancedFilter",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFilterInternal)this).AdvancedFilter, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.AdvancedFilterTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFilter FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Filter for the Event Subscription. + [System.ComponentModel.TypeConverter(typeof(EventSubscriptionFilterTypeConverter))] + public partial interface IEventSubscriptionFilter + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscriptionFilter.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscriptionFilter.TypeConverter.cs new file mode 100644 index 000000000000..c96292bb2fd6 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscriptionFilter.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class EventSubscriptionFilterTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFilter ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFilter).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return EventSubscriptionFilter.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return EventSubscriptionFilter.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return EventSubscriptionFilter.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscriptionFilter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscriptionFilter.cs new file mode 100644 index 000000000000..7e61275d2cd3 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscriptionFilter.cs @@ -0,0 +1,185 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Filter for the Event Subscription. + public partial class EventSubscriptionFilter : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFilter, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFilterInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[] _advancedFilter; + + /// An array of advanced filters that are used for filtering event subscriptions. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[] AdvancedFilter { get => this._advancedFilter; set => this._advancedFilter = value; } + + /// Backing field for property. + private bool? _enableAdvancedFilteringOnArray; + + /// + /// Allows advanced filters to be evaluated against an array of values instead of expecting a singular value. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public bool? EnableAdvancedFilteringOnArray { get => this._enableAdvancedFilteringOnArray; set => this._enableAdvancedFilteringOnArray = value; } + + /// Backing field for property. + private string[] _includedEventType; + + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string[] IncludedEventType { get => this._includedEventType; set => this._includedEventType = value; } + + /// Backing field for property. + private bool? _isSubjectCaseSensitive; + + /// + /// Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filter + /// should be compared in a case sensitive manner. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public bool? IsSubjectCaseSensitive { get => this._isSubjectCaseSensitive; set => this._isSubjectCaseSensitive = value; } + + /// Backing field for property. + private string _subjectBeginsWith; + + /// + /// An optional string to filter events for an event subscription based on a resource path prefix. + /// The format of this depends on the publisher of the events. + /// Wildcard characters are not supported in this path. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string SubjectBeginsWith { get => this._subjectBeginsWith; set => this._subjectBeginsWith = value; } + + /// Backing field for property. + private string _subjectEndsWith; + + /// + /// An optional string to filter events for an event subscription based on a resource path suffix. + /// Wildcard characters are not supported in this path. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string SubjectEndsWith { get => this._subjectEndsWith; set => this._subjectEndsWith = value; } + + /// Creates an new instance. + public EventSubscriptionFilter() + { + + } + } + /// Filter for the Event Subscription. + public partial interface IEventSubscriptionFilter : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// An array of advanced filters that are used for filtering event subscriptions. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An array of advanced filters that are used for filtering event subscriptions.", + SerializedName = @"advancedFilters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[] AdvancedFilter { get; set; } + /// + /// Allows advanced filters to be evaluated against an array of values instead of expecting a singular value. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allows advanced filters to be evaluated against an array of values instead of expecting a singular value.", + SerializedName = @"enableAdvancedFilteringOnArrays", + PossibleTypes = new [] { typeof(bool) })] + bool? EnableAdvancedFilteringOnArray { get; set; } + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"includedEventTypes", + PossibleTypes = new [] { typeof(string) })] + string[] IncludedEventType { get; set; } + /// + /// Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filter + /// should be compared in a case sensitive manner. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filter + should be compared in a case sensitive manner.", + SerializedName = @"isSubjectCaseSensitive", + PossibleTypes = new [] { typeof(bool) })] + bool? IsSubjectCaseSensitive { get; set; } + /// + /// An optional string to filter events for an event subscription based on a resource path prefix. + /// The format of this depends on the publisher of the events. + /// Wildcard characters are not supported in this path. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An optional string to filter events for an event subscription based on a resource path prefix. + The format of this depends on the publisher of the events. + Wildcard characters are not supported in this path.", + SerializedName = @"subjectBeginsWith", + PossibleTypes = new [] { typeof(string) })] + string SubjectBeginsWith { get; set; } + /// + /// An optional string to filter events for an event subscription based on a resource path suffix. + /// Wildcard characters are not supported in this path. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An optional string to filter events for an event subscription based on a resource path suffix. + Wildcard characters are not supported in this path.", + SerializedName = @"subjectEndsWith", + PossibleTypes = new [] { typeof(string) })] + string SubjectEndsWith { get; set; } + + } + /// Filter for the Event Subscription. + internal partial interface IEventSubscriptionFilterInternal + + { + /// An array of advanced filters that are used for filtering event subscriptions. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[] AdvancedFilter { get; set; } + /// + /// Allows advanced filters to be evaluated against an array of values instead of expecting a singular value. + /// + bool? EnableAdvancedFilteringOnArray { get; set; } + /// + /// 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. + /// + string[] IncludedEventType { get; set; } + /// + /// Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filter + /// should be compared in a case sensitive manner. + /// + bool? IsSubjectCaseSensitive { get; set; } + /// + /// An optional string to filter events for an event subscription based on a resource path prefix. + /// The format of this depends on the publisher of the events. + /// Wildcard characters are not supported in this path. + /// + string SubjectBeginsWith { get; set; } + /// + /// An optional string to filter events for an event subscription based on a resource path suffix. + /// Wildcard characters are not supported in this path. + /// + string SubjectEndsWith { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscriptionFilter.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscriptionFilter.json.cs new file mode 100644 index 000000000000..c1ed045cb2fc --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscriptionFilter.json.cs @@ -0,0 +1,132 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Filter for the Event Subscription. + public partial class EventSubscriptionFilter + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal EventSubscriptionFilter(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_subjectBeginsWith = If( json?.PropertyT("subjectBeginsWith"), out var __jsonSubjectBeginsWith) ? (string)__jsonSubjectBeginsWith : (string)SubjectBeginsWith;} + {_subjectEndsWith = If( json?.PropertyT("subjectEndsWith"), out var __jsonSubjectEndsWith) ? (string)__jsonSubjectEndsWith : (string)SubjectEndsWith;} + {_includedEventType = If( json?.PropertyT("includedEventTypes"), out var __jsonIncludedEventTypes) ? If( __jsonIncludedEventTypes as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : IncludedEventType;} + {_isSubjectCaseSensitive = If( json?.PropertyT("isSubjectCaseSensitive"), out var __jsonIsSubjectCaseSensitive) ? (bool?)__jsonIsSubjectCaseSensitive : IsSubjectCaseSensitive;} + {_enableAdvancedFilteringOnArray = If( json?.PropertyT("enableAdvancedFilteringOnArrays"), out var __jsonEnableAdvancedFilteringOnArrays) ? (bool?)__jsonEnableAdvancedFilteringOnArrays : EnableAdvancedFilteringOnArray;} + {_advancedFilter = If( json?.PropertyT("advancedFilters"), out var __jsonAdvancedFilters) ? If( __jsonAdvancedFilters as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter) (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.AdvancedFilter.FromJson(__p) )) ))() : null : AdvancedFilter;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFilter. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFilter. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFilter FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new EventSubscriptionFilter(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._subjectBeginsWith)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._subjectBeginsWith.ToString()) : null, "subjectBeginsWith" ,container.Add ); + AddIf( null != (((object)this._subjectEndsWith)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._subjectEndsWith.ToString()) : null, "subjectEndsWith" ,container.Add ); + if (null != this._includedEventType) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.XNodeArray(); + foreach( var __x in this._includedEventType ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("includedEventTypes",__w); + } + AddIf( null != this._isSubjectCaseSensitive ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonBoolean((bool)this._isSubjectCaseSensitive) : null, "isSubjectCaseSensitive" ,container.Add ); + AddIf( null != this._enableAdvancedFilteringOnArray ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonBoolean((bool)this._enableAdvancedFilteringOnArray) : null, "enableAdvancedFilteringOnArrays" ,container.Add ); + if (null != this._advancedFilter) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.XNodeArray(); + foreach( var __s in this._advancedFilter ) + { + AddIf(__s?.ToJson(null, serializationMode) ,__r.Add); + } + container.Add("advancedFilters",__r); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscriptionFullUrl.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscriptionFullUrl.PowerShell.cs new file mode 100644 index 000000000000..029b26ad3c0b --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscriptionFullUrl.PowerShell.cs @@ -0,0 +1,144 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Full endpoint url of an event subscription + [System.ComponentModel.TypeConverter(typeof(EventSubscriptionFullUrlTypeConverter))] + public partial class EventSubscriptionFullUrl + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFullUrl DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new EventSubscriptionFullUrl(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFullUrl DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new EventSubscriptionFullUrl(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal EventSubscriptionFullUrl(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("EndpointUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFullUrlInternal)this).EndpointUrl = (string) content.GetValueForProperty("EndpointUrl",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFullUrlInternal)this).EndpointUrl, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal EventSubscriptionFullUrl(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("EndpointUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFullUrlInternal)this).EndpointUrl = (string) content.GetValueForProperty("EndpointUrl",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFullUrlInternal)this).EndpointUrl, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFullUrl FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Full endpoint url of an event subscription + [System.ComponentModel.TypeConverter(typeof(EventSubscriptionFullUrlTypeConverter))] + public partial interface IEventSubscriptionFullUrl + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscriptionFullUrl.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscriptionFullUrl.TypeConverter.cs new file mode 100644 index 000000000000..33afb5e7c654 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscriptionFullUrl.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class EventSubscriptionFullUrlTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFullUrl ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFullUrl).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return EventSubscriptionFullUrl.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return EventSubscriptionFullUrl.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return EventSubscriptionFullUrl.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscriptionFullUrl.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscriptionFullUrl.cs new file mode 100644 index 000000000000..dbf406f68aad --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscriptionFullUrl.cs @@ -0,0 +1,57 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Full endpoint url of an event subscription + public partial class EventSubscriptionFullUrl : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFullUrl, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFullUrlInternal + { + + /// Backing field for property. + private string _endpointUrl; + + /// + /// The URL that represents the endpoint of the destination of an event subscription. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string EndpointUrl { get => this._endpointUrl; set => this._endpointUrl = value; } + + /// Creates an new instance. + public EventSubscriptionFullUrl() + { + + } + } + /// Full endpoint url of an event subscription + public partial interface IEventSubscriptionFullUrl : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// + /// The URL that represents the endpoint of the destination of an event subscription. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The URL that represents the endpoint of the destination of an event subscription.", + SerializedName = @"endpointUrl", + PossibleTypes = new [] { typeof(string) })] + string EndpointUrl { get; set; } + + } + /// Full endpoint url of an event subscription + internal partial interface IEventSubscriptionFullUrlInternal + + { + /// + /// The URL that represents the endpoint of the destination of an event subscription. + /// + string EndpointUrl { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscriptionFullUrl.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscriptionFullUrl.json.cs new file mode 100644 index 000000000000..81ec33a687a8 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscriptionFullUrl.json.cs @@ -0,0 +1,106 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Full endpoint url of an event subscription + public partial class EventSubscriptionFullUrl + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal EventSubscriptionFullUrl(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_endpointUrl = If( json?.PropertyT("endpointUrl"), out var __jsonEndpointUrl) ? (string)__jsonEndpointUrl : (string)EndpointUrl;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFullUrl. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFullUrl. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFullUrl FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new EventSubscriptionFullUrl(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._endpointUrl)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._endpointUrl.ToString()) : null, "endpointUrl" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscriptionIdentity.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscriptionIdentity.PowerShell.cs new file mode 100644 index 000000000000..a41043cbadd9 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscriptionIdentity.PowerShell.cs @@ -0,0 +1,152 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// The identity information with the event subscription. + [System.ComponentModel.TypeConverter(typeof(EventSubscriptionIdentityTypeConverter))] + public partial class EventSubscriptionIdentity + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionIdentity DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new EventSubscriptionIdentity(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionIdentity DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new EventSubscriptionIdentity(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal EventSubscriptionIdentity(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionIdentityInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType?) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionIdentityInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType.CreateFrom); + } + if (content.Contains("UserAssignedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionIdentityInternal)this).UserAssignedIdentity = (string) content.GetValueForProperty("UserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionIdentityInternal)this).UserAssignedIdentity, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal EventSubscriptionIdentity(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionIdentityInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType?) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionIdentityInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType.CreateFrom); + } + if (content.Contains("UserAssignedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionIdentityInternal)this).UserAssignedIdentity = (string) content.GetValueForProperty("UserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionIdentityInternal)this).UserAssignedIdentity, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionIdentity FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The identity information with the event subscription. + [System.ComponentModel.TypeConverter(typeof(EventSubscriptionIdentityTypeConverter))] + public partial interface IEventSubscriptionIdentity + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscriptionIdentity.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscriptionIdentity.TypeConverter.cs new file mode 100644 index 000000000000..fd0cf00dc60c --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscriptionIdentity.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class EventSubscriptionIdentityTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionIdentity ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionIdentity).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return EventSubscriptionIdentity.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return EventSubscriptionIdentity.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return EventSubscriptionIdentity.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscriptionIdentity.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscriptionIdentity.cs new file mode 100644 index 000000000000..6a8e9c29ad98 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscriptionIdentity.cs @@ -0,0 +1,77 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// The identity information with the event subscription. + public partial class EventSubscriptionIdentity : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionIdentity, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionIdentityInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType? _type; + + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType? Type { get => this._type; set => this._type = value; } + + /// Backing field for property. + private string _userAssignedIdentity; + + /// The user identity associated with the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string UserAssignedIdentity { get => this._userAssignedIdentity; set => this._userAssignedIdentity = value; } + + /// Creates an new instance. + public EventSubscriptionIdentity() + { + + } + } + /// The identity information with the event subscription. + public partial interface IEventSubscriptionIdentity : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType? Type { get; set; } + /// The user identity associated with the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The user identity associated with the resource.", + SerializedName = @"userAssignedIdentity", + PossibleTypes = new [] { typeof(string) })] + string UserAssignedIdentity { get; set; } + + } + /// The identity information with the event subscription. + internal partial interface IEventSubscriptionIdentityInternal + + { + /// + /// 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. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType? Type { get; set; } + /// The user identity associated with the resource. + string UserAssignedIdentity { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscriptionIdentity.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscriptionIdentity.json.cs new file mode 100644 index 000000000000..8f6e09825dea --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscriptionIdentity.json.cs @@ -0,0 +1,108 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// The identity information with the event subscription. + public partial class EventSubscriptionIdentity + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal EventSubscriptionIdentity(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + {_userAssignedIdentity = If( json?.PropertyT("userAssignedIdentity"), out var __jsonUserAssignedIdentity) ? (string)__jsonUserAssignedIdentity : (string)UserAssignedIdentity;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionIdentity. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionIdentity. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionIdentity FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new EventSubscriptionIdentity(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + AddIf( null != (((object)this._userAssignedIdentity)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._userAssignedIdentity.ToString()) : null, "userAssignedIdentity" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscriptionProperties.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscriptionProperties.PowerShell.cs new file mode 100644 index 000000000000..577211356de9 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscriptionProperties.PowerShell.cs @@ -0,0 +1,384 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Properties of the Event Subscription. + [System.ComponentModel.TypeConverter(typeof(EventSubscriptionPropertiesTypeConverter))] + public partial class EventSubscriptionProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new EventSubscriptionProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new EventSubscriptionProperties(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal EventSubscriptionProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Destination")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).Destination = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestination) content.GetValueForProperty("Destination",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).Destination, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionDestinationTypeConverter.ConvertFrom); + } + if (content.Contains("DeliveryWithResourceIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).DeliveryWithResourceIdentity = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryWithResourceIdentity) content.GetValueForProperty("DeliveryWithResourceIdentity",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).DeliveryWithResourceIdentity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeliveryWithResourceIdentityTypeConverter.ConvertFrom); + } + if (content.Contains("Filter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).Filter = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFilter) content.GetValueForProperty("Filter",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).Filter, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionFilterTypeConverter.ConvertFrom); + } + if (content.Contains("RetryPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).RetryPolicy = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IRetryPolicy) content.GetValueForProperty("RetryPolicy",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).RetryPolicy, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.RetryPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("DeadLetterDestination")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).DeadLetterDestination = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterDestination) content.GetValueForProperty("DeadLetterDestination",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).DeadLetterDestination, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeadLetterDestinationTypeConverter.ConvertFrom); + } + if (content.Contains("DeadLetterWithResourceIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).DeadLetterWithResourceIdentity = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterWithResourceIdentity) content.GetValueForProperty("DeadLetterWithResourceIdentity",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).DeadLetterWithResourceIdentity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeadLetterWithResourceIdentityTypeConverter.ConvertFrom); + } + if (content.Contains("Topic")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).Topic = (string) content.GetValueForProperty("Topic",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).Topic, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionProvisioningState.CreateFrom); + } + if (content.Contains("Label")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).Label = (string[]) content.GetValueForProperty("Label",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).Label, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ExpirationTimeUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).ExpirationTimeUtc = (global::System.DateTime?) content.GetValueForProperty("ExpirationTimeUtc",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).ExpirationTimeUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EventDeliverySchema")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).EventDeliverySchema = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema?) content.GetValueForProperty("EventDeliverySchema",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).EventDeliverySchema, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema.CreateFrom); + } + if (content.Contains("EndpointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).EndpointType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType) content.GetValueForProperty("EndpointType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).EndpointType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType.CreateFrom); + } + if (content.Contains("DeliveryWithResourceIdentityIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).DeliveryWithResourceIdentityIdentity = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionIdentity) content.GetValueForProperty("DeliveryWithResourceIdentityIdentity",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).DeliveryWithResourceIdentityIdentity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionIdentityTypeConverter.ConvertFrom); + } + if (content.Contains("DeliveryWithResourceIdentityDestination")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).DeliveryWithResourceIdentityDestination = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestination) content.GetValueForProperty("DeliveryWithResourceIdentityDestination",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).DeliveryWithResourceIdentityDestination, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionDestinationTypeConverter.ConvertFrom); + } + if (content.Contains("DeliveryWithResourceIdentityDestinationEndpointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).DeliveryWithResourceIdentityDestinationEndpointType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType) content.GetValueForProperty("DeliveryWithResourceIdentityDestinationEndpointType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).DeliveryWithResourceIdentityDestinationEndpointType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType.CreateFrom); + } + if (content.Contains("FilterSubjectBeginsWith")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).FilterSubjectBeginsWith = (string) content.GetValueForProperty("FilterSubjectBeginsWith",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).FilterSubjectBeginsWith, global::System.Convert.ToString); + } + if (content.Contains("FilterSubjectEndsWith")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).FilterSubjectEndsWith = (string) content.GetValueForProperty("FilterSubjectEndsWith",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).FilterSubjectEndsWith, global::System.Convert.ToString); + } + if (content.Contains("FilterIncludedEventType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).FilterIncludedEventType = (string[]) content.GetValueForProperty("FilterIncludedEventType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).FilterIncludedEventType, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("FilterIsSubjectCaseSensitive")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).FilterIsSubjectCaseSensitive = (bool?) content.GetValueForProperty("FilterIsSubjectCaseSensitive",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).FilterIsSubjectCaseSensitive, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("FilterEnableAdvancedFilteringOnArray")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).FilterEnableAdvancedFilteringOnArray = (bool?) content.GetValueForProperty("FilterEnableAdvancedFilteringOnArray",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).FilterEnableAdvancedFilteringOnArray, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("FilterAdvancedFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).FilterAdvancedFilter = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[]) content.GetValueForProperty("FilterAdvancedFilter",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).FilterAdvancedFilter, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.AdvancedFilterTypeConverter.ConvertFrom)); + } + if (content.Contains("RetryPolicyMaxDeliveryAttempt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).RetryPolicyMaxDeliveryAttempt = (int?) content.GetValueForProperty("RetryPolicyMaxDeliveryAttempt",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).RetryPolicyMaxDeliveryAttempt, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("RetryPolicyEventTimeToLiveInMinute")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).RetryPolicyEventTimeToLiveInMinute = (int?) content.GetValueForProperty("RetryPolicyEventTimeToLiveInMinute",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).RetryPolicyEventTimeToLiveInMinute, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("DeadLetterEndPointTypeEndpointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).DeadLetterEndPointTypeEndpointType = (string) content.GetValueForProperty("DeadLetterEndPointTypeEndpointType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).DeadLetterEndPointTypeEndpointType, global::System.Convert.ToString); + } + if (content.Contains("DeadLetterWithResourceIdentityIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).DeadLetterWithResourceIdentityIdentity = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionIdentity) content.GetValueForProperty("DeadLetterWithResourceIdentityIdentity",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).DeadLetterWithResourceIdentityIdentity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionIdentityTypeConverter.ConvertFrom); + } + if (content.Contains("DeadLetterWithResourceIdentityDeadLetterDestination")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).DeadLetterWithResourceIdentityDeadLetterDestination = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterDestination) content.GetValueForProperty("DeadLetterWithResourceIdentityDeadLetterDestination",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).DeadLetterWithResourceIdentityDeadLetterDestination, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeadLetterDestinationTypeConverter.ConvertFrom); + } + if (content.Contains("DeliveryWithResourceIdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).DeliveryWithResourceIdentityType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType?) content.GetValueForProperty("DeliveryWithResourceIdentityType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).DeliveryWithResourceIdentityType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType.CreateFrom); + } + if (content.Contains("DeliveryWithResourceIdentityUserAssignedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).DeliveryWithResourceIdentityUserAssignedIdentity = (string) content.GetValueForProperty("DeliveryWithResourceIdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).DeliveryWithResourceIdentityUserAssignedIdentity, global::System.Convert.ToString); + } + if (content.Contains("DeadLetterWithResourceIdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).DeadLetterWithResourceIdentityType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType?) content.GetValueForProperty("DeadLetterWithResourceIdentityType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).DeadLetterWithResourceIdentityType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType.CreateFrom); + } + if (content.Contains("DeadLetterWithResourceIdentityUserAssignedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).DeadLetterWithResourceIdentityUserAssignedIdentity = (string) content.GetValueForProperty("DeadLetterWithResourceIdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).DeadLetterWithResourceIdentityUserAssignedIdentity, global::System.Convert.ToString); + } + if (content.Contains("DeadLetterWithResourceIdentityDeadLetterDestinationEndpointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).DeadLetterWithResourceIdentityDeadLetterDestinationEndpointType = (string) content.GetValueForProperty("DeadLetterWithResourceIdentityDeadLetterDestinationEndpointType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).DeadLetterWithResourceIdentityDeadLetterDestinationEndpointType, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal EventSubscriptionProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Destination")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).Destination = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestination) content.GetValueForProperty("Destination",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).Destination, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionDestinationTypeConverter.ConvertFrom); + } + if (content.Contains("DeliveryWithResourceIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).DeliveryWithResourceIdentity = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryWithResourceIdentity) content.GetValueForProperty("DeliveryWithResourceIdentity",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).DeliveryWithResourceIdentity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeliveryWithResourceIdentityTypeConverter.ConvertFrom); + } + if (content.Contains("Filter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).Filter = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFilter) content.GetValueForProperty("Filter",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).Filter, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionFilterTypeConverter.ConvertFrom); + } + if (content.Contains("RetryPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).RetryPolicy = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IRetryPolicy) content.GetValueForProperty("RetryPolicy",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).RetryPolicy, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.RetryPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("DeadLetterDestination")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).DeadLetterDestination = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterDestination) content.GetValueForProperty("DeadLetterDestination",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).DeadLetterDestination, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeadLetterDestinationTypeConverter.ConvertFrom); + } + if (content.Contains("DeadLetterWithResourceIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).DeadLetterWithResourceIdentity = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterWithResourceIdentity) content.GetValueForProperty("DeadLetterWithResourceIdentity",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).DeadLetterWithResourceIdentity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeadLetterWithResourceIdentityTypeConverter.ConvertFrom); + } + if (content.Contains("Topic")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).Topic = (string) content.GetValueForProperty("Topic",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).Topic, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionProvisioningState.CreateFrom); + } + if (content.Contains("Label")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).Label = (string[]) content.GetValueForProperty("Label",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).Label, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ExpirationTimeUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).ExpirationTimeUtc = (global::System.DateTime?) content.GetValueForProperty("ExpirationTimeUtc",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).ExpirationTimeUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EventDeliverySchema")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).EventDeliverySchema = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema?) content.GetValueForProperty("EventDeliverySchema",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).EventDeliverySchema, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema.CreateFrom); + } + if (content.Contains("EndpointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).EndpointType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType) content.GetValueForProperty("EndpointType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).EndpointType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType.CreateFrom); + } + if (content.Contains("DeliveryWithResourceIdentityIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).DeliveryWithResourceIdentityIdentity = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionIdentity) content.GetValueForProperty("DeliveryWithResourceIdentityIdentity",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).DeliveryWithResourceIdentityIdentity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionIdentityTypeConverter.ConvertFrom); + } + if (content.Contains("DeliveryWithResourceIdentityDestination")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).DeliveryWithResourceIdentityDestination = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestination) content.GetValueForProperty("DeliveryWithResourceIdentityDestination",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).DeliveryWithResourceIdentityDestination, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionDestinationTypeConverter.ConvertFrom); + } + if (content.Contains("DeliveryWithResourceIdentityDestinationEndpointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).DeliveryWithResourceIdentityDestinationEndpointType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType) content.GetValueForProperty("DeliveryWithResourceIdentityDestinationEndpointType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).DeliveryWithResourceIdentityDestinationEndpointType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType.CreateFrom); + } + if (content.Contains("FilterSubjectBeginsWith")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).FilterSubjectBeginsWith = (string) content.GetValueForProperty("FilterSubjectBeginsWith",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).FilterSubjectBeginsWith, global::System.Convert.ToString); + } + if (content.Contains("FilterSubjectEndsWith")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).FilterSubjectEndsWith = (string) content.GetValueForProperty("FilterSubjectEndsWith",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).FilterSubjectEndsWith, global::System.Convert.ToString); + } + if (content.Contains("FilterIncludedEventType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).FilterIncludedEventType = (string[]) content.GetValueForProperty("FilterIncludedEventType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).FilterIncludedEventType, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("FilterIsSubjectCaseSensitive")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).FilterIsSubjectCaseSensitive = (bool?) content.GetValueForProperty("FilterIsSubjectCaseSensitive",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).FilterIsSubjectCaseSensitive, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("FilterEnableAdvancedFilteringOnArray")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).FilterEnableAdvancedFilteringOnArray = (bool?) content.GetValueForProperty("FilterEnableAdvancedFilteringOnArray",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).FilterEnableAdvancedFilteringOnArray, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("FilterAdvancedFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).FilterAdvancedFilter = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[]) content.GetValueForProperty("FilterAdvancedFilter",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).FilterAdvancedFilter, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.AdvancedFilterTypeConverter.ConvertFrom)); + } + if (content.Contains("RetryPolicyMaxDeliveryAttempt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).RetryPolicyMaxDeliveryAttempt = (int?) content.GetValueForProperty("RetryPolicyMaxDeliveryAttempt",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).RetryPolicyMaxDeliveryAttempt, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("RetryPolicyEventTimeToLiveInMinute")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).RetryPolicyEventTimeToLiveInMinute = (int?) content.GetValueForProperty("RetryPolicyEventTimeToLiveInMinute",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).RetryPolicyEventTimeToLiveInMinute, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("DeadLetterEndPointTypeEndpointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).DeadLetterEndPointTypeEndpointType = (string) content.GetValueForProperty("DeadLetterEndPointTypeEndpointType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).DeadLetterEndPointTypeEndpointType, global::System.Convert.ToString); + } + if (content.Contains("DeadLetterWithResourceIdentityIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).DeadLetterWithResourceIdentityIdentity = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionIdentity) content.GetValueForProperty("DeadLetterWithResourceIdentityIdentity",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).DeadLetterWithResourceIdentityIdentity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionIdentityTypeConverter.ConvertFrom); + } + if (content.Contains("DeadLetterWithResourceIdentityDeadLetterDestination")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).DeadLetterWithResourceIdentityDeadLetterDestination = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterDestination) content.GetValueForProperty("DeadLetterWithResourceIdentityDeadLetterDestination",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).DeadLetterWithResourceIdentityDeadLetterDestination, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeadLetterDestinationTypeConverter.ConvertFrom); + } + if (content.Contains("DeliveryWithResourceIdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).DeliveryWithResourceIdentityType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType?) content.GetValueForProperty("DeliveryWithResourceIdentityType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).DeliveryWithResourceIdentityType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType.CreateFrom); + } + if (content.Contains("DeliveryWithResourceIdentityUserAssignedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).DeliveryWithResourceIdentityUserAssignedIdentity = (string) content.GetValueForProperty("DeliveryWithResourceIdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).DeliveryWithResourceIdentityUserAssignedIdentity, global::System.Convert.ToString); + } + if (content.Contains("DeadLetterWithResourceIdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).DeadLetterWithResourceIdentityType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType?) content.GetValueForProperty("DeadLetterWithResourceIdentityType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).DeadLetterWithResourceIdentityType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType.CreateFrom); + } + if (content.Contains("DeadLetterWithResourceIdentityUserAssignedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).DeadLetterWithResourceIdentityUserAssignedIdentity = (string) content.GetValueForProperty("DeadLetterWithResourceIdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).DeadLetterWithResourceIdentityUserAssignedIdentity, global::System.Convert.ToString); + } + if (content.Contains("DeadLetterWithResourceIdentityDeadLetterDestinationEndpointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).DeadLetterWithResourceIdentityDeadLetterDestinationEndpointType = (string) content.GetValueForProperty("DeadLetterWithResourceIdentityDeadLetterDestinationEndpointType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal)this).DeadLetterWithResourceIdentityDeadLetterDestinationEndpointType, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties of the Event Subscription. + [System.ComponentModel.TypeConverter(typeof(EventSubscriptionPropertiesTypeConverter))] + public partial interface IEventSubscriptionProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscriptionProperties.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscriptionProperties.TypeConverter.cs new file mode 100644 index 000000000000..ef2d2403d808 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscriptionProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class EventSubscriptionPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return EventSubscriptionProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return EventSubscriptionProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return EventSubscriptionProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscriptionProperties.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscriptionProperties.cs new file mode 100644 index 000000000000..56580da8998d --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscriptionProperties.cs @@ -0,0 +1,559 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Properties of the Event Subscription. + public partial class EventSubscriptionProperties : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionProperties, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterDestination _deadLetterDestination; + + /// + /// 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 Azure Event Grid's identity to acquire the authentication tokens being used during delivery / dead-lettering. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterDestination DeadLetterDestination { get => (this._deadLetterDestination = this._deadLetterDestination ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeadLetterDestination()); set => this._deadLetterDestination = value; } + + /// Type of the endpoint for the dead letter destination + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string DeadLetterEndPointTypeEndpointType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterDestinationInternal)DeadLetterDestination).EndpointType; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterWithResourceIdentity _deadLetterWithResourceIdentity; + + /// + /// 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 or domain) to acquire the authentication tokens + /// being used during delivery / dead-lettering. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterWithResourceIdentity DeadLetterWithResourceIdentity { get => (this._deadLetterWithResourceIdentity = this._deadLetterWithResourceIdentity ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeadLetterWithResourceIdentity()); set => this._deadLetterWithResourceIdentity = value; } + + /// Type of the endpoint for the dead letter destination + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string DeadLetterWithResourceIdentityDeadLetterDestinationEndpointType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterWithResourceIdentityInternal)DeadLetterWithResourceIdentity).DeadLetterDestinationEndpointType; } + + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType? DeadLetterWithResourceIdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterWithResourceIdentityInternal)DeadLetterWithResourceIdentity).IdentityType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterWithResourceIdentityInternal)DeadLetterWithResourceIdentity).IdentityType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType)""); } + + /// The user identity associated with the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string DeadLetterWithResourceIdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterWithResourceIdentityInternal)DeadLetterWithResourceIdentity).IdentityUserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterWithResourceIdentityInternal)DeadLetterWithResourceIdentity).IdentityUserAssignedIdentity = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryWithResourceIdentity _deliveryWithResourceIdentity; + + /// + /// Information about the destination where events have to be delivered for the event subscription. + /// Uses the managed identity setup on the parent resource (namely, topic or domain) to acquire the authentication tokens + /// being used during delivery / dead-lettering. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryWithResourceIdentity DeliveryWithResourceIdentity { get => (this._deliveryWithResourceIdentity = this._deliveryWithResourceIdentity ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeliveryWithResourceIdentity()); set => this._deliveryWithResourceIdentity = value; } + + /// Type of the endpoint for the event subscription destination. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType? DeliveryWithResourceIdentityDestinationEndpointType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryWithResourceIdentityInternal)DeliveryWithResourceIdentity).DestinationEndpointType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryWithResourceIdentityInternal)DeliveryWithResourceIdentity).DestinationEndpointType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType)""); } + + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType? DeliveryWithResourceIdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryWithResourceIdentityInternal)DeliveryWithResourceIdentity).IdentityType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryWithResourceIdentityInternal)DeliveryWithResourceIdentity).IdentityType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType)""); } + + /// The user identity associated with the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string DeliveryWithResourceIdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryWithResourceIdentityInternal)DeliveryWithResourceIdentity).IdentityUserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryWithResourceIdentityInternal)DeliveryWithResourceIdentity).IdentityUserAssignedIdentity = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestination _destination; + + /// + /// Information about the destination where events have to be delivered for the event subscription. + /// Uses Azure Event Grid's identity to acquire the authentication tokens being used during delivery / dead-lettering. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestination Destination { get => (this._destination = this._destination ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionDestination()); set => this._destination = value; } + + /// Type of the endpoint for the event subscription destination. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType? EndpointType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestinationInternal)Destination).EndpointType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestinationInternal)Destination).EndpointType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType)""); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema? _eventDeliverySchema; + + /// The event delivery schema for the event subscription. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema? EventDeliverySchema { get => this._eventDeliverySchema; set => this._eventDeliverySchema = value; } + + /// Backing field for property. + private global::System.DateTime? _expirationTimeUtc; + + /// Expiration time of the event subscription. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public global::System.DateTime? ExpirationTimeUtc { get => this._expirationTimeUtc; set => this._expirationTimeUtc = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFilter _filter; + + /// Information about the filter for the event subscription. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFilter Filter { get => (this._filter = this._filter ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionFilter()); set => this._filter = value; } + + /// An array of advanced filters that are used for filtering event subscriptions. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[] FilterAdvancedFilter { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFilterInternal)Filter).AdvancedFilter; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFilterInternal)Filter).AdvancedFilter = value ?? null /* arrayOf */; } + + /// + /// Allows advanced filters to be evaluated against an array of values instead of expecting a singular value. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public bool? FilterEnableAdvancedFilteringOnArray { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFilterInternal)Filter).EnableAdvancedFilteringOnArray; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFilterInternal)Filter).EnableAdvancedFilteringOnArray = value ?? default(bool); } + + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string[] FilterIncludedEventType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFilterInternal)Filter).IncludedEventType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFilterInternal)Filter).IncludedEventType = value ?? null /* arrayOf */; } + + /// + /// Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filter + /// should be compared in a case sensitive manner. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public bool? FilterIsSubjectCaseSensitive { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFilterInternal)Filter).IsSubjectCaseSensitive; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFilterInternal)Filter).IsSubjectCaseSensitive = value ?? default(bool); } + + /// + /// An optional string to filter events for an event subscription based on a resource path prefix. + /// The format of this depends on the publisher of the events. + /// Wildcard characters are not supported in this path. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string FilterSubjectBeginsWith { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFilterInternal)Filter).SubjectBeginsWith; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFilterInternal)Filter).SubjectBeginsWith = value ?? null; } + + /// + /// An optional string to filter events for an event subscription based on a resource path suffix. + /// Wildcard characters are not supported in this path. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string FilterSubjectEndsWith { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFilterInternal)Filter).SubjectEndsWith; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFilterInternal)Filter).SubjectEndsWith = value ?? null; } + + /// Backing field for property. + private string[] _label; + + /// List of user defined labels. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string[] Label { get => this._label; set => this._label = value; } + + /// Internal Acessors for DeadLetterDestination + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterDestination Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal.DeadLetterDestination { get => (this._deadLetterDestination = this._deadLetterDestination ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeadLetterDestination()); set { {_deadLetterDestination = value;} } } + + /// Internal Acessors for DeadLetterEndPointTypeEndpointType + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal.DeadLetterEndPointTypeEndpointType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterDestinationInternal)DeadLetterDestination).EndpointType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterDestinationInternal)DeadLetterDestination).EndpointType = value; } + + /// Internal Acessors for DeadLetterWithResourceIdentity + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterWithResourceIdentity Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal.DeadLetterWithResourceIdentity { get => (this._deadLetterWithResourceIdentity = this._deadLetterWithResourceIdentity ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeadLetterWithResourceIdentity()); set { {_deadLetterWithResourceIdentity = value;} } } + + /// Internal Acessors for DeadLetterWithResourceIdentityDeadLetterDestination + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterDestination Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal.DeadLetterWithResourceIdentityDeadLetterDestination { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterWithResourceIdentityInternal)DeadLetterWithResourceIdentity).DeadLetterDestination; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterWithResourceIdentityInternal)DeadLetterWithResourceIdentity).DeadLetterDestination = value; } + + /// + /// Internal Acessors for DeadLetterWithResourceIdentityDeadLetterDestinationEndpointType + /// + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal.DeadLetterWithResourceIdentityDeadLetterDestinationEndpointType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterWithResourceIdentityInternal)DeadLetterWithResourceIdentity).DeadLetterDestinationEndpointType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterWithResourceIdentityInternal)DeadLetterWithResourceIdentity).DeadLetterDestinationEndpointType = value; } + + /// Internal Acessors for DeadLetterWithResourceIdentityIdentity + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionIdentity Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal.DeadLetterWithResourceIdentityIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterWithResourceIdentityInternal)DeadLetterWithResourceIdentity).Identity; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterWithResourceIdentityInternal)DeadLetterWithResourceIdentity).Identity = value; } + + /// Internal Acessors for DeliveryWithResourceIdentity + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryWithResourceIdentity Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal.DeliveryWithResourceIdentity { get => (this._deliveryWithResourceIdentity = this._deliveryWithResourceIdentity ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeliveryWithResourceIdentity()); set { {_deliveryWithResourceIdentity = value;} } } + + /// Internal Acessors for DeliveryWithResourceIdentityDestination + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestination Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal.DeliveryWithResourceIdentityDestination { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryWithResourceIdentityInternal)DeliveryWithResourceIdentity).Destination; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryWithResourceIdentityInternal)DeliveryWithResourceIdentity).Destination = value; } + + /// Internal Acessors for DeliveryWithResourceIdentityIdentity + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionIdentity Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal.DeliveryWithResourceIdentityIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryWithResourceIdentityInternal)DeliveryWithResourceIdentity).Identity; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryWithResourceIdentityInternal)DeliveryWithResourceIdentity).Identity = value; } + + /// Internal Acessors for Destination + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestination Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal.Destination { get => (this._destination = this._destination ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionDestination()); set { {_destination = value;} } } + + /// Internal Acessors for Filter + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFilter Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal.Filter { get => (this._filter = this._filter ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionFilter()); set { {_filter = value;} } } + + /// Internal Acessors for ProvisioningState + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + + /// Internal Acessors for RetryPolicy + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IRetryPolicy Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal.RetryPolicy { get => (this._retryPolicy = this._retryPolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.RetryPolicy()); set { {_retryPolicy = value;} } } + + /// Internal Acessors for Topic + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionPropertiesInternal.Topic { get => this._topic; set { {_topic = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionProvisioningState? _provisioningState; + + /// Provisioning state of the event subscription. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionProvisioningState? ProvisioningState { get => this._provisioningState; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IRetryPolicy _retryPolicy; + + /// + /// The retry policy for events. This can be used to configure maximum number of delivery attempts and time to live for events. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IRetryPolicy RetryPolicy { get => (this._retryPolicy = this._retryPolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.RetryPolicy()); set => this._retryPolicy = value; } + + /// Time To Live (in minutes) for events. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public int? RetryPolicyEventTimeToLiveInMinute { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IRetryPolicyInternal)RetryPolicy).EventTimeToLiveInMinute; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IRetryPolicyInternal)RetryPolicy).EventTimeToLiveInMinute = value ?? default(int); } + + /// Maximum number of delivery retry attempts for events. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public int? RetryPolicyMaxDeliveryAttempt { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IRetryPolicyInternal)RetryPolicy).MaxDeliveryAttempt; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IRetryPolicyInternal)RetryPolicy).MaxDeliveryAttempt = value ?? default(int); } + + /// Backing field for property. + private string _topic; + + /// Name of the topic of the event subscription. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string Topic { get => this._topic; } + + /// Creates an new instance. + public EventSubscriptionProperties() + { + + } + } + /// Properties of the Event Subscription. + public partial interface IEventSubscriptionProperties : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// Type of the endpoint for the dead letter destination + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Type of the endpoint for the dead letter destination", + SerializedName = @"endpointType", + PossibleTypes = new [] { typeof(string) })] + string DeadLetterEndPointTypeEndpointType { get; } + /// Type of the endpoint for the dead letter destination + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Type of the endpoint for the dead letter destination", + SerializedName = @"endpointType", + PossibleTypes = new [] { typeof(string) })] + string DeadLetterWithResourceIdentityDeadLetterDestinationEndpointType { get; } + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType? DeadLetterWithResourceIdentityType { get; set; } + /// The user identity associated with the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The user identity associated with the resource.", + SerializedName = @"userAssignedIdentity", + PossibleTypes = new [] { typeof(string) })] + string DeadLetterWithResourceIdentityUserAssignedIdentity { get; set; } + /// Type of the endpoint for the event subscription destination. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of the endpoint for the event subscription destination.", + SerializedName = @"endpointType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType? DeliveryWithResourceIdentityDestinationEndpointType { get; set; } + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType? DeliveryWithResourceIdentityType { get; set; } + /// The user identity associated with the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The user identity associated with the resource.", + SerializedName = @"userAssignedIdentity", + PossibleTypes = new [] { typeof(string) })] + string DeliveryWithResourceIdentityUserAssignedIdentity { get; set; } + /// Type of the endpoint for the event subscription destination. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of the endpoint for the event subscription destination.", + SerializedName = @"endpointType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType? EndpointType { get; set; } + /// The event delivery schema for the event subscription. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The event delivery schema for the event subscription.", + SerializedName = @"eventDeliverySchema", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema? EventDeliverySchema { get; set; } + /// Expiration time of the event subscription. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Expiration time of the event subscription.", + SerializedName = @"expirationTimeUtc", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ExpirationTimeUtc { get; set; } + /// An array of advanced filters that are used for filtering event subscriptions. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An array of advanced filters that are used for filtering event subscriptions.", + SerializedName = @"advancedFilters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[] FilterAdvancedFilter { get; set; } + /// + /// Allows advanced filters to be evaluated against an array of values instead of expecting a singular value. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allows advanced filters to be evaluated against an array of values instead of expecting a singular value.", + SerializedName = @"enableAdvancedFilteringOnArrays", + PossibleTypes = new [] { typeof(bool) })] + bool? FilterEnableAdvancedFilteringOnArray { get; set; } + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"includedEventTypes", + PossibleTypes = new [] { typeof(string) })] + string[] FilterIncludedEventType { get; set; } + /// + /// Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filter + /// should be compared in a case sensitive manner. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filter + should be compared in a case sensitive manner.", + SerializedName = @"isSubjectCaseSensitive", + PossibleTypes = new [] { typeof(bool) })] + bool? FilterIsSubjectCaseSensitive { get; set; } + /// + /// An optional string to filter events for an event subscription based on a resource path prefix. + /// The format of this depends on the publisher of the events. + /// Wildcard characters are not supported in this path. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An optional string to filter events for an event subscription based on a resource path prefix. + The format of this depends on the publisher of the events. + Wildcard characters are not supported in this path.", + SerializedName = @"subjectBeginsWith", + PossibleTypes = new [] { typeof(string) })] + string FilterSubjectBeginsWith { get; set; } + /// + /// An optional string to filter events for an event subscription based on a resource path suffix. + /// Wildcard characters are not supported in this path. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An optional string to filter events for an event subscription based on a resource path suffix. + Wildcard characters are not supported in this path.", + SerializedName = @"subjectEndsWith", + PossibleTypes = new [] { typeof(string) })] + string FilterSubjectEndsWith { get; set; } + /// List of user defined labels. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of user defined labels.", + SerializedName = @"labels", + PossibleTypes = new [] { typeof(string) })] + string[] Label { get; set; } + /// Provisioning state of the event subscription. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Provisioning state of the event subscription.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionProvisioningState) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionProvisioningState? ProvisioningState { get; } + /// Time To Live (in minutes) for events. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Time To Live (in minutes) for events.", + SerializedName = @"eventTimeToLiveInMinutes", + PossibleTypes = new [] { typeof(int) })] + int? RetryPolicyEventTimeToLiveInMinute { get; set; } + /// Maximum number of delivery retry attempts for events. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Maximum number of delivery retry attempts for events.", + SerializedName = @"maxDeliveryAttempts", + PossibleTypes = new [] { typeof(int) })] + int? RetryPolicyMaxDeliveryAttempt { get; set; } + /// Name of the topic of the event subscription. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Name of the topic of the event subscription.", + SerializedName = @"topic", + PossibleTypes = new [] { typeof(string) })] + string Topic { get; } + + } + /// Properties of the Event Subscription. + internal partial interface IEventSubscriptionPropertiesInternal + + { + /// + /// 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 Azure Event Grid's identity to acquire the authentication tokens being used during delivery / dead-lettering. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterDestination DeadLetterDestination { get; set; } + /// Type of the endpoint for the dead letter destination + string DeadLetterEndPointTypeEndpointType { get; set; } + /// + /// 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 or domain) to acquire the authentication tokens + /// being used during delivery / dead-lettering. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterWithResourceIdentity DeadLetterWithResourceIdentity { get; set; } + /// + /// Information about the destination where events have to be delivered for the event subscription. + /// Uses the managed identity setup on the parent resource (namely, topic or domain) to acquire the authentication tokens + /// being used during delivery / dead-lettering. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterDestination DeadLetterWithResourceIdentityDeadLetterDestination { get; set; } + /// Type of the endpoint for the dead letter destination + string DeadLetterWithResourceIdentityDeadLetterDestinationEndpointType { get; set; } + /// The identity to use when dead-lettering events. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionIdentity DeadLetterWithResourceIdentityIdentity { get; set; } + /// + /// 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. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType? DeadLetterWithResourceIdentityType { get; set; } + /// The user identity associated with the resource. + string DeadLetterWithResourceIdentityUserAssignedIdentity { get; set; } + /// + /// Information about the destination where events have to be delivered for the event subscription. + /// Uses the managed identity setup on the parent resource (namely, topic or domain) to acquire the authentication tokens + /// being used during delivery / dead-lettering. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryWithResourceIdentity DeliveryWithResourceIdentity { get; set; } + /// + /// Information about the destination where events have to be delivered for the event subscription. + /// Uses Azure Event Grid's identity to acquire the authentication tokens being used during delivery / dead-lettering. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestination DeliveryWithResourceIdentityDestination { get; set; } + /// Type of the endpoint for the event subscription destination. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType? DeliveryWithResourceIdentityDestinationEndpointType { get; set; } + /// The identity to use when delivering events. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionIdentity DeliveryWithResourceIdentityIdentity { get; set; } + /// + /// 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. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType? DeliveryWithResourceIdentityType { get; set; } + /// The user identity associated with the resource. + string DeliveryWithResourceIdentityUserAssignedIdentity { get; set; } + /// + /// Information about the destination where events have to be delivered for the event subscription. + /// Uses Azure Event Grid's identity to acquire the authentication tokens being used during delivery / dead-lettering. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestination Destination { get; set; } + /// Type of the endpoint for the event subscription destination. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType? EndpointType { get; set; } + /// The event delivery schema for the event subscription. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema? EventDeliverySchema { get; set; } + /// Expiration time of the event subscription. + global::System.DateTime? ExpirationTimeUtc { get; set; } + /// Information about the filter for the event subscription. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFilter Filter { get; set; } + /// An array of advanced filters that are used for filtering event subscriptions. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[] FilterAdvancedFilter { get; set; } + /// + /// Allows advanced filters to be evaluated against an array of values instead of expecting a singular value. + /// + bool? FilterEnableAdvancedFilteringOnArray { get; set; } + /// + /// 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. + /// + string[] FilterIncludedEventType { get; set; } + /// + /// Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filter + /// should be compared in a case sensitive manner. + /// + bool? FilterIsSubjectCaseSensitive { get; set; } + /// + /// An optional string to filter events for an event subscription based on a resource path prefix. + /// The format of this depends on the publisher of the events. + /// Wildcard characters are not supported in this path. + /// + string FilterSubjectBeginsWith { get; set; } + /// + /// An optional string to filter events for an event subscription based on a resource path suffix. + /// Wildcard characters are not supported in this path. + /// + string FilterSubjectEndsWith { get; set; } + /// List of user defined labels. + string[] Label { get; set; } + /// Provisioning state of the event subscription. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionProvisioningState? ProvisioningState { get; set; } + /// + /// The retry policy for events. This can be used to configure maximum number of delivery attempts and time to live for events. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IRetryPolicy RetryPolicy { get; set; } + /// Time To Live (in minutes) for events. + int? RetryPolicyEventTimeToLiveInMinute { get; set; } + /// Maximum number of delivery retry attempts for events. + int? RetryPolicyMaxDeliveryAttempt { get; set; } + /// Name of the topic of the event subscription. + string Topic { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscriptionProperties.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscriptionProperties.json.cs new file mode 100644 index 000000000000..e4e6a245f53b --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscriptionProperties.json.cs @@ -0,0 +1,140 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Properties of the Event Subscription. + public partial class EventSubscriptionProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal EventSubscriptionProperties(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_destination = If( json?.PropertyT("destination"), out var __jsonDestination) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionDestination.FromJson(__jsonDestination) : Destination;} + {_deliveryWithResourceIdentity = If( json?.PropertyT("deliveryWithResourceIdentity"), out var __jsonDeliveryWithResourceIdentity) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeliveryWithResourceIdentity.FromJson(__jsonDeliveryWithResourceIdentity) : DeliveryWithResourceIdentity;} + {_filter = If( json?.PropertyT("filter"), out var __jsonFilter) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionFilter.FromJson(__jsonFilter) : Filter;} + {_retryPolicy = If( json?.PropertyT("retryPolicy"), out var __jsonRetryPolicy) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.RetryPolicy.FromJson(__jsonRetryPolicy) : RetryPolicy;} + {_deadLetterDestination = If( json?.PropertyT("deadLetterDestination"), out var __jsonDeadLetterDestination) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeadLetterDestination.FromJson(__jsonDeadLetterDestination) : DeadLetterDestination;} + {_deadLetterWithResourceIdentity = If( json?.PropertyT("deadLetterWithResourceIdentity"), out var __jsonDeadLetterWithResourceIdentity) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeadLetterWithResourceIdentity.FromJson(__jsonDeadLetterWithResourceIdentity) : DeadLetterWithResourceIdentity;} + {_topic = If( json?.PropertyT("topic"), out var __jsonTopic) ? (string)__jsonTopic : (string)Topic;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} + {_label = If( json?.PropertyT("labels"), out var __jsonLabels) ? If( __jsonLabels as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Label;} + {_expirationTimeUtc = If( json?.PropertyT("expirationTimeUtc"), out var __jsonExpirationTimeUtc) ? global::System.DateTime.TryParse((string)__jsonExpirationTimeUtc, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonExpirationTimeUtcValue) ? __jsonExpirationTimeUtcValue : ExpirationTimeUtc : ExpirationTimeUtc;} + {_eventDeliverySchema = If( json?.PropertyT("eventDeliverySchema"), out var __jsonEventDeliverySchema) ? (string)__jsonEventDeliverySchema : (string)EventDeliverySchema;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new EventSubscriptionProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._destination ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._destination.ToJson(null,serializationMode) : null, "destination" ,container.Add ); + AddIf( null != this._deliveryWithResourceIdentity ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._deliveryWithResourceIdentity.ToJson(null,serializationMode) : null, "deliveryWithResourceIdentity" ,container.Add ); + AddIf( null != this._filter ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._filter.ToJson(null,serializationMode) : null, "filter" ,container.Add ); + AddIf( null != this._retryPolicy ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._retryPolicy.ToJson(null,serializationMode) : null, "retryPolicy" ,container.Add ); + AddIf( null != this._deadLetterDestination ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._deadLetterDestination.ToJson(null,serializationMode) : null, "deadLetterDestination" ,container.Add ); + AddIf( null != this._deadLetterWithResourceIdentity ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._deadLetterWithResourceIdentity.ToJson(null,serializationMode) : null, "deadLetterWithResourceIdentity" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._topic)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._topic.ToString()) : null, "topic" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); + } + if (null != this._label) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.XNodeArray(); + foreach( var __x in this._label ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("labels",__w); + } + AddIf( null != this._expirationTimeUtc ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._expirationTimeUtc?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "expirationTimeUtc" ,container.Add ); + AddIf( null != (((object)this._eventDeliverySchema)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._eventDeliverySchema.ToString()) : null, "eventDeliverySchema" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscriptionUpdateParameters.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscriptionUpdateParameters.PowerShell.cs new file mode 100644 index 000000000000..e11213a9741c --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscriptionUpdateParameters.PowerShell.cs @@ -0,0 +1,368 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Properties of the Event Subscription update. + [System.ComponentModel.TypeConverter(typeof(EventSubscriptionUpdateParametersTypeConverter))] + public partial class EventSubscriptionUpdateParameters + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new EventSubscriptionUpdateParameters(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new EventSubscriptionUpdateParameters(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal EventSubscriptionUpdateParameters(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Destination")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).Destination = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestination) content.GetValueForProperty("Destination",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).Destination, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionDestinationTypeConverter.ConvertFrom); + } + if (content.Contains("DeliveryWithResourceIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).DeliveryWithResourceIdentity = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryWithResourceIdentity) content.GetValueForProperty("DeliveryWithResourceIdentity",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).DeliveryWithResourceIdentity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeliveryWithResourceIdentityTypeConverter.ConvertFrom); + } + if (content.Contains("Filter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).Filter = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFilter) content.GetValueForProperty("Filter",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).Filter, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionFilterTypeConverter.ConvertFrom); + } + if (content.Contains("RetryPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).RetryPolicy = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IRetryPolicy) content.GetValueForProperty("RetryPolicy",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).RetryPolicy, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.RetryPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("DeadLetterDestination")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).DeadLetterDestination = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterDestination) content.GetValueForProperty("DeadLetterDestination",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).DeadLetterDestination, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeadLetterDestinationTypeConverter.ConvertFrom); + } + if (content.Contains("DeadLetterWithResourceIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).DeadLetterWithResourceIdentity = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterWithResourceIdentity) content.GetValueForProperty("DeadLetterWithResourceIdentity",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).DeadLetterWithResourceIdentity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeadLetterWithResourceIdentityTypeConverter.ConvertFrom); + } + if (content.Contains("Label")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).Label = (string[]) content.GetValueForProperty("Label",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).Label, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ExpirationTimeUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).ExpirationTimeUtc = (global::System.DateTime?) content.GetValueForProperty("ExpirationTimeUtc",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).ExpirationTimeUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EventDeliverySchema")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).EventDeliverySchema = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema?) content.GetValueForProperty("EventDeliverySchema",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).EventDeliverySchema, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema.CreateFrom); + } + if (content.Contains("EndpointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).EndpointType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType) content.GetValueForProperty("EndpointType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).EndpointType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType.CreateFrom); + } + if (content.Contains("DeliveryWithResourceIdentityIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).DeliveryWithResourceIdentityIdentity = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionIdentity) content.GetValueForProperty("DeliveryWithResourceIdentityIdentity",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).DeliveryWithResourceIdentityIdentity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionIdentityTypeConverter.ConvertFrom); + } + if (content.Contains("DeliveryWithResourceIdentityDestination")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).DeliveryWithResourceIdentityDestination = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestination) content.GetValueForProperty("DeliveryWithResourceIdentityDestination",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).DeliveryWithResourceIdentityDestination, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionDestinationTypeConverter.ConvertFrom); + } + if (content.Contains("DeliveryWithResourceIdentityDestinationEndpointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).DeliveryWithResourceIdentityDestinationEndpointType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType) content.GetValueForProperty("DeliveryWithResourceIdentityDestinationEndpointType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).DeliveryWithResourceIdentityDestinationEndpointType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType.CreateFrom); + } + if (content.Contains("FilterSubjectBeginsWith")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).FilterSubjectBeginsWith = (string) content.GetValueForProperty("FilterSubjectBeginsWith",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).FilterSubjectBeginsWith, global::System.Convert.ToString); + } + if (content.Contains("FilterSubjectEndsWith")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).FilterSubjectEndsWith = (string) content.GetValueForProperty("FilterSubjectEndsWith",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).FilterSubjectEndsWith, global::System.Convert.ToString); + } + if (content.Contains("FilterIncludedEventType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).FilterIncludedEventType = (string[]) content.GetValueForProperty("FilterIncludedEventType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).FilterIncludedEventType, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("FilterIsSubjectCaseSensitive")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).FilterIsSubjectCaseSensitive = (bool?) content.GetValueForProperty("FilterIsSubjectCaseSensitive",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).FilterIsSubjectCaseSensitive, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("FilterEnableAdvancedFilteringOnArray")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).FilterEnableAdvancedFilteringOnArray = (bool?) content.GetValueForProperty("FilterEnableAdvancedFilteringOnArray",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).FilterEnableAdvancedFilteringOnArray, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("FilterAdvancedFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).FilterAdvancedFilter = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[]) content.GetValueForProperty("FilterAdvancedFilter",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).FilterAdvancedFilter, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.AdvancedFilterTypeConverter.ConvertFrom)); + } + if (content.Contains("RetryPolicyMaxDeliveryAttempt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).RetryPolicyMaxDeliveryAttempt = (int?) content.GetValueForProperty("RetryPolicyMaxDeliveryAttempt",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).RetryPolicyMaxDeliveryAttempt, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("RetryPolicyEventTimeToLiveInMinute")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).RetryPolicyEventTimeToLiveInMinute = (int?) content.GetValueForProperty("RetryPolicyEventTimeToLiveInMinute",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).RetryPolicyEventTimeToLiveInMinute, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("DeadLetterEndPointTypeEndpointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).DeadLetterEndPointTypeEndpointType = (string) content.GetValueForProperty("DeadLetterEndPointTypeEndpointType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).DeadLetterEndPointTypeEndpointType, global::System.Convert.ToString); + } + if (content.Contains("DeadLetterWithResourceIdentityIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).DeadLetterWithResourceIdentityIdentity = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionIdentity) content.GetValueForProperty("DeadLetterWithResourceIdentityIdentity",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).DeadLetterWithResourceIdentityIdentity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionIdentityTypeConverter.ConvertFrom); + } + if (content.Contains("DeadLetterWithResourceIdentityDeadLetterDestination")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).DeadLetterWithResourceIdentityDeadLetterDestination = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterDestination) content.GetValueForProperty("DeadLetterWithResourceIdentityDeadLetterDestination",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).DeadLetterWithResourceIdentityDeadLetterDestination, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeadLetterDestinationTypeConverter.ConvertFrom); + } + if (content.Contains("DeliveryWithResourceIdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).DeliveryWithResourceIdentityType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType?) content.GetValueForProperty("DeliveryWithResourceIdentityType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).DeliveryWithResourceIdentityType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType.CreateFrom); + } + if (content.Contains("DeliveryWithResourceIdentityUserAssignedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).DeliveryWithResourceIdentityUserAssignedIdentity = (string) content.GetValueForProperty("DeliveryWithResourceIdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).DeliveryWithResourceIdentityUserAssignedIdentity, global::System.Convert.ToString); + } + if (content.Contains("DeadLetterWithResourceIdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).DeadLetterWithResourceIdentityType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType?) content.GetValueForProperty("DeadLetterWithResourceIdentityType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).DeadLetterWithResourceIdentityType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType.CreateFrom); + } + if (content.Contains("DeadLetterWithResourceIdentityUserAssignedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).DeadLetterWithResourceIdentityUserAssignedIdentity = (string) content.GetValueForProperty("DeadLetterWithResourceIdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).DeadLetterWithResourceIdentityUserAssignedIdentity, global::System.Convert.ToString); + } + if (content.Contains("DeadLetterWithResourceIdentityDeadLetterDestinationEndpointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).DeadLetterWithResourceIdentityDeadLetterDestinationEndpointType = (string) content.GetValueForProperty("DeadLetterWithResourceIdentityDeadLetterDestinationEndpointType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).DeadLetterWithResourceIdentityDeadLetterDestinationEndpointType, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal EventSubscriptionUpdateParameters(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Destination")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).Destination = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestination) content.GetValueForProperty("Destination",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).Destination, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionDestinationTypeConverter.ConvertFrom); + } + if (content.Contains("DeliveryWithResourceIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).DeliveryWithResourceIdentity = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryWithResourceIdentity) content.GetValueForProperty("DeliveryWithResourceIdentity",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).DeliveryWithResourceIdentity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeliveryWithResourceIdentityTypeConverter.ConvertFrom); + } + if (content.Contains("Filter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).Filter = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFilter) content.GetValueForProperty("Filter",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).Filter, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionFilterTypeConverter.ConvertFrom); + } + if (content.Contains("RetryPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).RetryPolicy = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IRetryPolicy) content.GetValueForProperty("RetryPolicy",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).RetryPolicy, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.RetryPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("DeadLetterDestination")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).DeadLetterDestination = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterDestination) content.GetValueForProperty("DeadLetterDestination",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).DeadLetterDestination, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeadLetterDestinationTypeConverter.ConvertFrom); + } + if (content.Contains("DeadLetterWithResourceIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).DeadLetterWithResourceIdentity = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterWithResourceIdentity) content.GetValueForProperty("DeadLetterWithResourceIdentity",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).DeadLetterWithResourceIdentity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeadLetterWithResourceIdentityTypeConverter.ConvertFrom); + } + if (content.Contains("Label")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).Label = (string[]) content.GetValueForProperty("Label",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).Label, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ExpirationTimeUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).ExpirationTimeUtc = (global::System.DateTime?) content.GetValueForProperty("ExpirationTimeUtc",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).ExpirationTimeUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EventDeliverySchema")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).EventDeliverySchema = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema?) content.GetValueForProperty("EventDeliverySchema",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).EventDeliverySchema, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema.CreateFrom); + } + if (content.Contains("EndpointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).EndpointType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType) content.GetValueForProperty("EndpointType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).EndpointType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType.CreateFrom); + } + if (content.Contains("DeliveryWithResourceIdentityIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).DeliveryWithResourceIdentityIdentity = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionIdentity) content.GetValueForProperty("DeliveryWithResourceIdentityIdentity",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).DeliveryWithResourceIdentityIdentity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionIdentityTypeConverter.ConvertFrom); + } + if (content.Contains("DeliveryWithResourceIdentityDestination")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).DeliveryWithResourceIdentityDestination = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestination) content.GetValueForProperty("DeliveryWithResourceIdentityDestination",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).DeliveryWithResourceIdentityDestination, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionDestinationTypeConverter.ConvertFrom); + } + if (content.Contains("DeliveryWithResourceIdentityDestinationEndpointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).DeliveryWithResourceIdentityDestinationEndpointType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType) content.GetValueForProperty("DeliveryWithResourceIdentityDestinationEndpointType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).DeliveryWithResourceIdentityDestinationEndpointType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType.CreateFrom); + } + if (content.Contains("FilterSubjectBeginsWith")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).FilterSubjectBeginsWith = (string) content.GetValueForProperty("FilterSubjectBeginsWith",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).FilterSubjectBeginsWith, global::System.Convert.ToString); + } + if (content.Contains("FilterSubjectEndsWith")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).FilterSubjectEndsWith = (string) content.GetValueForProperty("FilterSubjectEndsWith",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).FilterSubjectEndsWith, global::System.Convert.ToString); + } + if (content.Contains("FilterIncludedEventType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).FilterIncludedEventType = (string[]) content.GetValueForProperty("FilterIncludedEventType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).FilterIncludedEventType, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("FilterIsSubjectCaseSensitive")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).FilterIsSubjectCaseSensitive = (bool?) content.GetValueForProperty("FilterIsSubjectCaseSensitive",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).FilterIsSubjectCaseSensitive, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("FilterEnableAdvancedFilteringOnArray")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).FilterEnableAdvancedFilteringOnArray = (bool?) content.GetValueForProperty("FilterEnableAdvancedFilteringOnArray",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).FilterEnableAdvancedFilteringOnArray, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("FilterAdvancedFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).FilterAdvancedFilter = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[]) content.GetValueForProperty("FilterAdvancedFilter",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).FilterAdvancedFilter, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.AdvancedFilterTypeConverter.ConvertFrom)); + } + if (content.Contains("RetryPolicyMaxDeliveryAttempt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).RetryPolicyMaxDeliveryAttempt = (int?) content.GetValueForProperty("RetryPolicyMaxDeliveryAttempt",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).RetryPolicyMaxDeliveryAttempt, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("RetryPolicyEventTimeToLiveInMinute")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).RetryPolicyEventTimeToLiveInMinute = (int?) content.GetValueForProperty("RetryPolicyEventTimeToLiveInMinute",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).RetryPolicyEventTimeToLiveInMinute, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("DeadLetterEndPointTypeEndpointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).DeadLetterEndPointTypeEndpointType = (string) content.GetValueForProperty("DeadLetterEndPointTypeEndpointType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).DeadLetterEndPointTypeEndpointType, global::System.Convert.ToString); + } + if (content.Contains("DeadLetterWithResourceIdentityIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).DeadLetterWithResourceIdentityIdentity = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionIdentity) content.GetValueForProperty("DeadLetterWithResourceIdentityIdentity",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).DeadLetterWithResourceIdentityIdentity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionIdentityTypeConverter.ConvertFrom); + } + if (content.Contains("DeadLetterWithResourceIdentityDeadLetterDestination")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).DeadLetterWithResourceIdentityDeadLetterDestination = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterDestination) content.GetValueForProperty("DeadLetterWithResourceIdentityDeadLetterDestination",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).DeadLetterWithResourceIdentityDeadLetterDestination, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeadLetterDestinationTypeConverter.ConvertFrom); + } + if (content.Contains("DeliveryWithResourceIdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).DeliveryWithResourceIdentityType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType?) content.GetValueForProperty("DeliveryWithResourceIdentityType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).DeliveryWithResourceIdentityType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType.CreateFrom); + } + if (content.Contains("DeliveryWithResourceIdentityUserAssignedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).DeliveryWithResourceIdentityUserAssignedIdentity = (string) content.GetValueForProperty("DeliveryWithResourceIdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).DeliveryWithResourceIdentityUserAssignedIdentity, global::System.Convert.ToString); + } + if (content.Contains("DeadLetterWithResourceIdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).DeadLetterWithResourceIdentityType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType?) content.GetValueForProperty("DeadLetterWithResourceIdentityType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).DeadLetterWithResourceIdentityType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType.CreateFrom); + } + if (content.Contains("DeadLetterWithResourceIdentityUserAssignedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).DeadLetterWithResourceIdentityUserAssignedIdentity = (string) content.GetValueForProperty("DeadLetterWithResourceIdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).DeadLetterWithResourceIdentityUserAssignedIdentity, global::System.Convert.ToString); + } + if (content.Contains("DeadLetterWithResourceIdentityDeadLetterDestinationEndpointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).DeadLetterWithResourceIdentityDeadLetterDestinationEndpointType = (string) content.GetValueForProperty("DeadLetterWithResourceIdentityDeadLetterDestinationEndpointType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal)this).DeadLetterWithResourceIdentityDeadLetterDestinationEndpointType, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties of the Event Subscription update. + [System.ComponentModel.TypeConverter(typeof(EventSubscriptionUpdateParametersTypeConverter))] + public partial interface IEventSubscriptionUpdateParameters + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscriptionUpdateParameters.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscriptionUpdateParameters.TypeConverter.cs new file mode 100644 index 000000000000..438b8d220aae --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscriptionUpdateParameters.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class EventSubscriptionUpdateParametersTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParameters ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParameters).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return EventSubscriptionUpdateParameters.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return EventSubscriptionUpdateParameters.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return EventSubscriptionUpdateParameters.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscriptionUpdateParameters.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscriptionUpdateParameters.cs new file mode 100644 index 000000000000..4ebfc92cbbc6 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscriptionUpdateParameters.cs @@ -0,0 +1,519 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Properties of the Event Subscription update. + public partial class EventSubscriptionUpdateParameters : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParameters, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterDestination _deadLetterDestination; + + /// + /// 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 Azure Event Grid's identity to acquire the authentication tokens being used during delivery / dead-lettering. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterDestination DeadLetterDestination { get => (this._deadLetterDestination = this._deadLetterDestination ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeadLetterDestination()); set => this._deadLetterDestination = value; } + + /// Type of the endpoint for the dead letter destination + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string DeadLetterEndPointTypeEndpointType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterDestinationInternal)DeadLetterDestination).EndpointType; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterWithResourceIdentity _deadLetterWithResourceIdentity; + + /// + /// 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 (topic / domain) to acquire the authentication tokens being used + /// during delivery / dead-lettering. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterWithResourceIdentity DeadLetterWithResourceIdentity { get => (this._deadLetterWithResourceIdentity = this._deadLetterWithResourceIdentity ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeadLetterWithResourceIdentity()); set => this._deadLetterWithResourceIdentity = value; } + + /// Type of the endpoint for the dead letter destination + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string DeadLetterWithResourceIdentityDeadLetterDestinationEndpointType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterWithResourceIdentityInternal)DeadLetterWithResourceIdentity).DeadLetterDestinationEndpointType; } + + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType? DeadLetterWithResourceIdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterWithResourceIdentityInternal)DeadLetterWithResourceIdentity).IdentityType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterWithResourceIdentityInternal)DeadLetterWithResourceIdentity).IdentityType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType)""); } + + /// The user identity associated with the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string DeadLetterWithResourceIdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterWithResourceIdentityInternal)DeadLetterWithResourceIdentity).IdentityUserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterWithResourceIdentityInternal)DeadLetterWithResourceIdentity).IdentityUserAssignedIdentity = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryWithResourceIdentity _deliveryWithResourceIdentity; + + /// + /// Information about the destination where events have to be delivered for the event subscription. + /// Uses the managed identity setup on the parent resource (topic / domain) to acquire the authentication tokens being used + /// during delivery / dead-lettering. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryWithResourceIdentity DeliveryWithResourceIdentity { get => (this._deliveryWithResourceIdentity = this._deliveryWithResourceIdentity ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeliveryWithResourceIdentity()); set => this._deliveryWithResourceIdentity = value; } + + /// Type of the endpoint for the event subscription destination. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType? DeliveryWithResourceIdentityDestinationEndpointType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryWithResourceIdentityInternal)DeliveryWithResourceIdentity).DestinationEndpointType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryWithResourceIdentityInternal)DeliveryWithResourceIdentity).DestinationEndpointType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType)""); } + + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType? DeliveryWithResourceIdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryWithResourceIdentityInternal)DeliveryWithResourceIdentity).IdentityType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryWithResourceIdentityInternal)DeliveryWithResourceIdentity).IdentityType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType)""); } + + /// The user identity associated with the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string DeliveryWithResourceIdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryWithResourceIdentityInternal)DeliveryWithResourceIdentity).IdentityUserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryWithResourceIdentityInternal)DeliveryWithResourceIdentity).IdentityUserAssignedIdentity = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestination _destination; + + /// + /// Information about the destination where events have to be delivered for the event subscription. + /// Uses Azure Event Grid's identity to acquire the authentication tokens being used during delivery / dead-lettering. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestination Destination { get => (this._destination = this._destination ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionDestination()); set => this._destination = value; } + + /// Type of the endpoint for the event subscription destination. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType? EndpointType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestinationInternal)Destination).EndpointType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestinationInternal)Destination).EndpointType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType)""); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema? _eventDeliverySchema; + + /// The event delivery schema for the event subscription. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema? EventDeliverySchema { get => this._eventDeliverySchema; set => this._eventDeliverySchema = value; } + + /// Backing field for property. + private global::System.DateTime? _expirationTimeUtc; + + /// Information about the expiration time for the event subscription. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public global::System.DateTime? ExpirationTimeUtc { get => this._expirationTimeUtc; set => this._expirationTimeUtc = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFilter _filter; + + /// Information about the filter for the event subscription. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFilter Filter { get => (this._filter = this._filter ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionFilter()); set => this._filter = value; } + + /// An array of advanced filters that are used for filtering event subscriptions. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[] FilterAdvancedFilter { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFilterInternal)Filter).AdvancedFilter; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFilterInternal)Filter).AdvancedFilter = value ?? null /* arrayOf */; } + + /// + /// Allows advanced filters to be evaluated against an array of values instead of expecting a singular value. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public bool? FilterEnableAdvancedFilteringOnArray { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFilterInternal)Filter).EnableAdvancedFilteringOnArray; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFilterInternal)Filter).EnableAdvancedFilteringOnArray = value ?? default(bool); } + + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string[] FilterIncludedEventType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFilterInternal)Filter).IncludedEventType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFilterInternal)Filter).IncludedEventType = value ?? null /* arrayOf */; } + + /// + /// Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filter + /// should be compared in a case sensitive manner. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public bool? FilterIsSubjectCaseSensitive { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFilterInternal)Filter).IsSubjectCaseSensitive; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFilterInternal)Filter).IsSubjectCaseSensitive = value ?? default(bool); } + + /// + /// An optional string to filter events for an event subscription based on a resource path prefix. + /// The format of this depends on the publisher of the events. + /// Wildcard characters are not supported in this path. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string FilterSubjectBeginsWith { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFilterInternal)Filter).SubjectBeginsWith; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFilterInternal)Filter).SubjectBeginsWith = value ?? null; } + + /// + /// An optional string to filter events for an event subscription based on a resource path suffix. + /// Wildcard characters are not supported in this path. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string FilterSubjectEndsWith { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFilterInternal)Filter).SubjectEndsWith; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFilterInternal)Filter).SubjectEndsWith = value ?? null; } + + /// Backing field for property. + private string[] _label; + + /// List of user defined labels. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string[] Label { get => this._label; set => this._label = value; } + + /// Internal Acessors for DeadLetterDestination + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterDestination Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal.DeadLetterDestination { get => (this._deadLetterDestination = this._deadLetterDestination ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeadLetterDestination()); set { {_deadLetterDestination = value;} } } + + /// Internal Acessors for DeadLetterEndPointTypeEndpointType + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal.DeadLetterEndPointTypeEndpointType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterDestinationInternal)DeadLetterDestination).EndpointType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterDestinationInternal)DeadLetterDestination).EndpointType = value; } + + /// Internal Acessors for DeadLetterWithResourceIdentity + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterWithResourceIdentity Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal.DeadLetterWithResourceIdentity { get => (this._deadLetterWithResourceIdentity = this._deadLetterWithResourceIdentity ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeadLetterWithResourceIdentity()); set { {_deadLetterWithResourceIdentity = value;} } } + + /// Internal Acessors for DeadLetterWithResourceIdentityDeadLetterDestination + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterDestination Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal.DeadLetterWithResourceIdentityDeadLetterDestination { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterWithResourceIdentityInternal)DeadLetterWithResourceIdentity).DeadLetterDestination; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterWithResourceIdentityInternal)DeadLetterWithResourceIdentity).DeadLetterDestination = value; } + + /// + /// Internal Acessors for DeadLetterWithResourceIdentityDeadLetterDestinationEndpointType + /// + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal.DeadLetterWithResourceIdentityDeadLetterDestinationEndpointType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterWithResourceIdentityInternal)DeadLetterWithResourceIdentity).DeadLetterDestinationEndpointType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterWithResourceIdentityInternal)DeadLetterWithResourceIdentity).DeadLetterDestinationEndpointType = value; } + + /// Internal Acessors for DeadLetterWithResourceIdentityIdentity + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionIdentity Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal.DeadLetterWithResourceIdentityIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterWithResourceIdentityInternal)DeadLetterWithResourceIdentity).Identity; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterWithResourceIdentityInternal)DeadLetterWithResourceIdentity).Identity = value; } + + /// Internal Acessors for DeliveryWithResourceIdentity + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryWithResourceIdentity Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal.DeliveryWithResourceIdentity { get => (this._deliveryWithResourceIdentity = this._deliveryWithResourceIdentity ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeliveryWithResourceIdentity()); set { {_deliveryWithResourceIdentity = value;} } } + + /// Internal Acessors for DeliveryWithResourceIdentityDestination + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestination Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal.DeliveryWithResourceIdentityDestination { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryWithResourceIdentityInternal)DeliveryWithResourceIdentity).Destination; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryWithResourceIdentityInternal)DeliveryWithResourceIdentity).Destination = value; } + + /// Internal Acessors for DeliveryWithResourceIdentityIdentity + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionIdentity Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal.DeliveryWithResourceIdentityIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryWithResourceIdentityInternal)DeliveryWithResourceIdentity).Identity; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryWithResourceIdentityInternal)DeliveryWithResourceIdentity).Identity = value; } + + /// Internal Acessors for Destination + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestination Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal.Destination { get => (this._destination = this._destination ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionDestination()); set { {_destination = value;} } } + + /// Internal Acessors for Filter + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFilter Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal.Filter { get => (this._filter = this._filter ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionFilter()); set { {_filter = value;} } } + + /// Internal Acessors for RetryPolicy + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IRetryPolicy Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParametersInternal.RetryPolicy { get => (this._retryPolicy = this._retryPolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.RetryPolicy()); set { {_retryPolicy = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IRetryPolicy _retryPolicy; + + /// + /// The retry policy for events. This can be used to configure maximum number of delivery attempts and time to live for events. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IRetryPolicy RetryPolicy { get => (this._retryPolicy = this._retryPolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.RetryPolicy()); set => this._retryPolicy = value; } + + /// Time To Live (in minutes) for events. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public int? RetryPolicyEventTimeToLiveInMinute { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IRetryPolicyInternal)RetryPolicy).EventTimeToLiveInMinute; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IRetryPolicyInternal)RetryPolicy).EventTimeToLiveInMinute = value ?? default(int); } + + /// Maximum number of delivery retry attempts for events. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public int? RetryPolicyMaxDeliveryAttempt { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IRetryPolicyInternal)RetryPolicy).MaxDeliveryAttempt; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IRetryPolicyInternal)RetryPolicy).MaxDeliveryAttempt = value ?? default(int); } + + /// Creates an new instance. + public EventSubscriptionUpdateParameters() + { + + } + } + /// Properties of the Event Subscription update. + public partial interface IEventSubscriptionUpdateParameters : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// Type of the endpoint for the dead letter destination + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Type of the endpoint for the dead letter destination", + SerializedName = @"endpointType", + PossibleTypes = new [] { typeof(string) })] + string DeadLetterEndPointTypeEndpointType { get; } + /// Type of the endpoint for the dead letter destination + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Type of the endpoint for the dead letter destination", + SerializedName = @"endpointType", + PossibleTypes = new [] { typeof(string) })] + string DeadLetterWithResourceIdentityDeadLetterDestinationEndpointType { get; } + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType? DeadLetterWithResourceIdentityType { get; set; } + /// The user identity associated with the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The user identity associated with the resource.", + SerializedName = @"userAssignedIdentity", + PossibleTypes = new [] { typeof(string) })] + string DeadLetterWithResourceIdentityUserAssignedIdentity { get; set; } + /// Type of the endpoint for the event subscription destination. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of the endpoint for the event subscription destination.", + SerializedName = @"endpointType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType? DeliveryWithResourceIdentityDestinationEndpointType { get; set; } + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType? DeliveryWithResourceIdentityType { get; set; } + /// The user identity associated with the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The user identity associated with the resource.", + SerializedName = @"userAssignedIdentity", + PossibleTypes = new [] { typeof(string) })] + string DeliveryWithResourceIdentityUserAssignedIdentity { get; set; } + /// Type of the endpoint for the event subscription destination. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of the endpoint for the event subscription destination.", + SerializedName = @"endpointType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType? EndpointType { get; set; } + /// The event delivery schema for the event subscription. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The event delivery schema for the event subscription.", + SerializedName = @"eventDeliverySchema", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema? EventDeliverySchema { get; set; } + /// Information about the expiration time for the event subscription. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Information about the expiration time for the event subscription.", + SerializedName = @"expirationTimeUtc", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ExpirationTimeUtc { get; set; } + /// An array of advanced filters that are used for filtering event subscriptions. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An array of advanced filters that are used for filtering event subscriptions.", + SerializedName = @"advancedFilters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[] FilterAdvancedFilter { get; set; } + /// + /// Allows advanced filters to be evaluated against an array of values instead of expecting a singular value. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allows advanced filters to be evaluated against an array of values instead of expecting a singular value.", + SerializedName = @"enableAdvancedFilteringOnArrays", + PossibleTypes = new [] { typeof(bool) })] + bool? FilterEnableAdvancedFilteringOnArray { get; set; } + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"includedEventTypes", + PossibleTypes = new [] { typeof(string) })] + string[] FilterIncludedEventType { get; set; } + /// + /// Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filter + /// should be compared in a case sensitive manner. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filter + should be compared in a case sensitive manner.", + SerializedName = @"isSubjectCaseSensitive", + PossibleTypes = new [] { typeof(bool) })] + bool? FilterIsSubjectCaseSensitive { get; set; } + /// + /// An optional string to filter events for an event subscription based on a resource path prefix. + /// The format of this depends on the publisher of the events. + /// Wildcard characters are not supported in this path. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An optional string to filter events for an event subscription based on a resource path prefix. + The format of this depends on the publisher of the events. + Wildcard characters are not supported in this path.", + SerializedName = @"subjectBeginsWith", + PossibleTypes = new [] { typeof(string) })] + string FilterSubjectBeginsWith { get; set; } + /// + /// An optional string to filter events for an event subscription based on a resource path suffix. + /// Wildcard characters are not supported in this path. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An optional string to filter events for an event subscription based on a resource path suffix. + Wildcard characters are not supported in this path.", + SerializedName = @"subjectEndsWith", + PossibleTypes = new [] { typeof(string) })] + string FilterSubjectEndsWith { get; set; } + /// List of user defined labels. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of user defined labels.", + SerializedName = @"labels", + PossibleTypes = new [] { typeof(string) })] + string[] Label { get; set; } + /// Time To Live (in minutes) for events. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Time To Live (in minutes) for events.", + SerializedName = @"eventTimeToLiveInMinutes", + PossibleTypes = new [] { typeof(int) })] + int? RetryPolicyEventTimeToLiveInMinute { get; set; } + /// Maximum number of delivery retry attempts for events. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Maximum number of delivery retry attempts for events.", + SerializedName = @"maxDeliveryAttempts", + PossibleTypes = new [] { typeof(int) })] + int? RetryPolicyMaxDeliveryAttempt { get; set; } + + } + /// Properties of the Event Subscription update. + internal partial interface IEventSubscriptionUpdateParametersInternal + + { + /// + /// 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 Azure Event Grid's identity to acquire the authentication tokens being used during delivery / dead-lettering. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterDestination DeadLetterDestination { get; set; } + /// Type of the endpoint for the dead letter destination + string DeadLetterEndPointTypeEndpointType { get; set; } + /// + /// 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 (topic / domain) to acquire the authentication tokens being used + /// during delivery / dead-lettering. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterWithResourceIdentity DeadLetterWithResourceIdentity { get; set; } + /// + /// Information about the destination where events have to be delivered for the event subscription. + /// Uses the managed identity setup on the parent resource (namely, topic or domain) to acquire the authentication tokens + /// being used during delivery / dead-lettering. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterDestination DeadLetterWithResourceIdentityDeadLetterDestination { get; set; } + /// Type of the endpoint for the dead letter destination + string DeadLetterWithResourceIdentityDeadLetterDestinationEndpointType { get; set; } + /// The identity to use when dead-lettering events. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionIdentity DeadLetterWithResourceIdentityIdentity { get; set; } + /// + /// 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. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType? DeadLetterWithResourceIdentityType { get; set; } + /// The user identity associated with the resource. + string DeadLetterWithResourceIdentityUserAssignedIdentity { get; set; } + /// + /// Information about the destination where events have to be delivered for the event subscription. + /// Uses the managed identity setup on the parent resource (topic / domain) to acquire the authentication tokens being used + /// during delivery / dead-lettering. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryWithResourceIdentity DeliveryWithResourceIdentity { get; set; } + /// + /// Information about the destination where events have to be delivered for the event subscription. + /// Uses Azure Event Grid's identity to acquire the authentication tokens being used during delivery / dead-lettering. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestination DeliveryWithResourceIdentityDestination { get; set; } + /// Type of the endpoint for the event subscription destination. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType? DeliveryWithResourceIdentityDestinationEndpointType { get; set; } + /// The identity to use when delivering events. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionIdentity DeliveryWithResourceIdentityIdentity { get; set; } + /// + /// 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. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType? DeliveryWithResourceIdentityType { get; set; } + /// The user identity associated with the resource. + string DeliveryWithResourceIdentityUserAssignedIdentity { get; set; } + /// + /// Information about the destination where events have to be delivered for the event subscription. + /// Uses Azure Event Grid's identity to acquire the authentication tokens being used during delivery / dead-lettering. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestination Destination { get; set; } + /// Type of the endpoint for the event subscription destination. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType? EndpointType { get; set; } + /// The event delivery schema for the event subscription. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema? EventDeliverySchema { get; set; } + /// Information about the expiration time for the event subscription. + global::System.DateTime? ExpirationTimeUtc { get; set; } + /// Information about the filter for the event subscription. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFilter Filter { get; set; } + /// An array of advanced filters that are used for filtering event subscriptions. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[] FilterAdvancedFilter { get; set; } + /// + /// Allows advanced filters to be evaluated against an array of values instead of expecting a singular value. + /// + bool? FilterEnableAdvancedFilteringOnArray { get; set; } + /// + /// 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. + /// + string[] FilterIncludedEventType { get; set; } + /// + /// Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filter + /// should be compared in a case sensitive manner. + /// + bool? FilterIsSubjectCaseSensitive { get; set; } + /// + /// An optional string to filter events for an event subscription based on a resource path prefix. + /// The format of this depends on the publisher of the events. + /// Wildcard characters are not supported in this path. + /// + string FilterSubjectBeginsWith { get; set; } + /// + /// An optional string to filter events for an event subscription based on a resource path suffix. + /// Wildcard characters are not supported in this path. + /// + string FilterSubjectEndsWith { get; set; } + /// List of user defined labels. + string[] Label { get; set; } + /// + /// The retry policy for events. This can be used to configure maximum number of delivery attempts and time to live for events. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IRetryPolicy RetryPolicy { get; set; } + /// Time To Live (in minutes) for events. + int? RetryPolicyEventTimeToLiveInMinute { get; set; } + /// Maximum number of delivery retry attempts for events. + int? RetryPolicyMaxDeliveryAttempt { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscriptionUpdateParameters.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscriptionUpdateParameters.json.cs new file mode 100644 index 000000000000..29a977bc222f --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscriptionUpdateParameters.json.cs @@ -0,0 +1,130 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Properties of the Event Subscription update. + public partial class EventSubscriptionUpdateParameters + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal EventSubscriptionUpdateParameters(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_destination = If( json?.PropertyT("destination"), out var __jsonDestination) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionDestination.FromJson(__jsonDestination) : Destination;} + {_deliveryWithResourceIdentity = If( json?.PropertyT("deliveryWithResourceIdentity"), out var __jsonDeliveryWithResourceIdentity) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeliveryWithResourceIdentity.FromJson(__jsonDeliveryWithResourceIdentity) : DeliveryWithResourceIdentity;} + {_filter = If( json?.PropertyT("filter"), out var __jsonFilter) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionFilter.FromJson(__jsonFilter) : Filter;} + {_retryPolicy = If( json?.PropertyT("retryPolicy"), out var __jsonRetryPolicy) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.RetryPolicy.FromJson(__jsonRetryPolicy) : RetryPolicy;} + {_deadLetterDestination = If( json?.PropertyT("deadLetterDestination"), out var __jsonDeadLetterDestination) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeadLetterDestination.FromJson(__jsonDeadLetterDestination) : DeadLetterDestination;} + {_deadLetterWithResourceIdentity = If( json?.PropertyT("deadLetterWithResourceIdentity"), out var __jsonDeadLetterWithResourceIdentity) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeadLetterWithResourceIdentity.FromJson(__jsonDeadLetterWithResourceIdentity) : DeadLetterWithResourceIdentity;} + {_label = If( json?.PropertyT("labels"), out var __jsonLabels) ? If( __jsonLabels as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Label;} + {_expirationTimeUtc = If( json?.PropertyT("expirationTimeUtc"), out var __jsonExpirationTimeUtc) ? global::System.DateTime.TryParse((string)__jsonExpirationTimeUtc, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonExpirationTimeUtcValue) ? __jsonExpirationTimeUtcValue : ExpirationTimeUtc : ExpirationTimeUtc;} + {_eventDeliverySchema = If( json?.PropertyT("eventDeliverySchema"), out var __jsonEventDeliverySchema) ? (string)__jsonEventDeliverySchema : (string)EventDeliverySchema;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParameters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParameters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new EventSubscriptionUpdateParameters(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._destination ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._destination.ToJson(null,serializationMode) : null, "destination" ,container.Add ); + AddIf( null != this._deliveryWithResourceIdentity ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._deliveryWithResourceIdentity.ToJson(null,serializationMode) : null, "deliveryWithResourceIdentity" ,container.Add ); + AddIf( null != this._filter ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._filter.ToJson(null,serializationMode) : null, "filter" ,container.Add ); + AddIf( null != this._retryPolicy ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._retryPolicy.ToJson(null,serializationMode) : null, "retryPolicy" ,container.Add ); + AddIf( null != this._deadLetterDestination ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._deadLetterDestination.ToJson(null,serializationMode) : null, "deadLetterDestination" ,container.Add ); + AddIf( null != this._deadLetterWithResourceIdentity ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._deadLetterWithResourceIdentity.ToJson(null,serializationMode) : null, "deadLetterWithResourceIdentity" ,container.Add ); + if (null != this._label) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.XNodeArray(); + foreach( var __x in this._label ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("labels",__w); + } + AddIf( null != this._expirationTimeUtc ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._expirationTimeUtc?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "expirationTimeUtc" ,container.Add ); + AddIf( null != (((object)this._eventDeliverySchema)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._eventDeliverySchema.ToString()) : null, "eventDeliverySchema" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscriptionsListResult.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscriptionsListResult.PowerShell.cs new file mode 100644 index 000000000000..99da49a0abd5 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscriptionsListResult.PowerShell.cs @@ -0,0 +1,152 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Result of the List EventSubscriptions operation + [System.ComponentModel.TypeConverter(typeof(EventSubscriptionsListResultTypeConverter))] + public partial class EventSubscriptionsListResult + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionsListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new EventSubscriptionsListResult(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionsListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new EventSubscriptionsListResult(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal EventSubscriptionsListResult(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionsListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionsListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionsListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionsListResultInternal)this).NextLink, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal EventSubscriptionsListResult(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionsListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionsListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionsListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionsListResultInternal)this).NextLink, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionsListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Result of the List EventSubscriptions operation + [System.ComponentModel.TypeConverter(typeof(EventSubscriptionsListResultTypeConverter))] + public partial interface IEventSubscriptionsListResult + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscriptionsListResult.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscriptionsListResult.TypeConverter.cs new file mode 100644 index 000000000000..f425ab59e4c6 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscriptionsListResult.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class EventSubscriptionsListResultTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionsListResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionsListResult).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return EventSubscriptionsListResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return EventSubscriptionsListResult.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return EventSubscriptionsListResult.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscriptionsListResult.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscriptionsListResult.cs new file mode 100644 index 000000000000..a914be2e9be8 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscriptionsListResult.cs @@ -0,0 +1,68 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Result of the List EventSubscriptions operation + public partial class EventSubscriptionsListResult : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionsListResult, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionsListResultInternal + { + + /// Backing field for property. + private string _nextLink; + + /// A link for the next page of event subscriptions + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription[] _value; + + /// A collection of EventSubscriptions + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public EventSubscriptionsListResult() + { + + } + } + /// Result of the List EventSubscriptions operation + public partial interface IEventSubscriptionsListResult : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// A link for the next page of event subscriptions + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A link for the next page of event subscriptions", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// A collection of EventSubscriptions + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A collection of EventSubscriptions", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription[] Value { get; set; } + + } + /// Result of the List EventSubscriptions operation + internal partial interface IEventSubscriptionsListResultInternal + + { + /// A link for the next page of event subscriptions + string NextLink { get; set; } + /// A collection of EventSubscriptions + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscriptionsListResult.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscriptionsListResult.json.cs new file mode 100644 index 000000000000..286e6373f4ec --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventSubscriptionsListResult.json.cs @@ -0,0 +1,116 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Result of the List EventSubscriptions operation + public partial class EventSubscriptionsListResult + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal EventSubscriptionsListResult(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription) (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscription.FromJson(__u) )) ))() : null : Value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionsListResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionsListResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionsListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new EventSubscriptionsListResult(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventType.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventType.PowerShell.cs new file mode 100644 index 000000000000..c2e0791c6ebc --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventType.PowerShell.cs @@ -0,0 +1,198 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Event Type for a subject under a topic + [System.ComponentModel.TypeConverter(typeof(EventTypeTypeConverter))] + public partial class EventType + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventType DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new EventType(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventType DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new EventType(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal EventType(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventTypePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("DisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInternal)this).DisplayName, global::System.Convert.ToString); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("SchemaUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInternal)this).SchemaUrl = (string) content.GetValueForProperty("SchemaUrl",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInternal)this).SchemaUrl, global::System.Convert.ToString); + } + if (content.Contains("IsInDefaultSet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInternal)this).IsInDefaultSet = (bool?) content.GetValueForProperty("IsInDefaultSet",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInternal)this).IsInDefaultSet, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal EventType(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventTypePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("DisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInternal)this).DisplayName, global::System.Convert.ToString); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("SchemaUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInternal)this).SchemaUrl = (string) content.GetValueForProperty("SchemaUrl",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInternal)this).SchemaUrl, global::System.Convert.ToString); + } + if (content.Contains("IsInDefaultSet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInternal)this).IsInDefaultSet = (bool?) content.GetValueForProperty("IsInDefaultSet",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInternal)this).IsInDefaultSet, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventType FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Event Type for a subject under a topic + [System.ComponentModel.TypeConverter(typeof(EventTypeTypeConverter))] + public partial interface IEventType + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventType.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventType.TypeConverter.cs new file mode 100644 index 000000000000..fa7358cbb2d1 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventType.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class EventTypeTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventType ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventType).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return EventType.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return EventType.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return EventType.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventType.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventType.cs new file mode 100644 index 000000000000..9da248be613e --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventType.cs @@ -0,0 +1,142 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Event Type for a subject under a topic + public partial class EventType : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventType, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInternal, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.Resource(); + + /// Description of the event type. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypePropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypePropertiesInternal)Property).Description = value ?? null; } + + /// Display name of the event type. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypePropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypePropertiesInternal)Property).DisplayName = value ?? null; } + + /// Fully qualified identifier of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Id; } + + /// IsInDefaultSet flag of the event type. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public bool? IsInDefaultSet { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypePropertiesInternal)Property).IsInDefaultSet; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypePropertiesInternal)Property).IsInDefaultSet = value ?? default(bool); } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeProperties Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventTypeProperties()); set { {_property = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Type = value; } + + /// Name of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeProperties _property; + + /// Properties of the event type. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventTypeProperties()); set => this._property = value; } + + /// Url of the schema for this event type. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string SchemaUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypePropertiesInternal)Property).SchemaUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypePropertiesInternal)Property).SchemaUrl = value ?? null; } + + /// Type of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public EventType() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// Event Type for a subject under a topic + public partial interface IEventType : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResource + { + /// Description of the event type. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Description of the event type.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// Display name of the event type. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Display name of the event type.", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + string DisplayName { get; set; } + /// IsInDefaultSet flag of the event type. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"IsInDefaultSet flag of the event type.", + SerializedName = @"isInDefaultSet", + PossibleTypes = new [] { typeof(bool) })] + bool? IsInDefaultSet { get; set; } + /// Url of the schema for this event type. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Url of the schema for this event type.", + SerializedName = @"schemaUrl", + PossibleTypes = new [] { typeof(string) })] + string SchemaUrl { get; set; } + + } + /// Event Type for a subject under a topic + internal partial interface IEventTypeInternal : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal + { + /// Description of the event type. + string Description { get; set; } + /// Display name of the event type. + string DisplayName { get; set; } + /// IsInDefaultSet flag of the event type. + bool? IsInDefaultSet { get; set; } + /// Properties of the event type. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeProperties Property { get; set; } + /// Url of the schema for this event type. + string SchemaUrl { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventType.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventType.json.cs new file mode 100644 index 000000000000..c56c1e2f7212 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventType.json.cs @@ -0,0 +1,108 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Event Type for a subject under a topic + public partial class EventType + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal EventType(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventTypeProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventType. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventType. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventType FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new EventType(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventTypeInfo.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventTypeInfo.PowerShell.cs new file mode 100644 index 000000000000..55bf56459780 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventTypeInfo.PowerShell.cs @@ -0,0 +1,150 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// The event type information for Channels. + [System.ComponentModel.TypeConverter(typeof(EventTypeInfoTypeConverter))] + public partial class EventTypeInfo + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new EventTypeInfo(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new EventTypeInfo(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal EventTypeInfo(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind?) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind.CreateFrom); + } + if (content.Contains("InlineEventType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInternal)this).InlineEventType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInlineEventTypes) content.GetValueForProperty("InlineEventType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInternal)this).InlineEventType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventTypeInfoInlineEventTypesTypeConverter.ConvertFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal EventTypeInfo(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind?) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind.CreateFrom); + } + if (content.Contains("InlineEventType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInternal)this).InlineEventType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInlineEventTypes) content.GetValueForProperty("InlineEventType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInternal)this).InlineEventType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventTypeInfoInlineEventTypesTypeConverter.ConvertFrom); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The event type information for Channels. + [System.ComponentModel.TypeConverter(typeof(EventTypeInfoTypeConverter))] + public partial interface IEventTypeInfo + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventTypeInfo.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventTypeInfo.TypeConverter.cs new file mode 100644 index 000000000000..1b9aa81dd83b --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventTypeInfo.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class EventTypeInfoTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfo ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfo).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return EventTypeInfo.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return EventTypeInfo.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return EventTypeInfo.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventTypeInfo.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventTypeInfo.cs new file mode 100644 index 000000000000..0de93ff4cdd5 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventTypeInfo.cs @@ -0,0 +1,88 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// The event type information for Channels. + public partial class EventTypeInfo : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfo, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInlineEventTypes _inlineEventType; + + /// + /// A collection of inline event types for the resource. The inline event type keys are of type string which represents the + /// name of the event. + /// An example of a valid inline event name is "Contoso.OrderCreated". + /// The inline event type values are of type InlineEventProperties and will contain additional information for every inline + /// event type. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInlineEventTypes InlineEventType { get => (this._inlineEventType = this._inlineEventType ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventTypeInfoInlineEventTypes()); set => this._inlineEventType = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind? _kind; + + /// The kind of event type used. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind? Kind { get => this._kind; set => this._kind = value; } + + /// Creates an new instance. + public EventTypeInfo() + { + + } + } + /// The event type information for Channels. + public partial interface IEventTypeInfo : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// + /// A collection of inline event types for the resource. The inline event type keys are of type string which represents the + /// name of the event. + /// An example of a valid inline event name is "Contoso.OrderCreated". + /// The inline event type values are of type InlineEventProperties and will contain additional information for every inline + /// event type. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A collection of inline event types for the resource. The inline event type keys are of type string which represents the name of the event. + An example of a valid inline event name is ""Contoso.OrderCreated"". + The inline event type values are of type InlineEventProperties and will contain additional information for every inline event type.", + SerializedName = @"inlineEventTypes", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInlineEventTypes) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInlineEventTypes InlineEventType { get; set; } + /// The kind of event type used. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The kind of event type used.", + SerializedName = @"kind", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind? Kind { get; set; } + + } + /// The event type information for Channels. + internal partial interface IEventTypeInfoInternal + + { + /// + /// A collection of inline event types for the resource. The inline event type keys are of type string which represents the + /// name of the event. + /// An example of a valid inline event name is "Contoso.OrderCreated". + /// The inline event type values are of type InlineEventProperties and will contain additional information for every inline + /// event type. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInlineEventTypes InlineEventType { get; set; } + /// The kind of event type used. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind? Kind { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventTypeInfo.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventTypeInfo.json.cs new file mode 100644 index 000000000000..609b4baa1c5c --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventTypeInfo.json.cs @@ -0,0 +1,108 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// The event type information for Channels. + public partial class EventTypeInfo + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal EventTypeInfo(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_kind = If( json?.PropertyT("kind"), out var __jsonKind) ? (string)__jsonKind : (string)Kind;} + {_inlineEventType = If( json?.PropertyT("inlineEventTypes"), out var __jsonInlineEventTypes) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventTypeInfoInlineEventTypes.FromJson(__jsonInlineEventTypes) : InlineEventType;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new EventTypeInfo(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._kind)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._kind.ToString()) : null, "kind" ,container.Add ); + AddIf( null != this._inlineEventType ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._inlineEventType.ToJson(null,serializationMode) : null, "inlineEventTypes" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventTypeInfoInlineEventTypes.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventTypeInfoInlineEventTypes.PowerShell.cs new file mode 100644 index 000000000000..3a0ba1afd5be --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventTypeInfoInlineEventTypes.PowerShell.cs @@ -0,0 +1,150 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A collection of inline event types for the resource. The inline event type keys are of type string which represents the + /// name of the event. + /// An example of a valid inline event name is "Contoso.OrderCreated". + /// The inline event type values are of type InlineEventProperties and will contain additional information for every inline + /// event type. + /// + [System.ComponentModel.TypeConverter(typeof(EventTypeInfoInlineEventTypesTypeConverter))] + public partial class EventTypeInfoInlineEventTypes + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInlineEventTypes DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new EventTypeInfoInlineEventTypes(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInlineEventTypes DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new EventTypeInfoInlineEventTypes(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal EventTypeInfoInlineEventTypes(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal EventTypeInfoInlineEventTypes(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInlineEventTypes FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// A collection of inline event types for the resource. The inline event type keys are of type string which represents the + /// name of the event. + /// An example of a valid inline event name is "Contoso.OrderCreated". + /// The inline event type values are of type InlineEventProperties and will contain additional information for every inline + /// event type. + [System.ComponentModel.TypeConverter(typeof(EventTypeInfoInlineEventTypesTypeConverter))] + public partial interface IEventTypeInfoInlineEventTypes + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventTypeInfoInlineEventTypes.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventTypeInfoInlineEventTypes.TypeConverter.cs new file mode 100644 index 000000000000..0cc1f69ef006 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventTypeInfoInlineEventTypes.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class EventTypeInfoInlineEventTypesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInlineEventTypes ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInlineEventTypes).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return EventTypeInfoInlineEventTypes.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return EventTypeInfoInlineEventTypes.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return EventTypeInfoInlineEventTypes.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventTypeInfoInlineEventTypes.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventTypeInfoInlineEventTypes.cs new file mode 100644 index 000000000000..1c0468b9e952 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventTypeInfoInlineEventTypes.cs @@ -0,0 +1,49 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// + /// A collection of inline event types for the resource. The inline event type keys are of type string which represents the + /// name of the event. + /// An example of a valid inline event name is "Contoso.OrderCreated". + /// The inline event type values are of type InlineEventProperties and will contain additional information for every inline + /// event type. + /// + public partial class EventTypeInfoInlineEventTypes : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInlineEventTypes, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInlineEventTypesInternal + { + + /// Creates an new instance. + public EventTypeInfoInlineEventTypes() + { + + } + } + /// A collection of inline event types for the resource. The inline event type keys are of type string which represents the + /// name of the event. + /// An example of a valid inline event name is "Contoso.OrderCreated". + /// The inline event type values are of type InlineEventProperties and will contain additional information for every inline + /// event type. + public partial interface IEventTypeInfoInlineEventTypes : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray + { + + } + /// A collection of inline event types for the resource. The inline event type keys are of type string which represents the + /// name of the event. + /// An example of a valid inline event name is "Contoso.OrderCreated". + /// The inline event type values are of type InlineEventProperties and will contain additional information for every inline + /// event type. + internal partial interface IEventTypeInfoInlineEventTypesInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventTypeInfoInlineEventTypes.dictionary.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventTypeInfoInlineEventTypes.dictionary.cs new file mode 100644 index 000000000000..6e7a5c8c7cab --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventTypeInfoInlineEventTypes.dictionary.cs @@ -0,0 +1,75 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + public partial class EventTypeInfoInlineEventTypes : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInlineEventProperties this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInlineEventProperties value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInlineEventProperties value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventTypeInfoInlineEventTypes source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventTypeInfoInlineEventTypes.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventTypeInfoInlineEventTypes.json.cs new file mode 100644 index 000000000000..7a8d3d059383 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventTypeInfoInlineEventTypes.json.cs @@ -0,0 +1,113 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// + /// A collection of inline event types for the resource. The inline event type keys are of type string which represents the + /// name of the event. + /// An example of a valid inline event name is "Contoso.OrderCreated". + /// The inline event type values are of type InlineEventProperties and will contain additional information for every inline + /// event type. + /// + public partial class EventTypeInfoInlineEventTypes + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + /// + internal EventTypeInfoInlineEventTypes(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray)this).AdditionalProperties, (j) => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.InlineEventProperties.FromJson(j) ,exclusions ); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInlineEventTypes. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInlineEventTypes. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInlineEventTypes FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new EventTypeInfoInlineEventTypes(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventTypeProperties.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventTypeProperties.PowerShell.cs new file mode 100644 index 000000000000..65a329aefd72 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventTypeProperties.PowerShell.cs @@ -0,0 +1,168 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Properties of the event type + [System.ComponentModel.TypeConverter(typeof(EventTypePropertiesTypeConverter))] + public partial class EventTypeProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new EventTypeProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new EventTypeProperties(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal EventTypeProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypePropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypePropertiesInternal)this).DisplayName, global::System.Convert.ToString); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypePropertiesInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypePropertiesInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("SchemaUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypePropertiesInternal)this).SchemaUrl = (string) content.GetValueForProperty("SchemaUrl",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypePropertiesInternal)this).SchemaUrl, global::System.Convert.ToString); + } + if (content.Contains("IsInDefaultSet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypePropertiesInternal)this).IsInDefaultSet = (bool?) content.GetValueForProperty("IsInDefaultSet",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypePropertiesInternal)this).IsInDefaultSet, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal EventTypeProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypePropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypePropertiesInternal)this).DisplayName, global::System.Convert.ToString); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypePropertiesInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypePropertiesInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("SchemaUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypePropertiesInternal)this).SchemaUrl = (string) content.GetValueForProperty("SchemaUrl",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypePropertiesInternal)this).SchemaUrl, global::System.Convert.ToString); + } + if (content.Contains("IsInDefaultSet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypePropertiesInternal)this).IsInDefaultSet = (bool?) content.GetValueForProperty("IsInDefaultSet",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypePropertiesInternal)this).IsInDefaultSet, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties of the event type + [System.ComponentModel.TypeConverter(typeof(EventTypePropertiesTypeConverter))] + public partial interface IEventTypeProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventTypeProperties.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventTypeProperties.TypeConverter.cs new file mode 100644 index 000000000000..a60c648f975b --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventTypeProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class EventTypePropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return EventTypeProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return EventTypeProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return EventTypeProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventTypeProperties.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventTypeProperties.cs new file mode 100644 index 000000000000..e5d4a8bf934c --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventTypeProperties.cs @@ -0,0 +1,102 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Properties of the event type + public partial class EventTypeProperties : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeProperties, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypePropertiesInternal + { + + /// Backing field for property. + private string _description; + + /// Description of the event type. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string Description { get => this._description; set => this._description = value; } + + /// Backing field for property. + private string _displayName; + + /// Display name of the event type. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string DisplayName { get => this._displayName; set => this._displayName = value; } + + /// Backing field for property. + private bool? _isInDefaultSet; + + /// IsInDefaultSet flag of the event type. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public bool? IsInDefaultSet { get => this._isInDefaultSet; set => this._isInDefaultSet = value; } + + /// Backing field for property. + private string _schemaUrl; + + /// Url of the schema for this event type. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string SchemaUrl { get => this._schemaUrl; set => this._schemaUrl = value; } + + /// Creates an new instance. + public EventTypeProperties() + { + + } + } + /// Properties of the event type + public partial interface IEventTypeProperties : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// Description of the event type. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Description of the event type.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// Display name of the event type. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Display name of the event type.", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + string DisplayName { get; set; } + /// IsInDefaultSet flag of the event type. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"IsInDefaultSet flag of the event type.", + SerializedName = @"isInDefaultSet", + PossibleTypes = new [] { typeof(bool) })] + bool? IsInDefaultSet { get; set; } + /// Url of the schema for this event type. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Url of the schema for this event type.", + SerializedName = @"schemaUrl", + PossibleTypes = new [] { typeof(string) })] + string SchemaUrl { get; set; } + + } + /// Properties of the event type + internal partial interface IEventTypePropertiesInternal + + { + /// Description of the event type. + string Description { get; set; } + /// Display name of the event type. + string DisplayName { get; set; } + /// IsInDefaultSet flag of the event type. + bool? IsInDefaultSet { get; set; } + /// Url of the schema for this event type. + string SchemaUrl { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventTypeProperties.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventTypeProperties.json.cs new file mode 100644 index 000000000000..8b04cc2cfd66 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventTypeProperties.json.cs @@ -0,0 +1,112 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Properties of the event type + public partial class EventTypeProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal EventTypeProperties(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)DisplayName;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} + {_schemaUrl = If( json?.PropertyT("schemaUrl"), out var __jsonSchemaUrl) ? (string)__jsonSchemaUrl : (string)SchemaUrl;} + {_isInDefaultSet = If( json?.PropertyT("isInDefaultSet"), out var __jsonIsInDefaultSet) ? (bool?)__jsonIsInDefaultSet : IsInDefaultSet;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new EventTypeProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._displayName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._displayName.ToString()) : null, "displayName" ,container.Add ); + AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._description.ToString()) : null, "description" ,container.Add ); + AddIf( null != (((object)this._schemaUrl)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._schemaUrl.ToString()) : null, "schemaUrl" ,container.Add ); + AddIf( null != this._isInDefaultSet ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonBoolean((bool)this._isInDefaultSet) : null, "isInDefaultSet" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventTypesListResult.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventTypesListResult.PowerShell.cs new file mode 100644 index 000000000000..acdea93bb886 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventTypesListResult.PowerShell.cs @@ -0,0 +1,144 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Result of the List Event Types operation + [System.ComponentModel.TypeConverter(typeof(EventTypesListResultTypeConverter))] + public partial class EventTypesListResult + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypesListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new EventTypesListResult(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypesListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new EventTypesListResult(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal EventTypesListResult(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypesListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventType[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypesListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventTypeTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal EventTypesListResult(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypesListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventType[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypesListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventTypeTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypesListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Result of the List Event Types operation + [System.ComponentModel.TypeConverter(typeof(EventTypesListResultTypeConverter))] + public partial interface IEventTypesListResult + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventTypesListResult.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventTypesListResult.TypeConverter.cs new file mode 100644 index 000000000000..b857c303d3b3 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventTypesListResult.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class EventTypesListResultTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypesListResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypesListResult).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return EventTypesListResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return EventTypesListResult.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return EventTypesListResult.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventTypesListResult.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventTypesListResult.cs new file mode 100644 index 000000000000..f05d716c496d --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventTypesListResult.cs @@ -0,0 +1,51 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Result of the List Event Types operation + public partial class EventTypesListResult : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypesListResult, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypesListResultInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventType[] _value; + + /// A collection of event types + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventType[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public EventTypesListResult() + { + + } + } + /// Result of the List Event Types operation + public partial interface IEventTypesListResult : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// A collection of event types + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A collection of event types", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventType) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventType[] Value { get; set; } + + } + /// Result of the List Event Types operation + internal partial interface IEventTypesListResultInternal + + { + /// A collection of event types + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventType[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventTypesListResult.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventTypesListResult.json.cs new file mode 100644 index 000000000000..be9d4e2c75f2 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/EventTypesListResult.json.cs @@ -0,0 +1,114 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Result of the List Event Types operation + public partial class EventTypesListResult + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal EventTypesListResult(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventType) (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventType.FromJson(__u) )) ))() : null : Value;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypesListResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypesListResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypesListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new EventTypesListResult(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ExtendedLocation.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ExtendedLocation.PowerShell.cs new file mode 100644 index 000000000000..d2c7165b34a7 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ExtendedLocation.PowerShell.cs @@ -0,0 +1,150 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Definition of an Extended Location + [System.ComponentModel.TypeConverter(typeof(ExtendedLocationTypeConverter))] + public partial class ExtendedLocation + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtendedLocation DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ExtendedLocation(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtendedLocation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ExtendedLocation(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ExtendedLocation(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtendedLocationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtendedLocationInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtendedLocationInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtendedLocationInternal)this).Type, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ExtendedLocation(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtendedLocationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtendedLocationInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtendedLocationInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtendedLocationInternal)this).Type, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtendedLocation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Definition of an Extended Location + [System.ComponentModel.TypeConverter(typeof(ExtendedLocationTypeConverter))] + public partial interface IExtendedLocation + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ExtendedLocation.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ExtendedLocation.TypeConverter.cs new file mode 100644 index 000000000000..702ef4b85089 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ExtendedLocation.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ExtendedLocationTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtendedLocation ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtendedLocation).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ExtendedLocation.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ExtendedLocation.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ExtendedLocation.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ExtendedLocation.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ExtendedLocation.cs new file mode 100644 index 000000000000..636b8ed385b3 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ExtendedLocation.cs @@ -0,0 +1,68 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Definition of an Extended Location + public partial class ExtendedLocation : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtendedLocation, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtendedLocationInternal + { + + /// Backing field for property. + private string _name; + + /// Fully qualified name of the extended location. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private string _type; + + /// Type of the extended location. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string Type { get => this._type; set => this._type = value; } + + /// Creates an new instance. + public ExtendedLocation() + { + + } + } + /// Definition of an Extended Location + public partial interface IExtendedLocation : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// Fully qualified name of the extended location. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Fully qualified name of the extended location.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + /// Type of the extended location. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of the extended location.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string Type { get; set; } + + } + /// Definition of an Extended Location + internal partial interface IExtendedLocationInternal + + { + /// Fully qualified name of the extended location. + string Name { get; set; } + /// Type of the extended location. + string Type { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ExtendedLocation.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ExtendedLocation.json.cs new file mode 100644 index 000000000000..26213b565ed4 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ExtendedLocation.json.cs @@ -0,0 +1,108 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Definition of an Extended Location + public partial class ExtendedLocation + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal ExtendedLocation(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtendedLocation. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtendedLocation. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtendedLocation FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new ExtendedLocation(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ExtensionTopic.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ExtensionTopic.PowerShell.cs new file mode 100644 index 000000000000..25f265f486aa --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ExtensionTopic.PowerShell.cs @@ -0,0 +1,240 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// Event grid Extension Topic. This is used for getting Event Grid related metrics for Azure resources. + /// + [System.ComponentModel.TypeConverter(typeof(ExtensionTopicTypeConverter))] + public partial class ExtensionTopic + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtensionTopic DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ExtensionTopic(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtensionTopic DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ExtensionTopic(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ExtensionTopic(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtensionTopicInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtensionTopicProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtensionTopicInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ExtensionTopicPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtensionTopicInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtensionTopicInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtensionTopicInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtensionTopicInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtensionTopicInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtensionTopicInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtensionTopicInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtensionTopicInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("SystemTopic")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtensionTopicInternal)this).SystemTopic = (string) content.GetValueForProperty("SystemTopic",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtensionTopicInternal)this).SystemTopic, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtensionTopicInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtensionTopicInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtensionTopicInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtensionTopicInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtensionTopicInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtensionTopicInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtensionTopicInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtensionTopicInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ExtensionTopic(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtensionTopicInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtensionTopicProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtensionTopicInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ExtensionTopicPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtensionTopicInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtensionTopicInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtensionTopicInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtensionTopicInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtensionTopicInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtensionTopicInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtensionTopicInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtensionTopicInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("SystemTopic")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtensionTopicInternal)this).SystemTopic = (string) content.GetValueForProperty("SystemTopic",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtensionTopicInternal)this).SystemTopic, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtensionTopicInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtensionTopicInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtensionTopicInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtensionTopicInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtensionTopicInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtensionTopicInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtensionTopicInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtensionTopicInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtensionTopic FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Event grid Extension Topic. This is used for getting Event Grid related metrics for Azure resources. + [System.ComponentModel.TypeConverter(typeof(ExtensionTopicTypeConverter))] + public partial interface IExtensionTopic + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ExtensionTopic.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ExtensionTopic.TypeConverter.cs new file mode 100644 index 000000000000..7b3a90555aab --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ExtensionTopic.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ExtensionTopicTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtensionTopic ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtensionTopic).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ExtensionTopic.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ExtensionTopic.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ExtensionTopic.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ExtensionTopic.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ExtensionTopic.cs new file mode 100644 index 000000000000..278ed7345cb2 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ExtensionTopic.cs @@ -0,0 +1,212 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// + /// Event grid Extension Topic. This is used for getting Event Grid related metrics for Azure resources. + /// + public partial class ExtensionTopic : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtensionTopic, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtensionTopicInternal, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.Resource(); + + /// Description of the extension topic. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtensionTopicPropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtensionTopicPropertiesInternal)Property).Description = value ?? null; } + + /// Fully qualified identifier of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Id; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtensionTopicProperties Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtensionTopicInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ExtensionTopicProperties()); set { {_property = value;} } } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtensionTopicInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.SystemData()); set { {_systemData = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Type = value; } + + /// Name of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtensionTopicProperties _property; + + /// Properties of the extension topic + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtensionTopicProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ExtensionTopicProperties()); set => this._property = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData _systemData; + + /// The system metadata relating to Extension Topic resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.SystemData()); } + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).CreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType)""); } + + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType)""); } + + /// System topic resource id which is mapped to the source. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string SystemTopic { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtensionTopicPropertiesInternal)Property).SystemTopic; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtensionTopicPropertiesInternal)Property).SystemTopic = value ?? null; } + + /// Type of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public ExtensionTopic() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// Event grid Extension Topic. This is used for getting Event Grid related metrics for Azure resources. + public partial interface IExtensionTopic : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResource + { + /// Description of the extension topic. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Description of the extension topic.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timestamp of resource creation (UTC).", + SerializedName = @"createdAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SystemDataCreatedAt { get; set; } + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identity that created the resource.", + SerializedName = @"createdBy", + PossibleTypes = new [] { typeof(string) })] + string SystemDataCreatedBy { get; set; } + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of identity that created the resource.", + SerializedName = @"createdByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType? SystemDataCreatedByType { get; set; } + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timestamp of resource last modification (UTC)", + SerializedName = @"lastModifiedAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SystemDataLastModifiedAt { get; set; } + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identity that last modified the resource.", + SerializedName = @"lastModifiedBy", + PossibleTypes = new [] { typeof(string) })] + string SystemDataLastModifiedBy { get; set; } + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of identity that last modified the resource.", + SerializedName = @"lastModifiedByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + /// System topic resource id which is mapped to the source. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"System topic resource id which is mapped to the source.", + SerializedName = @"systemTopic", + PossibleTypes = new [] { typeof(string) })] + string SystemTopic { get; set; } + + } + /// Event grid Extension Topic. This is used for getting Event Grid related metrics for Azure resources. + internal partial interface IExtensionTopicInternal : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal + { + /// Description of the extension topic. + string Description { get; set; } + /// Properties of the extension topic + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtensionTopicProperties Property { get; set; } + /// The system metadata relating to Extension Topic resource. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData SystemData { get; set; } + /// The timestamp of resource creation (UTC). + global::System.DateTime? SystemDataCreatedAt { get; set; } + /// The identity that created the resource. + string SystemDataCreatedBy { get; set; } + /// The type of identity that created the resource. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType? SystemDataCreatedByType { get; set; } + /// The timestamp of resource last modification (UTC) + global::System.DateTime? SystemDataLastModifiedAt { get; set; } + /// The identity that last modified the resource. + string SystemDataLastModifiedBy { get; set; } + /// The type of identity that last modified the resource. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + /// System topic resource id which is mapped to the source. + string SystemTopic { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ExtensionTopic.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ExtensionTopic.json.cs new file mode 100644 index 000000000000..207fa868cbad --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ExtensionTopic.json.cs @@ -0,0 +1,115 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// + /// Event grid Extension Topic. This is used for getting Event Grid related metrics for Azure resources. + /// + public partial class ExtensionTopic + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal ExtensionTopic(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ExtensionTopicProperties.FromJson(__jsonProperties) : Property;} + {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.SystemData.FromJson(__jsonSystemData) : SystemData;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtensionTopic. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtensionTopic. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtensionTopic FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new ExtensionTopic(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._systemData ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._systemData.ToJson(null,serializationMode) : null, "systemData" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ExtensionTopicProperties.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ExtensionTopicProperties.PowerShell.cs new file mode 100644 index 000000000000..834f9f885186 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ExtensionTopicProperties.PowerShell.cs @@ -0,0 +1,152 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Properties of the Extension Topic + [System.ComponentModel.TypeConverter(typeof(ExtensionTopicPropertiesTypeConverter))] + public partial class ExtensionTopicProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtensionTopicProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ExtensionTopicProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtensionTopicProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ExtensionTopicProperties(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ExtensionTopicProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtensionTopicPropertiesInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtensionTopicPropertiesInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("SystemTopic")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtensionTopicPropertiesInternal)this).SystemTopic = (string) content.GetValueForProperty("SystemTopic",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtensionTopicPropertiesInternal)this).SystemTopic, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ExtensionTopicProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtensionTopicPropertiesInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtensionTopicPropertiesInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("SystemTopic")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtensionTopicPropertiesInternal)this).SystemTopic = (string) content.GetValueForProperty("SystemTopic",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtensionTopicPropertiesInternal)this).SystemTopic, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtensionTopicProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties of the Extension Topic + [System.ComponentModel.TypeConverter(typeof(ExtensionTopicPropertiesTypeConverter))] + public partial interface IExtensionTopicProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ExtensionTopicProperties.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ExtensionTopicProperties.TypeConverter.cs new file mode 100644 index 000000000000..28912ce5657c --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ExtensionTopicProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ExtensionTopicPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtensionTopicProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtensionTopicProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ExtensionTopicProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ExtensionTopicProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ExtensionTopicProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ExtensionTopicProperties.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ExtensionTopicProperties.cs new file mode 100644 index 000000000000..59ea464142eb --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ExtensionTopicProperties.cs @@ -0,0 +1,68 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Properties of the Extension Topic + public partial class ExtensionTopicProperties : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtensionTopicProperties, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtensionTopicPropertiesInternal + { + + /// Backing field for property. + private string _description; + + /// Description of the extension topic. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string Description { get => this._description; set => this._description = value; } + + /// Backing field for property. + private string _systemTopic; + + /// System topic resource id which is mapped to the source. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string SystemTopic { get => this._systemTopic; set => this._systemTopic = value; } + + /// Creates an new instance. + public ExtensionTopicProperties() + { + + } + } + /// Properties of the Extension Topic + public partial interface IExtensionTopicProperties : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// Description of the extension topic. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Description of the extension topic.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// System topic resource id which is mapped to the source. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"System topic resource id which is mapped to the source.", + SerializedName = @"systemTopic", + PossibleTypes = new [] { typeof(string) })] + string SystemTopic { get; set; } + + } + /// Properties of the Extension Topic + internal partial interface IExtensionTopicPropertiesInternal + + { + /// Description of the extension topic. + string Description { get; set; } + /// System topic resource id which is mapped to the source. + string SystemTopic { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ExtensionTopicProperties.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ExtensionTopicProperties.json.cs new file mode 100644 index 000000000000..a925bb713a36 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ExtensionTopicProperties.json.cs @@ -0,0 +1,108 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Properties of the Extension Topic + public partial class ExtensionTopicProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal ExtensionTopicProperties(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} + {_systemTopic = If( json?.PropertyT("systemTopic"), out var __jsonSystemTopic) ? (string)__jsonSystemTopic : (string)SystemTopic;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtensionTopicProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtensionTopicProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtensionTopicProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new ExtensionTopicProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._description.ToString()) : null, "description" ,container.Add ); + AddIf( null != (((object)this._systemTopic)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._systemTopic.ToString()) : null, "systemTopic" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/HybridConnectionEventSubscriptionDestination.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/HybridConnectionEventSubscriptionDestination.PowerShell.cs new file mode 100644 index 000000000000..755944fca555 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/HybridConnectionEventSubscriptionDestination.PowerShell.cs @@ -0,0 +1,169 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Information about the HybridConnection destination for an event subscription. + [System.ComponentModel.TypeConverter(typeof(HybridConnectionEventSubscriptionDestinationTypeConverter))] + public partial class HybridConnectionEventSubscriptionDestination + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IHybridConnectionEventSubscriptionDestination DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new HybridConnectionEventSubscriptionDestination(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IHybridConnectionEventSubscriptionDestination DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new HybridConnectionEventSubscriptionDestination(content); + } + + /// + /// Creates a new instance of , deserializing the content from + /// a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IHybridConnectionEventSubscriptionDestination FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal HybridConnectionEventSubscriptionDestination(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IHybridConnectionEventSubscriptionDestinationInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IHybridConnectionEventSubscriptionDestinationProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IHybridConnectionEventSubscriptionDestinationInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.HybridConnectionEventSubscriptionDestinationPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("EndpointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestinationInternal)this).EndpointType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType) content.GetValueForProperty("EndpointType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestinationInternal)this).EndpointType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType.CreateFrom); + } + if (content.Contains("ResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IHybridConnectionEventSubscriptionDestinationInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IHybridConnectionEventSubscriptionDestinationInternal)this).ResourceId, global::System.Convert.ToString); + } + if (content.Contains("DeliveryAttributeMapping")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IHybridConnectionEventSubscriptionDestinationInternal)this).DeliveryAttributeMapping = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping[]) content.GetValueForProperty("DeliveryAttributeMapping",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IHybridConnectionEventSubscriptionDestinationInternal)this).DeliveryAttributeMapping, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeliveryAttributeMappingTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal HybridConnectionEventSubscriptionDestination(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IHybridConnectionEventSubscriptionDestinationInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IHybridConnectionEventSubscriptionDestinationProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IHybridConnectionEventSubscriptionDestinationInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.HybridConnectionEventSubscriptionDestinationPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("EndpointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestinationInternal)this).EndpointType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType) content.GetValueForProperty("EndpointType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestinationInternal)this).EndpointType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType.CreateFrom); + } + if (content.Contains("ResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IHybridConnectionEventSubscriptionDestinationInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IHybridConnectionEventSubscriptionDestinationInternal)this).ResourceId, global::System.Convert.ToString); + } + if (content.Contains("DeliveryAttributeMapping")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IHybridConnectionEventSubscriptionDestinationInternal)this).DeliveryAttributeMapping = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping[]) content.GetValueForProperty("DeliveryAttributeMapping",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IHybridConnectionEventSubscriptionDestinationInternal)this).DeliveryAttributeMapping, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeliveryAttributeMappingTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Information about the HybridConnection destination for an event subscription. + [System.ComponentModel.TypeConverter(typeof(HybridConnectionEventSubscriptionDestinationTypeConverter))] + public partial interface IHybridConnectionEventSubscriptionDestination + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/HybridConnectionEventSubscriptionDestination.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/HybridConnectionEventSubscriptionDestination.TypeConverter.cs new file mode 100644 index 000000000000..951178050ee0 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/HybridConnectionEventSubscriptionDestination.TypeConverter.cs @@ -0,0 +1,150 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class HybridConnectionEventSubscriptionDestinationTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, + /// otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IHybridConnectionEventSubscriptionDestination ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IHybridConnectionEventSubscriptionDestination).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return HybridConnectionEventSubscriptionDestination.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return HybridConnectionEventSubscriptionDestination.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return HybridConnectionEventSubscriptionDestination.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/HybridConnectionEventSubscriptionDestination.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/HybridConnectionEventSubscriptionDestination.cs new file mode 100644 index 000000000000..95d460dbf62b --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/HybridConnectionEventSubscriptionDestination.cs @@ -0,0 +1,105 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Information about the HybridConnection destination for an event subscription. + public partial class HybridConnectionEventSubscriptionDestination : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IHybridConnectionEventSubscriptionDestination, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IHybridConnectionEventSubscriptionDestinationInternal, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestination __eventSubscriptionDestination = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionDestination(); + + /// Delivery attribute details. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping[] DeliveryAttributeMapping { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IHybridConnectionEventSubscriptionDestinationPropertiesInternal)Property).DeliveryAttributeMapping; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IHybridConnectionEventSubscriptionDestinationPropertiesInternal)Property).DeliveryAttributeMapping = value ?? null /* arrayOf */; } + + /// Type of the endpoint for the event subscription destination. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType EndpointType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestinationInternal)__eventSubscriptionDestination).EndpointType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestinationInternal)__eventSubscriptionDestination).EndpointType = value ; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IHybridConnectionEventSubscriptionDestinationProperties Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IHybridConnectionEventSubscriptionDestinationInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.HybridConnectionEventSubscriptionDestinationProperties()); set { {_property = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IHybridConnectionEventSubscriptionDestinationProperties _property; + + /// Hybrid connection Properties of the event subscription destination. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IHybridConnectionEventSubscriptionDestinationProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.HybridConnectionEventSubscriptionDestinationProperties()); set => this._property = value; } + + /// + /// The Azure Resource ID of an hybrid connection that is the destination of an event subscription. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string ResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IHybridConnectionEventSubscriptionDestinationPropertiesInternal)Property).ResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IHybridConnectionEventSubscriptionDestinationPropertiesInternal)Property).ResourceId = value ?? null; } + + /// + /// Creates an new instance. + /// + public HybridConnectionEventSubscriptionDestination() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__eventSubscriptionDestination), __eventSubscriptionDestination); + await eventListener.AssertObjectIsValid(nameof(__eventSubscriptionDestination), __eventSubscriptionDestination); + } + } + /// Information about the HybridConnection destination for an event subscription. + public partial interface IHybridConnectionEventSubscriptionDestination : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestination + { + /// Delivery attribute details. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Delivery attribute details.", + SerializedName = @"deliveryAttributeMappings", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping),typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStaticDeliveryAttributeMapping),typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDynamicDeliveryAttributeMapping) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping[] DeliveryAttributeMapping { get; set; } + /// + /// The Azure Resource ID of an hybrid connection that is the destination of an event subscription. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Azure Resource ID of an hybrid connection that is the destination of an event subscription.", + SerializedName = @"resourceId", + PossibleTypes = new [] { typeof(string) })] + string ResourceId { get; set; } + + } + /// Information about the HybridConnection destination for an event subscription. + internal partial interface IHybridConnectionEventSubscriptionDestinationInternal : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestinationInternal + { + /// Delivery attribute details. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping[] DeliveryAttributeMapping { get; set; } + /// Hybrid connection Properties of the event subscription destination. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IHybridConnectionEventSubscriptionDestinationProperties Property { get; set; } + /// + /// The Azure Resource ID of an hybrid connection that is the destination of an event subscription. + /// + string ResourceId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/HybridConnectionEventSubscriptionDestination.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/HybridConnectionEventSubscriptionDestination.json.cs new file mode 100644 index 000000000000..37c8ac1aa19b --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/HybridConnectionEventSubscriptionDestination.json.cs @@ -0,0 +1,111 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Information about the HybridConnection destination for an event subscription. + public partial class HybridConnectionEventSubscriptionDestination + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IHybridConnectionEventSubscriptionDestination. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IHybridConnectionEventSubscriptionDestination. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IHybridConnectionEventSubscriptionDestination FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new HybridConnectionEventSubscriptionDestination(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal HybridConnectionEventSubscriptionDestination(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __eventSubscriptionDestination = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionDestination(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.HybridConnectionEventSubscriptionDestinationProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __eventSubscriptionDestination?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/HybridConnectionEventSubscriptionDestinationProperties.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/HybridConnectionEventSubscriptionDestinationProperties.PowerShell.cs new file mode 100644 index 000000000000..575be13e6210 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/HybridConnectionEventSubscriptionDestinationProperties.PowerShell.cs @@ -0,0 +1,153 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// The properties for a hybrid connection destination. + [System.ComponentModel.TypeConverter(typeof(HybridConnectionEventSubscriptionDestinationPropertiesTypeConverter))] + public partial class HybridConnectionEventSubscriptionDestinationProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IHybridConnectionEventSubscriptionDestinationProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new HybridConnectionEventSubscriptionDestinationProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IHybridConnectionEventSubscriptionDestinationProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new HybridConnectionEventSubscriptionDestinationProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content + /// from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IHybridConnectionEventSubscriptionDestinationProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal HybridConnectionEventSubscriptionDestinationProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IHybridConnectionEventSubscriptionDestinationPropertiesInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IHybridConnectionEventSubscriptionDestinationPropertiesInternal)this).ResourceId, global::System.Convert.ToString); + } + if (content.Contains("DeliveryAttributeMapping")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IHybridConnectionEventSubscriptionDestinationPropertiesInternal)this).DeliveryAttributeMapping = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping[]) content.GetValueForProperty("DeliveryAttributeMapping",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IHybridConnectionEventSubscriptionDestinationPropertiesInternal)this).DeliveryAttributeMapping, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeliveryAttributeMappingTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal HybridConnectionEventSubscriptionDestinationProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IHybridConnectionEventSubscriptionDestinationPropertiesInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IHybridConnectionEventSubscriptionDestinationPropertiesInternal)this).ResourceId, global::System.Convert.ToString); + } + if (content.Contains("DeliveryAttributeMapping")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IHybridConnectionEventSubscriptionDestinationPropertiesInternal)this).DeliveryAttributeMapping = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping[]) content.GetValueForProperty("DeliveryAttributeMapping",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IHybridConnectionEventSubscriptionDestinationPropertiesInternal)this).DeliveryAttributeMapping, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeliveryAttributeMappingTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The properties for a hybrid connection destination. + [System.ComponentModel.TypeConverter(typeof(HybridConnectionEventSubscriptionDestinationPropertiesTypeConverter))] + public partial interface IHybridConnectionEventSubscriptionDestinationProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/HybridConnectionEventSubscriptionDestinationProperties.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/HybridConnectionEventSubscriptionDestinationProperties.TypeConverter.cs new file mode 100644 index 000000000000..079481fa8cbd --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/HybridConnectionEventSubscriptionDestinationProperties.TypeConverter.cs @@ -0,0 +1,152 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class HybridConnectionEventSubscriptionDestinationPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IHybridConnectionEventSubscriptionDestinationProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IHybridConnectionEventSubscriptionDestinationProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return HybridConnectionEventSubscriptionDestinationProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return HybridConnectionEventSubscriptionDestinationProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return HybridConnectionEventSubscriptionDestinationProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/HybridConnectionEventSubscriptionDestinationProperties.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/HybridConnectionEventSubscriptionDestinationProperties.cs new file mode 100644 index 000000000000..186f058f5bf6 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/HybridConnectionEventSubscriptionDestinationProperties.cs @@ -0,0 +1,76 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// The properties for a hybrid connection destination. + public partial class HybridConnectionEventSubscriptionDestinationProperties : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IHybridConnectionEventSubscriptionDestinationProperties, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IHybridConnectionEventSubscriptionDestinationPropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping[] _deliveryAttributeMapping; + + /// Delivery attribute details. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping[] DeliveryAttributeMapping { get => this._deliveryAttributeMapping; set => this._deliveryAttributeMapping = value; } + + /// Backing field for property. + private string _resourceId; + + /// + /// The Azure Resource ID of an hybrid connection that is the destination of an event subscription. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string ResourceId { get => this._resourceId; set => this._resourceId = value; } + + /// + /// Creates an new instance. + /// + public HybridConnectionEventSubscriptionDestinationProperties() + { + + } + } + /// The properties for a hybrid connection destination. + public partial interface IHybridConnectionEventSubscriptionDestinationProperties : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// Delivery attribute details. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Delivery attribute details.", + SerializedName = @"deliveryAttributeMappings", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping),typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStaticDeliveryAttributeMapping),typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDynamicDeliveryAttributeMapping) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping[] DeliveryAttributeMapping { get; set; } + /// + /// The Azure Resource ID of an hybrid connection that is the destination of an event subscription. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Azure Resource ID of an hybrid connection that is the destination of an event subscription.", + SerializedName = @"resourceId", + PossibleTypes = new [] { typeof(string) })] + string ResourceId { get; set; } + + } + /// The properties for a hybrid connection destination. + internal partial interface IHybridConnectionEventSubscriptionDestinationPropertiesInternal + + { + /// Delivery attribute details. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping[] DeliveryAttributeMapping { get; set; } + /// + /// The Azure Resource ID of an hybrid connection that is the destination of an event subscription. + /// + string ResourceId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/HybridConnectionEventSubscriptionDestinationProperties.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/HybridConnectionEventSubscriptionDestinationProperties.json.cs new file mode 100644 index 000000000000..dd73cee565c1 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/HybridConnectionEventSubscriptionDestinationProperties.json.cs @@ -0,0 +1,119 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// The properties for a hybrid connection destination. + public partial class HybridConnectionEventSubscriptionDestinationProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IHybridConnectionEventSubscriptionDestinationProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IHybridConnectionEventSubscriptionDestinationProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IHybridConnectionEventSubscriptionDestinationProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new HybridConnectionEventSubscriptionDestinationProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal HybridConnectionEventSubscriptionDestinationProperties(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_resourceId = If( json?.PropertyT("resourceId"), out var __jsonResourceId) ? (string)__jsonResourceId : (string)ResourceId;} + {_deliveryAttributeMapping = If( json?.PropertyT("deliveryAttributeMappings"), out var __jsonDeliveryAttributeMappings) ? If( __jsonDeliveryAttributeMappings as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping) (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeliveryAttributeMapping.FromJson(__u) )) ))() : null : DeliveryAttributeMapping;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._resourceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._resourceId.ToString()) : null, "resourceId" ,container.Add ); + if (null != this._deliveryAttributeMapping) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.XNodeArray(); + foreach( var __x in this._deliveryAttributeMapping ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("deliveryAttributeMappings",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/IdentityInfo.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/IdentityInfo.PowerShell.cs new file mode 100644 index 000000000000..88099364de09 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/IdentityInfo.PowerShell.cs @@ -0,0 +1,166 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// The identity information for the resource. + [System.ComponentModel.TypeConverter(typeof(IdentityInfoTypeConverter))] + public partial class IdentityInfo + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new IdentityInfo(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new IdentityInfo(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal IdentityInfo(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType?) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType.CreateFrom); + } + if (content.Contains("PrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoInternal)this).PrincipalId, global::System.Convert.ToString); + } + if (content.Contains("TenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoInternal)this).TenantId, global::System.Convert.ToString); + } + if (content.Contains("UserAssignedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoInternal)this).UserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities) content.GetValueForProperty("UserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoInternal)this).UserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IdentityInfoUserAssignedIdentitiesTypeConverter.ConvertFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal IdentityInfo(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType?) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType.CreateFrom); + } + if (content.Contains("PrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoInternal)this).PrincipalId, global::System.Convert.ToString); + } + if (content.Contains("TenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoInternal)this).TenantId, global::System.Convert.ToString); + } + if (content.Contains("UserAssignedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoInternal)this).UserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities) content.GetValueForProperty("UserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoInternal)this).UserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IdentityInfoUserAssignedIdentitiesTypeConverter.ConvertFrom); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The identity information for the resource. + [System.ComponentModel.TypeConverter(typeof(IdentityInfoTypeConverter))] + public partial interface IIdentityInfo + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/IdentityInfo.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/IdentityInfo.TypeConverter.cs new file mode 100644 index 000000000000..9fc6e29de216 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/IdentityInfo.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class IdentityInfoTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfo ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfo).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return IdentityInfo.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return IdentityInfo.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return IdentityInfo.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/IdentityInfo.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/IdentityInfo.cs new file mode 100644 index 000000000000..6758c073a492 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/IdentityInfo.cs @@ -0,0 +1,128 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// The identity information for the resource. + public partial class IdentityInfo : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfo, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoInternal + { + + /// Backing field for property. + private string _principalId; + + /// The principal ID of resource identity. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string PrincipalId { get => this._principalId; set => this._principalId = value; } + + /// Backing field for property. + private string _tenantId; + + /// The tenant ID of resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string TenantId { get => this._tenantId; set => this._tenantId = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType? _type; + + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType? Type { get => this._type; set => this._type = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities _userAssignedIdentity; + + /// + /// The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource + /// ids in the form: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + /// This property is currently not used and reserved for future usage. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities UserAssignedIdentity { get => (this._userAssignedIdentity = this._userAssignedIdentity ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IdentityInfoUserAssignedIdentities()); set => this._userAssignedIdentity = value; } + + /// Creates an new instance. + public IdentityInfo() + { + + } + } + /// The identity information for the resource. + public partial interface IIdentityInfo : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// The principal ID of resource identity. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The principal ID of resource identity.", + SerializedName = @"principalId", + PossibleTypes = new [] { typeof(string) })] + string PrincipalId { get; set; } + /// The tenant ID of resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The tenant ID of resource.", + SerializedName = @"tenantId", + PossibleTypes = new [] { typeof(string) })] + string TenantId { get; set; } + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType? Type { get; set; } + /// + /// The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource + /// ids in the form: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + /// This property is currently not used and reserved for future usage. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + This property is currently not used and reserved for future usage.", + SerializedName = @"userAssignedIdentities", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities UserAssignedIdentity { get; set; } + + } + /// The identity information for the resource. + internal partial interface IIdentityInfoInternal + + { + /// The principal ID of resource identity. + string PrincipalId { get; set; } + /// The tenant ID of resource. + string TenantId { get; set; } + /// + /// 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. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType? Type { get; set; } + /// + /// The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource + /// ids in the form: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + /// This property is currently not used and reserved for future usage. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities UserAssignedIdentity { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/IdentityInfo.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/IdentityInfo.json.cs new file mode 100644 index 000000000000..79d57291aa49 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/IdentityInfo.json.cs @@ -0,0 +1,112 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// The identity information for the resource. + public partial class IdentityInfo + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new IdentityInfo(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal IdentityInfo(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)PrincipalId;} + {_tenantId = If( json?.PropertyT("tenantId"), out var __jsonTenantId) ? (string)__jsonTenantId : (string)TenantId;} + {_userAssignedIdentity = If( json?.PropertyT("userAssignedIdentities"), out var __jsonUserAssignedIdentities) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IdentityInfoUserAssignedIdentities.FromJson(__jsonUserAssignedIdentities) : UserAssignedIdentity;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + AddIf( null != (((object)this._principalId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._principalId.ToString()) : null, "principalId" ,container.Add ); + AddIf( null != (((object)this._tenantId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._tenantId.ToString()) : null, "tenantId" ,container.Add ); + AddIf( null != this._userAssignedIdentity ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._userAssignedIdentity.ToJson(null,serializationMode) : null, "userAssignedIdentities" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/IdentityInfoUserAssignedIdentities.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/IdentityInfoUserAssignedIdentities.PowerShell.cs new file mode 100644 index 000000000000..23592043d64e --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/IdentityInfoUserAssignedIdentities.PowerShell.cs @@ -0,0 +1,148 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource + /// ids in the form: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + /// This property is currently not used and reserved for future usage. + /// + [System.ComponentModel.TypeConverter(typeof(IdentityInfoUserAssignedIdentitiesTypeConverter))] + public partial class IdentityInfoUserAssignedIdentities + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new IdentityInfoUserAssignedIdentities(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new IdentityInfoUserAssignedIdentities(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal IdentityInfoUserAssignedIdentities(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal IdentityInfoUserAssignedIdentities(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource + /// ids in the form: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + /// This property is currently not used and reserved for future usage. + [System.ComponentModel.TypeConverter(typeof(IdentityInfoUserAssignedIdentitiesTypeConverter))] + public partial interface IIdentityInfoUserAssignedIdentities + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/IdentityInfoUserAssignedIdentities.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/IdentityInfoUserAssignedIdentities.TypeConverter.cs new file mode 100644 index 000000000000..d921327d56f9 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/IdentityInfoUserAssignedIdentities.TypeConverter.cs @@ -0,0 +1,148 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class IdentityInfoUserAssignedIdentitiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return IdentityInfoUserAssignedIdentities.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return IdentityInfoUserAssignedIdentities.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return IdentityInfoUserAssignedIdentities.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/IdentityInfoUserAssignedIdentities.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/IdentityInfoUserAssignedIdentities.cs new file mode 100644 index 000000000000..b4a731fe0aa6 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/IdentityInfoUserAssignedIdentities.cs @@ -0,0 +1,46 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// + /// The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource + /// ids in the form: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + /// This property is currently not used and reserved for future usage. + /// + public partial class IdentityInfoUserAssignedIdentities : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentitiesInternal + { + + /// Creates an new instance. + public IdentityInfoUserAssignedIdentities() + { + + } + } + /// The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource + /// ids in the form: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + /// This property is currently not used and reserved for future usage. + public partial interface IIdentityInfoUserAssignedIdentities : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray + { + + } + /// The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource + /// ids in the form: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + /// This property is currently not used and reserved for future usage. + internal partial interface IIdentityInfoUserAssignedIdentitiesInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/IdentityInfoUserAssignedIdentities.dictionary.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/IdentityInfoUserAssignedIdentities.dictionary.cs new file mode 100644 index 000000000000..6f23303acc4a --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/IdentityInfoUserAssignedIdentities.dictionary.cs @@ -0,0 +1,75 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + public partial class IdentityInfoUserAssignedIdentities : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IUserIdentityProperties this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IUserIdentityProperties value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IUserIdentityProperties value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IdentityInfoUserAssignedIdentities source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/IdentityInfoUserAssignedIdentities.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/IdentityInfoUserAssignedIdentities.json.cs new file mode 100644 index 000000000000..22d252c731c5 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/IdentityInfoUserAssignedIdentities.json.cs @@ -0,0 +1,113 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// + /// The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource + /// ids in the form: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + /// This property is currently not used and reserved for future usage. + /// + public partial class IdentityInfoUserAssignedIdentities + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new IdentityInfoUserAssignedIdentities(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + /// + internal IdentityInfoUserAssignedIdentities(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray)this).AdditionalProperties, (j) => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.UserIdentityProperties.FromJson(j) ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/InboundIPRule.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/InboundIPRule.PowerShell.cs new file mode 100644 index 000000000000..46c6129b37db --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/InboundIPRule.PowerShell.cs @@ -0,0 +1,148 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(InboundIPRuleTypeConverter))] + public partial class InboundIPRule + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new InboundIPRule(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new InboundIPRule(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal InboundIPRule(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("IPMask")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRuleInternal)this).IPMask = (string) content.GetValueForProperty("IPMask",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRuleInternal)this).IPMask, global::System.Convert.ToString); + } + if (content.Contains("Action")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRuleInternal)this).Action = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IPActionType?) content.GetValueForProperty("Action",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRuleInternal)this).Action, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IPActionType.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal InboundIPRule(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("IPMask")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRuleInternal)this).IPMask = (string) content.GetValueForProperty("IPMask",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRuleInternal)this).IPMask, global::System.Convert.ToString); + } + if (content.Contains("Action")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRuleInternal)this).Action = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IPActionType?) content.GetValueForProperty("Action",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRuleInternal)this).Action, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IPActionType.CreateFrom); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(InboundIPRuleTypeConverter))] + public partial interface IInboundIPRule + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/InboundIPRule.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/InboundIPRule.TypeConverter.cs new file mode 100644 index 000000000000..a3bf233febbd --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/InboundIPRule.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class InboundIPRuleTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return InboundIPRule.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return InboundIPRule.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return InboundIPRule.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/InboundIPRule.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/InboundIPRule.cs new file mode 100644 index 000000000000..5a5485c5dff7 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/InboundIPRule.cs @@ -0,0 +1,65 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + public partial class InboundIPRule : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRuleInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IPActionType? _action; + + /// Action to perform based on the match or no match of the IpMask. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IPActionType? Action { get => this._action; set => this._action = value; } + + /// Backing field for property. + private string _iPMask; + + /// IP Address in CIDR notation e.g., 10.0.0.0/8. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string IPMask { get => this._iPMask; set => this._iPMask = value; } + + /// Creates an new instance. + public InboundIPRule() + { + + } + } + public partial interface IInboundIPRule : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// Action to perform based on the match or no match of the IpMask. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Action to perform based on the match or no match of the IpMask.", + SerializedName = @"action", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IPActionType) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IPActionType? Action { get; set; } + /// IP Address in CIDR notation e.g., 10.0.0.0/8. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"IP Address in CIDR notation e.g., 10.0.0.0/8.", + SerializedName = @"ipMask", + PossibleTypes = new [] { typeof(string) })] + string IPMask { get; set; } + + } + internal partial interface IInboundIPRuleInternal + + { + /// Action to perform based on the match or no match of the IpMask. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IPActionType? Action { get; set; } + /// IP Address in CIDR notation e.g., 10.0.0.0/8. + string IPMask { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/InboundIPRule.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/InboundIPRule.json.cs new file mode 100644 index 000000000000..40bff934b897 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/InboundIPRule.json.cs @@ -0,0 +1,107 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + public partial class InboundIPRule + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new InboundIPRule(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal InboundIPRule(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_iPMask = If( json?.PropertyT("ipMask"), out var __jsonIPMask) ? (string)__jsonIPMask : (string)IPMask;} + {_action = If( json?.PropertyT("action"), out var __jsonAction) ? (string)__jsonAction : (string)Action;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._iPMask)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._iPMask.ToString()) : null, "ipMask" ,container.Add ); + AddIf( null != (((object)this._action)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._action.ToString()) : null, "action" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/InlineEventProperties.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/InlineEventProperties.PowerShell.cs new file mode 100644 index 000000000000..b069951fa480 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/InlineEventProperties.PowerShell.cs @@ -0,0 +1,160 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Additional information about every inline event. + [System.ComponentModel.TypeConverter(typeof(InlineEventPropertiesTypeConverter))] + public partial class InlineEventProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInlineEventProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new InlineEventProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInlineEventProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new InlineEventProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInlineEventProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal InlineEventProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInlineEventPropertiesInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInlineEventPropertiesInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("DocumentationUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInlineEventPropertiesInternal)this).DocumentationUrl = (string) content.GetValueForProperty("DocumentationUrl",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInlineEventPropertiesInternal)this).DocumentationUrl, global::System.Convert.ToString); + } + if (content.Contains("DataSchemaUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInlineEventPropertiesInternal)this).DataSchemaUrl = (string) content.GetValueForProperty("DataSchemaUrl",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInlineEventPropertiesInternal)this).DataSchemaUrl, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal InlineEventProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInlineEventPropertiesInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInlineEventPropertiesInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("DocumentationUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInlineEventPropertiesInternal)this).DocumentationUrl = (string) content.GetValueForProperty("DocumentationUrl",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInlineEventPropertiesInternal)this).DocumentationUrl, global::System.Convert.ToString); + } + if (content.Contains("DataSchemaUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInlineEventPropertiesInternal)this).DataSchemaUrl = (string) content.GetValueForProperty("DataSchemaUrl",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInlineEventPropertiesInternal)this).DataSchemaUrl, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Additional information about every inline event. + [System.ComponentModel.TypeConverter(typeof(InlineEventPropertiesTypeConverter))] + public partial interface IInlineEventProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/InlineEventProperties.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/InlineEventProperties.TypeConverter.cs new file mode 100644 index 000000000000..15bd24c08cf6 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/InlineEventProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class InlineEventPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInlineEventProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInlineEventProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return InlineEventProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return InlineEventProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return InlineEventProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/InlineEventProperties.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/InlineEventProperties.cs new file mode 100644 index 000000000000..67783f4af0d8 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/InlineEventProperties.cs @@ -0,0 +1,85 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Additional information about every inline event. + public partial class InlineEventProperties : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInlineEventProperties, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInlineEventPropertiesInternal + { + + /// Backing field for property. + private string _dataSchemaUrl; + + /// The dataSchemaUrl for the inline event. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string DataSchemaUrl { get => this._dataSchemaUrl; set => this._dataSchemaUrl = value; } + + /// Backing field for property. + private string _description; + + /// The description for the inline event. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string Description { get => this._description; set => this._description = value; } + + /// Backing field for property. + private string _documentationUrl; + + /// The documentationUrl for the inline event. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string DocumentationUrl { get => this._documentationUrl; set => this._documentationUrl = value; } + + /// Creates an new instance. + public InlineEventProperties() + { + + } + } + /// Additional information about every inline event. + public partial interface IInlineEventProperties : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// The dataSchemaUrl for the inline event. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The dataSchemaUrl for the inline event.", + SerializedName = @"dataSchemaUrl", + PossibleTypes = new [] { typeof(string) })] + string DataSchemaUrl { get; set; } + /// The description for the inline event. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The description for the inline event.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// The documentationUrl for the inline event. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The documentationUrl for the inline event.", + SerializedName = @"documentationUrl", + PossibleTypes = new [] { typeof(string) })] + string DocumentationUrl { get; set; } + + } + /// Additional information about every inline event. + internal partial interface IInlineEventPropertiesInternal + + { + /// The dataSchemaUrl for the inline event. + string DataSchemaUrl { get; set; } + /// The description for the inline event. + string Description { get; set; } + /// The documentationUrl for the inline event. + string DocumentationUrl { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/InlineEventProperties.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/InlineEventProperties.json.cs new file mode 100644 index 000000000000..ae0d9943b42c --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/InlineEventProperties.json.cs @@ -0,0 +1,110 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Additional information about every inline event. + public partial class InlineEventProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInlineEventProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInlineEventProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInlineEventProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new InlineEventProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal InlineEventProperties(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} + {_documentationUrl = If( json?.PropertyT("documentationUrl"), out var __jsonDocumentationUrl) ? (string)__jsonDocumentationUrl : (string)DocumentationUrl;} + {_dataSchemaUrl = If( json?.PropertyT("dataSchemaUrl"), out var __jsonDataSchemaUrl) ? (string)__jsonDataSchemaUrl : (string)DataSchemaUrl;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._description.ToString()) : null, "description" ,container.Add ); + AddIf( null != (((object)this._documentationUrl)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._documentationUrl.ToString()) : null, "documentationUrl" ,container.Add ); + AddIf( null != (((object)this._dataSchemaUrl)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._dataSchemaUrl.ToString()) : null, "dataSchemaUrl" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/InputSchemaMapping.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/InputSchemaMapping.PowerShell.cs new file mode 100644 index 000000000000..3cc9cd808b37 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/InputSchemaMapping.PowerShell.cs @@ -0,0 +1,148 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// By default, Event Grid expects events to be in the Event Grid event schema. Specifying an input schema mapping enables + /// publishing to Event Grid using a custom input schema. Currently, the only supported type of InputSchemaMapping is 'JsonInputSchemaMapping'. + /// + [System.ComponentModel.TypeConverter(typeof(InputSchemaMappingTypeConverter))] + public partial class InputSchemaMapping + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInputSchemaMapping DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new InputSchemaMapping(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInputSchemaMapping DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new InputSchemaMapping(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInputSchemaMapping FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal InputSchemaMapping(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInputSchemaMappingInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInputSchemaMappingInternal)this).Type, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal InputSchemaMapping(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInputSchemaMappingInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInputSchemaMappingInternal)this).Type, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// By default, Event Grid expects events to be in the Event Grid event schema. Specifying an input schema mapping enables + /// publishing to Event Grid using a custom input schema. Currently, the only supported type of InputSchemaMapping is 'JsonInputSchemaMapping'. + [System.ComponentModel.TypeConverter(typeof(InputSchemaMappingTypeConverter))] + public partial interface IInputSchemaMapping + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/InputSchemaMapping.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/InputSchemaMapping.TypeConverter.cs new file mode 100644 index 000000000000..1f2fdec8ce05 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/InputSchemaMapping.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class InputSchemaMappingTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInputSchemaMapping ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInputSchemaMapping).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return InputSchemaMapping.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return InputSchemaMapping.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return InputSchemaMapping.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/InputSchemaMapping.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/InputSchemaMapping.cs new file mode 100644 index 000000000000..296ad92ab6d2 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/InputSchemaMapping.cs @@ -0,0 +1,59 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// + /// By default, Event Grid expects events to be in the Event Grid event schema. Specifying an input schema mapping enables + /// publishing to Event Grid using a custom input schema. Currently, the only supported type of InputSchemaMapping is 'JsonInputSchemaMapping'. + /// + public partial class InputSchemaMapping : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInputSchemaMapping, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInputSchemaMappingInternal + { + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInputSchemaMappingInternal.Type { get => this._type; set { {_type = value;} } } + + /// Backing field for property. + private string _type= @"Json"; + + /// Type of the custom mapping + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string Type { get => this._type; } + + /// Creates an new instance. + public InputSchemaMapping() + { + + } + } + /// By default, Event Grid expects events to be in the Event Grid event schema. Specifying an input schema mapping enables + /// publishing to Event Grid using a custom input schema. Currently, the only supported type of InputSchemaMapping is 'JsonInputSchemaMapping'. + public partial interface IInputSchemaMapping : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// Type of the custom mapping + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = true, + Description = @"Type of the custom mapping", + SerializedName = @"inputSchemaMappingType", + PossibleTypes = new [] { typeof(string) })] + string Type { get; } + + } + /// By default, Event Grid expects events to be in the Event Grid event schema. Specifying an input schema mapping enables + /// publishing to Event Grid using a custom input schema. Currently, the only supported type of InputSchemaMapping is 'JsonInputSchemaMapping'. + internal partial interface IInputSchemaMappingInternal + + { + /// Type of the custom mapping + string Type { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/InputSchemaMapping.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/InputSchemaMapping.json.cs new file mode 100644 index 000000000000..7b4c39dadf6f --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/InputSchemaMapping.json.cs @@ -0,0 +1,124 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// + /// By default, Event Grid expects events to be in the Event Grid event schema. Specifying an input schema mapping enables + /// publishing to Event Grid using a custom input schema. Currently, the only supported type of InputSchemaMapping is 'JsonInputSchemaMapping'. + /// + public partial class InputSchemaMapping + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInputSchemaMapping. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInputSchemaMapping interface is polymorphic, + /// and the precise model class that will get deserialized is determined at runtime based on the payload. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInputSchemaMapping. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInputSchemaMapping FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + if (!(node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json)) + { + return null; + } + // Polymorphic type -- select the appropriate constructor using the discriminator + + switch ( json.StringProperty("inputSchemaMappingType") ) + { + case "Json": + { + return new JsonInputSchemaMapping(json); + } + } + return new InputSchemaMapping(json); + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal InputSchemaMapping(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_type = If( json?.PropertyT("inputSchemaMappingType"), out var __jsonInputSchemaMappingType) ? (string)__jsonInputSchemaMappingType : (string)Type;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._type.ToString()) : null, "inputSchemaMappingType" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/IsNotNullAdvancedFilter.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/IsNotNullAdvancedFilter.PowerShell.cs new file mode 100644 index 000000000000..dc4875c8b901 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/IsNotNullAdvancedFilter.PowerShell.cs @@ -0,0 +1,152 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// IsNotNull Advanced Filter. + [System.ComponentModel.TypeConverter(typeof(IsNotNullAdvancedFilterTypeConverter))] + public partial class IsNotNullAdvancedFilter + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIsNotNullAdvancedFilter DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new IsNotNullAdvancedFilter(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIsNotNullAdvancedFilter DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new IsNotNullAdvancedFilter(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIsNotNullAdvancedFilter FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal IsNotNullAdvancedFilter(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("OperatorType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).OperatorType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType) content.GetValueForProperty("OperatorType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).OperatorType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType.CreateFrom); + } + if (content.Contains("Key")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).Key = (string) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).Key, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal IsNotNullAdvancedFilter(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("OperatorType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).OperatorType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType) content.GetValueForProperty("OperatorType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).OperatorType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType.CreateFrom); + } + if (content.Contains("Key")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).Key = (string) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).Key, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// IsNotNull Advanced Filter. + [System.ComponentModel.TypeConverter(typeof(IsNotNullAdvancedFilterTypeConverter))] + public partial interface IIsNotNullAdvancedFilter + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/IsNotNullAdvancedFilter.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/IsNotNullAdvancedFilter.TypeConverter.cs new file mode 100644 index 000000000000..7bbe3b4358ad --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/IsNotNullAdvancedFilter.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class IsNotNullAdvancedFilterTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIsNotNullAdvancedFilter ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIsNotNullAdvancedFilter).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return IsNotNullAdvancedFilter.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return IsNotNullAdvancedFilter.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return IsNotNullAdvancedFilter.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/IsNotNullAdvancedFilter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/IsNotNullAdvancedFilter.cs new file mode 100644 index 000000000000..5c00302a4e86 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/IsNotNullAdvancedFilter.cs @@ -0,0 +1,63 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// IsNotNull Advanced Filter. + public partial class IsNotNullAdvancedFilter : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIsNotNullAdvancedFilter, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIsNotNullAdvancedFilterInternal, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter __advancedFilter = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.AdvancedFilter(); + + /// The field/property in the event based on which you want to filter. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public string Key { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)__advancedFilter).Key; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)__advancedFilter).Key = value ?? null; } + + /// + /// The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType OperatorType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)__advancedFilter).OperatorType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)__advancedFilter).OperatorType = value ; } + + /// Creates an new instance. + public IsNotNullAdvancedFilter() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__advancedFilter), __advancedFilter); + await eventListener.AssertObjectIsValid(nameof(__advancedFilter), __advancedFilter); + } + } + /// IsNotNull Advanced Filter. + public partial interface IIsNotNullAdvancedFilter : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter + { + + } + /// IsNotNull Advanced Filter. + internal partial interface IIsNotNullAdvancedFilterInternal : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/IsNotNullAdvancedFilter.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/IsNotNullAdvancedFilter.json.cs new file mode 100644 index 000000000000..8ad7c3e826e4 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/IsNotNullAdvancedFilter.json.cs @@ -0,0 +1,106 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// IsNotNull Advanced Filter. + public partial class IsNotNullAdvancedFilter + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIsNotNullAdvancedFilter. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIsNotNullAdvancedFilter. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIsNotNullAdvancedFilter FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new IsNotNullAdvancedFilter(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal IsNotNullAdvancedFilter(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __advancedFilter = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.AdvancedFilter(json); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __advancedFilter?.ToJson(container, serializationMode); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/IsNullOrUndefinedAdvancedFilter.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/IsNullOrUndefinedAdvancedFilter.PowerShell.cs new file mode 100644 index 000000000000..6035e767ad9b --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/IsNullOrUndefinedAdvancedFilter.PowerShell.cs @@ -0,0 +1,152 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// IsNullOrUndefined Advanced Filter. + [System.ComponentModel.TypeConverter(typeof(IsNullOrUndefinedAdvancedFilterTypeConverter))] + public partial class IsNullOrUndefinedAdvancedFilter + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIsNullOrUndefinedAdvancedFilter DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new IsNullOrUndefinedAdvancedFilter(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIsNullOrUndefinedAdvancedFilter DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new IsNullOrUndefinedAdvancedFilter(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIsNullOrUndefinedAdvancedFilter FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal IsNullOrUndefinedAdvancedFilter(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("OperatorType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).OperatorType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType) content.GetValueForProperty("OperatorType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).OperatorType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType.CreateFrom); + } + if (content.Contains("Key")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).Key = (string) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).Key, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal IsNullOrUndefinedAdvancedFilter(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("OperatorType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).OperatorType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType) content.GetValueForProperty("OperatorType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).OperatorType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType.CreateFrom); + } + if (content.Contains("Key")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).Key = (string) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).Key, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// IsNullOrUndefined Advanced Filter. + [System.ComponentModel.TypeConverter(typeof(IsNullOrUndefinedAdvancedFilterTypeConverter))] + public partial interface IIsNullOrUndefinedAdvancedFilter + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/IsNullOrUndefinedAdvancedFilter.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/IsNullOrUndefinedAdvancedFilter.TypeConverter.cs new file mode 100644 index 000000000000..96f70f79952d --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/IsNullOrUndefinedAdvancedFilter.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class IsNullOrUndefinedAdvancedFilterTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIsNullOrUndefinedAdvancedFilter ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIsNullOrUndefinedAdvancedFilter).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return IsNullOrUndefinedAdvancedFilter.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return IsNullOrUndefinedAdvancedFilter.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return IsNullOrUndefinedAdvancedFilter.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/IsNullOrUndefinedAdvancedFilter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/IsNullOrUndefinedAdvancedFilter.cs new file mode 100644 index 000000000000..4ee3abd76e24 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/IsNullOrUndefinedAdvancedFilter.cs @@ -0,0 +1,63 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// IsNullOrUndefined Advanced Filter. + public partial class IsNullOrUndefinedAdvancedFilter : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIsNullOrUndefinedAdvancedFilter, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIsNullOrUndefinedAdvancedFilterInternal, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter __advancedFilter = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.AdvancedFilter(); + + /// The field/property in the event based on which you want to filter. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public string Key { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)__advancedFilter).Key; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)__advancedFilter).Key = value ?? null; } + + /// + /// The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType OperatorType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)__advancedFilter).OperatorType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)__advancedFilter).OperatorType = value ; } + + /// Creates an new instance. + public IsNullOrUndefinedAdvancedFilter() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__advancedFilter), __advancedFilter); + await eventListener.AssertObjectIsValid(nameof(__advancedFilter), __advancedFilter); + } + } + /// IsNullOrUndefined Advanced Filter. + public partial interface IIsNullOrUndefinedAdvancedFilter : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter + { + + } + /// IsNullOrUndefined Advanced Filter. + internal partial interface IIsNullOrUndefinedAdvancedFilterInternal : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/IsNullOrUndefinedAdvancedFilter.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/IsNullOrUndefinedAdvancedFilter.json.cs new file mode 100644 index 000000000000..355bf704977c --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/IsNullOrUndefinedAdvancedFilter.json.cs @@ -0,0 +1,106 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// IsNullOrUndefined Advanced Filter. + public partial class IsNullOrUndefinedAdvancedFilter + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIsNullOrUndefinedAdvancedFilter. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIsNullOrUndefinedAdvancedFilter. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIsNullOrUndefinedAdvancedFilter FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new IsNullOrUndefinedAdvancedFilter(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal IsNullOrUndefinedAdvancedFilter(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __advancedFilter = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.AdvancedFilter(json); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __advancedFilter?.ToJson(container, serializationMode); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/JsonField.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/JsonField.PowerShell.cs new file mode 100644 index 000000000000..6b209468dae1 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/JsonField.PowerShell.cs @@ -0,0 +1,148 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// 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. + /// + [System.ComponentModel.TypeConverter(typeof(JsonFieldTypeConverter))] + public partial class JsonField + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonField DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new JsonField(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonField DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new JsonField(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonField FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal JsonField(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SourceField")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonFieldInternal)this).SourceField = (string) content.GetValueForProperty("SourceField",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonFieldInternal)this).SourceField, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal JsonField(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SourceField")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonFieldInternal)this).SourceField = (string) content.GetValueForProperty("SourceField",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonFieldInternal)this).SourceField, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// 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. + [System.ComponentModel.TypeConverter(typeof(JsonFieldTypeConverter))] + public partial interface IJsonField + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/JsonField.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/JsonField.TypeConverter.cs new file mode 100644 index 000000000000..7f09d847e289 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/JsonField.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class JsonFieldTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonField ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonField).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return JsonField.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return JsonField.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return JsonField.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/JsonField.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/JsonField.cs new file mode 100644 index 000000000000..b2bfb6e5509e --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/JsonField.cs @@ -0,0 +1,65 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// + /// 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. + /// + public partial class JsonField : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonField, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonFieldInternal + { + + /// Backing field for property. + private string _sourceField; + + /// + /// Name of a field in the input event schema that's to be used as the source of a mapping. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string SourceField { get => this._sourceField; set => this._sourceField = value; } + + /// Creates an new instance. + public 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. + public partial interface IJsonField : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// + /// Name of a field in the input event schema that's to be used as the source of a mapping. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of a field in the input event schema that's to be used as the source of a mapping.", + SerializedName = @"sourceField", + PossibleTypes = new [] { typeof(string) })] + string SourceField { get; set; } + + } + /// 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. + internal partial interface IJsonFieldInternal + + { + /// + /// Name of a field in the input event schema that's to be used as the source of a mapping. + /// + string SourceField { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/JsonField.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/JsonField.json.cs new file mode 100644 index 000000000000..03be97a19dc6 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/JsonField.json.cs @@ -0,0 +1,110 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// + /// 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. + /// + public partial class JsonField + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonField. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonField. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonField FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new JsonField(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal JsonField(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_sourceField = If( json?.PropertyT("sourceField"), out var __jsonSourceField) ? (string)__jsonSourceField : (string)SourceField;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._sourceField)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._sourceField.ToString()) : null, "sourceField" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/JsonFieldWithDefault.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/JsonFieldWithDefault.PowerShell.cs new file mode 100644 index 000000000000..5bea51d15016 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/JsonFieldWithDefault.PowerShell.cs @@ -0,0 +1,160 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// 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 'subject', + /// 'eventtype' and 'dataversion' properties. This represents a field in the input event schema + /// along with a default value to be used, and at least one of these two properties should be provided. + /// + [System.ComponentModel.TypeConverter(typeof(JsonFieldWithDefaultTypeConverter))] + public partial class JsonFieldWithDefault + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonFieldWithDefault DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new JsonFieldWithDefault(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonFieldWithDefault DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new JsonFieldWithDefault(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonFieldWithDefault FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal JsonFieldWithDefault(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SourceField")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonFieldWithDefaultInternal)this).SourceField = (string) content.GetValueForProperty("SourceField",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonFieldWithDefaultInternal)this).SourceField, global::System.Convert.ToString); + } + if (content.Contains("DefaultValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonFieldWithDefaultInternal)this).DefaultValue = (string) content.GetValueForProperty("DefaultValue",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonFieldWithDefaultInternal)this).DefaultValue, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal JsonFieldWithDefault(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SourceField")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonFieldWithDefaultInternal)this).SourceField = (string) content.GetValueForProperty("SourceField",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonFieldWithDefaultInternal)this).SourceField, global::System.Convert.ToString); + } + if (content.Contains("DefaultValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonFieldWithDefaultInternal)this).DefaultValue = (string) content.GetValueForProperty("DefaultValue",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonFieldWithDefaultInternal)this).DefaultValue, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// 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 'subject', + /// 'eventtype' and 'dataversion' properties. This represents a field in the input event schema + /// along with a default value to be used, and at least one of these two properties should be provided. + [System.ComponentModel.TypeConverter(typeof(JsonFieldWithDefaultTypeConverter))] + public partial interface IJsonFieldWithDefault + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/JsonFieldWithDefault.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/JsonFieldWithDefault.TypeConverter.cs new file mode 100644 index 000000000000..c8094a654ac4 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/JsonFieldWithDefault.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class JsonFieldWithDefaultTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonFieldWithDefault ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonFieldWithDefault).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return JsonFieldWithDefault.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return JsonFieldWithDefault.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return JsonFieldWithDefault.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/JsonFieldWithDefault.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/JsonFieldWithDefault.cs new file mode 100644 index 000000000000..e7ff64f91b5a --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/JsonFieldWithDefault.cs @@ -0,0 +1,94 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// + /// 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 'subject', + /// 'eventtype' and 'dataversion' properties. This represents a field in the input event schema + /// along with a default value to be used, and at least one of these two properties should be provided. + /// + public partial class JsonFieldWithDefault : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonFieldWithDefault, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonFieldWithDefaultInternal + { + + /// Backing field for property. + private string _defaultValue; + + /// + /// The default value to be used for mapping when a SourceField is not provided or if there's no property with the specified + /// name in the published JSON event payload. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string DefaultValue { get => this._defaultValue; set => this._defaultValue = value; } + + /// Backing field for property. + private string _sourceField; + + /// + /// Name of a field in the input event schema that's to be used as the source of a mapping. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string SourceField { get => this._sourceField; set => this._sourceField = value; } + + /// Creates an new instance. + public JsonFieldWithDefault() + { + + } + } + /// 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 'subject', + /// 'eventtype' and 'dataversion' properties. This represents a field in the input event schema + /// along with a default value to be used, and at least one of these two properties should be provided. + public partial interface IJsonFieldWithDefault : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// + /// The default value to be used for mapping when a SourceField is not provided or if there's no property with the specified + /// name in the published JSON event payload. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default value to be used for mapping when a SourceField is not provided or if there's no property with the specified name in the published JSON event payload.", + SerializedName = @"defaultValue", + PossibleTypes = new [] { typeof(string) })] + string DefaultValue { get; set; } + /// + /// Name of a field in the input event schema that's to be used as the source of a mapping. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of a field in the input event schema that's to be used as the source of a mapping.", + SerializedName = @"sourceField", + PossibleTypes = new [] { typeof(string) })] + string SourceField { get; set; } + + } + /// 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 'subject', + /// 'eventtype' and 'dataversion' properties. This represents a field in the input event schema + /// along with a default value to be used, and at least one of these two properties should be provided. + internal partial interface IJsonFieldWithDefaultInternal + + { + /// + /// The default value to be used for mapping when a SourceField is not provided or if there's no property with the specified + /// name in the published JSON event payload. + /// + string DefaultValue { get; set; } + /// + /// Name of a field in the input event schema that's to be used as the source of a mapping. + /// + string SourceField { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/JsonFieldWithDefault.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/JsonFieldWithDefault.json.cs new file mode 100644 index 000000000000..4f1dd0fea03f --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/JsonFieldWithDefault.json.cs @@ -0,0 +1,113 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// + /// 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 'subject', + /// 'eventtype' and 'dataversion' properties. This represents a field in the input event schema + /// along with a default value to be used, and at least one of these two properties should be provided. + /// + public partial class JsonFieldWithDefault + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonFieldWithDefault. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonFieldWithDefault. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonFieldWithDefault FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new JsonFieldWithDefault(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal JsonFieldWithDefault(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_sourceField = If( json?.PropertyT("sourceField"), out var __jsonSourceField) ? (string)__jsonSourceField : (string)SourceField;} + {_defaultValue = If( json?.PropertyT("defaultValue"), out var __jsonDefaultValue) ? (string)__jsonDefaultValue : (string)DefaultValue;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._sourceField)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._sourceField.ToString()) : null, "sourceField" ,container.Add ); + AddIf( null != (((object)this._defaultValue)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._defaultValue.ToString()) : null, "defaultValue" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/JsonInputSchemaMapping.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/JsonInputSchemaMapping.PowerShell.cs new file mode 100644 index 000000000000..bf2c6305b29e --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/JsonInputSchemaMapping.PowerShell.cs @@ -0,0 +1,276 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// This enables publishing to Event Grid using a custom input schema. This can be used to map properties from a custom input + /// JSON schema to the Event Grid event schema. + /// + [System.ComponentModel.TypeConverter(typeof(JsonInputSchemaMappingTypeConverter))] + public partial class JsonInputSchemaMapping + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMapping DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new JsonInputSchemaMapping(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMapping DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new JsonInputSchemaMapping(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMapping FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal JsonInputSchemaMapping(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.JsonInputSchemaMappingPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInputSchemaMappingInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInputSchemaMappingInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingInternal)this).Id = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonField) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingInternal)this).Id, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.JsonFieldTypeConverter.ConvertFrom); + } + if (content.Contains("Topic")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingInternal)this).Topic = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonField) content.GetValueForProperty("Topic",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingInternal)this).Topic, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.JsonFieldTypeConverter.ConvertFrom); + } + if (content.Contains("EventTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingInternal)this).EventTime = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonField) content.GetValueForProperty("EventTime",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingInternal)this).EventTime, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.JsonFieldTypeConverter.ConvertFrom); + } + if (content.Contains("EventType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingInternal)this).EventType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonFieldWithDefault) content.GetValueForProperty("EventType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingInternal)this).EventType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.JsonFieldWithDefaultTypeConverter.ConvertFrom); + } + if (content.Contains("Subject")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingInternal)this).Subject = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonFieldWithDefault) content.GetValueForProperty("Subject",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingInternal)this).Subject, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.JsonFieldWithDefaultTypeConverter.ConvertFrom); + } + if (content.Contains("DataVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingInternal)this).DataVersion = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonFieldWithDefault) content.GetValueForProperty("DataVersion",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingInternal)this).DataVersion, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.JsonFieldWithDefaultTypeConverter.ConvertFrom); + } + if (content.Contains("IdSourceField")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingInternal)this).IdSourceField = (string) content.GetValueForProperty("IdSourceField",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingInternal)this).IdSourceField, global::System.Convert.ToString); + } + if (content.Contains("TopicSourceField")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingInternal)this).TopicSourceField = (string) content.GetValueForProperty("TopicSourceField",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingInternal)this).TopicSourceField, global::System.Convert.ToString); + } + if (content.Contains("EventTimeSourceField")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingInternal)this).EventTimeSourceField = (string) content.GetValueForProperty("EventTimeSourceField",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingInternal)this).EventTimeSourceField, global::System.Convert.ToString); + } + if (content.Contains("EventTypeSourceField")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingInternal)this).EventTypeSourceField = (string) content.GetValueForProperty("EventTypeSourceField",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingInternal)this).EventTypeSourceField, global::System.Convert.ToString); + } + if (content.Contains("EventTypeDefaultValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingInternal)this).EventTypeDefaultValue = (string) content.GetValueForProperty("EventTypeDefaultValue",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingInternal)this).EventTypeDefaultValue, global::System.Convert.ToString); + } + if (content.Contains("SubjectSourceField")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingInternal)this).SubjectSourceField = (string) content.GetValueForProperty("SubjectSourceField",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingInternal)this).SubjectSourceField, global::System.Convert.ToString); + } + if (content.Contains("SubjectDefaultValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingInternal)this).SubjectDefaultValue = (string) content.GetValueForProperty("SubjectDefaultValue",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingInternal)this).SubjectDefaultValue, global::System.Convert.ToString); + } + if (content.Contains("DataVersionSourceField")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingInternal)this).DataVersionSourceField = (string) content.GetValueForProperty("DataVersionSourceField",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingInternal)this).DataVersionSourceField, global::System.Convert.ToString); + } + if (content.Contains("DataVersionDefaultValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingInternal)this).DataVersionDefaultValue = (string) content.GetValueForProperty("DataVersionDefaultValue",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingInternal)this).DataVersionDefaultValue, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal JsonInputSchemaMapping(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.JsonInputSchemaMappingPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInputSchemaMappingInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInputSchemaMappingInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingInternal)this).Id = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonField) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingInternal)this).Id, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.JsonFieldTypeConverter.ConvertFrom); + } + if (content.Contains("Topic")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingInternal)this).Topic = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonField) content.GetValueForProperty("Topic",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingInternal)this).Topic, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.JsonFieldTypeConverter.ConvertFrom); + } + if (content.Contains("EventTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingInternal)this).EventTime = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonField) content.GetValueForProperty("EventTime",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingInternal)this).EventTime, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.JsonFieldTypeConverter.ConvertFrom); + } + if (content.Contains("EventType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingInternal)this).EventType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonFieldWithDefault) content.GetValueForProperty("EventType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingInternal)this).EventType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.JsonFieldWithDefaultTypeConverter.ConvertFrom); + } + if (content.Contains("Subject")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingInternal)this).Subject = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonFieldWithDefault) content.GetValueForProperty("Subject",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingInternal)this).Subject, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.JsonFieldWithDefaultTypeConverter.ConvertFrom); + } + if (content.Contains("DataVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingInternal)this).DataVersion = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonFieldWithDefault) content.GetValueForProperty("DataVersion",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingInternal)this).DataVersion, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.JsonFieldWithDefaultTypeConverter.ConvertFrom); + } + if (content.Contains("IdSourceField")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingInternal)this).IdSourceField = (string) content.GetValueForProperty("IdSourceField",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingInternal)this).IdSourceField, global::System.Convert.ToString); + } + if (content.Contains("TopicSourceField")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingInternal)this).TopicSourceField = (string) content.GetValueForProperty("TopicSourceField",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingInternal)this).TopicSourceField, global::System.Convert.ToString); + } + if (content.Contains("EventTimeSourceField")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingInternal)this).EventTimeSourceField = (string) content.GetValueForProperty("EventTimeSourceField",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingInternal)this).EventTimeSourceField, global::System.Convert.ToString); + } + if (content.Contains("EventTypeSourceField")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingInternal)this).EventTypeSourceField = (string) content.GetValueForProperty("EventTypeSourceField",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingInternal)this).EventTypeSourceField, global::System.Convert.ToString); + } + if (content.Contains("EventTypeDefaultValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingInternal)this).EventTypeDefaultValue = (string) content.GetValueForProperty("EventTypeDefaultValue",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingInternal)this).EventTypeDefaultValue, global::System.Convert.ToString); + } + if (content.Contains("SubjectSourceField")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingInternal)this).SubjectSourceField = (string) content.GetValueForProperty("SubjectSourceField",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingInternal)this).SubjectSourceField, global::System.Convert.ToString); + } + if (content.Contains("SubjectDefaultValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingInternal)this).SubjectDefaultValue = (string) content.GetValueForProperty("SubjectDefaultValue",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingInternal)this).SubjectDefaultValue, global::System.Convert.ToString); + } + if (content.Contains("DataVersionSourceField")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingInternal)this).DataVersionSourceField = (string) content.GetValueForProperty("DataVersionSourceField",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingInternal)this).DataVersionSourceField, global::System.Convert.ToString); + } + if (content.Contains("DataVersionDefaultValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingInternal)this).DataVersionDefaultValue = (string) content.GetValueForProperty("DataVersionDefaultValue",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingInternal)this).DataVersionDefaultValue, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// This enables publishing to Event Grid using a custom input schema. This can be used to map properties from a custom input + /// JSON schema to the Event Grid event schema. + [System.ComponentModel.TypeConverter(typeof(JsonInputSchemaMappingTypeConverter))] + public partial interface IJsonInputSchemaMapping + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/JsonInputSchemaMapping.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/JsonInputSchemaMapping.TypeConverter.cs new file mode 100644 index 000000000000..46a007d8945b --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/JsonInputSchemaMapping.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class JsonInputSchemaMappingTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMapping ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMapping).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return JsonInputSchemaMapping.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return JsonInputSchemaMapping.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return JsonInputSchemaMapping.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/JsonInputSchemaMapping.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/JsonInputSchemaMapping.cs new file mode 100644 index 000000000000..e3be457368d5 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/JsonInputSchemaMapping.cs @@ -0,0 +1,296 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// + /// This enables publishing to Event Grid using a custom input schema. This can be used to map properties from a custom input + /// JSON schema to the Event Grid event schema. + /// + public partial class JsonInputSchemaMapping : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMapping, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingInternal, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInputSchemaMapping __inputSchemaMapping = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.InputSchemaMapping(); + + /// + /// The default value to be used for mapping when a SourceField is not provided or if there's no property with the specified + /// name in the published JSON event payload. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string DataVersionDefaultValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal)Property).DataVersionDefaultValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal)Property).DataVersionDefaultValue = value ?? null; } + + /// + /// Name of a field in the input event schema that's to be used as the source of a mapping. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string DataVersionSourceField { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal)Property).DataVersionSourceField; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal)Property).DataVersionSourceField = value ?? null; } + + /// + /// Name of a field in the input event schema that's to be used as the source of a mapping. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string EventTimeSourceField { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal)Property).EventTimeSourceField; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal)Property).EventTimeSourceField = value ?? null; } + + /// + /// The default value to be used for mapping when a SourceField is not provided or if there's no property with the specified + /// name in the published JSON event payload. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string EventTypeDefaultValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal)Property).EventTypeDefaultValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal)Property).EventTypeDefaultValue = value ?? null; } + + /// + /// Name of a field in the input event schema that's to be used as the source of a mapping. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string EventTypeSourceField { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal)Property).EventTypeSourceField; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal)Property).EventTypeSourceField = value ?? null; } + + /// + /// Name of a field in the input event schema that's to be used as the source of a mapping. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string IdSourceField { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal)Property).IdSourceField; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal)Property).IdSourceField = value ?? null; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInputSchemaMappingInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInputSchemaMappingInternal)__inputSchemaMapping).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInputSchemaMappingInternal)__inputSchemaMapping).Type = value; } + + /// Internal Acessors for DataVersion + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonFieldWithDefault Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingInternal.DataVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal)Property).DataVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal)Property).DataVersion = value; } + + /// Internal Acessors for EventTime + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonField Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingInternal.EventTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal)Property).EventTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal)Property).EventTime = value; } + + /// Internal Acessors for EventType + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonFieldWithDefault Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingInternal.EventType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal)Property).EventType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal)Property).EventType = value; } + + /// Internal Acessors for Id + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonField Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal)Property).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal)Property).Id = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingProperties Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.JsonInputSchemaMappingProperties()); set { {_property = value;} } } + + /// Internal Acessors for Subject + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonFieldWithDefault Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingInternal.Subject { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal)Property).Subject; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal)Property).Subject = value; } + + /// Internal Acessors for Topic + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonField Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingInternal.Topic { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal)Property).Topic; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal)Property).Topic = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingProperties _property; + + /// JSON Properties of the input schema mapping + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.JsonInputSchemaMappingProperties()); set => this._property = value; } + + /// + /// The default value to be used for mapping when a SourceField is not provided or if there's no property with the specified + /// name in the published JSON event payload. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string SubjectDefaultValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal)Property).SubjectDefaultValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal)Property).SubjectDefaultValue = value ?? null; } + + /// + /// Name of a field in the input event schema that's to be used as the source of a mapping. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string SubjectSourceField { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal)Property).SubjectSourceField; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal)Property).SubjectSourceField = value ?? null; } + + /// + /// Name of a field in the input event schema that's to be used as the source of a mapping. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string TopicSourceField { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal)Property).TopicSourceField; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal)Property).TopicSourceField = value ?? null; } + + /// Type of the custom mapping + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInputSchemaMappingInternal)__inputSchemaMapping).Type; } + + /// Creates an new instance. + public JsonInputSchemaMapping() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__inputSchemaMapping), __inputSchemaMapping); + await eventListener.AssertObjectIsValid(nameof(__inputSchemaMapping), __inputSchemaMapping); + } + } + /// This enables publishing to Event Grid using a custom input schema. This can be used to map properties from a custom input + /// JSON schema to the Event Grid event schema. + public partial interface IJsonInputSchemaMapping : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInputSchemaMapping + { + /// + /// The default value to be used for mapping when a SourceField is not provided or if there's no property with the specified + /// name in the published JSON event payload. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default value to be used for mapping when a SourceField is not provided or if there's no property with the specified name in the published JSON event payload.", + SerializedName = @"defaultValue", + PossibleTypes = new [] { typeof(string) })] + string DataVersionDefaultValue { get; set; } + /// + /// Name of a field in the input event schema that's to be used as the source of a mapping. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of a field in the input event schema that's to be used as the source of a mapping.", + SerializedName = @"sourceField", + PossibleTypes = new [] { typeof(string) })] + string DataVersionSourceField { get; set; } + /// + /// Name of a field in the input event schema that's to be used as the source of a mapping. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of a field in the input event schema that's to be used as the source of a mapping.", + SerializedName = @"sourceField", + PossibleTypes = new [] { typeof(string) })] + string EventTimeSourceField { get; set; } + /// + /// The default value to be used for mapping when a SourceField is not provided or if there's no property with the specified + /// name in the published JSON event payload. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default value to be used for mapping when a SourceField is not provided or if there's no property with the specified name in the published JSON event payload.", + SerializedName = @"defaultValue", + PossibleTypes = new [] { typeof(string) })] + string EventTypeDefaultValue { get; set; } + /// + /// Name of a field in the input event schema that's to be used as the source of a mapping. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of a field in the input event schema that's to be used as the source of a mapping.", + SerializedName = @"sourceField", + PossibleTypes = new [] { typeof(string) })] + string EventTypeSourceField { get; set; } + /// + /// Name of a field in the input event schema that's to be used as the source of a mapping. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of a field in the input event schema that's to be used as the source of a mapping.", + SerializedName = @"sourceField", + PossibleTypes = new [] { typeof(string) })] + string IdSourceField { get; set; } + /// + /// The default value to be used for mapping when a SourceField is not provided or if there's no property with the specified + /// name in the published JSON event payload. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default value to be used for mapping when a SourceField is not provided or if there's no property with the specified name in the published JSON event payload.", + SerializedName = @"defaultValue", + PossibleTypes = new [] { typeof(string) })] + string SubjectDefaultValue { get; set; } + /// + /// Name of a field in the input event schema that's to be used as the source of a mapping. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of a field in the input event schema that's to be used as the source of a mapping.", + SerializedName = @"sourceField", + PossibleTypes = new [] { typeof(string) })] + string SubjectSourceField { get; set; } + /// + /// Name of a field in the input event schema that's to be used as the source of a mapping. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of a field in the input event schema that's to be used as the source of a mapping.", + SerializedName = @"sourceField", + PossibleTypes = new [] { typeof(string) })] + string TopicSourceField { get; set; } + + } + /// This enables publishing to Event Grid using a custom input schema. This can be used to map properties from a custom input + /// JSON schema to the Event Grid event schema. + internal partial interface IJsonInputSchemaMappingInternal : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInputSchemaMappingInternal + { + /// The mapping information for the DataVersion property of the Event Grid Event. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonFieldWithDefault DataVersion { get; set; } + /// + /// The default value to be used for mapping when a SourceField is not provided or if there's no property with the specified + /// name in the published JSON event payload. + /// + string DataVersionDefaultValue { get; set; } + /// + /// Name of a field in the input event schema that's to be used as the source of a mapping. + /// + string DataVersionSourceField { get; set; } + /// The mapping information for the EventTime property of the Event Grid Event. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonField EventTime { get; set; } + /// + /// Name of a field in the input event schema that's to be used as the source of a mapping. + /// + string EventTimeSourceField { get; set; } + /// The mapping information for the EventType property of the Event Grid Event. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonFieldWithDefault EventType { get; set; } + /// + /// The default value to be used for mapping when a SourceField is not provided or if there's no property with the specified + /// name in the published JSON event payload. + /// + string EventTypeDefaultValue { get; set; } + /// + /// Name of a field in the input event schema that's to be used as the source of a mapping. + /// + string EventTypeSourceField { get; set; } + /// The mapping information for the Id property of the Event Grid Event. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonField Id { get; set; } + /// + /// Name of a field in the input event schema that's to be used as the source of a mapping. + /// + string IdSourceField { get; set; } + /// JSON Properties of the input schema mapping + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingProperties Property { get; set; } + /// The mapping information for the Subject property of the Event Grid Event. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonFieldWithDefault Subject { get; set; } + /// + /// The default value to be used for mapping when a SourceField is not provided or if there's no property with the specified + /// name in the published JSON event payload. + /// + string SubjectDefaultValue { get; set; } + /// + /// Name of a field in the input event schema that's to be used as the source of a mapping. + /// + string SubjectSourceField { get; set; } + /// The mapping information for the Topic property of the Event Grid Event. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonField Topic { get; set; } + /// + /// Name of a field in the input event schema that's to be used as the source of a mapping. + /// + string TopicSourceField { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/JsonInputSchemaMapping.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/JsonInputSchemaMapping.json.cs new file mode 100644 index 000000000000..e41469815e07 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/JsonInputSchemaMapping.json.cs @@ -0,0 +1,111 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// + /// This enables publishing to Event Grid using a custom input schema. This can be used to map properties from a custom input + /// JSON schema to the Event Grid event schema. + /// + public partial class JsonInputSchemaMapping + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMapping. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMapping. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMapping FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new JsonInputSchemaMapping(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal JsonInputSchemaMapping(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __inputSchemaMapping = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.InputSchemaMapping(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.JsonInputSchemaMappingProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __inputSchemaMapping?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/JsonInputSchemaMappingProperties.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/JsonInputSchemaMappingProperties.PowerShell.cs new file mode 100644 index 000000000000..288892147eea --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/JsonInputSchemaMappingProperties.PowerShell.cs @@ -0,0 +1,260 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// This can be used to map properties of a source schema (or default values, for certain supported properties) to properties + /// of the EventGridEvent schema. + /// + [System.ComponentModel.TypeConverter(typeof(JsonInputSchemaMappingPropertiesTypeConverter))] + public partial class JsonInputSchemaMappingProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new JsonInputSchemaMappingProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new JsonInputSchemaMappingProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal JsonInputSchemaMappingProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal)this).Id = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonField) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal)this).Id, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.JsonFieldTypeConverter.ConvertFrom); + } + if (content.Contains("Topic")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal)this).Topic = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonField) content.GetValueForProperty("Topic",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal)this).Topic, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.JsonFieldTypeConverter.ConvertFrom); + } + if (content.Contains("EventTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal)this).EventTime = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonField) content.GetValueForProperty("EventTime",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal)this).EventTime, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.JsonFieldTypeConverter.ConvertFrom); + } + if (content.Contains("EventType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal)this).EventType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonFieldWithDefault) content.GetValueForProperty("EventType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal)this).EventType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.JsonFieldWithDefaultTypeConverter.ConvertFrom); + } + if (content.Contains("Subject")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal)this).Subject = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonFieldWithDefault) content.GetValueForProperty("Subject",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal)this).Subject, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.JsonFieldWithDefaultTypeConverter.ConvertFrom); + } + if (content.Contains("DataVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal)this).DataVersion = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonFieldWithDefault) content.GetValueForProperty("DataVersion",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal)this).DataVersion, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.JsonFieldWithDefaultTypeConverter.ConvertFrom); + } + if (content.Contains("IdSourceField")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal)this).IdSourceField = (string) content.GetValueForProperty("IdSourceField",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal)this).IdSourceField, global::System.Convert.ToString); + } + if (content.Contains("TopicSourceField")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal)this).TopicSourceField = (string) content.GetValueForProperty("TopicSourceField",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal)this).TopicSourceField, global::System.Convert.ToString); + } + if (content.Contains("EventTimeSourceField")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal)this).EventTimeSourceField = (string) content.GetValueForProperty("EventTimeSourceField",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal)this).EventTimeSourceField, global::System.Convert.ToString); + } + if (content.Contains("EventTypeSourceField")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal)this).EventTypeSourceField = (string) content.GetValueForProperty("EventTypeSourceField",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal)this).EventTypeSourceField, global::System.Convert.ToString); + } + if (content.Contains("EventTypeDefaultValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal)this).EventTypeDefaultValue = (string) content.GetValueForProperty("EventTypeDefaultValue",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal)this).EventTypeDefaultValue, global::System.Convert.ToString); + } + if (content.Contains("SubjectSourceField")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal)this).SubjectSourceField = (string) content.GetValueForProperty("SubjectSourceField",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal)this).SubjectSourceField, global::System.Convert.ToString); + } + if (content.Contains("SubjectDefaultValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal)this).SubjectDefaultValue = (string) content.GetValueForProperty("SubjectDefaultValue",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal)this).SubjectDefaultValue, global::System.Convert.ToString); + } + if (content.Contains("DataVersionSourceField")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal)this).DataVersionSourceField = (string) content.GetValueForProperty("DataVersionSourceField",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal)this).DataVersionSourceField, global::System.Convert.ToString); + } + if (content.Contains("DataVersionDefaultValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal)this).DataVersionDefaultValue = (string) content.GetValueForProperty("DataVersionDefaultValue",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal)this).DataVersionDefaultValue, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal JsonInputSchemaMappingProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal)this).Id = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonField) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal)this).Id, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.JsonFieldTypeConverter.ConvertFrom); + } + if (content.Contains("Topic")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal)this).Topic = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonField) content.GetValueForProperty("Topic",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal)this).Topic, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.JsonFieldTypeConverter.ConvertFrom); + } + if (content.Contains("EventTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal)this).EventTime = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonField) content.GetValueForProperty("EventTime",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal)this).EventTime, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.JsonFieldTypeConverter.ConvertFrom); + } + if (content.Contains("EventType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal)this).EventType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonFieldWithDefault) content.GetValueForProperty("EventType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal)this).EventType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.JsonFieldWithDefaultTypeConverter.ConvertFrom); + } + if (content.Contains("Subject")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal)this).Subject = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonFieldWithDefault) content.GetValueForProperty("Subject",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal)this).Subject, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.JsonFieldWithDefaultTypeConverter.ConvertFrom); + } + if (content.Contains("DataVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal)this).DataVersion = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonFieldWithDefault) content.GetValueForProperty("DataVersion",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal)this).DataVersion, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.JsonFieldWithDefaultTypeConverter.ConvertFrom); + } + if (content.Contains("IdSourceField")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal)this).IdSourceField = (string) content.GetValueForProperty("IdSourceField",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal)this).IdSourceField, global::System.Convert.ToString); + } + if (content.Contains("TopicSourceField")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal)this).TopicSourceField = (string) content.GetValueForProperty("TopicSourceField",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal)this).TopicSourceField, global::System.Convert.ToString); + } + if (content.Contains("EventTimeSourceField")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal)this).EventTimeSourceField = (string) content.GetValueForProperty("EventTimeSourceField",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal)this).EventTimeSourceField, global::System.Convert.ToString); + } + if (content.Contains("EventTypeSourceField")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal)this).EventTypeSourceField = (string) content.GetValueForProperty("EventTypeSourceField",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal)this).EventTypeSourceField, global::System.Convert.ToString); + } + if (content.Contains("EventTypeDefaultValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal)this).EventTypeDefaultValue = (string) content.GetValueForProperty("EventTypeDefaultValue",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal)this).EventTypeDefaultValue, global::System.Convert.ToString); + } + if (content.Contains("SubjectSourceField")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal)this).SubjectSourceField = (string) content.GetValueForProperty("SubjectSourceField",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal)this).SubjectSourceField, global::System.Convert.ToString); + } + if (content.Contains("SubjectDefaultValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal)this).SubjectDefaultValue = (string) content.GetValueForProperty("SubjectDefaultValue",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal)this).SubjectDefaultValue, global::System.Convert.ToString); + } + if (content.Contains("DataVersionSourceField")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal)this).DataVersionSourceField = (string) content.GetValueForProperty("DataVersionSourceField",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal)this).DataVersionSourceField, global::System.Convert.ToString); + } + if (content.Contains("DataVersionDefaultValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal)this).DataVersionDefaultValue = (string) content.GetValueForProperty("DataVersionDefaultValue",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal)this).DataVersionDefaultValue, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// This can be used to map properties of a source schema (or default values, for certain supported properties) to properties + /// of the EventGridEvent schema. + [System.ComponentModel.TypeConverter(typeof(JsonInputSchemaMappingPropertiesTypeConverter))] + public partial interface IJsonInputSchemaMappingProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/JsonInputSchemaMappingProperties.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/JsonInputSchemaMappingProperties.TypeConverter.cs new file mode 100644 index 000000000000..4c4deb717cb2 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/JsonInputSchemaMappingProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class JsonInputSchemaMappingPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return JsonInputSchemaMappingProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return JsonInputSchemaMappingProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return JsonInputSchemaMappingProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/JsonInputSchemaMappingProperties.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/JsonInputSchemaMappingProperties.cs new file mode 100644 index 000000000000..013db818a7cc --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/JsonInputSchemaMappingProperties.cs @@ -0,0 +1,300 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// + /// This can be used to map properties of a source schema (or default values, for certain supported properties) to properties + /// of the EventGridEvent schema. + /// + public partial class JsonInputSchemaMappingProperties : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingProperties, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonFieldWithDefault _dataVersion; + + /// The mapping information for the DataVersion property of the Event Grid Event. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonFieldWithDefault DataVersion { get => (this._dataVersion = this._dataVersion ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.JsonFieldWithDefault()); set => this._dataVersion = value; } + + /// + /// The default value to be used for mapping when a SourceField is not provided or if there's no property with the specified + /// name in the published JSON event payload. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string DataVersionDefaultValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonFieldWithDefaultInternal)DataVersion).DefaultValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonFieldWithDefaultInternal)DataVersion).DefaultValue = value ?? null; } + + /// + /// Name of a field in the input event schema that's to be used as the source of a mapping. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string DataVersionSourceField { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonFieldWithDefaultInternal)DataVersion).SourceField; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonFieldWithDefaultInternal)DataVersion).SourceField = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonField _eventTime; + + /// The mapping information for the EventTime property of the Event Grid Event. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonField EventTime { get => (this._eventTime = this._eventTime ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.JsonField()); set => this._eventTime = value; } + + /// + /// Name of a field in the input event schema that's to be used as the source of a mapping. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string EventTimeSourceField { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonFieldInternal)EventTime).SourceField; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonFieldInternal)EventTime).SourceField = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonFieldWithDefault _eventType; + + /// The mapping information for the EventType property of the Event Grid Event. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonFieldWithDefault EventType { get => (this._eventType = this._eventType ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.JsonFieldWithDefault()); set => this._eventType = value; } + + /// + /// The default value to be used for mapping when a SourceField is not provided or if there's no property with the specified + /// name in the published JSON event payload. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string EventTypeDefaultValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonFieldWithDefaultInternal)EventType).DefaultValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonFieldWithDefaultInternal)EventType).DefaultValue = value ?? null; } + + /// + /// Name of a field in the input event schema that's to be used as the source of a mapping. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string EventTypeSourceField { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonFieldWithDefaultInternal)EventType).SourceField; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonFieldWithDefaultInternal)EventType).SourceField = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonField _id; + + /// The mapping information for the Id property of the Event Grid Event. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonField Id { get => (this._id = this._id ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.JsonField()); set => this._id = value; } + + /// + /// Name of a field in the input event schema that's to be used as the source of a mapping. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string IdSourceField { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonFieldInternal)Id).SourceField; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonFieldInternal)Id).SourceField = value ?? null; } + + /// Internal Acessors for DataVersion + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonFieldWithDefault Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal.DataVersion { get => (this._dataVersion = this._dataVersion ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.JsonFieldWithDefault()); set { {_dataVersion = value;} } } + + /// Internal Acessors for EventTime + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonField Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal.EventTime { get => (this._eventTime = this._eventTime ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.JsonField()); set { {_eventTime = value;} } } + + /// Internal Acessors for EventType + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonFieldWithDefault Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal.EventType { get => (this._eventType = this._eventType ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.JsonFieldWithDefault()); set { {_eventType = value;} } } + + /// Internal Acessors for Id + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonField Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal.Id { get => (this._id = this._id ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.JsonField()); set { {_id = value;} } } + + /// Internal Acessors for Subject + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonFieldWithDefault Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal.Subject { get => (this._subject = this._subject ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.JsonFieldWithDefault()); set { {_subject = value;} } } + + /// Internal Acessors for Topic + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonField Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingPropertiesInternal.Topic { get => (this._topic = this._topic ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.JsonField()); set { {_topic = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonFieldWithDefault _subject; + + /// The mapping information for the Subject property of the Event Grid Event. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonFieldWithDefault Subject { get => (this._subject = this._subject ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.JsonFieldWithDefault()); set => this._subject = value; } + + /// + /// The default value to be used for mapping when a SourceField is not provided or if there's no property with the specified + /// name in the published JSON event payload. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string SubjectDefaultValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonFieldWithDefaultInternal)Subject).DefaultValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonFieldWithDefaultInternal)Subject).DefaultValue = value ?? null; } + + /// + /// Name of a field in the input event schema that's to be used as the source of a mapping. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string SubjectSourceField { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonFieldWithDefaultInternal)Subject).SourceField; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonFieldWithDefaultInternal)Subject).SourceField = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonField _topic; + + /// The mapping information for the Topic property of the Event Grid Event. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonField Topic { get => (this._topic = this._topic ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.JsonField()); set => this._topic = value; } + + /// + /// Name of a field in the input event schema that's to be used as the source of a mapping. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string TopicSourceField { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonFieldInternal)Topic).SourceField; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonFieldInternal)Topic).SourceField = value ?? null; } + + /// Creates an new instance. + public JsonInputSchemaMappingProperties() + { + + } + } + /// This can be used to map properties of a source schema (or default values, for certain supported properties) to properties + /// of the EventGridEvent schema. + public partial interface IJsonInputSchemaMappingProperties : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// + /// The default value to be used for mapping when a SourceField is not provided or if there's no property with the specified + /// name in the published JSON event payload. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default value to be used for mapping when a SourceField is not provided or if there's no property with the specified name in the published JSON event payload.", + SerializedName = @"defaultValue", + PossibleTypes = new [] { typeof(string) })] + string DataVersionDefaultValue { get; set; } + /// + /// Name of a field in the input event schema that's to be used as the source of a mapping. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of a field in the input event schema that's to be used as the source of a mapping.", + SerializedName = @"sourceField", + PossibleTypes = new [] { typeof(string) })] + string DataVersionSourceField { get; set; } + /// + /// Name of a field in the input event schema that's to be used as the source of a mapping. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of a field in the input event schema that's to be used as the source of a mapping.", + SerializedName = @"sourceField", + PossibleTypes = new [] { typeof(string) })] + string EventTimeSourceField { get; set; } + /// + /// The default value to be used for mapping when a SourceField is not provided or if there's no property with the specified + /// name in the published JSON event payload. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default value to be used for mapping when a SourceField is not provided or if there's no property with the specified name in the published JSON event payload.", + SerializedName = @"defaultValue", + PossibleTypes = new [] { typeof(string) })] + string EventTypeDefaultValue { get; set; } + /// + /// Name of a field in the input event schema that's to be used as the source of a mapping. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of a field in the input event schema that's to be used as the source of a mapping.", + SerializedName = @"sourceField", + PossibleTypes = new [] { typeof(string) })] + string EventTypeSourceField { get; set; } + /// + /// Name of a field in the input event schema that's to be used as the source of a mapping. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of a field in the input event schema that's to be used as the source of a mapping.", + SerializedName = @"sourceField", + PossibleTypes = new [] { typeof(string) })] + string IdSourceField { get; set; } + /// + /// The default value to be used for mapping when a SourceField is not provided or if there's no property with the specified + /// name in the published JSON event payload. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default value to be used for mapping when a SourceField is not provided or if there's no property with the specified name in the published JSON event payload.", + SerializedName = @"defaultValue", + PossibleTypes = new [] { typeof(string) })] + string SubjectDefaultValue { get; set; } + /// + /// Name of a field in the input event schema that's to be used as the source of a mapping. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of a field in the input event schema that's to be used as the source of a mapping.", + SerializedName = @"sourceField", + PossibleTypes = new [] { typeof(string) })] + string SubjectSourceField { get; set; } + /// + /// Name of a field in the input event schema that's to be used as the source of a mapping. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of a field in the input event schema that's to be used as the source of a mapping.", + SerializedName = @"sourceField", + PossibleTypes = new [] { typeof(string) })] + string TopicSourceField { get; set; } + + } + /// This can be used to map properties of a source schema (or default values, for certain supported properties) to properties + /// of the EventGridEvent schema. + internal partial interface IJsonInputSchemaMappingPropertiesInternal + + { + /// The mapping information for the DataVersion property of the Event Grid Event. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonFieldWithDefault DataVersion { get; set; } + /// + /// The default value to be used for mapping when a SourceField is not provided or if there's no property with the specified + /// name in the published JSON event payload. + /// + string DataVersionDefaultValue { get; set; } + /// + /// Name of a field in the input event schema that's to be used as the source of a mapping. + /// + string DataVersionSourceField { get; set; } + /// The mapping information for the EventTime property of the Event Grid Event. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonField EventTime { get; set; } + /// + /// Name of a field in the input event schema that's to be used as the source of a mapping. + /// + string EventTimeSourceField { get; set; } + /// The mapping information for the EventType property of the Event Grid Event. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonFieldWithDefault EventType { get; set; } + /// + /// The default value to be used for mapping when a SourceField is not provided or if there's no property with the specified + /// name in the published JSON event payload. + /// + string EventTypeDefaultValue { get; set; } + /// + /// Name of a field in the input event schema that's to be used as the source of a mapping. + /// + string EventTypeSourceField { get; set; } + /// The mapping information for the Id property of the Event Grid Event. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonField Id { get; set; } + /// + /// Name of a field in the input event schema that's to be used as the source of a mapping. + /// + string IdSourceField { get; set; } + /// The mapping information for the Subject property of the Event Grid Event. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonFieldWithDefault Subject { get; set; } + /// + /// The default value to be used for mapping when a SourceField is not provided or if there's no property with the specified + /// name in the published JSON event payload. + /// + string SubjectDefaultValue { get; set; } + /// + /// Name of a field in the input event schema that's to be used as the source of a mapping. + /// + string SubjectSourceField { get; set; } + /// The mapping information for the Topic property of the Event Grid Event. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonField Topic { get; set; } + /// + /// Name of a field in the input event schema that's to be used as the source of a mapping. + /// + string TopicSourceField { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/JsonInputSchemaMappingProperties.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/JsonInputSchemaMappingProperties.json.cs new file mode 100644 index 000000000000..38fccee6595c --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/JsonInputSchemaMappingProperties.json.cs @@ -0,0 +1,119 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// + /// This can be used to map properties of a source schema (or default values, for certain supported properties) to properties + /// of the EventGridEvent schema. + /// + public partial class JsonInputSchemaMappingProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IJsonInputSchemaMappingProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new JsonInputSchemaMappingProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal JsonInputSchemaMappingProperties(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_id = If( json?.PropertyT("id"), out var __jsonId) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.JsonField.FromJson(__jsonId) : Id;} + {_topic = If( json?.PropertyT("topic"), out var __jsonTopic) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.JsonField.FromJson(__jsonTopic) : Topic;} + {_eventTime = If( json?.PropertyT("eventTime"), out var __jsonEventTime) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.JsonField.FromJson(__jsonEventTime) : EventTime;} + {_eventType = If( json?.PropertyT("eventType"), out var __jsonEventType) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.JsonFieldWithDefault.FromJson(__jsonEventType) : EventType;} + {_subject = If( json?.PropertyT("subject"), out var __jsonSubject) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.JsonFieldWithDefault.FromJson(__jsonSubject) : Subject;} + {_dataVersion = If( json?.PropertyT("dataVersion"), out var __jsonDataVersion) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.JsonFieldWithDefault.FromJson(__jsonDataVersion) : DataVersion;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._id ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._id.ToJson(null,serializationMode) : null, "id" ,container.Add ); + AddIf( null != this._topic ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._topic.ToJson(null,serializationMode) : null, "topic" ,container.Add ); + AddIf( null != this._eventTime ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._eventTime.ToJson(null,serializationMode) : null, "eventTime" ,container.Add ); + AddIf( null != this._eventType ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._eventType.ToJson(null,serializationMode) : null, "eventType" ,container.Add ); + AddIf( null != this._subject ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._subject.ToJson(null,serializationMode) : null, "subject" ,container.Add ); + AddIf( null != this._dataVersion ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._dataVersion.ToJson(null,serializationMode) : null, "dataVersion" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberGreaterThanAdvancedFilter.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberGreaterThanAdvancedFilter.PowerShell.cs new file mode 100644 index 000000000000..1fd1f22d7128 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberGreaterThanAdvancedFilter.PowerShell.cs @@ -0,0 +1,160 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// NumberGreaterThan Advanced Filter. + [System.ComponentModel.TypeConverter(typeof(NumberGreaterThanAdvancedFilterTypeConverter))] + public partial class NumberGreaterThanAdvancedFilter + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberGreaterThanAdvancedFilter DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new NumberGreaterThanAdvancedFilter(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberGreaterThanAdvancedFilter DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new NumberGreaterThanAdvancedFilter(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberGreaterThanAdvancedFilter FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal NumberGreaterThanAdvancedFilter(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberGreaterThanAdvancedFilterInternal)this).Value = (double?) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberGreaterThanAdvancedFilterInternal)this).Value, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("OperatorType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).OperatorType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType) content.GetValueForProperty("OperatorType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).OperatorType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType.CreateFrom); + } + if (content.Contains("Key")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).Key = (string) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).Key, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal NumberGreaterThanAdvancedFilter(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberGreaterThanAdvancedFilterInternal)this).Value = (double?) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberGreaterThanAdvancedFilterInternal)this).Value, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("OperatorType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).OperatorType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType) content.GetValueForProperty("OperatorType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).OperatorType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType.CreateFrom); + } + if (content.Contains("Key")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).Key = (string) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).Key, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// NumberGreaterThan Advanced Filter. + [System.ComponentModel.TypeConverter(typeof(NumberGreaterThanAdvancedFilterTypeConverter))] + public partial interface INumberGreaterThanAdvancedFilter + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberGreaterThanAdvancedFilter.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberGreaterThanAdvancedFilter.TypeConverter.cs new file mode 100644 index 000000000000..ea12362de15c --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberGreaterThanAdvancedFilter.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class NumberGreaterThanAdvancedFilterTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberGreaterThanAdvancedFilter ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberGreaterThanAdvancedFilter).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return NumberGreaterThanAdvancedFilter.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return NumberGreaterThanAdvancedFilter.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return NumberGreaterThanAdvancedFilter.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberGreaterThanAdvancedFilter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberGreaterThanAdvancedFilter.cs new file mode 100644 index 000000000000..10f820b3a596 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberGreaterThanAdvancedFilter.cs @@ -0,0 +1,80 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// NumberGreaterThan Advanced Filter. + public partial class NumberGreaterThanAdvancedFilter : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberGreaterThanAdvancedFilter, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberGreaterThanAdvancedFilterInternal, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter __advancedFilter = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.AdvancedFilter(); + + /// The field/property in the event based on which you want to filter. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public string Key { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)__advancedFilter).Key; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)__advancedFilter).Key = value ?? null; } + + /// + /// The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType OperatorType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)__advancedFilter).OperatorType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)__advancedFilter).OperatorType = value ; } + + /// Backing field for property. + private double? _value; + + /// The filter value. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public double? Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public NumberGreaterThanAdvancedFilter() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__advancedFilter), __advancedFilter); + await eventListener.AssertObjectIsValid(nameof(__advancedFilter), __advancedFilter); + } + } + /// NumberGreaterThan Advanced Filter. + public partial interface INumberGreaterThanAdvancedFilter : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter + { + /// The filter value. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The filter value.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(double) })] + double? Value { get; set; } + + } + /// NumberGreaterThan Advanced Filter. + internal partial interface INumberGreaterThanAdvancedFilterInternal : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal + { + /// The filter value. + double? Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberGreaterThanAdvancedFilter.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberGreaterThanAdvancedFilter.json.cs new file mode 100644 index 000000000000..c17055143f9a --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberGreaterThanAdvancedFilter.json.cs @@ -0,0 +1,108 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// NumberGreaterThan Advanced Filter. + public partial class NumberGreaterThanAdvancedFilter + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberGreaterThanAdvancedFilter. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberGreaterThanAdvancedFilter. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberGreaterThanAdvancedFilter FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new NumberGreaterThanAdvancedFilter(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal NumberGreaterThanAdvancedFilter(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __advancedFilter = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.AdvancedFilter(json); + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? (double?)__jsonValue : Value;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __advancedFilter?.ToJson(container, serializationMode); + AddIf( null != this._value ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNumber((double)this._value) : null, "value" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberGreaterThanOrEqualsAdvancedFilter.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberGreaterThanOrEqualsAdvancedFilter.PowerShell.cs new file mode 100644 index 000000000000..5b0d115d4eb1 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberGreaterThanOrEqualsAdvancedFilter.PowerShell.cs @@ -0,0 +1,161 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// NumberGreaterThanOrEquals Advanced Filter. + [System.ComponentModel.TypeConverter(typeof(NumberGreaterThanOrEqualsAdvancedFilterTypeConverter))] + public partial class NumberGreaterThanOrEqualsAdvancedFilter + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberGreaterThanOrEqualsAdvancedFilter DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new NumberGreaterThanOrEqualsAdvancedFilter(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberGreaterThanOrEqualsAdvancedFilter DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new NumberGreaterThanOrEqualsAdvancedFilter(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json + /// string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberGreaterThanOrEqualsAdvancedFilter FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal NumberGreaterThanOrEqualsAdvancedFilter(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberGreaterThanOrEqualsAdvancedFilterInternal)this).Value = (double?) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberGreaterThanOrEqualsAdvancedFilterInternal)this).Value, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("OperatorType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).OperatorType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType) content.GetValueForProperty("OperatorType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).OperatorType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType.CreateFrom); + } + if (content.Contains("Key")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).Key = (string) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).Key, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal NumberGreaterThanOrEqualsAdvancedFilter(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberGreaterThanOrEqualsAdvancedFilterInternal)this).Value = (double?) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberGreaterThanOrEqualsAdvancedFilterInternal)this).Value, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("OperatorType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).OperatorType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType) content.GetValueForProperty("OperatorType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).OperatorType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType.CreateFrom); + } + if (content.Contains("Key")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).Key = (string) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).Key, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// NumberGreaterThanOrEquals Advanced Filter. + [System.ComponentModel.TypeConverter(typeof(NumberGreaterThanOrEqualsAdvancedFilterTypeConverter))] + public partial interface INumberGreaterThanOrEqualsAdvancedFilter + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberGreaterThanOrEqualsAdvancedFilter.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberGreaterThanOrEqualsAdvancedFilter.TypeConverter.cs new file mode 100644 index 000000000000..b6b368de1805 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberGreaterThanOrEqualsAdvancedFilter.TypeConverter.cs @@ -0,0 +1,150 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class NumberGreaterThanOrEqualsAdvancedFilterTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberGreaterThanOrEqualsAdvancedFilter ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberGreaterThanOrEqualsAdvancedFilter).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return NumberGreaterThanOrEqualsAdvancedFilter.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return NumberGreaterThanOrEqualsAdvancedFilter.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return NumberGreaterThanOrEqualsAdvancedFilter.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberGreaterThanOrEqualsAdvancedFilter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberGreaterThanOrEqualsAdvancedFilter.cs new file mode 100644 index 000000000000..8f0f7a630453 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberGreaterThanOrEqualsAdvancedFilter.cs @@ -0,0 +1,80 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// NumberGreaterThanOrEquals Advanced Filter. + public partial class NumberGreaterThanOrEqualsAdvancedFilter : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberGreaterThanOrEqualsAdvancedFilter, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberGreaterThanOrEqualsAdvancedFilterInternal, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter __advancedFilter = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.AdvancedFilter(); + + /// The field/property in the event based on which you want to filter. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public string Key { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)__advancedFilter).Key; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)__advancedFilter).Key = value ?? null; } + + /// + /// The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType OperatorType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)__advancedFilter).OperatorType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)__advancedFilter).OperatorType = value ; } + + /// Backing field for property. + private double? _value; + + /// The filter value. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public double? Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public NumberGreaterThanOrEqualsAdvancedFilter() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__advancedFilter), __advancedFilter); + await eventListener.AssertObjectIsValid(nameof(__advancedFilter), __advancedFilter); + } + } + /// NumberGreaterThanOrEquals Advanced Filter. + public partial interface INumberGreaterThanOrEqualsAdvancedFilter : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter + { + /// The filter value. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The filter value.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(double) })] + double? Value { get; set; } + + } + /// NumberGreaterThanOrEquals Advanced Filter. + internal partial interface INumberGreaterThanOrEqualsAdvancedFilterInternal : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal + { + /// The filter value. + double? Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberGreaterThanOrEqualsAdvancedFilter.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberGreaterThanOrEqualsAdvancedFilter.json.cs new file mode 100644 index 000000000000..0d0085f5e998 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberGreaterThanOrEqualsAdvancedFilter.json.cs @@ -0,0 +1,110 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// NumberGreaterThanOrEquals Advanced Filter. + public partial class NumberGreaterThanOrEqualsAdvancedFilter + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberGreaterThanOrEqualsAdvancedFilter. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberGreaterThanOrEqualsAdvancedFilter. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberGreaterThanOrEqualsAdvancedFilter FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new NumberGreaterThanOrEqualsAdvancedFilter(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal NumberGreaterThanOrEqualsAdvancedFilter(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __advancedFilter = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.AdvancedFilter(json); + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? (double?)__jsonValue : Value;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __advancedFilter?.ToJson(container, serializationMode); + AddIf( null != this._value ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNumber((double)this._value) : null, "value" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberInAdvancedFilter.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberInAdvancedFilter.PowerShell.cs new file mode 100644 index 000000000000..7bca13a65b45 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberInAdvancedFilter.PowerShell.cs @@ -0,0 +1,160 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// NumberIn Advanced Filter. + [System.ComponentModel.TypeConverter(typeof(NumberInAdvancedFilterTypeConverter))] + public partial class NumberInAdvancedFilter + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberInAdvancedFilter DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new NumberInAdvancedFilter(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberInAdvancedFilter DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new NumberInAdvancedFilter(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberInAdvancedFilter FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal NumberInAdvancedFilter(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberInAdvancedFilterInternal)this).Value = (double[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberInAdvancedFilterInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, (__w)=> (double) global::System.Convert.ChangeType(__w, typeof(double)))); + } + if (content.Contains("OperatorType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).OperatorType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType) content.GetValueForProperty("OperatorType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).OperatorType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType.CreateFrom); + } + if (content.Contains("Key")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).Key = (string) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).Key, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal NumberInAdvancedFilter(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberInAdvancedFilterInternal)this).Value = (double[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberInAdvancedFilterInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, (__w)=> (double) global::System.Convert.ChangeType(__w, typeof(double)))); + } + if (content.Contains("OperatorType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).OperatorType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType) content.GetValueForProperty("OperatorType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).OperatorType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType.CreateFrom); + } + if (content.Contains("Key")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).Key = (string) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).Key, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// NumberIn Advanced Filter. + [System.ComponentModel.TypeConverter(typeof(NumberInAdvancedFilterTypeConverter))] + public partial interface INumberInAdvancedFilter + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberInAdvancedFilter.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberInAdvancedFilter.TypeConverter.cs new file mode 100644 index 000000000000..d75ef271ffc9 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberInAdvancedFilter.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class NumberInAdvancedFilterTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberInAdvancedFilter ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberInAdvancedFilter).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return NumberInAdvancedFilter.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return NumberInAdvancedFilter.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return NumberInAdvancedFilter.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberInAdvancedFilter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberInAdvancedFilter.cs new file mode 100644 index 000000000000..3d3a9a90c231 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberInAdvancedFilter.cs @@ -0,0 +1,80 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// NumberIn Advanced Filter. + public partial class NumberInAdvancedFilter : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberInAdvancedFilter, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberInAdvancedFilterInternal, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter __advancedFilter = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.AdvancedFilter(); + + /// The field/property in the event based on which you want to filter. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public string Key { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)__advancedFilter).Key; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)__advancedFilter).Key = value ?? null; } + + /// + /// The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType OperatorType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)__advancedFilter).OperatorType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)__advancedFilter).OperatorType = value ; } + + /// Backing field for property. + private double[] _value; + + /// The set of filter values. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public double[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public NumberInAdvancedFilter() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__advancedFilter), __advancedFilter); + await eventListener.AssertObjectIsValid(nameof(__advancedFilter), __advancedFilter); + } + } + /// NumberIn Advanced Filter. + public partial interface INumberInAdvancedFilter : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter + { + /// The set of filter values. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The set of filter values.", + SerializedName = @"values", + PossibleTypes = new [] { typeof(double) })] + double[] Value { get; set; } + + } + /// NumberIn Advanced Filter. + internal partial interface INumberInAdvancedFilterInternal : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal + { + /// The set of filter values. + double[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberInAdvancedFilter.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberInAdvancedFilter.json.cs new file mode 100644 index 000000000000..a79a8c8674b1 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberInAdvancedFilter.json.cs @@ -0,0 +1,116 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// NumberIn Advanced Filter. + public partial class NumberInAdvancedFilter + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberInAdvancedFilter. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberInAdvancedFilter. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberInAdvancedFilter FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new NumberInAdvancedFilter(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal NumberInAdvancedFilter(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __advancedFilter = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.AdvancedFilter(json); + {_value = If( json?.PropertyT("values"), out var __jsonValues) ? If( __jsonValues as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(double) (__u is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNumber __t ? (double)__t : default(double))) ))() : null : Value;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __advancedFilter?.ToJson(container, serializationMode); + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNumber(__x) ,__w.Add); + } + container.Add("values",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberInRangeAdvancedFilter.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberInRangeAdvancedFilter.PowerShell.cs new file mode 100644 index 000000000000..966efcff123b --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberInRangeAdvancedFilter.PowerShell.cs @@ -0,0 +1,160 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// NumberInRange Advanced Filter. + [System.ComponentModel.TypeConverter(typeof(NumberInRangeAdvancedFilterTypeConverter))] + public partial class NumberInRangeAdvancedFilter + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberInRangeAdvancedFilter DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new NumberInRangeAdvancedFilter(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberInRangeAdvancedFilter DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new NumberInRangeAdvancedFilter(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberInRangeAdvancedFilter FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal NumberInRangeAdvancedFilter(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberInRangeAdvancedFilterInternal)this).Value = (double[][]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberInRangeAdvancedFilterInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, __w => TypeConverterExtensions.SelectToArray(__w, (__u)=> (double) global::System.Convert.ChangeType(__u, typeof(double))))); + } + if (content.Contains("OperatorType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).OperatorType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType) content.GetValueForProperty("OperatorType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).OperatorType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType.CreateFrom); + } + if (content.Contains("Key")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).Key = (string) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).Key, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal NumberInRangeAdvancedFilter(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberInRangeAdvancedFilterInternal)this).Value = (double[][]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberInRangeAdvancedFilterInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, __w => TypeConverterExtensions.SelectToArray(__w, (__u)=> (double) global::System.Convert.ChangeType(__u, typeof(double))))); + } + if (content.Contains("OperatorType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).OperatorType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType) content.GetValueForProperty("OperatorType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).OperatorType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType.CreateFrom); + } + if (content.Contains("Key")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).Key = (string) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).Key, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// NumberInRange Advanced Filter. + [System.ComponentModel.TypeConverter(typeof(NumberInRangeAdvancedFilterTypeConverter))] + public partial interface INumberInRangeAdvancedFilter + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberInRangeAdvancedFilter.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberInRangeAdvancedFilter.TypeConverter.cs new file mode 100644 index 000000000000..c8f1233be4ed --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberInRangeAdvancedFilter.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class NumberInRangeAdvancedFilterTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberInRangeAdvancedFilter ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberInRangeAdvancedFilter).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return NumberInRangeAdvancedFilter.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return NumberInRangeAdvancedFilter.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return NumberInRangeAdvancedFilter.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberInRangeAdvancedFilter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberInRangeAdvancedFilter.cs new file mode 100644 index 000000000000..d13fc67dd15c --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberInRangeAdvancedFilter.cs @@ -0,0 +1,80 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// NumberInRange Advanced Filter. + public partial class NumberInRangeAdvancedFilter : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberInRangeAdvancedFilter, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberInRangeAdvancedFilterInternal, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter __advancedFilter = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.AdvancedFilter(); + + /// The field/property in the event based on which you want to filter. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public string Key { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)__advancedFilter).Key; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)__advancedFilter).Key = value ?? null; } + + /// + /// The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType OperatorType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)__advancedFilter).OperatorType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)__advancedFilter).OperatorType = value ; } + + /// Backing field for property. + private double[][] _value; + + /// The set of filter values. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public double[][] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public NumberInRangeAdvancedFilter() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__advancedFilter), __advancedFilter); + await eventListener.AssertObjectIsValid(nameof(__advancedFilter), __advancedFilter); + } + } + /// NumberInRange Advanced Filter. + public partial interface INumberInRangeAdvancedFilter : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter + { + /// The set of filter values. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The set of filter values.", + SerializedName = @"values", + PossibleTypes = new [] { typeof(double) })] + double[][] Value { get; set; } + + } + /// NumberInRange Advanced Filter. + internal partial interface INumberInRangeAdvancedFilterInternal : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal + { + /// The set of filter values. + double[][] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberInRangeAdvancedFilter.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberInRangeAdvancedFilter.json.cs new file mode 100644 index 000000000000..e15f060a4846 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberInRangeAdvancedFilter.json.cs @@ -0,0 +1,116 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// NumberInRange Advanced Filter. + public partial class NumberInRangeAdvancedFilter + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberInRangeAdvancedFilter. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberInRangeAdvancedFilter. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberInRangeAdvancedFilter FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new NumberInRangeAdvancedFilter(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal NumberInRangeAdvancedFilter(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __advancedFilter = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.AdvancedFilter(json); + {_value = If( json?.PropertyT("values"), out var __jsonValues) ? If( __jsonValues as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonArray, out var __u) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__u, (__t)=>(double[]) (If( __t as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonArray, out var __s) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__s, (__r)=>(double) (__r is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNumber __q ? (double)__q : default(double))) ))() : null /* arrayOf */)) ))() : null : Value;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __advancedFilter?.ToJson(container, serializationMode); + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(null != __x ? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.XNodeArray(global::System.Linq.Enumerable.ToArray(System.Linq.Enumerable.Select(__x, (__v) => (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNumber(__v)))) : null ,__w.Add); + } + container.Add("values",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberLessThanAdvancedFilter.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberLessThanAdvancedFilter.PowerShell.cs new file mode 100644 index 000000000000..970138dcb023 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberLessThanAdvancedFilter.PowerShell.cs @@ -0,0 +1,160 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// NumberLessThan Advanced Filter. + [System.ComponentModel.TypeConverter(typeof(NumberLessThanAdvancedFilterTypeConverter))] + public partial class NumberLessThanAdvancedFilter + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberLessThanAdvancedFilter DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new NumberLessThanAdvancedFilter(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberLessThanAdvancedFilter DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new NumberLessThanAdvancedFilter(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberLessThanAdvancedFilter FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal NumberLessThanAdvancedFilter(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberLessThanAdvancedFilterInternal)this).Value = (double?) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberLessThanAdvancedFilterInternal)this).Value, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("OperatorType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).OperatorType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType) content.GetValueForProperty("OperatorType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).OperatorType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType.CreateFrom); + } + if (content.Contains("Key")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).Key = (string) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).Key, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal NumberLessThanAdvancedFilter(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberLessThanAdvancedFilterInternal)this).Value = (double?) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberLessThanAdvancedFilterInternal)this).Value, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("OperatorType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).OperatorType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType) content.GetValueForProperty("OperatorType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).OperatorType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType.CreateFrom); + } + if (content.Contains("Key")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).Key = (string) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).Key, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// NumberLessThan Advanced Filter. + [System.ComponentModel.TypeConverter(typeof(NumberLessThanAdvancedFilterTypeConverter))] + public partial interface INumberLessThanAdvancedFilter + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberLessThanAdvancedFilter.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberLessThanAdvancedFilter.TypeConverter.cs new file mode 100644 index 000000000000..86d1916008e0 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberLessThanAdvancedFilter.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class NumberLessThanAdvancedFilterTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberLessThanAdvancedFilter ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberLessThanAdvancedFilter).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return NumberLessThanAdvancedFilter.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return NumberLessThanAdvancedFilter.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return NumberLessThanAdvancedFilter.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberLessThanAdvancedFilter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberLessThanAdvancedFilter.cs new file mode 100644 index 000000000000..613e06e46e0f --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberLessThanAdvancedFilter.cs @@ -0,0 +1,80 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// NumberLessThan Advanced Filter. + public partial class NumberLessThanAdvancedFilter : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberLessThanAdvancedFilter, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberLessThanAdvancedFilterInternal, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter __advancedFilter = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.AdvancedFilter(); + + /// The field/property in the event based on which you want to filter. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public string Key { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)__advancedFilter).Key; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)__advancedFilter).Key = value ?? null; } + + /// + /// The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType OperatorType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)__advancedFilter).OperatorType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)__advancedFilter).OperatorType = value ; } + + /// Backing field for property. + private double? _value; + + /// The filter value. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public double? Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public NumberLessThanAdvancedFilter() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__advancedFilter), __advancedFilter); + await eventListener.AssertObjectIsValid(nameof(__advancedFilter), __advancedFilter); + } + } + /// NumberLessThan Advanced Filter. + public partial interface INumberLessThanAdvancedFilter : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter + { + /// The filter value. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The filter value.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(double) })] + double? Value { get; set; } + + } + /// NumberLessThan Advanced Filter. + internal partial interface INumberLessThanAdvancedFilterInternal : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal + { + /// The filter value. + double? Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberLessThanAdvancedFilter.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberLessThanAdvancedFilter.json.cs new file mode 100644 index 000000000000..bd4f936a86b7 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberLessThanAdvancedFilter.json.cs @@ -0,0 +1,108 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// NumberLessThan Advanced Filter. + public partial class NumberLessThanAdvancedFilter + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberLessThanAdvancedFilter. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberLessThanAdvancedFilter. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberLessThanAdvancedFilter FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new NumberLessThanAdvancedFilter(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal NumberLessThanAdvancedFilter(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __advancedFilter = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.AdvancedFilter(json); + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? (double?)__jsonValue : Value;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __advancedFilter?.ToJson(container, serializationMode); + AddIf( null != this._value ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNumber((double)this._value) : null, "value" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberLessThanOrEqualsAdvancedFilter.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberLessThanOrEqualsAdvancedFilter.PowerShell.cs new file mode 100644 index 000000000000..3a6f743b8e45 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberLessThanOrEqualsAdvancedFilter.PowerShell.cs @@ -0,0 +1,160 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// NumberLessThanOrEquals Advanced Filter. + [System.ComponentModel.TypeConverter(typeof(NumberLessThanOrEqualsAdvancedFilterTypeConverter))] + public partial class NumberLessThanOrEqualsAdvancedFilter + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberLessThanOrEqualsAdvancedFilter DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new NumberLessThanOrEqualsAdvancedFilter(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberLessThanOrEqualsAdvancedFilter DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new NumberLessThanOrEqualsAdvancedFilter(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberLessThanOrEqualsAdvancedFilter FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal NumberLessThanOrEqualsAdvancedFilter(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberLessThanOrEqualsAdvancedFilterInternal)this).Value = (double?) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberLessThanOrEqualsAdvancedFilterInternal)this).Value, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("OperatorType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).OperatorType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType) content.GetValueForProperty("OperatorType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).OperatorType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType.CreateFrom); + } + if (content.Contains("Key")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).Key = (string) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).Key, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal NumberLessThanOrEqualsAdvancedFilter(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberLessThanOrEqualsAdvancedFilterInternal)this).Value = (double?) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberLessThanOrEqualsAdvancedFilterInternal)this).Value, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("OperatorType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).OperatorType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType) content.GetValueForProperty("OperatorType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).OperatorType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType.CreateFrom); + } + if (content.Contains("Key")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).Key = (string) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).Key, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// NumberLessThanOrEquals Advanced Filter. + [System.ComponentModel.TypeConverter(typeof(NumberLessThanOrEqualsAdvancedFilterTypeConverter))] + public partial interface INumberLessThanOrEqualsAdvancedFilter + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberLessThanOrEqualsAdvancedFilter.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberLessThanOrEqualsAdvancedFilter.TypeConverter.cs new file mode 100644 index 000000000000..2c8fceb56418 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberLessThanOrEqualsAdvancedFilter.TypeConverter.cs @@ -0,0 +1,149 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class NumberLessThanOrEqualsAdvancedFilterTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberLessThanOrEqualsAdvancedFilter ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberLessThanOrEqualsAdvancedFilter).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return NumberLessThanOrEqualsAdvancedFilter.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return NumberLessThanOrEqualsAdvancedFilter.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return NumberLessThanOrEqualsAdvancedFilter.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberLessThanOrEqualsAdvancedFilter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberLessThanOrEqualsAdvancedFilter.cs new file mode 100644 index 000000000000..171efca18c34 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberLessThanOrEqualsAdvancedFilter.cs @@ -0,0 +1,80 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// NumberLessThanOrEquals Advanced Filter. + public partial class NumberLessThanOrEqualsAdvancedFilter : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberLessThanOrEqualsAdvancedFilter, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberLessThanOrEqualsAdvancedFilterInternal, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter __advancedFilter = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.AdvancedFilter(); + + /// The field/property in the event based on which you want to filter. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public string Key { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)__advancedFilter).Key; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)__advancedFilter).Key = value ?? null; } + + /// + /// The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType OperatorType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)__advancedFilter).OperatorType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)__advancedFilter).OperatorType = value ; } + + /// Backing field for property. + private double? _value; + + /// The filter value. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public double? Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public NumberLessThanOrEqualsAdvancedFilter() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__advancedFilter), __advancedFilter); + await eventListener.AssertObjectIsValid(nameof(__advancedFilter), __advancedFilter); + } + } + /// NumberLessThanOrEquals Advanced Filter. + public partial interface INumberLessThanOrEqualsAdvancedFilter : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter + { + /// The filter value. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The filter value.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(double) })] + double? Value { get; set; } + + } + /// NumberLessThanOrEquals Advanced Filter. + internal partial interface INumberLessThanOrEqualsAdvancedFilterInternal : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal + { + /// The filter value. + double? Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberLessThanOrEqualsAdvancedFilter.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberLessThanOrEqualsAdvancedFilter.json.cs new file mode 100644 index 000000000000..a4bd1a497dc2 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberLessThanOrEqualsAdvancedFilter.json.cs @@ -0,0 +1,109 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// NumberLessThanOrEquals Advanced Filter. + public partial class NumberLessThanOrEqualsAdvancedFilter + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberLessThanOrEqualsAdvancedFilter. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberLessThanOrEqualsAdvancedFilter. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberLessThanOrEqualsAdvancedFilter FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new NumberLessThanOrEqualsAdvancedFilter(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal NumberLessThanOrEqualsAdvancedFilter(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __advancedFilter = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.AdvancedFilter(json); + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? (double?)__jsonValue : Value;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __advancedFilter?.ToJson(container, serializationMode); + AddIf( null != this._value ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNumber((double)this._value) : null, "value" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberNotInAdvancedFilter.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberNotInAdvancedFilter.PowerShell.cs new file mode 100644 index 000000000000..b408cdfa7611 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberNotInAdvancedFilter.PowerShell.cs @@ -0,0 +1,160 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// NumberNotIn Advanced Filter. + [System.ComponentModel.TypeConverter(typeof(NumberNotInAdvancedFilterTypeConverter))] + public partial class NumberNotInAdvancedFilter + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberNotInAdvancedFilter DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new NumberNotInAdvancedFilter(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberNotInAdvancedFilter DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new NumberNotInAdvancedFilter(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberNotInAdvancedFilter FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal NumberNotInAdvancedFilter(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberNotInAdvancedFilterInternal)this).Value = (double[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberNotInAdvancedFilterInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, (__w)=> (double) global::System.Convert.ChangeType(__w, typeof(double)))); + } + if (content.Contains("OperatorType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).OperatorType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType) content.GetValueForProperty("OperatorType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).OperatorType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType.CreateFrom); + } + if (content.Contains("Key")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).Key = (string) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).Key, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal NumberNotInAdvancedFilter(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberNotInAdvancedFilterInternal)this).Value = (double[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberNotInAdvancedFilterInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, (__w)=> (double) global::System.Convert.ChangeType(__w, typeof(double)))); + } + if (content.Contains("OperatorType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).OperatorType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType) content.GetValueForProperty("OperatorType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).OperatorType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType.CreateFrom); + } + if (content.Contains("Key")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).Key = (string) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).Key, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// NumberNotIn Advanced Filter. + [System.ComponentModel.TypeConverter(typeof(NumberNotInAdvancedFilterTypeConverter))] + public partial interface INumberNotInAdvancedFilter + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberNotInAdvancedFilter.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberNotInAdvancedFilter.TypeConverter.cs new file mode 100644 index 000000000000..d71c206d420c --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberNotInAdvancedFilter.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class NumberNotInAdvancedFilterTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberNotInAdvancedFilter ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberNotInAdvancedFilter).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return NumberNotInAdvancedFilter.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return NumberNotInAdvancedFilter.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return NumberNotInAdvancedFilter.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberNotInAdvancedFilter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberNotInAdvancedFilter.cs new file mode 100644 index 000000000000..be99a25b9aa3 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberNotInAdvancedFilter.cs @@ -0,0 +1,80 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// NumberNotIn Advanced Filter. + public partial class NumberNotInAdvancedFilter : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberNotInAdvancedFilter, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberNotInAdvancedFilterInternal, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter __advancedFilter = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.AdvancedFilter(); + + /// The field/property in the event based on which you want to filter. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public string Key { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)__advancedFilter).Key; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)__advancedFilter).Key = value ?? null; } + + /// + /// The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType OperatorType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)__advancedFilter).OperatorType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)__advancedFilter).OperatorType = value ; } + + /// Backing field for property. + private double[] _value; + + /// The set of filter values. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public double[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public NumberNotInAdvancedFilter() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__advancedFilter), __advancedFilter); + await eventListener.AssertObjectIsValid(nameof(__advancedFilter), __advancedFilter); + } + } + /// NumberNotIn Advanced Filter. + public partial interface INumberNotInAdvancedFilter : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter + { + /// The set of filter values. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The set of filter values.", + SerializedName = @"values", + PossibleTypes = new [] { typeof(double) })] + double[] Value { get; set; } + + } + /// NumberNotIn Advanced Filter. + internal partial interface INumberNotInAdvancedFilterInternal : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal + { + /// The set of filter values. + double[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberNotInAdvancedFilter.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberNotInAdvancedFilter.json.cs new file mode 100644 index 000000000000..a22967bbb87c --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberNotInAdvancedFilter.json.cs @@ -0,0 +1,116 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// NumberNotIn Advanced Filter. + public partial class NumberNotInAdvancedFilter + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberNotInAdvancedFilter. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberNotInAdvancedFilter. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberNotInAdvancedFilter FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new NumberNotInAdvancedFilter(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal NumberNotInAdvancedFilter(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __advancedFilter = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.AdvancedFilter(json); + {_value = If( json?.PropertyT("values"), out var __jsonValues) ? If( __jsonValues as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(double) (__u is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNumber __t ? (double)__t : default(double))) ))() : null : Value;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __advancedFilter?.ToJson(container, serializationMode); + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNumber(__x) ,__w.Add); + } + container.Add("values",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberNotInRangeAdvancedFilter.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberNotInRangeAdvancedFilter.PowerShell.cs new file mode 100644 index 000000000000..002133534d94 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberNotInRangeAdvancedFilter.PowerShell.cs @@ -0,0 +1,160 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// NumberNotInRange Advanced Filter. + [System.ComponentModel.TypeConverter(typeof(NumberNotInRangeAdvancedFilterTypeConverter))] + public partial class NumberNotInRangeAdvancedFilter + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberNotInRangeAdvancedFilter DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new NumberNotInRangeAdvancedFilter(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberNotInRangeAdvancedFilter DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new NumberNotInRangeAdvancedFilter(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberNotInRangeAdvancedFilter FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal NumberNotInRangeAdvancedFilter(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberNotInRangeAdvancedFilterInternal)this).Value = (double[][]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberNotInRangeAdvancedFilterInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, __w => TypeConverterExtensions.SelectToArray(__w, (__u)=> (double) global::System.Convert.ChangeType(__u, typeof(double))))); + } + if (content.Contains("OperatorType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).OperatorType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType) content.GetValueForProperty("OperatorType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).OperatorType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType.CreateFrom); + } + if (content.Contains("Key")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).Key = (string) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).Key, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal NumberNotInRangeAdvancedFilter(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberNotInRangeAdvancedFilterInternal)this).Value = (double[][]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberNotInRangeAdvancedFilterInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, __w => TypeConverterExtensions.SelectToArray(__w, (__u)=> (double) global::System.Convert.ChangeType(__u, typeof(double))))); + } + if (content.Contains("OperatorType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).OperatorType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType) content.GetValueForProperty("OperatorType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).OperatorType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType.CreateFrom); + } + if (content.Contains("Key")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).Key = (string) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).Key, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// NumberNotInRange Advanced Filter. + [System.ComponentModel.TypeConverter(typeof(NumberNotInRangeAdvancedFilterTypeConverter))] + public partial interface INumberNotInRangeAdvancedFilter + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberNotInRangeAdvancedFilter.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberNotInRangeAdvancedFilter.TypeConverter.cs new file mode 100644 index 000000000000..20f56688dfa6 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberNotInRangeAdvancedFilter.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class NumberNotInRangeAdvancedFilterTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberNotInRangeAdvancedFilter ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberNotInRangeAdvancedFilter).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return NumberNotInRangeAdvancedFilter.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return NumberNotInRangeAdvancedFilter.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return NumberNotInRangeAdvancedFilter.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberNotInRangeAdvancedFilter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberNotInRangeAdvancedFilter.cs new file mode 100644 index 000000000000..3ac5e0457731 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberNotInRangeAdvancedFilter.cs @@ -0,0 +1,80 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// NumberNotInRange Advanced Filter. + public partial class NumberNotInRangeAdvancedFilter : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberNotInRangeAdvancedFilter, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberNotInRangeAdvancedFilterInternal, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter __advancedFilter = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.AdvancedFilter(); + + /// The field/property in the event based on which you want to filter. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public string Key { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)__advancedFilter).Key; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)__advancedFilter).Key = value ?? null; } + + /// + /// The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType OperatorType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)__advancedFilter).OperatorType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)__advancedFilter).OperatorType = value ; } + + /// Backing field for property. + private double[][] _value; + + /// The set of filter values. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public double[][] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public NumberNotInRangeAdvancedFilter() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__advancedFilter), __advancedFilter); + await eventListener.AssertObjectIsValid(nameof(__advancedFilter), __advancedFilter); + } + } + /// NumberNotInRange Advanced Filter. + public partial interface INumberNotInRangeAdvancedFilter : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter + { + /// The set of filter values. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The set of filter values.", + SerializedName = @"values", + PossibleTypes = new [] { typeof(double) })] + double[][] Value { get; set; } + + } + /// NumberNotInRange Advanced Filter. + internal partial interface INumberNotInRangeAdvancedFilterInternal : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal + { + /// The set of filter values. + double[][] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberNotInRangeAdvancedFilter.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberNotInRangeAdvancedFilter.json.cs new file mode 100644 index 000000000000..659fcca4dfb8 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/NumberNotInRangeAdvancedFilter.json.cs @@ -0,0 +1,116 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// NumberNotInRange Advanced Filter. + public partial class NumberNotInRangeAdvancedFilter + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberNotInRangeAdvancedFilter. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberNotInRangeAdvancedFilter. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.INumberNotInRangeAdvancedFilter FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new NumberNotInRangeAdvancedFilter(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal NumberNotInRangeAdvancedFilter(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __advancedFilter = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.AdvancedFilter(json); + {_value = If( json?.PropertyT("values"), out var __jsonValues) ? If( __jsonValues as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonArray, out var __u) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__u, (__t)=>(double[]) (If( __t as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonArray, out var __s) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__s, (__r)=>(double) (__r is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNumber __q ? (double)__q : default(double))) ))() : null /* arrayOf */)) ))() : null : Value;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __advancedFilter?.ToJson(container, serializationMode); + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(null != __x ? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.XNodeArray(global::System.Linq.Enumerable.ToArray(System.Linq.Enumerable.Select(__x, (__v) => (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNumber(__v)))) : null ,__w.Add); + } + container.Add("values",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/Operation.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/Operation.PowerShell.cs new file mode 100644 index 000000000000..1cde99e833ff --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/Operation.PowerShell.cs @@ -0,0 +1,206 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Represents an operation returned by the GetOperations request. + [System.ComponentModel.TypeConverter(typeof(OperationTypeConverter))] + public partial class Operation + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperation DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new Operation(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new Operation(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal Operation(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Display")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperationInternal)this).Display = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperationInfo) content.GetValueForProperty("Display",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperationInternal)this).Display, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.OperationInfoTypeConverter.ConvertFrom); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperationInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Origin")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperationInternal)this).Origin = (string) content.GetValueForProperty("Origin",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperationInternal)this).Origin, global::System.Convert.ToString); + } + if (content.Contains("IsDataAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperationInternal)this).IsDataAction = (bool?) content.GetValueForProperty("IsDataAction",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperationInternal)this).IsDataAction, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperationInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IAny) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperationInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.AnyTypeConverter.ConvertFrom); + } + if (content.Contains("DisplayProvider")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperationInternal)this).DisplayProvider = (string) content.GetValueForProperty("DisplayProvider",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperationInternal)this).DisplayProvider, global::System.Convert.ToString); + } + if (content.Contains("DisplayResource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperationInternal)this).DisplayResource = (string) content.GetValueForProperty("DisplayResource",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperationInternal)this).DisplayResource, global::System.Convert.ToString); + } + if (content.Contains("DisplayOperation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperationInternal)this).DisplayOperation = (string) content.GetValueForProperty("DisplayOperation",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperationInternal)this).DisplayOperation, global::System.Convert.ToString); + } + if (content.Contains("DisplayDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperationInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperationInternal)this).DisplayDescription, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal Operation(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Display")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperationInternal)this).Display = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperationInfo) content.GetValueForProperty("Display",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperationInternal)this).Display, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.OperationInfoTypeConverter.ConvertFrom); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperationInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Origin")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperationInternal)this).Origin = (string) content.GetValueForProperty("Origin",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperationInternal)this).Origin, global::System.Convert.ToString); + } + if (content.Contains("IsDataAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperationInternal)this).IsDataAction = (bool?) content.GetValueForProperty("IsDataAction",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperationInternal)this).IsDataAction, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperationInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IAny) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperationInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.AnyTypeConverter.ConvertFrom); + } + if (content.Contains("DisplayProvider")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperationInternal)this).DisplayProvider = (string) content.GetValueForProperty("DisplayProvider",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperationInternal)this).DisplayProvider, global::System.Convert.ToString); + } + if (content.Contains("DisplayResource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperationInternal)this).DisplayResource = (string) content.GetValueForProperty("DisplayResource",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperationInternal)this).DisplayResource, global::System.Convert.ToString); + } + if (content.Contains("DisplayOperation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperationInternal)this).DisplayOperation = (string) content.GetValueForProperty("DisplayOperation",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperationInternal)this).DisplayOperation, global::System.Convert.ToString); + } + if (content.Contains("DisplayDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperationInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperationInternal)this).DisplayDescription, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Represents an operation returned by the GetOperations request. + [System.ComponentModel.TypeConverter(typeof(OperationTypeConverter))] + public partial interface IOperation + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/Operation.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/Operation.TypeConverter.cs new file mode 100644 index 000000000000..b6f4335f4652 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/Operation.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class OperationTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperation ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperation).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return Operation.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return Operation.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return Operation.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/Operation.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/Operation.cs new file mode 100644 index 000000000000..997ac092cc1e --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/Operation.cs @@ -0,0 +1,176 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Represents an operation returned by the GetOperations request. + public partial class Operation : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperation, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperationInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperationInfo _display; + + /// Display name of the operation. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperationInfo Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.OperationInfo()); set => this._display = value; } + + /// Description of the operation + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string DisplayDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperationInfoInternal)Display).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperationInfoInternal)Display).Description = value ?? null; } + + /// Name of the operation + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string DisplayOperation { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperationInfoInternal)Display).Operation; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperationInfoInternal)Display).Operation = value ?? null; } + + /// Name of the provider + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string DisplayProvider { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperationInfoInternal)Display).Provider; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperationInfoInternal)Display).Provider = value ?? null; } + + /// Name of the resource type + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string DisplayResource { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperationInfoInternal)Display).Resource; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperationInfoInternal)Display).Resource = value ?? null; } + + /// Backing field for property. + private bool? _isDataAction; + + /// + /// This Boolean is used to determine if the operation is a data plane action or not. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public bool? IsDataAction { get => this._isDataAction; set => this._isDataAction = value; } + + /// Internal Acessors for Display + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperationInfo Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperationInternal.Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.OperationInfo()); set { {_display = value;} } } + + /// Backing field for property. + private string _name; + + /// Name of the operation. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private string _origin; + + /// Origin of the operation. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string Origin { get => this._origin; set => this._origin = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IAny _property; + + /// Properties of the operation. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IAny Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Any()); set => this._property = value; } + + /// Creates an new instance. + public Operation() + { + + } + } + /// Represents an operation returned by the GetOperations request. + public partial interface IOperation : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// Description of the operation + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Description of the operation", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string DisplayDescription { get; set; } + /// Name of the operation + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the operation", + SerializedName = @"operation", + PossibleTypes = new [] { typeof(string) })] + string DisplayOperation { get; set; } + /// Name of the provider + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the provider", + SerializedName = @"provider", + PossibleTypes = new [] { typeof(string) })] + string DisplayProvider { get; set; } + /// Name of the resource type + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the resource type", + SerializedName = @"resource", + PossibleTypes = new [] { typeof(string) })] + string DisplayResource { get; set; } + /// + /// This Boolean is used to determine if the operation is a data plane action or not. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This Boolean is used to determine if the operation is a data plane action or not.", + SerializedName = @"isDataAction", + PossibleTypes = new [] { typeof(bool) })] + bool? IsDataAction { get; set; } + /// Name of the operation. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the operation.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + /// Origin of the operation. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Origin of the operation.", + SerializedName = @"origin", + PossibleTypes = new [] { typeof(string) })] + string Origin { get; set; } + /// Properties of the operation. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Properties of the operation.", + SerializedName = @"properties", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IAny) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IAny Property { get; set; } + + } + /// Represents an operation returned by the GetOperations request. + internal partial interface IOperationInternal + + { + /// Display name of the operation. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperationInfo Display { get; set; } + /// Description of the operation + string DisplayDescription { get; set; } + /// Name of the operation + string DisplayOperation { get; set; } + /// Name of the provider + string DisplayProvider { get; set; } + /// Name of the resource type + string DisplayResource { get; set; } + /// + /// This Boolean is used to determine if the operation is a data plane action or not. + /// + bool? IsDataAction { get; set; } + /// Name of the operation. + string Name { get; set; } + /// Origin of the operation. + string Origin { get; set; } + /// Properties of the operation. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IAny Property { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/Operation.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/Operation.json.cs new file mode 100644 index 000000000000..974c06d967a3 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/Operation.json.cs @@ -0,0 +1,114 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Represents an operation returned by the GetOperations request. + public partial class Operation + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperation. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperation. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperation FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new Operation(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal Operation(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_display = If( json?.PropertyT("display"), out var __jsonDisplay) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.OperationInfo.FromJson(__jsonDisplay) : Display;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_origin = If( json?.PropertyT("origin"), out var __jsonOrigin) ? (string)__jsonOrigin : (string)Origin;} + {_isDataAction = If( json?.PropertyT("isDataAction"), out var __jsonIsDataAction) ? (bool?)__jsonIsDataAction : IsDataAction;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Any.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._display ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._display.ToJson(null,serializationMode) : null, "display" ,container.Add ); + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AddIf( null != (((object)this._origin)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._origin.ToString()) : null, "origin" ,container.Add ); + AddIf( null != this._isDataAction ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonBoolean((bool)this._isDataAction) : null, "isDataAction" ,container.Add ); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/OperationInfo.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/OperationInfo.PowerShell.cs new file mode 100644 index 000000000000..df29db50415d --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/OperationInfo.PowerShell.cs @@ -0,0 +1,166 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Information about an operation + [System.ComponentModel.TypeConverter(typeof(OperationInfoTypeConverter))] + public partial class OperationInfo + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperationInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new OperationInfo(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperationInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new OperationInfo(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperationInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal OperationInfo(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Provider")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperationInfoInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperationInfoInternal)this).Provider, global::System.Convert.ToString); + } + if (content.Contains("Resource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperationInfoInternal)this).Resource = (string) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperationInfoInternal)this).Resource, global::System.Convert.ToString); + } + if (content.Contains("Operation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperationInfoInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperationInfoInternal)this).Operation, global::System.Convert.ToString); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperationInfoInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperationInfoInternal)this).Description, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal OperationInfo(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Provider")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperationInfoInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperationInfoInternal)this).Provider, global::System.Convert.ToString); + } + if (content.Contains("Resource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperationInfoInternal)this).Resource = (string) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperationInfoInternal)this).Resource, global::System.Convert.ToString); + } + if (content.Contains("Operation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperationInfoInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperationInfoInternal)this).Operation, global::System.Convert.ToString); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperationInfoInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperationInfoInternal)this).Description, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Information about an operation + [System.ComponentModel.TypeConverter(typeof(OperationInfoTypeConverter))] + public partial interface IOperationInfo + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/OperationInfo.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/OperationInfo.TypeConverter.cs new file mode 100644 index 000000000000..ef98204a2004 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/OperationInfo.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class OperationInfoTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperationInfo ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperationInfo).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return OperationInfo.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return OperationInfo.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return OperationInfo.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/OperationInfo.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/OperationInfo.cs new file mode 100644 index 000000000000..afd3c3b6898e --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/OperationInfo.cs @@ -0,0 +1,102 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Information about an operation + public partial class OperationInfo : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperationInfo, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperationInfoInternal + { + + /// Backing field for property. + private string _description; + + /// Description of the operation + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string Description { get => this._description; set => this._description = value; } + + /// Backing field for property. + private string _operation; + + /// Name of the operation + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string Operation { get => this._operation; set => this._operation = value; } + + /// Backing field for property. + private string _provider; + + /// Name of the provider + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string Provider { get => this._provider; set => this._provider = value; } + + /// Backing field for property. + private string _resource; + + /// Name of the resource type + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string Resource { get => this._resource; set => this._resource = value; } + + /// Creates an new instance. + public OperationInfo() + { + + } + } + /// Information about an operation + public partial interface IOperationInfo : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// Description of the operation + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Description of the operation", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// Name of the operation + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the operation", + SerializedName = @"operation", + PossibleTypes = new [] { typeof(string) })] + string Operation { get; set; } + /// Name of the provider + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the provider", + SerializedName = @"provider", + PossibleTypes = new [] { typeof(string) })] + string Provider { get; set; } + /// Name of the resource type + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the resource type", + SerializedName = @"resource", + PossibleTypes = new [] { typeof(string) })] + string Resource { get; set; } + + } + /// Information about an operation + internal partial interface IOperationInfoInternal + + { + /// Description of the operation + string Description { get; set; } + /// Name of the operation + string Operation { get; set; } + /// Name of the provider + string Provider { get; set; } + /// Name of the resource type + string Resource { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/OperationInfo.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/OperationInfo.json.cs new file mode 100644 index 000000000000..1d812e21ecfc --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/OperationInfo.json.cs @@ -0,0 +1,112 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Information about an operation + public partial class OperationInfo + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperationInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperationInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperationInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new OperationInfo(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal OperationInfo(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_provider = If( json?.PropertyT("provider"), out var __jsonProvider) ? (string)__jsonProvider : (string)Provider;} + {_resource = If( json?.PropertyT("resource"), out var __jsonResource) ? (string)__jsonResource : (string)Resource;} + {_operation = If( json?.PropertyT("operation"), out var __jsonOperation) ? (string)__jsonOperation : (string)Operation;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._provider)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._provider.ToString()) : null, "provider" ,container.Add ); + AddIf( null != (((object)this._resource)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._resource.ToString()) : null, "resource" ,container.Add ); + AddIf( null != (((object)this._operation)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._operation.ToString()) : null, "operation" ,container.Add ); + AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._description.ToString()) : null, "description" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/OperationsListResult.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/OperationsListResult.PowerShell.cs new file mode 100644 index 000000000000..a3ec5abab4ae --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/OperationsListResult.PowerShell.cs @@ -0,0 +1,144 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Result of the List Operations operation + [System.ComponentModel.TypeConverter(typeof(OperationsListResultTypeConverter))] + public partial class OperationsListResult + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperationsListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new OperationsListResult(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperationsListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new OperationsListResult(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperationsListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal OperationsListResult(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperationsListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperation[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperationsListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.OperationTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal OperationsListResult(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperationsListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperation[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperationsListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.OperationTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Result of the List Operations operation + [System.ComponentModel.TypeConverter(typeof(OperationsListResultTypeConverter))] + public partial interface IOperationsListResult + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/OperationsListResult.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/OperationsListResult.TypeConverter.cs new file mode 100644 index 000000000000..a771fa863c98 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/OperationsListResult.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class OperationsListResultTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperationsListResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperationsListResult).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return OperationsListResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return OperationsListResult.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return OperationsListResult.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/OperationsListResult.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/OperationsListResult.cs new file mode 100644 index 000000000000..41c3e8fb5db8 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/OperationsListResult.cs @@ -0,0 +1,51 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Result of the List Operations operation + public partial class OperationsListResult : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperationsListResult, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperationsListResultInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperation[] _value; + + /// A collection of operations + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperation[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public OperationsListResult() + { + + } + } + /// Result of the List Operations operation + public partial interface IOperationsListResult : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// A collection of operations + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A collection of operations", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperation) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperation[] Value { get; set; } + + } + /// Result of the List Operations operation + internal partial interface IOperationsListResultInternal + + { + /// A collection of operations + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperation[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/OperationsListResult.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/OperationsListResult.json.cs new file mode 100644 index 000000000000..b8282530fbd9 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/OperationsListResult.json.cs @@ -0,0 +1,114 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Result of the List Operations operation + public partial class OperationsListResult + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperationsListResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperationsListResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperationsListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new OperationsListResult(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal OperationsListResult(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperation) (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.Operation.FromJson(__u) )) ))() : null : Value;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/Partner.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/Partner.PowerShell.cs new file mode 100644 index 000000000000..7148f97bb439 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/Partner.PowerShell.cs @@ -0,0 +1,158 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Information about the partner. + [System.ComponentModel.TypeConverter(typeof(PartnerTypeConverter))] + public partial class Partner + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartner DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new Partner(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartner DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new Partner(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartner FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal Partner(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("RegistrationImmutableId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerInternal)this).RegistrationImmutableId = (string) content.GetValueForProperty("RegistrationImmutableId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerInternal)this).RegistrationImmutableId, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("AuthorizationExpirationTimeInUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerInternal)this).AuthorizationExpirationTimeInUtc = (global::System.DateTime?) content.GetValueForProperty("AuthorizationExpirationTimeInUtc",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerInternal)this).AuthorizationExpirationTimeInUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal Partner(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("RegistrationImmutableId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerInternal)this).RegistrationImmutableId = (string) content.GetValueForProperty("RegistrationImmutableId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerInternal)this).RegistrationImmutableId, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("AuthorizationExpirationTimeInUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerInternal)this).AuthorizationExpirationTimeInUtc = (global::System.DateTime?) content.GetValueForProperty("AuthorizationExpirationTimeInUtc",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerInternal)this).AuthorizationExpirationTimeInUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Information about the partner. + [System.ComponentModel.TypeConverter(typeof(PartnerTypeConverter))] + public partial interface IPartner + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/Partner.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/Partner.TypeConverter.cs new file mode 100644 index 000000000000..c52076f52429 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/Partner.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class PartnerTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartner ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartner).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return Partner.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return Partner.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return Partner.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/Partner.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/Partner.cs new file mode 100644 index 000000000000..33fc37f7840e --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/Partner.cs @@ -0,0 +1,108 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Information about the partner. + public partial class Partner : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartner, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerInternal + { + + /// Backing field for property. + private global::System.DateTime? _authorizationExpirationTimeInUtc; + + /// + /// Expiration time of the partner authorization. If this timer expires, any request from this partner to create, update or + /// delete resources in subscriber's + /// context will fail. If specified, the allowed values are between 1 to the value of defaultMaximumExpirationTimeInDays specified + /// in PartnerConfiguration. + /// If not specified, the default value will be the value of defaultMaximumExpirationTimeInDays specified in PartnerConfiguration + /// or 7 if this value is not specified. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public global::System.DateTime? AuthorizationExpirationTimeInUtc { get => this._authorizationExpirationTimeInUtc; set => this._authorizationExpirationTimeInUtc = value; } + + /// Backing field for property. + private string _name; + + /// The partner name. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private string _registrationImmutableId; + + /// The immutableId of the corresponding partner registration. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string RegistrationImmutableId { get => this._registrationImmutableId; set => this._registrationImmutableId = value; } + + /// Creates an new instance. + public Partner() + { + + } + } + /// Information about the partner. + public partial interface IPartner : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// + /// Expiration time of the partner authorization. If this timer expires, any request from this partner to create, update or + /// delete resources in subscriber's + /// context will fail. If specified, the allowed values are between 1 to the value of defaultMaximumExpirationTimeInDays specified + /// in PartnerConfiguration. + /// If not specified, the default value will be the value of defaultMaximumExpirationTimeInDays specified in PartnerConfiguration + /// or 7 if this value is not specified. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Expiration time of the partner authorization. If this timer expires, any request from this partner to create, update or delete resources in subscriber's + context will fail. If specified, the allowed values are between 1 to the value of defaultMaximumExpirationTimeInDays specified in PartnerConfiguration. + If not specified, the default value will be the value of defaultMaximumExpirationTimeInDays specified in PartnerConfiguration or 7 if this value is not specified.", + SerializedName = @"authorizationExpirationTimeInUtc", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? AuthorizationExpirationTimeInUtc { get; set; } + /// The partner name. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The partner name.", + SerializedName = @"partnerName", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + /// The immutableId of the corresponding partner registration. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The immutableId of the corresponding partner registration.", + SerializedName = @"partnerRegistrationImmutableId", + PossibleTypes = new [] { typeof(string) })] + string RegistrationImmutableId { get; set; } + + } + /// Information about the partner. + internal partial interface IPartnerInternal + + { + /// + /// Expiration time of the partner authorization. If this timer expires, any request from this partner to create, update or + /// delete resources in subscriber's + /// context will fail. If specified, the allowed values are between 1 to the value of defaultMaximumExpirationTimeInDays specified + /// in PartnerConfiguration. + /// If not specified, the default value will be the value of defaultMaximumExpirationTimeInDays specified in PartnerConfiguration + /// or 7 if this value is not specified. + /// + global::System.DateTime? AuthorizationExpirationTimeInUtc { get; set; } + /// The partner name. + string Name { get; set; } + /// The immutableId of the corresponding partner registration. + string RegistrationImmutableId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/Partner.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/Partner.json.cs new file mode 100644 index 000000000000..2bb9f0c487a0 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/Partner.json.cs @@ -0,0 +1,110 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Information about the partner. + public partial class Partner + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartner. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartner. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartner FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new Partner(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal Partner(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_registrationImmutableId = If( json?.PropertyT("partnerRegistrationImmutableId"), out var __jsonPartnerRegistrationImmutableId) ? (string)__jsonPartnerRegistrationImmutableId : (string)RegistrationImmutableId;} + {_name = If( json?.PropertyT("partnerName"), out var __jsonPartnerName) ? (string)__jsonPartnerName : (string)Name;} + {_authorizationExpirationTimeInUtc = If( json?.PropertyT("authorizationExpirationTimeInUtc"), out var __jsonAuthorizationExpirationTimeInUtc) ? global::System.DateTime.TryParse((string)__jsonAuthorizationExpirationTimeInUtc, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonAuthorizationExpirationTimeInUtcValue) ? __jsonAuthorizationExpirationTimeInUtcValue : AuthorizationExpirationTimeInUtc : AuthorizationExpirationTimeInUtc;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._registrationImmutableId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._registrationImmutableId.ToString()) : null, "partnerRegistrationImmutableId" ,container.Add ); + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._name.ToString()) : null, "partnerName" ,container.Add ); + AddIf( null != this._authorizationExpirationTimeInUtc ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._authorizationExpirationTimeInUtc?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "authorizationExpirationTimeInUtc" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerAuthorization.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerAuthorization.PowerShell.cs new file mode 100644 index 000000000000..298f0f26c9ec --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerAuthorization.PowerShell.cs @@ -0,0 +1,152 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// The partner authorization details. + [System.ComponentModel.TypeConverter(typeof(PartnerAuthorizationTypeConverter))] + public partial class PartnerAuthorization + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerAuthorization DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new PartnerAuthorization(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerAuthorization DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new PartnerAuthorization(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerAuthorization FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal PartnerAuthorization(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DefaultMaximumExpirationTimeInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerAuthorizationInternal)this).DefaultMaximumExpirationTimeInDay = (int?) content.GetValueForProperty("DefaultMaximumExpirationTimeInDay",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerAuthorizationInternal)this).DefaultMaximumExpirationTimeInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("AuthorizedPartnersList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerAuthorizationInternal)this).AuthorizedPartnersList = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartner[]) content.GetValueForProperty("AuthorizedPartnersList",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerAuthorizationInternal)this).AuthorizedPartnersList, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal PartnerAuthorization(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DefaultMaximumExpirationTimeInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerAuthorizationInternal)this).DefaultMaximumExpirationTimeInDay = (int?) content.GetValueForProperty("DefaultMaximumExpirationTimeInDay",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerAuthorizationInternal)this).DefaultMaximumExpirationTimeInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("AuthorizedPartnersList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerAuthorizationInternal)this).AuthorizedPartnersList = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartner[]) content.GetValueForProperty("AuthorizedPartnersList",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerAuthorizationInternal)this).AuthorizedPartnersList, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The partner authorization details. + [System.ComponentModel.TypeConverter(typeof(PartnerAuthorizationTypeConverter))] + public partial interface IPartnerAuthorization + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerAuthorization.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerAuthorization.TypeConverter.cs new file mode 100644 index 000000000000..b7959bf08b5f --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerAuthorization.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class PartnerAuthorizationTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerAuthorization ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerAuthorization).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return PartnerAuthorization.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return PartnerAuthorization.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return PartnerAuthorization.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerAuthorization.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerAuthorization.cs new file mode 100644 index 000000000000..e0e4735250e7 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerAuthorization.cs @@ -0,0 +1,81 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// The partner authorization details. + public partial class PartnerAuthorization : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerAuthorization, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerAuthorizationInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartner[] _authorizedPartnersList; + + /// The list of authorized partners. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartner[] AuthorizedPartnersList { get => this._authorizedPartnersList; set => this._authorizedPartnersList = value; } + + /// Backing field for property. + private int? _defaultMaximumExpirationTimeInDay; + + /// + /// Time used to validate the authorization expiration time for each authorized partner. If DefaultMaximumExpirationTimeInDays + /// is + /// not specified, the default is 7 days. Otherwise, allowed values are between 1 and 365 days. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public int? DefaultMaximumExpirationTimeInDay { get => this._defaultMaximumExpirationTimeInDay; set => this._defaultMaximumExpirationTimeInDay = value; } + + /// Creates an new instance. + public PartnerAuthorization() + { + + } + } + /// The partner authorization details. + public partial interface IPartnerAuthorization : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// The list of authorized partners. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of authorized partners.", + SerializedName = @"authorizedPartnersList", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartner) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartner[] AuthorizedPartnersList { get; set; } + /// + /// Time used to validate the authorization expiration time for each authorized partner. If DefaultMaximumExpirationTimeInDays + /// is + /// not specified, the default is 7 days. Otherwise, allowed values are between 1 and 365 days. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Time used to validate the authorization expiration time for each authorized partner. If DefaultMaximumExpirationTimeInDays is + not specified, the default is 7 days. Otherwise, allowed values are between 1 and 365 days.", + SerializedName = @"defaultMaximumExpirationTimeInDays", + PossibleTypes = new [] { typeof(int) })] + int? DefaultMaximumExpirationTimeInDay { get; set; } + + } + /// The partner authorization details. + internal partial interface IPartnerAuthorizationInternal + + { + /// The list of authorized partners. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartner[] AuthorizedPartnersList { get; set; } + /// + /// Time used to validate the authorization expiration time for each authorized partner. If DefaultMaximumExpirationTimeInDays + /// is + /// not specified, the default is 7 days. Otherwise, allowed values are between 1 and 365 days. + /// + int? DefaultMaximumExpirationTimeInDay { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerAuthorization.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerAuthorization.json.cs new file mode 100644 index 000000000000..0cd859b8bb4c --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerAuthorization.json.cs @@ -0,0 +1,116 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// The partner authorization details. + public partial class PartnerAuthorization + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerAuthorization. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerAuthorization. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerAuthorization FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new PartnerAuthorization(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal PartnerAuthorization(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_defaultMaximumExpirationTimeInDay = If( json?.PropertyT("defaultMaximumExpirationTimeInDays"), out var __jsonDefaultMaximumExpirationTimeInDays) ? (int?)__jsonDefaultMaximumExpirationTimeInDays : DefaultMaximumExpirationTimeInDay;} + {_authorizedPartnersList = If( json?.PropertyT("authorizedPartnersList"), out var __jsonAuthorizedPartnersList) ? If( __jsonAuthorizedPartnersList as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartner) (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.Partner.FromJson(__u) )) ))() : null : AuthorizedPartnersList;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._defaultMaximumExpirationTimeInDay ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNumber((int)this._defaultMaximumExpirationTimeInDay) : null, "defaultMaximumExpirationTimeInDays" ,container.Add ); + if (null != this._authorizedPartnersList) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.XNodeArray(); + foreach( var __x in this._authorizedPartnersList ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("authorizedPartnersList",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerClientAuthentication.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerClientAuthentication.PowerShell.cs new file mode 100644 index 000000000000..02f231d4a26d --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerClientAuthentication.PowerShell.cs @@ -0,0 +1,144 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Partner client authentication + [System.ComponentModel.TypeConverter(typeof(PartnerClientAuthenticationTypeConverter))] + public partial class PartnerClientAuthentication + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerClientAuthentication DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new PartnerClientAuthentication(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerClientAuthentication DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new PartnerClientAuthentication(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerClientAuthentication FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal PartnerClientAuthentication(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ClientAuthenticationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerClientAuthenticationInternal)this).ClientAuthenticationType = (string) content.GetValueForProperty("ClientAuthenticationType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerClientAuthenticationInternal)this).ClientAuthenticationType, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal PartnerClientAuthentication(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ClientAuthenticationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerClientAuthenticationInternal)this).ClientAuthenticationType = (string) content.GetValueForProperty("ClientAuthenticationType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerClientAuthenticationInternal)this).ClientAuthenticationType, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Partner client authentication + [System.ComponentModel.TypeConverter(typeof(PartnerClientAuthenticationTypeConverter))] + public partial interface IPartnerClientAuthentication + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerClientAuthentication.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerClientAuthentication.TypeConverter.cs new file mode 100644 index 000000000000..a5795d944be8 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerClientAuthentication.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class PartnerClientAuthenticationTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerClientAuthentication ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerClientAuthentication).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return PartnerClientAuthentication.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return PartnerClientAuthentication.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return PartnerClientAuthentication.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerClientAuthentication.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerClientAuthentication.cs new file mode 100644 index 000000000000..de5c9d8bf866 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerClientAuthentication.cs @@ -0,0 +1,54 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Partner client authentication + public partial class PartnerClientAuthentication : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerClientAuthentication, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerClientAuthenticationInternal + { + + /// Backing field for property. + private string _clientAuthenticationType= @"AzureAD"; + + /// Type of client authentication + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string ClientAuthenticationType { get => this._clientAuthenticationType; } + + /// Internal Acessors for ClientAuthenticationType + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerClientAuthenticationInternal.ClientAuthenticationType { get => this._clientAuthenticationType; set { {_clientAuthenticationType = value;} } } + + /// Creates an new instance. + public PartnerClientAuthentication() + { + + } + } + /// Partner client authentication + public partial interface IPartnerClientAuthentication : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// Type of client authentication + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = true, + Description = @"Type of client authentication", + SerializedName = @"clientAuthenticationType", + PossibleTypes = new [] { typeof(string) })] + string ClientAuthenticationType { get; } + + } + /// Partner client authentication + internal partial interface IPartnerClientAuthenticationInternal + + { + /// Type of client authentication + string ClientAuthenticationType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerClientAuthentication.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerClientAuthentication.json.cs new file mode 100644 index 000000000000..79a64ff5068d --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerClientAuthentication.json.cs @@ -0,0 +1,121 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Partner client authentication + public partial class PartnerClientAuthentication + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerClientAuthentication. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerClientAuthentication interface + /// is polymorphic, and the precise model class that will get deserialized is determined at runtime based on the payload. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerClientAuthentication. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerClientAuthentication FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + if (!(node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json)) + { + return null; + } + // Polymorphic type -- select the appropriate constructor using the discriminator + + switch ( json.StringProperty("clientAuthenticationType") ) + { + case "AzureAD": + { + return new AzureAdPartnerClientAuthentication(json); + } + } + return new PartnerClientAuthentication(json); + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal PartnerClientAuthentication(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_clientAuthenticationType = If( json?.PropertyT("clientAuthenticationType"), out var __jsonClientAuthenticationType) ? (string)__jsonClientAuthenticationType : (string)ClientAuthenticationType;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._clientAuthenticationType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._clientAuthenticationType.ToString()) : null, "clientAuthenticationType" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerConfiguration.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerConfiguration.PowerShell.cs new file mode 100644 index 000000000000..5584741db599 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerConfiguration.PowerShell.cs @@ -0,0 +1,272 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Partner configuration information + [System.ComponentModel.TypeConverter(typeof(PartnerConfigurationTypeConverter))] + public partial class PartnerConfiguration + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfiguration DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new PartnerConfiguration(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfiguration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new PartnerConfiguration(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfiguration FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal PartnerConfiguration(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerConfigurationPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerConfigurationTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("PartnerAuthorization")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationInternal)this).PartnerAuthorization = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerAuthorization) content.GetValueForProperty("PartnerAuthorization",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationInternal)this).PartnerAuthorization, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerAuthorizationTypeConverter.ConvertFrom); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerConfigurationProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerConfigurationProvisioningState.CreateFrom); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("PartnerAuthorizationDefaultMaximumExpirationTimeInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationInternal)this).PartnerAuthorizationDefaultMaximumExpirationTimeInDay = (int?) content.GetValueForProperty("PartnerAuthorizationDefaultMaximumExpirationTimeInDay",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationInternal)this).PartnerAuthorizationDefaultMaximumExpirationTimeInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("PartnerAuthorizationAuthorizedPartnersList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationInternal)this).PartnerAuthorizationAuthorizedPartnersList = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartner[]) content.GetValueForProperty("PartnerAuthorizationAuthorizedPartnersList",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationInternal)this).PartnerAuthorizationAuthorizedPartnersList, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal PartnerConfiguration(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerConfigurationPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerConfigurationTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("PartnerAuthorization")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationInternal)this).PartnerAuthorization = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerAuthorization) content.GetValueForProperty("PartnerAuthorization",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationInternal)this).PartnerAuthorization, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerAuthorizationTypeConverter.ConvertFrom); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerConfigurationProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerConfigurationProvisioningState.CreateFrom); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("PartnerAuthorizationDefaultMaximumExpirationTimeInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationInternal)this).PartnerAuthorizationDefaultMaximumExpirationTimeInDay = (int?) content.GetValueForProperty("PartnerAuthorizationDefaultMaximumExpirationTimeInDay",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationInternal)this).PartnerAuthorizationDefaultMaximumExpirationTimeInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("PartnerAuthorizationAuthorizedPartnersList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationInternal)this).PartnerAuthorizationAuthorizedPartnersList = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartner[]) content.GetValueForProperty("PartnerAuthorizationAuthorizedPartnersList",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationInternal)this).PartnerAuthorizationAuthorizedPartnersList, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Partner configuration information + [System.ComponentModel.TypeConverter(typeof(PartnerConfigurationTypeConverter))] + public partial interface IPartnerConfiguration + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerConfiguration.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerConfiguration.TypeConverter.cs new file mode 100644 index 000000000000..643a7b7cf994 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerConfiguration.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class PartnerConfigurationTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfiguration ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfiguration).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return PartnerConfiguration.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return PartnerConfiguration.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return PartnerConfiguration.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerConfiguration.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerConfiguration.cs new file mode 100644 index 000000000000..b2ae04c96838 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerConfiguration.cs @@ -0,0 +1,276 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Partner configuration information + public partial class PartnerConfiguration : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfiguration, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationInternal, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.Resource(); + + /// Fully qualified identifier of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Id; } + + /// Backing field for property. + private string _location; + + /// Location of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string Location { get => this._location; set => this._location = value; } + + /// Internal Acessors for PartnerAuthorization + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerAuthorization Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationInternal.PartnerAuthorization { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationPropertiesInternal)Property).PartnerAuthorization; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationPropertiesInternal)Property).PartnerAuthorization = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationProperties Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerConfigurationProperties()); set { {_property = value;} } } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.SystemData()); set { {_systemData = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Type = value; } + + /// Name of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Name; } + + /// The list of authorized partners. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartner[] PartnerAuthorizationAuthorizedPartnersList { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationPropertiesInternal)Property).PartnerAuthorizationAuthorizedPartnersList; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationPropertiesInternal)Property).PartnerAuthorizationAuthorizedPartnersList = value ?? null /* arrayOf */; } + + /// + /// Time used to validate the authorization expiration time for each authorized partner. If DefaultMaximumExpirationTimeInDays + /// is + /// not specified, the default is 7 days. Otherwise, allowed values are between 1 and 365 days. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public int? PartnerAuthorizationDefaultMaximumExpirationTimeInDay { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationPropertiesInternal)Property).PartnerAuthorizationDefaultMaximumExpirationTimeInDay; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationPropertiesInternal)Property).PartnerAuthorizationDefaultMaximumExpirationTimeInDay = value ?? default(int); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationProperties _property; + + /// Properties of the partner configuration. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerConfigurationProperties()); set => this._property = value; } + + /// Provisioning state of the partner configuration. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerConfigurationProvisioningState? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationPropertiesInternal)Property).ProvisioningState = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerConfigurationProvisioningState)""); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData _systemData; + + /// The system metadata relating to partner configuration resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.SystemData()); } + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).CreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType)""); } + + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType)""); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationTags _tag; + + /// Tags of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerConfigurationTags()); set => this._tag = value; } + + /// Type of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public PartnerConfiguration() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// Partner configuration information + public partial interface IPartnerConfiguration : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResource + { + /// Location of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Location of the resource.", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + string Location { get; set; } + /// The list of authorized partners. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of authorized partners.", + SerializedName = @"authorizedPartnersList", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartner) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartner[] PartnerAuthorizationAuthorizedPartnersList { get; set; } + /// + /// Time used to validate the authorization expiration time for each authorized partner. If DefaultMaximumExpirationTimeInDays + /// is + /// not specified, the default is 7 days. Otherwise, allowed values are between 1 and 365 days. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Time used to validate the authorization expiration time for each authorized partner. If DefaultMaximumExpirationTimeInDays is + not specified, the default is 7 days. Otherwise, allowed values are between 1 and 365 days.", + SerializedName = @"defaultMaximumExpirationTimeInDays", + PossibleTypes = new [] { typeof(int) })] + int? PartnerAuthorizationDefaultMaximumExpirationTimeInDay { get; set; } + /// Provisioning state of the partner configuration. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Provisioning state of the partner configuration.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerConfigurationProvisioningState) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerConfigurationProvisioningState? ProvisioningState { get; set; } + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timestamp of resource creation (UTC).", + SerializedName = @"createdAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SystemDataCreatedAt { get; set; } + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identity that created the resource.", + SerializedName = @"createdBy", + PossibleTypes = new [] { typeof(string) })] + string SystemDataCreatedBy { get; set; } + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of identity that created the resource.", + SerializedName = @"createdByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType? SystemDataCreatedByType { get; set; } + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timestamp of resource last modification (UTC)", + SerializedName = @"lastModifiedAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SystemDataLastModifiedAt { get; set; } + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identity that last modified the resource.", + SerializedName = @"lastModifiedBy", + PossibleTypes = new [] { typeof(string) })] + string SystemDataLastModifiedBy { get; set; } + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of identity that last modified the resource.", + SerializedName = @"lastModifiedByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + /// Tags of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Tags of the resource.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationTags) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationTags Tag { get; set; } + + } + /// Partner configuration information + internal partial interface IPartnerConfigurationInternal : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal + { + /// Location of the resource. + string Location { get; set; } + /// The details of authorized partners. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerAuthorization PartnerAuthorization { get; set; } + /// The list of authorized partners. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartner[] PartnerAuthorizationAuthorizedPartnersList { get; set; } + /// + /// Time used to validate the authorization expiration time for each authorized partner. If DefaultMaximumExpirationTimeInDays + /// is + /// not specified, the default is 7 days. Otherwise, allowed values are between 1 and 365 days. + /// + int? PartnerAuthorizationDefaultMaximumExpirationTimeInDay { get; set; } + /// Properties of the partner configuration. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationProperties Property { get; set; } + /// Provisioning state of the partner configuration. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerConfigurationProvisioningState? ProvisioningState { get; set; } + /// The system metadata relating to partner configuration resource. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData SystemData { get; set; } + /// The timestamp of resource creation (UTC). + global::System.DateTime? SystemDataCreatedAt { get; set; } + /// The identity that created the resource. + string SystemDataCreatedBy { get; set; } + /// The type of identity that created the resource. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType? SystemDataCreatedByType { get; set; } + /// The timestamp of resource last modification (UTC) + global::System.DateTime? SystemDataLastModifiedAt { get; set; } + /// The identity that last modified the resource. + string SystemDataLastModifiedBy { get; set; } + /// The type of identity that last modified the resource. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + /// Tags of the resource. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationTags Tag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerConfiguration.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerConfiguration.json.cs new file mode 100644 index 000000000000..2db13dbdf701 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerConfiguration.json.cs @@ -0,0 +1,117 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Partner configuration information + public partial class PartnerConfiguration + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfiguration. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfiguration. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfiguration FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new PartnerConfiguration(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal PartnerConfiguration(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerConfigurationProperties.FromJson(__jsonProperties) : Property;} + {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.SystemData.FromJson(__jsonSystemData) : SystemData;} + {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)Location;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerConfigurationTags.FromJson(__jsonTags) : Tag;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._systemData ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._systemData.ToJson(null,serializationMode) : null, "systemData" ,container.Add ); + } + AddIf( null != (((object)this._location)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._location.ToString()) : null, "location" ,container.Add ); + AddIf( null != this._tag ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._tag.ToJson(null,serializationMode) : null, "tags" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerConfigurationProperties.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerConfigurationProperties.PowerShell.cs new file mode 100644 index 000000000000..98e5b5c01aed --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerConfigurationProperties.PowerShell.cs @@ -0,0 +1,168 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Properties of the partner configuration. + [System.ComponentModel.TypeConverter(typeof(PartnerConfigurationPropertiesTypeConverter))] + public partial class PartnerConfigurationProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new PartnerConfigurationProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new PartnerConfigurationProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal PartnerConfigurationProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("PartnerAuthorization")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationPropertiesInternal)this).PartnerAuthorization = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerAuthorization) content.GetValueForProperty("PartnerAuthorization",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationPropertiesInternal)this).PartnerAuthorization, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerAuthorizationTypeConverter.ConvertFrom); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerConfigurationProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerConfigurationProvisioningState.CreateFrom); + } + if (content.Contains("PartnerAuthorizationDefaultMaximumExpirationTimeInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationPropertiesInternal)this).PartnerAuthorizationDefaultMaximumExpirationTimeInDay = (int?) content.GetValueForProperty("PartnerAuthorizationDefaultMaximumExpirationTimeInDay",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationPropertiesInternal)this).PartnerAuthorizationDefaultMaximumExpirationTimeInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("PartnerAuthorizationAuthorizedPartnersList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationPropertiesInternal)this).PartnerAuthorizationAuthorizedPartnersList = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartner[]) content.GetValueForProperty("PartnerAuthorizationAuthorizedPartnersList",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationPropertiesInternal)this).PartnerAuthorizationAuthorizedPartnersList, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal PartnerConfigurationProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("PartnerAuthorization")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationPropertiesInternal)this).PartnerAuthorization = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerAuthorization) content.GetValueForProperty("PartnerAuthorization",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationPropertiesInternal)this).PartnerAuthorization, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerAuthorizationTypeConverter.ConvertFrom); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerConfigurationProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerConfigurationProvisioningState.CreateFrom); + } + if (content.Contains("PartnerAuthorizationDefaultMaximumExpirationTimeInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationPropertiesInternal)this).PartnerAuthorizationDefaultMaximumExpirationTimeInDay = (int?) content.GetValueForProperty("PartnerAuthorizationDefaultMaximumExpirationTimeInDay",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationPropertiesInternal)this).PartnerAuthorizationDefaultMaximumExpirationTimeInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("PartnerAuthorizationAuthorizedPartnersList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationPropertiesInternal)this).PartnerAuthorizationAuthorizedPartnersList = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartner[]) content.GetValueForProperty("PartnerAuthorizationAuthorizedPartnersList",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationPropertiesInternal)this).PartnerAuthorizationAuthorizedPartnersList, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties of the partner configuration. + [System.ComponentModel.TypeConverter(typeof(PartnerConfigurationPropertiesTypeConverter))] + public partial interface IPartnerConfigurationProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerConfigurationProperties.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerConfigurationProperties.TypeConverter.cs new file mode 100644 index 000000000000..ae283e1fceb7 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerConfigurationProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class PartnerConfigurationPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return PartnerConfigurationProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return PartnerConfigurationProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return PartnerConfigurationProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerConfigurationProperties.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerConfigurationProperties.cs new file mode 100644 index 000000000000..6c2f130e85f1 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerConfigurationProperties.cs @@ -0,0 +1,104 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Properties of the partner configuration. + public partial class PartnerConfigurationProperties : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationProperties, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationPropertiesInternal + { + + /// Internal Acessors for PartnerAuthorization + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerAuthorization Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationPropertiesInternal.PartnerAuthorization { get => (this._partnerAuthorization = this._partnerAuthorization ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerAuthorization()); set { {_partnerAuthorization = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerAuthorization _partnerAuthorization; + + /// The details of authorized partners. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerAuthorization PartnerAuthorization { get => (this._partnerAuthorization = this._partnerAuthorization ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerAuthorization()); set => this._partnerAuthorization = value; } + + /// The list of authorized partners. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartner[] PartnerAuthorizationAuthorizedPartnersList { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerAuthorizationInternal)PartnerAuthorization).AuthorizedPartnersList; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerAuthorizationInternal)PartnerAuthorization).AuthorizedPartnersList = value ?? null /* arrayOf */; } + + /// + /// Time used to validate the authorization expiration time for each authorized partner. If DefaultMaximumExpirationTimeInDays + /// is + /// not specified, the default is 7 days. Otherwise, allowed values are between 1 and 365 days. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public int? PartnerAuthorizationDefaultMaximumExpirationTimeInDay { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerAuthorizationInternal)PartnerAuthorization).DefaultMaximumExpirationTimeInDay; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerAuthorizationInternal)PartnerAuthorization).DefaultMaximumExpirationTimeInDay = value ?? default(int); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerConfigurationProvisioningState? _provisioningState; + + /// Provisioning state of the partner configuration. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerConfigurationProvisioningState? ProvisioningState { get => this._provisioningState; set => this._provisioningState = value; } + + /// Creates an new instance. + public PartnerConfigurationProperties() + { + + } + } + /// Properties of the partner configuration. + public partial interface IPartnerConfigurationProperties : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// The list of authorized partners. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of authorized partners.", + SerializedName = @"authorizedPartnersList", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartner) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartner[] PartnerAuthorizationAuthorizedPartnersList { get; set; } + /// + /// Time used to validate the authorization expiration time for each authorized partner. If DefaultMaximumExpirationTimeInDays + /// is + /// not specified, the default is 7 days. Otherwise, allowed values are between 1 and 365 days. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Time used to validate the authorization expiration time for each authorized partner. If DefaultMaximumExpirationTimeInDays is + not specified, the default is 7 days. Otherwise, allowed values are between 1 and 365 days.", + SerializedName = @"defaultMaximumExpirationTimeInDays", + PossibleTypes = new [] { typeof(int) })] + int? PartnerAuthorizationDefaultMaximumExpirationTimeInDay { get; set; } + /// Provisioning state of the partner configuration. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Provisioning state of the partner configuration.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerConfigurationProvisioningState) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerConfigurationProvisioningState? ProvisioningState { get; set; } + + } + /// Properties of the partner configuration. + internal partial interface IPartnerConfigurationPropertiesInternal + + { + /// The details of authorized partners. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerAuthorization PartnerAuthorization { get; set; } + /// The list of authorized partners. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartner[] PartnerAuthorizationAuthorizedPartnersList { get; set; } + /// + /// Time used to validate the authorization expiration time for each authorized partner. If DefaultMaximumExpirationTimeInDays + /// is + /// not specified, the default is 7 days. Otherwise, allowed values are between 1 and 365 days. + /// + int? PartnerAuthorizationDefaultMaximumExpirationTimeInDay { get; set; } + /// Provisioning state of the partner configuration. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerConfigurationProvisioningState? ProvisioningState { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerConfigurationProperties.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerConfigurationProperties.json.cs new file mode 100644 index 000000000000..9bcb67d04ea9 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerConfigurationProperties.json.cs @@ -0,0 +1,108 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Properties of the partner configuration. + public partial class PartnerConfigurationProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new PartnerConfigurationProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal PartnerConfigurationProperties(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_partnerAuthorization = If( json?.PropertyT("partnerAuthorization"), out var __jsonPartnerAuthorization) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerAuthorization.FromJson(__jsonPartnerAuthorization) : PartnerAuthorization;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._partnerAuthorization ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._partnerAuthorization.ToJson(null,serializationMode) : null, "partnerAuthorization" ,container.Add ); + AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerConfigurationTags.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerConfigurationTags.PowerShell.cs new file mode 100644 index 000000000000..ace452b412f7 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerConfigurationTags.PowerShell.cs @@ -0,0 +1,140 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Tags of the resource. + [System.ComponentModel.TypeConverter(typeof(PartnerConfigurationTagsTypeConverter))] + public partial class PartnerConfigurationTags + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationTags DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new PartnerConfigurationTags(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new PartnerConfigurationTags(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal PartnerConfigurationTags(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal PartnerConfigurationTags(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Tags of the resource. + [System.ComponentModel.TypeConverter(typeof(PartnerConfigurationTagsTypeConverter))] + public partial interface IPartnerConfigurationTags + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerConfigurationTags.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerConfigurationTags.TypeConverter.cs new file mode 100644 index 000000000000..17a2592f60df --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerConfigurationTags.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class PartnerConfigurationTagsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationTags ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationTags).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return PartnerConfigurationTags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return PartnerConfigurationTags.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return PartnerConfigurationTags.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerConfigurationTags.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerConfigurationTags.cs new file mode 100644 index 000000000000..192603b292b1 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerConfigurationTags.cs @@ -0,0 +1,35 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Tags of the resource. + public partial class PartnerConfigurationTags : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationTags, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationTagsInternal + { + + /// Creates an new instance. + public PartnerConfigurationTags() + { + + } + } + /// Tags of the resource. + public partial interface IPartnerConfigurationTags : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray + { + + } + /// Tags of the resource. + internal partial interface IPartnerConfigurationTagsInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerConfigurationTags.dictionary.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerConfigurationTags.dictionary.cs new file mode 100644 index 000000000000..e326d658404a --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerConfigurationTags.dictionary.cs @@ -0,0 +1,75 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + public partial class PartnerConfigurationTags : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerConfigurationTags source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerConfigurationTags.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerConfigurationTags.json.cs new file mode 100644 index 000000000000..227c71316614 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerConfigurationTags.json.cs @@ -0,0 +1,107 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Tags of the resource. + public partial class PartnerConfigurationTags + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationTags. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationTags. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new PartnerConfigurationTags(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + /// + internal PartnerConfigurationTags(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerConfigurationUpdateParameterProperties.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerConfigurationUpdateParameterProperties.PowerShell.cs new file mode 100644 index 000000000000..07f39102f9fe --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerConfigurationUpdateParameterProperties.PowerShell.cs @@ -0,0 +1,145 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Information of partner configuration update parameter properties. + [System.ComponentModel.TypeConverter(typeof(PartnerConfigurationUpdateParameterPropertiesTypeConverter))] + public partial class PartnerConfigurationUpdateParameterProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationUpdateParameterProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new PartnerConfigurationUpdateParameterProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationUpdateParameterProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new PartnerConfigurationUpdateParameterProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from + /// a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationUpdateParameterProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal PartnerConfigurationUpdateParameterProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DefaultMaximumExpirationTimeInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationUpdateParameterPropertiesInternal)this).DefaultMaximumExpirationTimeInDay = (int?) content.GetValueForProperty("DefaultMaximumExpirationTimeInDay",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationUpdateParameterPropertiesInternal)this).DefaultMaximumExpirationTimeInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal PartnerConfigurationUpdateParameterProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DefaultMaximumExpirationTimeInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationUpdateParameterPropertiesInternal)this).DefaultMaximumExpirationTimeInDay = (int?) content.GetValueForProperty("DefaultMaximumExpirationTimeInDay",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationUpdateParameterPropertiesInternal)this).DefaultMaximumExpirationTimeInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Information of partner configuration update parameter properties. + [System.ComponentModel.TypeConverter(typeof(PartnerConfigurationUpdateParameterPropertiesTypeConverter))] + public partial interface IPartnerConfigurationUpdateParameterProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerConfigurationUpdateParameterProperties.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerConfigurationUpdateParameterProperties.TypeConverter.cs new file mode 100644 index 000000000000..563f71504e04 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerConfigurationUpdateParameterProperties.TypeConverter.cs @@ -0,0 +1,150 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class PartnerConfigurationUpdateParameterPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, + /// otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationUpdateParameterProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationUpdateParameterProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return PartnerConfigurationUpdateParameterProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return PartnerConfigurationUpdateParameterProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return PartnerConfigurationUpdateParameterProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerConfigurationUpdateParameterProperties.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerConfigurationUpdateParameterProperties.cs new file mode 100644 index 000000000000..8317c0ee8766 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerConfigurationUpdateParameterProperties.cs @@ -0,0 +1,62 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Information of partner configuration update parameter properties. + public partial class PartnerConfigurationUpdateParameterProperties : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationUpdateParameterProperties, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationUpdateParameterPropertiesInternal + { + + /// Backing field for property. + private int? _defaultMaximumExpirationTimeInDay; + + /// + /// The default time used to validate the maximum expiration time for each authorized partners in days. Allowed values ar + /// between 1 and 365 days. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public int? DefaultMaximumExpirationTimeInDay { get => this._defaultMaximumExpirationTimeInDay; set => this._defaultMaximumExpirationTimeInDay = value; } + + /// + /// Creates an new instance. + /// + public PartnerConfigurationUpdateParameterProperties() + { + + } + } + /// Information of partner configuration update parameter properties. + public partial interface IPartnerConfigurationUpdateParameterProperties : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// + /// The default time used to validate the maximum expiration time for each authorized partners in days. Allowed values ar + /// between 1 and 365 days. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default time used to validate the maximum expiration time for each authorized partners in days. Allowed values ar between 1 and 365 days.", + SerializedName = @"defaultMaximumExpirationTimeInDays", + PossibleTypes = new [] { typeof(int) })] + int? DefaultMaximumExpirationTimeInDay { get; set; } + + } + /// Information of partner configuration update parameter properties. + internal partial interface IPartnerConfigurationUpdateParameterPropertiesInternal + + { + /// + /// The default time used to validate the maximum expiration time for each authorized partners in days. Allowed values ar + /// between 1 and 365 days. + /// + int? DefaultMaximumExpirationTimeInDay { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerConfigurationUpdateParameterProperties.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerConfigurationUpdateParameterProperties.json.cs new file mode 100644 index 000000000000..67d66c9ac562 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerConfigurationUpdateParameterProperties.json.cs @@ -0,0 +1,109 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Information of partner configuration update parameter properties. + public partial class PartnerConfigurationUpdateParameterProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationUpdateParameterProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationUpdateParameterProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationUpdateParameterProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new PartnerConfigurationUpdateParameterProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal PartnerConfigurationUpdateParameterProperties(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_defaultMaximumExpirationTimeInDay = If( json?.PropertyT("defaultMaximumExpirationTimeInDays"), out var __jsonDefaultMaximumExpirationTimeInDays) ? (int?)__jsonDefaultMaximumExpirationTimeInDays : DefaultMaximumExpirationTimeInDay;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._defaultMaximumExpirationTimeInDay ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNumber((int)this._defaultMaximumExpirationTimeInDay) : null, "defaultMaximumExpirationTimeInDays" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerConfigurationUpdateParameters.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerConfigurationUpdateParameters.PowerShell.cs new file mode 100644 index 000000000000..b1c3b0474918 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerConfigurationUpdateParameters.PowerShell.cs @@ -0,0 +1,160 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Properties of the partner configuration update. + [System.ComponentModel.TypeConverter(typeof(PartnerConfigurationUpdateParametersTypeConverter))] + public partial class PartnerConfigurationUpdateParameters + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationUpdateParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new PartnerConfigurationUpdateParameters(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationUpdateParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new PartnerConfigurationUpdateParameters(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationUpdateParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal PartnerConfigurationUpdateParameters(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationUpdateParametersInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationUpdateParameterProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationUpdateParametersInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerConfigurationUpdateParameterPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationUpdateParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationUpdateParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationUpdateParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerConfigurationUpdateParametersTagsTypeConverter.ConvertFrom); + } + if (content.Contains("DefaultMaximumExpirationTimeInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationUpdateParametersInternal)this).DefaultMaximumExpirationTimeInDay = (int?) content.GetValueForProperty("DefaultMaximumExpirationTimeInDay",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationUpdateParametersInternal)this).DefaultMaximumExpirationTimeInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal PartnerConfigurationUpdateParameters(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationUpdateParametersInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationUpdateParameterProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationUpdateParametersInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerConfigurationUpdateParameterPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationUpdateParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationUpdateParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationUpdateParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerConfigurationUpdateParametersTagsTypeConverter.ConvertFrom); + } + if (content.Contains("DefaultMaximumExpirationTimeInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationUpdateParametersInternal)this).DefaultMaximumExpirationTimeInDay = (int?) content.GetValueForProperty("DefaultMaximumExpirationTimeInDay",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationUpdateParametersInternal)this).DefaultMaximumExpirationTimeInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties of the partner configuration update. + [System.ComponentModel.TypeConverter(typeof(PartnerConfigurationUpdateParametersTypeConverter))] + public partial interface IPartnerConfigurationUpdateParameters + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerConfigurationUpdateParameters.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerConfigurationUpdateParameters.TypeConverter.cs new file mode 100644 index 000000000000..d47a7628219d --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerConfigurationUpdateParameters.TypeConverter.cs @@ -0,0 +1,149 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class PartnerConfigurationUpdateParametersTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationUpdateParameters ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationUpdateParameters).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return PartnerConfigurationUpdateParameters.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return PartnerConfigurationUpdateParameters.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return PartnerConfigurationUpdateParameters.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerConfigurationUpdateParameters.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerConfigurationUpdateParameters.cs new file mode 100644 index 000000000000..339c58a9b5bb --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerConfigurationUpdateParameters.cs @@ -0,0 +1,86 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Properties of the partner configuration update. + public partial class PartnerConfigurationUpdateParameters : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationUpdateParameters, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationUpdateParametersInternal + { + + /// + /// The default time used to validate the maximum expiration time for each authorized partners in days. Allowed values ar + /// between 1 and 365 days. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public int? DefaultMaximumExpirationTimeInDay { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationUpdateParameterPropertiesInternal)Property).DefaultMaximumExpirationTimeInDay; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationUpdateParameterPropertiesInternal)Property).DefaultMaximumExpirationTimeInDay = value ?? default(int); } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationUpdateParameterProperties Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationUpdateParametersInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerConfigurationUpdateParameterProperties()); set { {_property = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationUpdateParameterProperties _property; + + /// Properties of the Topic resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationUpdateParameterProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerConfigurationUpdateParameterProperties()); set => this._property = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationUpdateParametersTags _tag; + + /// Tags of the partner configuration resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationUpdateParametersTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerConfigurationUpdateParametersTags()); set => this._tag = value; } + + /// Creates an new instance. + public PartnerConfigurationUpdateParameters() + { + + } + } + /// Properties of the partner configuration update. + public partial interface IPartnerConfigurationUpdateParameters : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// + /// The default time used to validate the maximum expiration time for each authorized partners in days. Allowed values ar + /// between 1 and 365 days. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default time used to validate the maximum expiration time for each authorized partners in days. Allowed values ar between 1 and 365 days.", + SerializedName = @"defaultMaximumExpirationTimeInDays", + PossibleTypes = new [] { typeof(int) })] + int? DefaultMaximumExpirationTimeInDay { get; set; } + /// Tags of the partner configuration resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Tags of the partner configuration resource.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationUpdateParametersTags) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationUpdateParametersTags Tag { get; set; } + + } + /// Properties of the partner configuration update. + internal partial interface IPartnerConfigurationUpdateParametersInternal + + { + /// + /// The default time used to validate the maximum expiration time for each authorized partners in days. Allowed values ar + /// between 1 and 365 days. + /// + int? DefaultMaximumExpirationTimeInDay { get; set; } + /// Properties of the Topic resource. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationUpdateParameterProperties Property { get; set; } + /// Tags of the partner configuration resource. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationUpdateParametersTags Tag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerConfigurationUpdateParameters.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerConfigurationUpdateParameters.json.cs new file mode 100644 index 000000000000..1bbc9864d85f --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerConfigurationUpdateParameters.json.cs @@ -0,0 +1,109 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Properties of the partner configuration update. + public partial class PartnerConfigurationUpdateParameters + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationUpdateParameters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationUpdateParameters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationUpdateParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new PartnerConfigurationUpdateParameters(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal PartnerConfigurationUpdateParameters(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerConfigurationUpdateParameterProperties.FromJson(__jsonProperties) : Property;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerConfigurationUpdateParametersTags.FromJson(__jsonTags) : Tag;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AddIf( null != this._tag ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._tag.ToJson(null,serializationMode) : null, "tags" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerConfigurationUpdateParametersTags.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerConfigurationUpdateParametersTags.PowerShell.cs new file mode 100644 index 000000000000..a7351e26e2d0 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerConfigurationUpdateParametersTags.PowerShell.cs @@ -0,0 +1,141 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Tags of the partner configuration resource. + [System.ComponentModel.TypeConverter(typeof(PartnerConfigurationUpdateParametersTagsTypeConverter))] + public partial class PartnerConfigurationUpdateParametersTags + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationUpdateParametersTags DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new PartnerConfigurationUpdateParametersTags(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationUpdateParametersTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new PartnerConfigurationUpdateParametersTags(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json + /// string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationUpdateParametersTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal PartnerConfigurationUpdateParametersTags(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal PartnerConfigurationUpdateParametersTags(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Tags of the partner configuration resource. + [System.ComponentModel.TypeConverter(typeof(PartnerConfigurationUpdateParametersTagsTypeConverter))] + public partial interface IPartnerConfigurationUpdateParametersTags + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerConfigurationUpdateParametersTags.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerConfigurationUpdateParametersTags.TypeConverter.cs new file mode 100644 index 000000000000..bcb2d37b0778 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerConfigurationUpdateParametersTags.TypeConverter.cs @@ -0,0 +1,150 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class PartnerConfigurationUpdateParametersTagsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationUpdateParametersTags ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationUpdateParametersTags).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return PartnerConfigurationUpdateParametersTags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return PartnerConfigurationUpdateParametersTags.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return PartnerConfigurationUpdateParametersTags.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerConfigurationUpdateParametersTags.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerConfigurationUpdateParametersTags.cs new file mode 100644 index 000000000000..83352f484f1f --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerConfigurationUpdateParametersTags.cs @@ -0,0 +1,37 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Tags of the partner configuration resource. + public partial class PartnerConfigurationUpdateParametersTags : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationUpdateParametersTags, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationUpdateParametersTagsInternal + { + + /// + /// Creates an new instance. + /// + public PartnerConfigurationUpdateParametersTags() + { + + } + } + /// Tags of the partner configuration resource. + public partial interface IPartnerConfigurationUpdateParametersTags : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray + { + + } + /// Tags of the partner configuration resource. + internal partial interface IPartnerConfigurationUpdateParametersTagsInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerConfigurationUpdateParametersTags.dictionary.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerConfigurationUpdateParametersTags.dictionary.cs new file mode 100644 index 000000000000..c01510dfd948 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerConfigurationUpdateParametersTags.dictionary.cs @@ -0,0 +1,75 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + public partial class PartnerConfigurationUpdateParametersTags : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerConfigurationUpdateParametersTags source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerConfigurationUpdateParametersTags.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerConfigurationUpdateParametersTags.json.cs new file mode 100644 index 000000000000..651334a45001 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerConfigurationUpdateParametersTags.json.cs @@ -0,0 +1,109 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Tags of the partner configuration resource. + public partial class PartnerConfigurationUpdateParametersTags + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationUpdateParametersTags. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationUpdateParametersTags. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationUpdateParametersTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new PartnerConfigurationUpdateParametersTags(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + /// + internal PartnerConfigurationUpdateParametersTags(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerConfigurationsListResult.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerConfigurationsListResult.PowerShell.cs new file mode 100644 index 000000000000..41e80ed9b574 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerConfigurationsListResult.PowerShell.cs @@ -0,0 +1,152 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Result of the List partner configurations operation + [System.ComponentModel.TypeConverter(typeof(PartnerConfigurationsListResultTypeConverter))] + public partial class PartnerConfigurationsListResult + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationsListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new PartnerConfigurationsListResult(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationsListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new PartnerConfigurationsListResult(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationsListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal PartnerConfigurationsListResult(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationsListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfiguration[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationsListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerConfigurationTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationsListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationsListResultInternal)this).NextLink, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal PartnerConfigurationsListResult(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationsListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfiguration[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationsListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerConfigurationTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationsListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationsListResultInternal)this).NextLink, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Result of the List partner configurations operation + [System.ComponentModel.TypeConverter(typeof(PartnerConfigurationsListResultTypeConverter))] + public partial interface IPartnerConfigurationsListResult + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerConfigurationsListResult.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerConfigurationsListResult.TypeConverter.cs new file mode 100644 index 000000000000..943faaeca3bb --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerConfigurationsListResult.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class PartnerConfigurationsListResultTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationsListResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationsListResult).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return PartnerConfigurationsListResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return PartnerConfigurationsListResult.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return PartnerConfigurationsListResult.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerConfigurationsListResult.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerConfigurationsListResult.cs new file mode 100644 index 000000000000..1aa5ccc4a09d --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerConfigurationsListResult.cs @@ -0,0 +1,68 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Result of the List partner configurations operation + public partial class PartnerConfigurationsListResult : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationsListResult, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationsListResultInternal + { + + /// Backing field for property. + private string _nextLink; + + /// A link for the next page of partner configurations. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfiguration[] _value; + + /// A collection of partner configurations. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfiguration[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public PartnerConfigurationsListResult() + { + + } + } + /// Result of the List partner configurations operation + public partial interface IPartnerConfigurationsListResult : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// A link for the next page of partner configurations. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A link for the next page of partner configurations.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// A collection of partner configurations. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A collection of partner configurations.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfiguration) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfiguration[] Value { get; set; } + + } + /// Result of the List partner configurations operation + internal partial interface IPartnerConfigurationsListResultInternal + + { + /// A link for the next page of partner configurations. + string NextLink { get; set; } + /// A collection of partner configurations. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfiguration[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerConfigurationsListResult.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerConfigurationsListResult.json.cs new file mode 100644 index 000000000000..95cb100b84a6 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerConfigurationsListResult.json.cs @@ -0,0 +1,116 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Result of the List partner configurations operation + public partial class PartnerConfigurationsListResult + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationsListResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationsListResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationsListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new PartnerConfigurationsListResult(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal PartnerConfigurationsListResult(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfiguration) (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerConfiguration.FromJson(__u) )) ))() : null : Value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerDestination.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerDestination.PowerShell.cs new file mode 100644 index 000000000000..24e57f72caf3 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerDestination.PowerShell.cs @@ -0,0 +1,296 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Event Grid Partner Destination. + [System.ComponentModel.TypeConverter(typeof(PartnerDestinationTypeConverter))] + public partial class PartnerDestination + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestination DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new PartnerDestination(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestination DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new PartnerDestination(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestination FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal PartnerDestination(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerDestinationPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.TrackedResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("PartnerRegistrationImmutableId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInternal)this).PartnerRegistrationImmutableId = (string) content.GetValueForProperty("PartnerRegistrationImmutableId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInternal)this).PartnerRegistrationImmutableId, global::System.Convert.ToString); + } + if (content.Contains("EndpointServiceContext")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInternal)this).EndpointServiceContext = (string) content.GetValueForProperty("EndpointServiceContext",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInternal)this).EndpointServiceContext, global::System.Convert.ToString); + } + if (content.Contains("ExpirationTimeIfNotActivatedUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInternal)this).ExpirationTimeIfNotActivatedUtc = (global::System.DateTime?) content.GetValueForProperty("ExpirationTimeIfNotActivatedUtc",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInternal)this).ExpirationTimeIfNotActivatedUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerDestinationProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerDestinationProvisioningState.CreateFrom); + } + if (content.Contains("ActivationState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInternal)this).ActivationState = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerDestinationActivationState?) content.GetValueForProperty("ActivationState",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInternal)this).ActivationState, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerDestinationActivationState.CreateFrom); + } + if (content.Contains("EndpointBaseUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInternal)this).EndpointBaseUrl = (string) content.GetValueForProperty("EndpointBaseUrl",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInternal)this).EndpointBaseUrl, global::System.Convert.ToString); + } + if (content.Contains("MessageForActivation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInternal)this).MessageForActivation = (string) content.GetValueForProperty("MessageForActivation",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInternal)this).MessageForActivation, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal PartnerDestination(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerDestinationPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.TrackedResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("PartnerRegistrationImmutableId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInternal)this).PartnerRegistrationImmutableId = (string) content.GetValueForProperty("PartnerRegistrationImmutableId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInternal)this).PartnerRegistrationImmutableId, global::System.Convert.ToString); + } + if (content.Contains("EndpointServiceContext")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInternal)this).EndpointServiceContext = (string) content.GetValueForProperty("EndpointServiceContext",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInternal)this).EndpointServiceContext, global::System.Convert.ToString); + } + if (content.Contains("ExpirationTimeIfNotActivatedUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInternal)this).ExpirationTimeIfNotActivatedUtc = (global::System.DateTime?) content.GetValueForProperty("ExpirationTimeIfNotActivatedUtc",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInternal)this).ExpirationTimeIfNotActivatedUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerDestinationProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerDestinationProvisioningState.CreateFrom); + } + if (content.Contains("ActivationState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInternal)this).ActivationState = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerDestinationActivationState?) content.GetValueForProperty("ActivationState",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInternal)this).ActivationState, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerDestinationActivationState.CreateFrom); + } + if (content.Contains("EndpointBaseUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInternal)this).EndpointBaseUrl = (string) content.GetValueForProperty("EndpointBaseUrl",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInternal)this).EndpointBaseUrl, global::System.Convert.ToString); + } + if (content.Contains("MessageForActivation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInternal)this).MessageForActivation = (string) content.GetValueForProperty("MessageForActivation",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInternal)this).MessageForActivation, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Event Grid Partner Destination. + [System.ComponentModel.TypeConverter(typeof(PartnerDestinationTypeConverter))] + public partial interface IPartnerDestination + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerDestination.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerDestination.TypeConverter.cs new file mode 100644 index 000000000000..c23d8525ead9 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerDestination.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class PartnerDestinationTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestination ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestination).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return PartnerDestination.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return PartnerDestination.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return PartnerDestination.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerDestination.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerDestination.cs new file mode 100644 index 000000000000..755751e6ad88 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerDestination.cs @@ -0,0 +1,298 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Event Grid Partner Destination. + public partial class PartnerDestination : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestination, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInternal, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResource __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.TrackedResource(); + + /// Activation state of the partner destination. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerDestinationActivationState? ActivationState { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationPropertiesInternal)Property).ActivationState; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationPropertiesInternal)Property).ActivationState = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerDestinationActivationState)""); } + + /// Endpoint Base URL of the partner destination + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string EndpointBaseUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationPropertiesInternal)Property).EndpointBaseUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationPropertiesInternal)Property).EndpointBaseUrl = value ?? null; } + + /// Endpoint context associated with this partner destination. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string EndpointServiceContext { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationPropertiesInternal)Property).EndpointServiceContext; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationPropertiesInternal)Property).EndpointServiceContext = value ?? null; } + + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public global::System.DateTime? ExpirationTimeIfNotActivatedUtc { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationPropertiesInternal)Property).ExpirationTimeIfNotActivatedUtc; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationPropertiesInternal)Property).ExpirationTimeIfNotActivatedUtc = value ?? default(global::System.DateTime); } + + /// Fully qualified identifier of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__trackedResource).Id; } + + /// Location of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal)__trackedResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal)__trackedResource).Location = value ; } + + /// Context or helpful message that can be used during the approval process. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string MessageForActivation { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationPropertiesInternal)Property).MessageForActivation; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationPropertiesInternal)Property).MessageForActivation = value ?? null; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationProperties Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerDestinationProperties()); set { {_property = value;} } } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.SystemData()); set { {_systemData = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__trackedResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__trackedResource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__trackedResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__trackedResource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__trackedResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__trackedResource).Type = value; } + + /// Name of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__trackedResource).Name; } + + /// The immutable Id of the corresponding partner registration. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string PartnerRegistrationImmutableId { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationPropertiesInternal)Property).PartnerRegistrationImmutableId; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationPropertiesInternal)Property).PartnerRegistrationImmutableId = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationProperties _property; + + /// Properties of the Partner Destination. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerDestinationProperties()); set => this._property = value; } + + /// Provisioning state of the partner destination. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerDestinationProvisioningState? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationPropertiesInternal)Property).ProvisioningState = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerDestinationProvisioningState)""); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData _systemData; + + /// The system metadata relating to Partner Destination resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.SystemData()); } + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).CreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType)""); } + + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType)""); } + + /// Tags of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal)__trackedResource).Tag = value ?? null /* model class */; } + + /// Type of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__trackedResource).Type; } + + /// Creates an new instance. + public PartnerDestination() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__trackedResource), __trackedResource); + await eventListener.AssertObjectIsValid(nameof(__trackedResource), __trackedResource); + } + } + /// Event Grid Partner Destination. + public partial interface IPartnerDestination : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResource + { + /// Activation state of the partner destination. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Activation state of the partner destination.", + SerializedName = @"activationState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerDestinationActivationState) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerDestinationActivationState? ActivationState { get; set; } + /// Endpoint Base URL of the partner destination + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Endpoint Base URL of the partner destination", + SerializedName = @"endpointBaseUrl", + PossibleTypes = new [] { typeof(string) })] + string EndpointBaseUrl { get; set; } + /// Endpoint context associated with this partner destination. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Endpoint context associated with this partner destination.", + SerializedName = @"endpointServiceContext", + PossibleTypes = new [] { typeof(string) })] + string EndpointServiceContext { get; set; } + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"expirationTimeIfNotActivatedUtc", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ExpirationTimeIfNotActivatedUtc { get; set; } + /// Context or helpful message that can be used during the approval process. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Context or helpful message that can be used during the approval process.", + SerializedName = @"messageForActivation", + PossibleTypes = new [] { typeof(string) })] + string MessageForActivation { get; set; } + /// The immutable Id of the corresponding partner registration. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The immutable Id of the corresponding partner registration.", + SerializedName = @"partnerRegistrationImmutableId", + PossibleTypes = new [] { typeof(string) })] + string PartnerRegistrationImmutableId { get; set; } + /// Provisioning state of the partner destination. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Provisioning state of the partner destination.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerDestinationProvisioningState) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerDestinationProvisioningState? ProvisioningState { get; set; } + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timestamp of resource creation (UTC).", + SerializedName = @"createdAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SystemDataCreatedAt { get; set; } + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identity that created the resource.", + SerializedName = @"createdBy", + PossibleTypes = new [] { typeof(string) })] + string SystemDataCreatedBy { get; set; } + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of identity that created the resource.", + SerializedName = @"createdByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType? SystemDataCreatedByType { get; set; } + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timestamp of resource last modification (UTC)", + SerializedName = @"lastModifiedAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SystemDataLastModifiedAt { get; set; } + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identity that last modified the resource.", + SerializedName = @"lastModifiedBy", + PossibleTypes = new [] { typeof(string) })] + string SystemDataLastModifiedBy { get; set; } + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of identity that last modified the resource.", + SerializedName = @"lastModifiedByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + + } + /// Event Grid Partner Destination. + internal partial interface IPartnerDestinationInternal : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal + { + /// Activation state of the partner destination. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerDestinationActivationState? ActivationState { get; set; } + /// Endpoint Base URL of the partner destination + string EndpointBaseUrl { get; set; } + /// Endpoint context associated with this partner destination. + string EndpointServiceContext { get; set; } + /// + /// 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. + /// + global::System.DateTime? ExpirationTimeIfNotActivatedUtc { get; set; } + /// Context or helpful message that can be used during the approval process. + string MessageForActivation { get; set; } + /// The immutable Id of the corresponding partner registration. + string PartnerRegistrationImmutableId { get; set; } + /// Properties of the Partner Destination. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationProperties Property { get; set; } + /// Provisioning state of the partner destination. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerDestinationProvisioningState? ProvisioningState { get; set; } + /// The system metadata relating to Partner Destination resource. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData SystemData { get; set; } + /// The timestamp of resource creation (UTC). + global::System.DateTime? SystemDataCreatedAt { get; set; } + /// The identity that created the resource. + string SystemDataCreatedBy { get; set; } + /// The type of identity that created the resource. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType? SystemDataCreatedByType { get; set; } + /// The timestamp of resource last modification (UTC) + global::System.DateTime? SystemDataLastModifiedAt { get; set; } + /// The identity that last modified the resource. + string SystemDataLastModifiedBy { get; set; } + /// The type of identity that last modified the resource. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerDestination.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerDestination.json.cs new file mode 100644 index 000000000000..74621c6e4782 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerDestination.json.cs @@ -0,0 +1,113 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Event Grid Partner Destination. + public partial class PartnerDestination + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestination. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestination. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestination FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new PartnerDestination(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal PartnerDestination(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.TrackedResource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerDestinationProperties.FromJson(__jsonProperties) : Property;} + {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.SystemData.FromJson(__jsonSystemData) : SystemData;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __trackedResource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._systemData ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._systemData.ToJson(null,serializationMode) : null, "systemData" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerDestinationInfo.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerDestinationInfo.PowerShell.cs new file mode 100644 index 000000000000..e7f99eec79c0 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerDestinationInfo.PowerShell.cs @@ -0,0 +1,184 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Properties of the corresponding partner destination of a Channel. + [System.ComponentModel.TypeConverter(typeof(PartnerDestinationInfoTypeConverter))] + public partial class PartnerDestinationInfo + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new PartnerDestinationInfo(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new PartnerDestinationInfo(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal PartnerDestinationInfo(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AzureSubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfoInternal)this).AzureSubscriptionId = (string) content.GetValueForProperty("AzureSubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfoInternal)this).AzureSubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("ResourceGroupName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfoInternal)this).ResourceGroupName = (string) content.GetValueForProperty("ResourceGroupName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfoInternal)this).ResourceGroupName, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfoInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfoInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("EndpointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfoInternal)this).EndpointType = (string) content.GetValueForProperty("EndpointType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfoInternal)this).EndpointType, global::System.Convert.ToString); + } + if (content.Contains("EndpointServiceContext")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfoInternal)this).EndpointServiceContext = (string) content.GetValueForProperty("EndpointServiceContext",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfoInternal)this).EndpointServiceContext, global::System.Convert.ToString); + } + if (content.Contains("ResourceMoveChangeHistory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfoInternal)this).ResourceMoveChangeHistory = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceMoveChangeHistory[]) content.GetValueForProperty("ResourceMoveChangeHistory",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfoInternal)this).ResourceMoveChangeHistory, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ResourceMoveChangeHistoryTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal PartnerDestinationInfo(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AzureSubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfoInternal)this).AzureSubscriptionId = (string) content.GetValueForProperty("AzureSubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfoInternal)this).AzureSubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("ResourceGroupName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfoInternal)this).ResourceGroupName = (string) content.GetValueForProperty("ResourceGroupName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfoInternal)this).ResourceGroupName, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfoInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfoInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("EndpointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfoInternal)this).EndpointType = (string) content.GetValueForProperty("EndpointType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfoInternal)this).EndpointType, global::System.Convert.ToString); + } + if (content.Contains("EndpointServiceContext")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfoInternal)this).EndpointServiceContext = (string) content.GetValueForProperty("EndpointServiceContext",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfoInternal)this).EndpointServiceContext, global::System.Convert.ToString); + } + if (content.Contains("ResourceMoveChangeHistory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfoInternal)this).ResourceMoveChangeHistory = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceMoveChangeHistory[]) content.GetValueForProperty("ResourceMoveChangeHistory",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfoInternal)this).ResourceMoveChangeHistory, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ResourceMoveChangeHistoryTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties of the corresponding partner destination of a Channel. + [System.ComponentModel.TypeConverter(typeof(PartnerDestinationInfoTypeConverter))] + public partial interface IPartnerDestinationInfo + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerDestinationInfo.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerDestinationInfo.TypeConverter.cs new file mode 100644 index 000000000000..505effa30dd2 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerDestinationInfo.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class PartnerDestinationInfoTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfo ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfo).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return PartnerDestinationInfo.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return PartnerDestinationInfo.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return PartnerDestinationInfo.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerDestinationInfo.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerDestinationInfo.cs new file mode 100644 index 000000000000..dd2aedc0520e --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerDestinationInfo.cs @@ -0,0 +1,159 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Properties of the corresponding partner destination of a Channel. + public partial class PartnerDestinationInfo : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfo, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfoInternal + { + + /// Backing field for property. + private string _azureSubscriptionId; + + /// + /// Azure subscription ID of the subscriber. The partner destination associated with the channel will be + /// created under this Azure subscription. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string AzureSubscriptionId { get => this._azureSubscriptionId; set => this._azureSubscriptionId = value; } + + /// Backing field for property. + private string _endpointServiceContext; + + /// Additional context of the partner destination endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string EndpointServiceContext { get => this._endpointServiceContext; set => this._endpointServiceContext = value; } + + /// Backing field for property. + private string _endpointType= @"WebHook"; + + /// Type of the endpoint for the partner destination + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string EndpointType { get => this._endpointType; } + + /// Internal Acessors for EndpointType + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfoInternal.EndpointType { get => this._endpointType; set { {_endpointType = value;} } } + + /// Backing field for property. + private string _name; + + /// Name of the partner destination associated with the channel. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// Azure Resource Group of the subscriber. The partner destination associated with the channel will be + /// created under this resource group. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceMoveChangeHistory[] _resourceMoveChangeHistory; + + /// Change history of the resource move. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceMoveChangeHistory[] ResourceMoveChangeHistory { get => this._resourceMoveChangeHistory; set => this._resourceMoveChangeHistory = value; } + + /// Creates an new instance. + public PartnerDestinationInfo() + { + + } + } + /// Properties of the corresponding partner destination of a Channel. + public partial interface IPartnerDestinationInfo : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// + /// Azure subscription ID of the subscriber. The partner destination associated with the channel will be + /// created under this Azure subscription. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Azure subscription ID of the subscriber. The partner destination associated with the channel will be + created under this Azure subscription.", + SerializedName = @"azureSubscriptionId", + PossibleTypes = new [] { typeof(string) })] + string AzureSubscriptionId { get; set; } + /// Additional context of the partner destination endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Additional context of the partner destination endpoint.", + SerializedName = @"endpointServiceContext", + PossibleTypes = new [] { typeof(string) })] + string EndpointServiceContext { get; set; } + /// Type of the endpoint for the partner destination + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = true, + Description = @"Type of the endpoint for the partner destination", + SerializedName = @"endpointType", + PossibleTypes = new [] { typeof(string) })] + string EndpointType { get; } + /// Name of the partner destination associated with the channel. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the partner destination associated with the channel.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + /// + /// Azure Resource Group of the subscriber. The partner destination associated with the channel will be + /// created under this resource group. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Azure Resource Group of the subscriber. The partner destination associated with the channel will be + created under this resource group.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + string ResourceGroupName { get; set; } + /// Change history of the resource move. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Change history of the resource move.", + SerializedName = @"resourceMoveChangeHistory", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceMoveChangeHistory) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceMoveChangeHistory[] ResourceMoveChangeHistory { get; set; } + + } + /// Properties of the corresponding partner destination of a Channel. + internal partial interface IPartnerDestinationInfoInternal + + { + /// + /// Azure subscription ID of the subscriber. The partner destination associated with the channel will be + /// created under this Azure subscription. + /// + string AzureSubscriptionId { get; set; } + /// Additional context of the partner destination endpoint. + string EndpointServiceContext { get; set; } + /// Type of the endpoint for the partner destination + string EndpointType { get; set; } + /// Name of the partner destination associated with the channel. + string Name { get; set; } + /// + /// Azure Resource Group of the subscriber. The partner destination associated with the channel will be + /// created under this resource group. + /// + string ResourceGroupName { get; set; } + /// Change history of the resource move. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceMoveChangeHistory[] ResourceMoveChangeHistory { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerDestinationInfo.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerDestinationInfo.json.cs new file mode 100644 index 000000000000..9729ca33afaa --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerDestinationInfo.json.cs @@ -0,0 +1,139 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Properties of the corresponding partner destination of a Channel. + public partial class PartnerDestinationInfo + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfo. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfo interface is + /// polymorphic, and the precise model class that will get deserialized is determined at runtime based on the payload. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + if (!(node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json)) + { + return null; + } + // Polymorphic type -- select the appropriate constructor using the discriminator + + switch ( json.StringProperty("endpointType") ) + { + case "WebHook": + { + return new WebhookPartnerDestinationInfo(json); + } + } + return new PartnerDestinationInfo(json); + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal PartnerDestinationInfo(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_azureSubscriptionId = If( json?.PropertyT("azureSubscriptionId"), out var __jsonAzureSubscriptionId) ? (string)__jsonAzureSubscriptionId : (string)AzureSubscriptionId;} + {_resourceGroupName = If( json?.PropertyT("resourceGroupName"), out var __jsonResourceGroupName) ? (string)__jsonResourceGroupName : (string)ResourceGroupName;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_endpointType = If( json?.PropertyT("endpointType"), out var __jsonEndpointType) ? (string)__jsonEndpointType : (string)EndpointType;} + {_endpointServiceContext = If( json?.PropertyT("endpointServiceContext"), out var __jsonEndpointServiceContext) ? (string)__jsonEndpointServiceContext : (string)EndpointServiceContext;} + {_resourceMoveChangeHistory = If( json?.PropertyT("resourceMoveChangeHistory"), out var __jsonResourceMoveChangeHistory) ? If( __jsonResourceMoveChangeHistory as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceMoveChangeHistory) (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ResourceMoveChangeHistory.FromJson(__u) )) ))() : null : ResourceMoveChangeHistory;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._azureSubscriptionId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._azureSubscriptionId.ToString()) : null, "azureSubscriptionId" ,container.Add ); + AddIf( null != (((object)this._resourceGroupName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._resourceGroupName.ToString()) : null, "resourceGroupName" ,container.Add ); + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AddIf( null != (((object)this._endpointType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._endpointType.ToString()) : null, "endpointType" ,container.Add ); + AddIf( null != (((object)this._endpointServiceContext)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._endpointServiceContext.ToString()) : null, "endpointServiceContext" ,container.Add ); + if (null != this._resourceMoveChangeHistory) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.XNodeArray(); + foreach( var __x in this._resourceMoveChangeHistory ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("resourceMoveChangeHistory",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerDestinationProperties.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerDestinationProperties.PowerShell.cs new file mode 100644 index 000000000000..563b57b699f7 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerDestinationProperties.PowerShell.cs @@ -0,0 +1,192 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Properties of the Partner Destination. + [System.ComponentModel.TypeConverter(typeof(PartnerDestinationPropertiesTypeConverter))] + public partial class PartnerDestinationProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new PartnerDestinationProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new PartnerDestinationProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal PartnerDestinationProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("PartnerRegistrationImmutableId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationPropertiesInternal)this).PartnerRegistrationImmutableId = (string) content.GetValueForProperty("PartnerRegistrationImmutableId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationPropertiesInternal)this).PartnerRegistrationImmutableId, global::System.Convert.ToString); + } + if (content.Contains("EndpointServiceContext")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationPropertiesInternal)this).EndpointServiceContext = (string) content.GetValueForProperty("EndpointServiceContext",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationPropertiesInternal)this).EndpointServiceContext, global::System.Convert.ToString); + } + if (content.Contains("ExpirationTimeIfNotActivatedUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationPropertiesInternal)this).ExpirationTimeIfNotActivatedUtc = (global::System.DateTime?) content.GetValueForProperty("ExpirationTimeIfNotActivatedUtc",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationPropertiesInternal)this).ExpirationTimeIfNotActivatedUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerDestinationProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerDestinationProvisioningState.CreateFrom); + } + if (content.Contains("ActivationState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationPropertiesInternal)this).ActivationState = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerDestinationActivationState?) content.GetValueForProperty("ActivationState",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationPropertiesInternal)this).ActivationState, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerDestinationActivationState.CreateFrom); + } + if (content.Contains("EndpointBaseUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationPropertiesInternal)this).EndpointBaseUrl = (string) content.GetValueForProperty("EndpointBaseUrl",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationPropertiesInternal)this).EndpointBaseUrl, global::System.Convert.ToString); + } + if (content.Contains("MessageForActivation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationPropertiesInternal)this).MessageForActivation = (string) content.GetValueForProperty("MessageForActivation",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationPropertiesInternal)this).MessageForActivation, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal PartnerDestinationProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("PartnerRegistrationImmutableId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationPropertiesInternal)this).PartnerRegistrationImmutableId = (string) content.GetValueForProperty("PartnerRegistrationImmutableId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationPropertiesInternal)this).PartnerRegistrationImmutableId, global::System.Convert.ToString); + } + if (content.Contains("EndpointServiceContext")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationPropertiesInternal)this).EndpointServiceContext = (string) content.GetValueForProperty("EndpointServiceContext",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationPropertiesInternal)this).EndpointServiceContext, global::System.Convert.ToString); + } + if (content.Contains("ExpirationTimeIfNotActivatedUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationPropertiesInternal)this).ExpirationTimeIfNotActivatedUtc = (global::System.DateTime?) content.GetValueForProperty("ExpirationTimeIfNotActivatedUtc",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationPropertiesInternal)this).ExpirationTimeIfNotActivatedUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerDestinationProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerDestinationProvisioningState.CreateFrom); + } + if (content.Contains("ActivationState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationPropertiesInternal)this).ActivationState = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerDestinationActivationState?) content.GetValueForProperty("ActivationState",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationPropertiesInternal)this).ActivationState, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerDestinationActivationState.CreateFrom); + } + if (content.Contains("EndpointBaseUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationPropertiesInternal)this).EndpointBaseUrl = (string) content.GetValueForProperty("EndpointBaseUrl",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationPropertiesInternal)this).EndpointBaseUrl, global::System.Convert.ToString); + } + if (content.Contains("MessageForActivation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationPropertiesInternal)this).MessageForActivation = (string) content.GetValueForProperty("MessageForActivation",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationPropertiesInternal)this).MessageForActivation, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties of the Partner Destination. + [System.ComponentModel.TypeConverter(typeof(PartnerDestinationPropertiesTypeConverter))] + public partial interface IPartnerDestinationProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerDestinationProperties.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerDestinationProperties.TypeConverter.cs new file mode 100644 index 000000000000..ed3cbe0187c7 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerDestinationProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class PartnerDestinationPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return PartnerDestinationProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return PartnerDestinationProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return PartnerDestinationProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerDestinationProperties.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerDestinationProperties.cs new file mode 100644 index 000000000000..f3dc6720a634 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerDestinationProperties.cs @@ -0,0 +1,163 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Properties of the Partner Destination. + public partial class PartnerDestinationProperties : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationProperties, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationPropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerDestinationActivationState? _activationState; + + /// Activation state of the partner destination. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerDestinationActivationState? ActivationState { get => this._activationState; set => this._activationState = value; } + + /// Backing field for property. + private string _endpointBaseUrl; + + /// Endpoint Base URL of the partner destination + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string EndpointBaseUrl { get => this._endpointBaseUrl; set => this._endpointBaseUrl = value; } + + /// Backing field for property. + private string _endpointServiceContext; + + /// Endpoint context associated with this partner destination. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string EndpointServiceContext { get => this._endpointServiceContext; set => this._endpointServiceContext = value; } + + /// Backing field for property. + private global::System.DateTime? _expirationTimeIfNotActivatedUtc; + + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public global::System.DateTime? ExpirationTimeIfNotActivatedUtc { get => this._expirationTimeIfNotActivatedUtc; set => this._expirationTimeIfNotActivatedUtc = value; } + + /// Backing field for property. + private string _messageForActivation; + + /// Context or helpful message that can be used during the approval process. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string MessageForActivation { get => this._messageForActivation; set => this._messageForActivation = value; } + + /// Backing field for property. + private string _partnerRegistrationImmutableId; + + /// The immutable Id of the corresponding partner registration. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string PartnerRegistrationImmutableId { get => this._partnerRegistrationImmutableId; set => this._partnerRegistrationImmutableId = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerDestinationProvisioningState? _provisioningState; + + /// Provisioning state of the partner destination. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerDestinationProvisioningState? ProvisioningState { get => this._provisioningState; set => this._provisioningState = value; } + + /// Creates an new instance. + public PartnerDestinationProperties() + { + + } + } + /// Properties of the Partner Destination. + public partial interface IPartnerDestinationProperties : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// Activation state of the partner destination. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Activation state of the partner destination.", + SerializedName = @"activationState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerDestinationActivationState) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerDestinationActivationState? ActivationState { get; set; } + /// Endpoint Base URL of the partner destination + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Endpoint Base URL of the partner destination", + SerializedName = @"endpointBaseUrl", + PossibleTypes = new [] { typeof(string) })] + string EndpointBaseUrl { get; set; } + /// Endpoint context associated with this partner destination. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Endpoint context associated with this partner destination.", + SerializedName = @"endpointServiceContext", + PossibleTypes = new [] { typeof(string) })] + string EndpointServiceContext { get; set; } + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"expirationTimeIfNotActivatedUtc", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ExpirationTimeIfNotActivatedUtc { get; set; } + /// Context or helpful message that can be used during the approval process. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Context or helpful message that can be used during the approval process.", + SerializedName = @"messageForActivation", + PossibleTypes = new [] { typeof(string) })] + string MessageForActivation { get; set; } + /// The immutable Id of the corresponding partner registration. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The immutable Id of the corresponding partner registration.", + SerializedName = @"partnerRegistrationImmutableId", + PossibleTypes = new [] { typeof(string) })] + string PartnerRegistrationImmutableId { get; set; } + /// Provisioning state of the partner destination. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Provisioning state of the partner destination.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerDestinationProvisioningState) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerDestinationProvisioningState? ProvisioningState { get; set; } + + } + /// Properties of the Partner Destination. + internal partial interface IPartnerDestinationPropertiesInternal + + { + /// Activation state of the partner destination. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerDestinationActivationState? ActivationState { get; set; } + /// Endpoint Base URL of the partner destination + string EndpointBaseUrl { get; set; } + /// Endpoint context associated with this partner destination. + string EndpointServiceContext { get; set; } + /// + /// 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. + /// + global::System.DateTime? ExpirationTimeIfNotActivatedUtc { get; set; } + /// Context or helpful message that can be used during the approval process. + string MessageForActivation { get; set; } + /// The immutable Id of the corresponding partner registration. + string PartnerRegistrationImmutableId { get; set; } + /// Provisioning state of the partner destination. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerDestinationProvisioningState? ProvisioningState { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerDestinationProperties.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerDestinationProperties.json.cs new file mode 100644 index 000000000000..9ecdcd5a00a3 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerDestinationProperties.json.cs @@ -0,0 +1,118 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Properties of the Partner Destination. + public partial class PartnerDestinationProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new PartnerDestinationProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal PartnerDestinationProperties(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_partnerRegistrationImmutableId = If( json?.PropertyT("partnerRegistrationImmutableId"), out var __jsonPartnerRegistrationImmutableId) ? (string)__jsonPartnerRegistrationImmutableId : (string)PartnerRegistrationImmutableId;} + {_endpointServiceContext = If( json?.PropertyT("endpointServiceContext"), out var __jsonEndpointServiceContext) ? (string)__jsonEndpointServiceContext : (string)EndpointServiceContext;} + {_expirationTimeIfNotActivatedUtc = If( json?.PropertyT("expirationTimeIfNotActivatedUtc"), out var __jsonExpirationTimeIfNotActivatedUtc) ? global::System.DateTime.TryParse((string)__jsonExpirationTimeIfNotActivatedUtc, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonExpirationTimeIfNotActivatedUtcValue) ? __jsonExpirationTimeIfNotActivatedUtcValue : ExpirationTimeIfNotActivatedUtc : ExpirationTimeIfNotActivatedUtc;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} + {_activationState = If( json?.PropertyT("activationState"), out var __jsonActivationState) ? (string)__jsonActivationState : (string)ActivationState;} + {_endpointBaseUrl = If( json?.PropertyT("endpointBaseUrl"), out var __jsonEndpointBaseUrl) ? (string)__jsonEndpointBaseUrl : (string)EndpointBaseUrl;} + {_messageForActivation = If( json?.PropertyT("messageForActivation"), out var __jsonMessageForActivation) ? (string)__jsonMessageForActivation : (string)MessageForActivation;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._partnerRegistrationImmutableId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._partnerRegistrationImmutableId.ToString()) : null, "partnerRegistrationImmutableId" ,container.Add ); + AddIf( null != (((object)this._endpointServiceContext)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._endpointServiceContext.ToString()) : null, "endpointServiceContext" ,container.Add ); + AddIf( null != this._expirationTimeIfNotActivatedUtc ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._expirationTimeIfNotActivatedUtc?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "expirationTimeIfNotActivatedUtc" ,container.Add ); + AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); + AddIf( null != (((object)this._activationState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._activationState.ToString()) : null, "activationState" ,container.Add ); + AddIf( null != (((object)this._endpointBaseUrl)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._endpointBaseUrl.ToString()) : null, "endpointBaseUrl" ,container.Add ); + AddIf( null != (((object)this._messageForActivation)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._messageForActivation.ToString()) : null, "messageForActivation" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerDestinationUpdateParameters.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerDestinationUpdateParameters.PowerShell.cs new file mode 100644 index 000000000000..8a8d2b364529 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerDestinationUpdateParameters.PowerShell.cs @@ -0,0 +1,144 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Properties of the Partner Destination that can be updated. + [System.ComponentModel.TypeConverter(typeof(PartnerDestinationUpdateParametersTypeConverter))] + public partial class PartnerDestinationUpdateParameters + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationUpdateParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new PartnerDestinationUpdateParameters(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationUpdateParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new PartnerDestinationUpdateParameters(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationUpdateParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal PartnerDestinationUpdateParameters(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationUpdateParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationUpdateParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationUpdateParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerDestinationUpdateParametersTagsTypeConverter.ConvertFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal PartnerDestinationUpdateParameters(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationUpdateParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationUpdateParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationUpdateParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerDestinationUpdateParametersTagsTypeConverter.ConvertFrom); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties of the Partner Destination that can be updated. + [System.ComponentModel.TypeConverter(typeof(PartnerDestinationUpdateParametersTypeConverter))] + public partial interface IPartnerDestinationUpdateParameters + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerDestinationUpdateParameters.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerDestinationUpdateParameters.TypeConverter.cs new file mode 100644 index 000000000000..bdb6c8bb90c1 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerDestinationUpdateParameters.TypeConverter.cs @@ -0,0 +1,148 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class PartnerDestinationUpdateParametersTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationUpdateParameters ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationUpdateParameters).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return PartnerDestinationUpdateParameters.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return PartnerDestinationUpdateParameters.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return PartnerDestinationUpdateParameters.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerDestinationUpdateParameters.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerDestinationUpdateParameters.cs new file mode 100644 index 000000000000..de52393ae584 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerDestinationUpdateParameters.cs @@ -0,0 +1,51 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Properties of the Partner Destination that can be updated. + public partial class PartnerDestinationUpdateParameters : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationUpdateParameters, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationUpdateParametersInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationUpdateParametersTags _tag; + + /// Tags of the Partner Destination resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationUpdateParametersTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerDestinationUpdateParametersTags()); set => this._tag = value; } + + /// Creates an new instance. + public PartnerDestinationUpdateParameters() + { + + } + } + /// Properties of the Partner Destination that can be updated. + public partial interface IPartnerDestinationUpdateParameters : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// Tags of the Partner Destination resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Tags of the Partner Destination resource.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationUpdateParametersTags) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationUpdateParametersTags Tag { get; set; } + + } + /// Properties of the Partner Destination that can be updated. + internal partial interface IPartnerDestinationUpdateParametersInternal + + { + /// Tags of the Partner Destination resource. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationUpdateParametersTags Tag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerDestinationUpdateParameters.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerDestinationUpdateParameters.json.cs new file mode 100644 index 000000000000..43950fdf205b --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerDestinationUpdateParameters.json.cs @@ -0,0 +1,107 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Properties of the Partner Destination that can be updated. + public partial class PartnerDestinationUpdateParameters + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationUpdateParameters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationUpdateParameters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationUpdateParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new PartnerDestinationUpdateParameters(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal PartnerDestinationUpdateParameters(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerDestinationUpdateParametersTags.FromJson(__jsonTags) : Tag;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._tag ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._tag.ToJson(null,serializationMode) : null, "tags" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerDestinationUpdateParametersTags.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerDestinationUpdateParametersTags.PowerShell.cs new file mode 100644 index 000000000000..71e1bd464b1d --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerDestinationUpdateParametersTags.PowerShell.cs @@ -0,0 +1,141 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Tags of the Partner Destination resource. + [System.ComponentModel.TypeConverter(typeof(PartnerDestinationUpdateParametersTagsTypeConverter))] + public partial class PartnerDestinationUpdateParametersTags + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationUpdateParametersTags DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new PartnerDestinationUpdateParametersTags(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationUpdateParametersTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new PartnerDestinationUpdateParametersTags(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json + /// string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationUpdateParametersTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal PartnerDestinationUpdateParametersTags(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal PartnerDestinationUpdateParametersTags(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Tags of the Partner Destination resource. + [System.ComponentModel.TypeConverter(typeof(PartnerDestinationUpdateParametersTagsTypeConverter))] + public partial interface IPartnerDestinationUpdateParametersTags + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerDestinationUpdateParametersTags.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerDestinationUpdateParametersTags.TypeConverter.cs new file mode 100644 index 000000000000..01e33d958d0d --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerDestinationUpdateParametersTags.TypeConverter.cs @@ -0,0 +1,150 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class PartnerDestinationUpdateParametersTagsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationUpdateParametersTags ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationUpdateParametersTags).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return PartnerDestinationUpdateParametersTags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return PartnerDestinationUpdateParametersTags.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return PartnerDestinationUpdateParametersTags.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerDestinationUpdateParametersTags.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerDestinationUpdateParametersTags.cs new file mode 100644 index 000000000000..069b5a2d9af6 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerDestinationUpdateParametersTags.cs @@ -0,0 +1,35 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Tags of the Partner Destination resource. + public partial class PartnerDestinationUpdateParametersTags : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationUpdateParametersTags, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationUpdateParametersTagsInternal + { + + /// Creates an new instance. + public PartnerDestinationUpdateParametersTags() + { + + } + } + /// Tags of the Partner Destination resource. + public partial interface IPartnerDestinationUpdateParametersTags : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray + { + + } + /// Tags of the Partner Destination resource. + internal partial interface IPartnerDestinationUpdateParametersTagsInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerDestinationUpdateParametersTags.dictionary.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerDestinationUpdateParametersTags.dictionary.cs new file mode 100644 index 000000000000..a9cfb8e1a442 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerDestinationUpdateParametersTags.dictionary.cs @@ -0,0 +1,75 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + public partial class PartnerDestinationUpdateParametersTags : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerDestinationUpdateParametersTags source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerDestinationUpdateParametersTags.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerDestinationUpdateParametersTags.json.cs new file mode 100644 index 000000000000..1c013d0791bc --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerDestinationUpdateParametersTags.json.cs @@ -0,0 +1,108 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Tags of the Partner Destination resource. + public partial class PartnerDestinationUpdateParametersTags + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationUpdateParametersTags. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationUpdateParametersTags. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationUpdateParametersTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new PartnerDestinationUpdateParametersTags(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + /// + internal PartnerDestinationUpdateParametersTags(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerDestinationsListResult.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerDestinationsListResult.PowerShell.cs new file mode 100644 index 000000000000..5af8ee22151e --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerDestinationsListResult.PowerShell.cs @@ -0,0 +1,152 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Result of the List Partner Destinations operation. + [System.ComponentModel.TypeConverter(typeof(PartnerDestinationsListResultTypeConverter))] + public partial class PartnerDestinationsListResult + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationsListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new PartnerDestinationsListResult(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationsListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new PartnerDestinationsListResult(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationsListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal PartnerDestinationsListResult(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationsListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestination[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationsListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerDestinationTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationsListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationsListResultInternal)this).NextLink, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal PartnerDestinationsListResult(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationsListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestination[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationsListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerDestinationTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationsListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationsListResultInternal)this).NextLink, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Result of the List Partner Destinations operation. + [System.ComponentModel.TypeConverter(typeof(PartnerDestinationsListResultTypeConverter))] + public partial interface IPartnerDestinationsListResult + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerDestinationsListResult.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerDestinationsListResult.TypeConverter.cs new file mode 100644 index 000000000000..046800d2754e --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerDestinationsListResult.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class PartnerDestinationsListResultTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationsListResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationsListResult).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return PartnerDestinationsListResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return PartnerDestinationsListResult.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return PartnerDestinationsListResult.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerDestinationsListResult.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerDestinationsListResult.cs new file mode 100644 index 000000000000..f0bd396d4a2a --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerDestinationsListResult.cs @@ -0,0 +1,68 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Result of the List Partner Destinations operation. + public partial class PartnerDestinationsListResult : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationsListResult, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationsListResultInternal + { + + /// Backing field for property. + private string _nextLink; + + /// A link for the next page of partner destinations. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestination[] _value; + + /// A collection of partner destinations. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestination[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public PartnerDestinationsListResult() + { + + } + } + /// Result of the List Partner Destinations operation. + public partial interface IPartnerDestinationsListResult : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// A link for the next page of partner destinations. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A link for the next page of partner destinations.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// A collection of partner destinations. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A collection of partner destinations.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestination) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestination[] Value { get; set; } + + } + /// Result of the List Partner Destinations operation. + internal partial interface IPartnerDestinationsListResultInternal + + { + /// A link for the next page of partner destinations. + string NextLink { get; set; } + /// A collection of partner destinations. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestination[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerDestinationsListResult.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerDestinationsListResult.json.cs new file mode 100644 index 000000000000..04bbdda565bf --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerDestinationsListResult.json.cs @@ -0,0 +1,116 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Result of the List Partner Destinations operation. + public partial class PartnerDestinationsListResult + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationsListResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationsListResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationsListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new PartnerDestinationsListResult(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal PartnerDestinationsListResult(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestination) (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerDestination.FromJson(__u) )) ))() : null : Value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerDetails.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerDetails.PowerShell.cs new file mode 100644 index 000000000000..d31267f4c64d --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerDetails.PowerShell.cs @@ -0,0 +1,158 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Information about the partner. + [System.ComponentModel.TypeConverter(typeof(PartnerDetailsTypeConverter))] + public partial class PartnerDetails + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDetails DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new PartnerDetails(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDetails DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new PartnerDetails(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDetails FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal PartnerDetails(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDetailsInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDetailsInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("LongDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDetailsInternal)this).LongDescription = (string) content.GetValueForProperty("LongDescription",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDetailsInternal)this).LongDescription, global::System.Convert.ToString); + } + if (content.Contains("SetupUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDetailsInternal)this).SetupUri = (string) content.GetValueForProperty("SetupUri",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDetailsInternal)this).SetupUri, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal PartnerDetails(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDetailsInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDetailsInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("LongDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDetailsInternal)this).LongDescription = (string) content.GetValueForProperty("LongDescription",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDetailsInternal)this).LongDescription, global::System.Convert.ToString); + } + if (content.Contains("SetupUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDetailsInternal)this).SetupUri = (string) content.GetValueForProperty("SetupUri",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDetailsInternal)this).SetupUri, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Information about the partner. + [System.ComponentModel.TypeConverter(typeof(PartnerDetailsTypeConverter))] + public partial interface IPartnerDetails + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerDetails.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerDetails.TypeConverter.cs new file mode 100644 index 000000000000..1daeb0a7f2c5 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerDetails.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class PartnerDetailsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDetails ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDetails).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return PartnerDetails.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return PartnerDetails.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return PartnerDetails.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerDetails.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerDetails.cs new file mode 100644 index 000000000000..e9a9875ac054 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerDetails.cs @@ -0,0 +1,107 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Information about the partner. + public partial class PartnerDetails : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDetails, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDetailsInternal + { + + /// Backing field for property. + private string _description; + + /// + /// This is short description about the partner. The length of this description should not exceed 256 characters. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string Description { get => this._description; set => this._description = value; } + + /// Backing field for property. + private string _longDescription; + + /// + /// Long description for the partner's scenarios and integration.Length of this description should not exceed 2048 characters. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string LongDescription { get => this._longDescription; set => this._longDescription = value; } + + /// Backing field for property. + private string _setupUri; + + /// + /// URI of the partner website that can be used by Azure customers to setup Event Grid + /// integration on an event source. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string SetupUri { get => this._setupUri; set => this._setupUri = value; } + + /// Creates an new instance. + public PartnerDetails() + { + + } + } + /// Information about the partner. + public partial interface IPartnerDetails : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// + /// This is short description about the partner. The length of this description should not exceed 256 characters. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This is short description about the partner. The length of this description should not exceed 256 characters.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// + /// Long description for the partner's scenarios and integration.Length of this description should not exceed 2048 characters. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Long description for the partner's scenarios and integration.Length of this description should not exceed 2048 characters.", + SerializedName = @"longDescription", + PossibleTypes = new [] { typeof(string) })] + string LongDescription { get; set; } + /// + /// URI of the partner website that can be used by Azure customers to setup Event Grid + /// integration on an event source. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"URI of the partner website that can be used by Azure customers to setup Event Grid + integration on an event source.", + SerializedName = @"setupUri", + PossibleTypes = new [] { typeof(string) })] + string SetupUri { get; set; } + + } + /// Information about the partner. + internal partial interface IPartnerDetailsInternal + + { + /// + /// This is short description about the partner. The length of this description should not exceed 256 characters. + /// + string Description { get; set; } + /// + /// Long description for the partner's scenarios and integration.Length of this description should not exceed 2048 characters. + /// + string LongDescription { get; set; } + /// + /// URI of the partner website that can be used by Azure customers to setup Event Grid + /// integration on an event source. + /// + string SetupUri { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerDetails.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerDetails.json.cs new file mode 100644 index 000000000000..480d241b23c3 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerDetails.json.cs @@ -0,0 +1,110 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Information about the partner. + public partial class PartnerDetails + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDetails. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDetails. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDetails FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new PartnerDetails(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal PartnerDetails(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} + {_longDescription = If( json?.PropertyT("longDescription"), out var __jsonLongDescription) ? (string)__jsonLongDescription : (string)LongDescription;} + {_setupUri = If( json?.PropertyT("setupUri"), out var __jsonSetupUri) ? (string)__jsonSetupUri : (string)SetupUri;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._description.ToString()) : null, "description" ,container.Add ); + AddIf( null != (((object)this._longDescription)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._longDescription.ToString()) : null, "longDescription" ,container.Add ); + AddIf( null != (((object)this._setupUri)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._setupUri.ToString()) : null, "setupUri" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerEventSubscriptionDestination.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerEventSubscriptionDestination.PowerShell.cs new file mode 100644 index 000000000000..3524cca750db --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerEventSubscriptionDestination.PowerShell.cs @@ -0,0 +1,158 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(PartnerEventSubscriptionDestinationTypeConverter))] + public partial class PartnerEventSubscriptionDestination + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerEventSubscriptionDestination DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new PartnerEventSubscriptionDestination(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerEventSubscriptionDestination DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new PartnerEventSubscriptionDestination(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerEventSubscriptionDestination FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal PartnerEventSubscriptionDestination(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerEventSubscriptionDestinationInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerEventSubscriptionDestinationProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerEventSubscriptionDestinationInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerEventSubscriptionDestinationPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("EndpointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestinationInternal)this).EndpointType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType) content.GetValueForProperty("EndpointType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestinationInternal)this).EndpointType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType.CreateFrom); + } + if (content.Contains("ResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerEventSubscriptionDestinationInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerEventSubscriptionDestinationInternal)this).ResourceId, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal PartnerEventSubscriptionDestination(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerEventSubscriptionDestinationInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerEventSubscriptionDestinationProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerEventSubscriptionDestinationInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerEventSubscriptionDestinationPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("EndpointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestinationInternal)this).EndpointType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType) content.GetValueForProperty("EndpointType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestinationInternal)this).EndpointType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType.CreateFrom); + } + if (content.Contains("ResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerEventSubscriptionDestinationInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerEventSubscriptionDestinationInternal)this).ResourceId, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(PartnerEventSubscriptionDestinationTypeConverter))] + public partial interface IPartnerEventSubscriptionDestination + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerEventSubscriptionDestination.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerEventSubscriptionDestination.TypeConverter.cs new file mode 100644 index 000000000000..e2be891b3be1 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerEventSubscriptionDestination.TypeConverter.cs @@ -0,0 +1,148 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class PartnerEventSubscriptionDestinationTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerEventSubscriptionDestination ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerEventSubscriptionDestination).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return PartnerEventSubscriptionDestination.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return PartnerEventSubscriptionDestination.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return PartnerEventSubscriptionDestination.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerEventSubscriptionDestination.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerEventSubscriptionDestination.cs new file mode 100644 index 000000000000..792a1de46b34 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerEventSubscriptionDestination.cs @@ -0,0 +1,86 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + public partial class PartnerEventSubscriptionDestination : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerEventSubscriptionDestination, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerEventSubscriptionDestinationInternal, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestination __eventSubscriptionDestination = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionDestination(); + + /// Type of the endpoint for the event subscription destination. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType EndpointType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestinationInternal)__eventSubscriptionDestination).EndpointType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestinationInternal)__eventSubscriptionDestination).EndpointType = value ; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerEventSubscriptionDestinationProperties Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerEventSubscriptionDestinationInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerEventSubscriptionDestinationProperties()); set { {_property = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerEventSubscriptionDestinationProperties _property; + + /// Partner Destination Properties of the event subscription destination. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerEventSubscriptionDestinationProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerEventSubscriptionDestinationProperties()); set => this._property = value; } + + /// + /// The Azure Resource Id that represents the endpoint of a Partner Destination of an event subscription. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string ResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerEventSubscriptionDestinationPropertiesInternal)Property).ResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerEventSubscriptionDestinationPropertiesInternal)Property).ResourceId = value ?? null; } + + /// Creates an new instance. + public PartnerEventSubscriptionDestination() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__eventSubscriptionDestination), __eventSubscriptionDestination); + await eventListener.AssertObjectIsValid(nameof(__eventSubscriptionDestination), __eventSubscriptionDestination); + } + } + public partial interface IPartnerEventSubscriptionDestination : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestination + { + /// + /// The Azure Resource Id that represents the endpoint of a Partner Destination of an event subscription. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Azure Resource Id that represents the endpoint of a Partner Destination of an event subscription.", + SerializedName = @"resourceId", + PossibleTypes = new [] { typeof(string) })] + string ResourceId { get; set; } + + } + internal partial interface IPartnerEventSubscriptionDestinationInternal : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestinationInternal + { + /// Partner Destination Properties of the event subscription destination. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerEventSubscriptionDestinationProperties Property { get; set; } + /// + /// The Azure Resource Id that represents the endpoint of a Partner Destination of an event subscription. + /// + string ResourceId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerEventSubscriptionDestination.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerEventSubscriptionDestination.json.cs new file mode 100644 index 000000000000..1ce86bb8a482 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerEventSubscriptionDestination.json.cs @@ -0,0 +1,108 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + public partial class PartnerEventSubscriptionDestination + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerEventSubscriptionDestination. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerEventSubscriptionDestination. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerEventSubscriptionDestination FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new PartnerEventSubscriptionDestination(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal PartnerEventSubscriptionDestination(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __eventSubscriptionDestination = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionDestination(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerEventSubscriptionDestinationProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __eventSubscriptionDestination?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerEventSubscriptionDestinationProperties.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerEventSubscriptionDestinationProperties.PowerShell.cs new file mode 100644 index 000000000000..3edc4811e7be --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerEventSubscriptionDestinationProperties.PowerShell.cs @@ -0,0 +1,143 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(PartnerEventSubscriptionDestinationPropertiesTypeConverter))] + public partial class PartnerEventSubscriptionDestinationProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerEventSubscriptionDestinationProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new PartnerEventSubscriptionDestinationProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerEventSubscriptionDestinationProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new PartnerEventSubscriptionDestinationProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from + /// a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerEventSubscriptionDestinationProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal PartnerEventSubscriptionDestinationProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerEventSubscriptionDestinationPropertiesInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerEventSubscriptionDestinationPropertiesInternal)this).ResourceId, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal PartnerEventSubscriptionDestinationProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerEventSubscriptionDestinationPropertiesInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerEventSubscriptionDestinationPropertiesInternal)this).ResourceId, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(PartnerEventSubscriptionDestinationPropertiesTypeConverter))] + public partial interface IPartnerEventSubscriptionDestinationProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerEventSubscriptionDestinationProperties.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerEventSubscriptionDestinationProperties.TypeConverter.cs new file mode 100644 index 000000000000..259ebfd123af --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerEventSubscriptionDestinationProperties.TypeConverter.cs @@ -0,0 +1,150 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class PartnerEventSubscriptionDestinationPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, + /// otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerEventSubscriptionDestinationProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerEventSubscriptionDestinationProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return PartnerEventSubscriptionDestinationProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return PartnerEventSubscriptionDestinationProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return PartnerEventSubscriptionDestinationProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerEventSubscriptionDestinationProperties.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerEventSubscriptionDestinationProperties.cs new file mode 100644 index 000000000000..c7f379a480e4 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerEventSubscriptionDestinationProperties.cs @@ -0,0 +1,56 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + public partial class PartnerEventSubscriptionDestinationProperties : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerEventSubscriptionDestinationProperties, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerEventSubscriptionDestinationPropertiesInternal + { + + /// Backing field for property. + private string _resourceId; + + /// + /// The Azure Resource Id that represents the endpoint of a Partner Destination of an event subscription. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string ResourceId { get => this._resourceId; set => this._resourceId = value; } + + /// + /// Creates an new instance. + /// + public PartnerEventSubscriptionDestinationProperties() + { + + } + } + public partial interface IPartnerEventSubscriptionDestinationProperties : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// + /// The Azure Resource Id that represents the endpoint of a Partner Destination of an event subscription. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Azure Resource Id that represents the endpoint of a Partner Destination of an event subscription.", + SerializedName = @"resourceId", + PossibleTypes = new [] { typeof(string) })] + string ResourceId { get; set; } + + } + internal partial interface IPartnerEventSubscriptionDestinationPropertiesInternal + + { + /// + /// The Azure Resource Id that represents the endpoint of a Partner Destination of an event subscription. + /// + string ResourceId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerEventSubscriptionDestinationProperties.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerEventSubscriptionDestinationProperties.json.cs new file mode 100644 index 000000000000..840b8d191bd3 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerEventSubscriptionDestinationProperties.json.cs @@ -0,0 +1,108 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + public partial class PartnerEventSubscriptionDestinationProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerEventSubscriptionDestinationProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerEventSubscriptionDestinationProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerEventSubscriptionDestinationProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new PartnerEventSubscriptionDestinationProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal PartnerEventSubscriptionDestinationProperties(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_resourceId = If( json?.PropertyT("resourceId"), out var __jsonResourceId) ? (string)__jsonResourceId : (string)ResourceId;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._resourceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._resourceId.ToString()) : null, "resourceId" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespace.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespace.PowerShell.cs new file mode 100644 index 000000000000..bb815acf0cf7 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespace.PowerShell.cs @@ -0,0 +1,302 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// EventGrid Partner Namespace. + [System.ComponentModel.TypeConverter(typeof(PartnerNamespaceTypeConverter))] + public partial class PartnerNamespace + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespace DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new PartnerNamespace(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespace DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new PartnerNamespace(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespace FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal PartnerNamespace(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerNamespacePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.TrackedResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("PrivateEndpointConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceInternal)this).PrivateEndpointConnection = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnection[]) content.GetValueForProperty("PrivateEndpointConnection",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceInternal)this).PrivateEndpointConnection, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PrivateEndpointConnectionTypeConverter.ConvertFrom)); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerNamespaceProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerNamespaceProvisioningState.CreateFrom); + } + if (content.Contains("PartnerRegistrationFullyQualifiedId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceInternal)this).PartnerRegistrationFullyQualifiedId = (string) content.GetValueForProperty("PartnerRegistrationFullyQualifiedId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceInternal)this).PartnerRegistrationFullyQualifiedId, global::System.Convert.ToString); + } + if (content.Contains("Endpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceInternal)this).Endpoint = (string) content.GetValueForProperty("Endpoint",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceInternal)this).Endpoint, global::System.Convert.ToString); + } + if (content.Contains("PublicNetworkAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceInternal)this).PublicNetworkAccess = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess?) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceInternal)this).PublicNetworkAccess, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess.CreateFrom); + } + if (content.Contains("InboundIPRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceInternal)this).InboundIPRule = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[]) content.GetValueForProperty("InboundIPRule",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceInternal)this).InboundIPRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.InboundIPRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("DisableLocalAuth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceInternal)this).DisableLocalAuth = (bool?) content.GetValueForProperty("DisableLocalAuth",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceInternal)this).DisableLocalAuth, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("PartnerTopicRoutingMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceInternal)this).PartnerTopicRoutingMode = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicRoutingMode?) content.GetValueForProperty("PartnerTopicRoutingMode",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceInternal)this).PartnerTopicRoutingMode, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicRoutingMode.CreateFrom); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal PartnerNamespace(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerNamespacePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.TrackedResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("PrivateEndpointConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceInternal)this).PrivateEndpointConnection = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnection[]) content.GetValueForProperty("PrivateEndpointConnection",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceInternal)this).PrivateEndpointConnection, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PrivateEndpointConnectionTypeConverter.ConvertFrom)); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerNamespaceProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerNamespaceProvisioningState.CreateFrom); + } + if (content.Contains("PartnerRegistrationFullyQualifiedId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceInternal)this).PartnerRegistrationFullyQualifiedId = (string) content.GetValueForProperty("PartnerRegistrationFullyQualifiedId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceInternal)this).PartnerRegistrationFullyQualifiedId, global::System.Convert.ToString); + } + if (content.Contains("Endpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceInternal)this).Endpoint = (string) content.GetValueForProperty("Endpoint",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceInternal)this).Endpoint, global::System.Convert.ToString); + } + if (content.Contains("PublicNetworkAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceInternal)this).PublicNetworkAccess = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess?) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceInternal)this).PublicNetworkAccess, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess.CreateFrom); + } + if (content.Contains("InboundIPRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceInternal)this).InboundIPRule = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[]) content.GetValueForProperty("InboundIPRule",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceInternal)this).InboundIPRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.InboundIPRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("DisableLocalAuth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceInternal)this).DisableLocalAuth = (bool?) content.GetValueForProperty("DisableLocalAuth",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceInternal)this).DisableLocalAuth, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("PartnerTopicRoutingMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceInternal)this).PartnerTopicRoutingMode = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicRoutingMode?) content.GetValueForProperty("PartnerTopicRoutingMode",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceInternal)this).PartnerTopicRoutingMode, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicRoutingMode.CreateFrom); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// EventGrid Partner Namespace. + [System.ComponentModel.TypeConverter(typeof(PartnerNamespaceTypeConverter))] + public partial interface IPartnerNamespace + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespace.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespace.TypeConverter.cs new file mode 100644 index 000000000000..f40035a26597 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespace.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class PartnerNamespaceTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespace ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespace).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return PartnerNamespace.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return PartnerNamespace.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return PartnerNamespace.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespace.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespace.cs new file mode 100644 index 000000000000..42494c8c118c --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespace.cs @@ -0,0 +1,367 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// EventGrid Partner Namespace. + public partial class PartnerNamespace : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespace, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceInternal, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResource __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.TrackedResource(); + + /// + /// This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD + /// token will be used to authenticate if user is allowed to publish to the partner namespace. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public bool? DisableLocalAuth { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespacePropertiesInternal)Property).DisableLocalAuth; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespacePropertiesInternal)Property).DisableLocalAuth = value ?? default(bool); } + + /// Endpoint for the partner namespace. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string Endpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespacePropertiesInternal)Property).Endpoint; } + + /// Fully qualified identifier of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__trackedResource).Id; } + + /// + /// This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess + /// is enabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[] InboundIPRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespacePropertiesInternal)Property).InboundIPRule; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespacePropertiesInternal)Property).InboundIPRule = value ?? null /* arrayOf */; } + + /// Location of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal)__trackedResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal)__trackedResource).Location = value ; } + + /// Internal Acessors for Endpoint + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceInternal.Endpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespacePropertiesInternal)Property).Endpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespacePropertiesInternal)Property).Endpoint = value; } + + /// Internal Acessors for PrivateEndpointConnection + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnection[] Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceInternal.PrivateEndpointConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespacePropertiesInternal)Property).PrivateEndpointConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespacePropertiesInternal)Property).PrivateEndpointConnection = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceProperties Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerNamespaceProperties()); set { {_property = value;} } } + + /// Internal Acessors for ProvisioningState + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerNamespaceProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespacePropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespacePropertiesInternal)Property).ProvisioningState = value; } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.SystemData()); set { {_systemData = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__trackedResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__trackedResource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__trackedResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__trackedResource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__trackedResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__trackedResource).Type = value; } + + /// Name of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__trackedResource).Name; } + + /// + /// 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}. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string PartnerRegistrationFullyQualifiedId { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespacePropertiesInternal)Property).PartnerRegistrationFullyQualifiedId; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespacePropertiesInternal)Property).PartnerRegistrationFullyQualifiedId = value ?? null; } + + /// + /// This determines if events published to this partner namespace should use the source attribute in the event payload + /// or use the channel name in the header when matching to the partner topic. If none is specified, source attribute routing + /// will be used to match the partner topic. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicRoutingMode? PartnerTopicRoutingMode { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespacePropertiesInternal)Property).PartnerTopicRoutingMode; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespacePropertiesInternal)Property).PartnerTopicRoutingMode = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicRoutingMode)""); } + + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnection[] PrivateEndpointConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespacePropertiesInternal)Property).PrivateEndpointConnection; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceProperties _property; + + /// Properties of the Partner Namespace. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerNamespaceProperties()); set => this._property = value; } + + /// Provisioning state of the partner namespace. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerNamespaceProvisioningState? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespacePropertiesInternal)Property).ProvisioningState; } + + /// + /// This determines if traffic is allowed over public network. By default it is enabled. + /// You can further restrict to specific IPs by configuring + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess? PublicNetworkAccess { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespacePropertiesInternal)Property).PublicNetworkAccess; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespacePropertiesInternal)Property).PublicNetworkAccess = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess)""); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData _systemData; + + /// The system metadata relating to Partner Namespace resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.SystemData()); } + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).CreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType)""); } + + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType)""); } + + /// Tags of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal)__trackedResource).Tag = value ?? null /* model class */; } + + /// Type of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__trackedResource).Type; } + + /// Creates an new instance. + public PartnerNamespace() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__trackedResource), __trackedResource); + await eventListener.AssertObjectIsValid(nameof(__trackedResource), __trackedResource); + } + } + /// EventGrid Partner Namespace. + public partial interface IPartnerNamespace : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResource + { + /// + /// This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD + /// token will be used to authenticate if user is allowed to publish to the partner namespace. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD token will be used to authenticate if user is allowed to publish to the partner namespace.", + SerializedName = @"disableLocalAuth", + PossibleTypes = new [] { typeof(bool) })] + bool? DisableLocalAuth { get; set; } + /// Endpoint for the partner namespace. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Endpoint for the partner namespace.", + SerializedName = @"endpoint", + PossibleTypes = new [] { typeof(string) })] + string Endpoint { get; } + /// + /// This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess + /// is enabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess is enabled.", + SerializedName = @"inboundIpRules", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[] InboundIPRule { get; set; } + /// + /// 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}. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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}.", + SerializedName = @"partnerRegistrationFullyQualifiedId", + PossibleTypes = new [] { typeof(string) })] + string PartnerRegistrationFullyQualifiedId { get; set; } + /// + /// This determines if events published to this partner namespace should use the source attribute in the event payload + /// or use the channel name in the header when matching to the partner topic. If none is specified, source attribute routing + /// will be used to match the partner topic. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This determines if events published to this partner namespace should use the source attribute in the event payload + or use the channel name in the header when matching to the partner topic. If none is specified, source attribute routing will be used to match the partner topic.", + SerializedName = @"partnerTopicRoutingMode", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicRoutingMode) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicRoutingMode? PartnerTopicRoutingMode { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"", + SerializedName = @"privateEndpointConnections", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnection) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnection[] PrivateEndpointConnection { get; } + /// Provisioning state of the partner namespace. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Provisioning state of the partner namespace.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerNamespaceProvisioningState) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerNamespaceProvisioningState? ProvisioningState { get; } + /// + /// This determines if traffic is allowed over public network. By default it is enabled. + /// You can further restrict to specific IPs by configuring + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This determines if traffic is allowed over public network. By default it is enabled. + You can further restrict to specific IPs by configuring ", + SerializedName = @"publicNetworkAccess", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess? PublicNetworkAccess { get; set; } + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timestamp of resource creation (UTC).", + SerializedName = @"createdAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SystemDataCreatedAt { get; set; } + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identity that created the resource.", + SerializedName = @"createdBy", + PossibleTypes = new [] { typeof(string) })] + string SystemDataCreatedBy { get; set; } + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of identity that created the resource.", + SerializedName = @"createdByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType? SystemDataCreatedByType { get; set; } + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timestamp of resource last modification (UTC)", + SerializedName = @"lastModifiedAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SystemDataLastModifiedAt { get; set; } + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identity that last modified the resource.", + SerializedName = @"lastModifiedBy", + PossibleTypes = new [] { typeof(string) })] + string SystemDataLastModifiedBy { get; set; } + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of identity that last modified the resource.", + SerializedName = @"lastModifiedByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + + } + /// EventGrid Partner Namespace. + internal partial interface IPartnerNamespaceInternal : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal + { + /// + /// This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD + /// token will be used to authenticate if user is allowed to publish to the partner namespace. + /// + bool? DisableLocalAuth { get; set; } + /// Endpoint for the partner namespace. + string Endpoint { get; set; } + /// + /// This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess + /// is enabled. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[] InboundIPRule { get; set; } + /// + /// 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}. + /// + string PartnerRegistrationFullyQualifiedId { get; set; } + /// + /// This determines if events published to this partner namespace should use the source attribute in the event payload + /// or use the channel name in the header when matching to the partner topic. If none is specified, source attribute routing + /// will be used to match the partner topic. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicRoutingMode? PartnerTopicRoutingMode { get; set; } + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnection[] PrivateEndpointConnection { get; set; } + /// Properties of the Partner Namespace. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceProperties Property { get; set; } + /// Provisioning state of the partner namespace. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerNamespaceProvisioningState? ProvisioningState { get; set; } + /// + /// This determines if traffic is allowed over public network. By default it is enabled. + /// You can further restrict to specific IPs by configuring + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess? PublicNetworkAccess { get; set; } + /// The system metadata relating to Partner Namespace resource. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData SystemData { get; set; } + /// The timestamp of resource creation (UTC). + global::System.DateTime? SystemDataCreatedAt { get; set; } + /// The identity that created the resource. + string SystemDataCreatedBy { get; set; } + /// The type of identity that created the resource. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType? SystemDataCreatedByType { get; set; } + /// The timestamp of resource last modification (UTC) + global::System.DateTime? SystemDataLastModifiedAt { get; set; } + /// The identity that last modified the resource. + string SystemDataLastModifiedBy { get; set; } + /// The type of identity that last modified the resource. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespace.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespace.json.cs new file mode 100644 index 000000000000..6bc3495f40f0 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespace.json.cs @@ -0,0 +1,113 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// EventGrid Partner Namespace. + public partial class PartnerNamespace + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespace. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespace. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespace FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new PartnerNamespace(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal PartnerNamespace(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.TrackedResource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerNamespaceProperties.FromJson(__jsonProperties) : Property;} + {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.SystemData.FromJson(__jsonSystemData) : SystemData;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __trackedResource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._systemData ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._systemData.ToJson(null,serializationMode) : null, "systemData" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespaceProperties.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespaceProperties.PowerShell.cs new file mode 100644 index 000000000000..621c0db14b03 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespaceProperties.PowerShell.cs @@ -0,0 +1,200 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Properties of the partner namespace. + [System.ComponentModel.TypeConverter(typeof(PartnerNamespacePropertiesTypeConverter))] + public partial class PartnerNamespaceProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new PartnerNamespaceProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new PartnerNamespaceProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal PartnerNamespaceProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("PrivateEndpointConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespacePropertiesInternal)this).PrivateEndpointConnection = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnection[]) content.GetValueForProperty("PrivateEndpointConnection",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespacePropertiesInternal)this).PrivateEndpointConnection, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PrivateEndpointConnectionTypeConverter.ConvertFrom)); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespacePropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerNamespaceProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespacePropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerNamespaceProvisioningState.CreateFrom); + } + if (content.Contains("PartnerRegistrationFullyQualifiedId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespacePropertiesInternal)this).PartnerRegistrationFullyQualifiedId = (string) content.GetValueForProperty("PartnerRegistrationFullyQualifiedId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespacePropertiesInternal)this).PartnerRegistrationFullyQualifiedId, global::System.Convert.ToString); + } + if (content.Contains("Endpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespacePropertiesInternal)this).Endpoint = (string) content.GetValueForProperty("Endpoint",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespacePropertiesInternal)this).Endpoint, global::System.Convert.ToString); + } + if (content.Contains("PublicNetworkAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespacePropertiesInternal)this).PublicNetworkAccess = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess?) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespacePropertiesInternal)this).PublicNetworkAccess, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess.CreateFrom); + } + if (content.Contains("InboundIPRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespacePropertiesInternal)this).InboundIPRule = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[]) content.GetValueForProperty("InboundIPRule",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespacePropertiesInternal)this).InboundIPRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.InboundIPRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("DisableLocalAuth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespacePropertiesInternal)this).DisableLocalAuth = (bool?) content.GetValueForProperty("DisableLocalAuth",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespacePropertiesInternal)this).DisableLocalAuth, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("PartnerTopicRoutingMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespacePropertiesInternal)this).PartnerTopicRoutingMode = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicRoutingMode?) content.GetValueForProperty("PartnerTopicRoutingMode",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespacePropertiesInternal)this).PartnerTopicRoutingMode, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicRoutingMode.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal PartnerNamespaceProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("PrivateEndpointConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespacePropertiesInternal)this).PrivateEndpointConnection = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnection[]) content.GetValueForProperty("PrivateEndpointConnection",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespacePropertiesInternal)this).PrivateEndpointConnection, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PrivateEndpointConnectionTypeConverter.ConvertFrom)); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespacePropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerNamespaceProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespacePropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerNamespaceProvisioningState.CreateFrom); + } + if (content.Contains("PartnerRegistrationFullyQualifiedId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespacePropertiesInternal)this).PartnerRegistrationFullyQualifiedId = (string) content.GetValueForProperty("PartnerRegistrationFullyQualifiedId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespacePropertiesInternal)this).PartnerRegistrationFullyQualifiedId, global::System.Convert.ToString); + } + if (content.Contains("Endpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespacePropertiesInternal)this).Endpoint = (string) content.GetValueForProperty("Endpoint",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespacePropertiesInternal)this).Endpoint, global::System.Convert.ToString); + } + if (content.Contains("PublicNetworkAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespacePropertiesInternal)this).PublicNetworkAccess = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess?) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespacePropertiesInternal)this).PublicNetworkAccess, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess.CreateFrom); + } + if (content.Contains("InboundIPRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespacePropertiesInternal)this).InboundIPRule = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[]) content.GetValueForProperty("InboundIPRule",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespacePropertiesInternal)this).InboundIPRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.InboundIPRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("DisableLocalAuth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespacePropertiesInternal)this).DisableLocalAuth = (bool?) content.GetValueForProperty("DisableLocalAuth",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespacePropertiesInternal)this).DisableLocalAuth, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("PartnerTopicRoutingMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespacePropertiesInternal)this).PartnerTopicRoutingMode = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicRoutingMode?) content.GetValueForProperty("PartnerTopicRoutingMode",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespacePropertiesInternal)this).PartnerTopicRoutingMode, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicRoutingMode.CreateFrom); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties of the partner namespace. + [System.ComponentModel.TypeConverter(typeof(PartnerNamespacePropertiesTypeConverter))] + public partial interface IPartnerNamespaceProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespaceProperties.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespaceProperties.TypeConverter.cs new file mode 100644 index 000000000000..e5a53043f743 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespaceProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class PartnerNamespacePropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return PartnerNamespaceProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return PartnerNamespaceProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return PartnerNamespaceProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespaceProperties.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespaceProperties.cs new file mode 100644 index 000000000000..3717cbd9f87e --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespaceProperties.cs @@ -0,0 +1,235 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Properties of the partner namespace. + public partial class PartnerNamespaceProperties : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceProperties, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespacePropertiesInternal + { + + /// Backing field for property. + private bool? _disableLocalAuth; + + /// + /// This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD + /// token will be used to authenticate if user is allowed to publish to the partner namespace. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public bool? DisableLocalAuth { get => this._disableLocalAuth; set => this._disableLocalAuth = value; } + + /// Backing field for property. + private string _endpoint; + + /// Endpoint for the partner namespace. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string Endpoint { get => this._endpoint; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[] _inboundIPRule; + + /// + /// This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess + /// is enabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[] InboundIPRule { get => this._inboundIPRule; set => this._inboundIPRule = value; } + + /// Internal Acessors for Endpoint + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespacePropertiesInternal.Endpoint { get => this._endpoint; set { {_endpoint = value;} } } + + /// Internal Acessors for PrivateEndpointConnection + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnection[] Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespacePropertiesInternal.PrivateEndpointConnection { get => this._privateEndpointConnection; set { {_privateEndpointConnection = value;} } } + + /// Internal Acessors for ProvisioningState + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerNamespaceProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespacePropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + + /// Backing field for property. + private string _partnerRegistrationFullyQualifiedId; + + /// + /// 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}. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string PartnerRegistrationFullyQualifiedId { get => this._partnerRegistrationFullyQualifiedId; set => this._partnerRegistrationFullyQualifiedId = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicRoutingMode? _partnerTopicRoutingMode; + + /// + /// This determines if events published to this partner namespace should use the source attribute in the event payload + /// or use the channel name in the header when matching to the partner topic. If none is specified, source attribute routing + /// will be used to match the partner topic. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicRoutingMode? PartnerTopicRoutingMode { get => this._partnerTopicRoutingMode; set => this._partnerTopicRoutingMode = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnection[] _privateEndpointConnection; + + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnection[] PrivateEndpointConnection { get => this._privateEndpointConnection; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerNamespaceProvisioningState? _provisioningState; + + /// Provisioning state of the partner namespace. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerNamespaceProvisioningState? ProvisioningState { get => this._provisioningState; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess? _publicNetworkAccess; + + /// + /// This determines if traffic is allowed over public network. By default it is enabled. + /// You can further restrict to specific IPs by configuring + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess? PublicNetworkAccess { get => this._publicNetworkAccess; set => this._publicNetworkAccess = value; } + + /// Creates an new instance. + public PartnerNamespaceProperties() + { + + } + } + /// Properties of the partner namespace. + public partial interface IPartnerNamespaceProperties : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// + /// This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD + /// token will be used to authenticate if user is allowed to publish to the partner namespace. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD token will be used to authenticate if user is allowed to publish to the partner namespace.", + SerializedName = @"disableLocalAuth", + PossibleTypes = new [] { typeof(bool) })] + bool? DisableLocalAuth { get; set; } + /// Endpoint for the partner namespace. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Endpoint for the partner namespace.", + SerializedName = @"endpoint", + PossibleTypes = new [] { typeof(string) })] + string Endpoint { get; } + /// + /// This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess + /// is enabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess is enabled.", + SerializedName = @"inboundIpRules", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[] InboundIPRule { get; set; } + /// + /// 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}. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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}.", + SerializedName = @"partnerRegistrationFullyQualifiedId", + PossibleTypes = new [] { typeof(string) })] + string PartnerRegistrationFullyQualifiedId { get; set; } + /// + /// This determines if events published to this partner namespace should use the source attribute in the event payload + /// or use the channel name in the header when matching to the partner topic. If none is specified, source attribute routing + /// will be used to match the partner topic. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This determines if events published to this partner namespace should use the source attribute in the event payload + or use the channel name in the header when matching to the partner topic. If none is specified, source attribute routing will be used to match the partner topic.", + SerializedName = @"partnerTopicRoutingMode", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicRoutingMode) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicRoutingMode? PartnerTopicRoutingMode { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"", + SerializedName = @"privateEndpointConnections", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnection) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnection[] PrivateEndpointConnection { get; } + /// Provisioning state of the partner namespace. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Provisioning state of the partner namespace.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerNamespaceProvisioningState) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerNamespaceProvisioningState? ProvisioningState { get; } + /// + /// This determines if traffic is allowed over public network. By default it is enabled. + /// You can further restrict to specific IPs by configuring + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This determines if traffic is allowed over public network. By default it is enabled. + You can further restrict to specific IPs by configuring ", + SerializedName = @"publicNetworkAccess", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess? PublicNetworkAccess { get; set; } + + } + /// Properties of the partner namespace. + internal partial interface IPartnerNamespacePropertiesInternal + + { + /// + /// This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD + /// token will be used to authenticate if user is allowed to publish to the partner namespace. + /// + bool? DisableLocalAuth { get; set; } + /// Endpoint for the partner namespace. + string Endpoint { get; set; } + /// + /// This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess + /// is enabled. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[] InboundIPRule { get; set; } + /// + /// 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}. + /// + string PartnerRegistrationFullyQualifiedId { get; set; } + /// + /// This determines if events published to this partner namespace should use the source attribute in the event payload + /// or use the channel name in the header when matching to the partner topic. If none is specified, source attribute routing + /// will be used to match the partner topic. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicRoutingMode? PartnerTopicRoutingMode { get; set; } + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnection[] PrivateEndpointConnection { get; set; } + /// Provisioning state of the partner namespace. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerNamespaceProvisioningState? ProvisioningState { get; set; } + /// + /// This determines if traffic is allowed over public network. By default it is enabled. + /// You can further restrict to specific IPs by configuring + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess? PublicNetworkAccess { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespaceProperties.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespaceProperties.json.cs new file mode 100644 index 000000000000..cca6cdae7821 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespaceProperties.json.cs @@ -0,0 +1,145 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Properties of the partner namespace. + public partial class PartnerNamespaceProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new PartnerNamespaceProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal PartnerNamespaceProperties(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_privateEndpointConnection = If( json?.PropertyT("privateEndpointConnections"), out var __jsonPrivateEndpointConnections) ? If( __jsonPrivateEndpointConnections as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnection) (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PrivateEndpointConnection.FromJson(__u) )) ))() : null : PrivateEndpointConnection;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} + {_partnerRegistrationFullyQualifiedId = If( json?.PropertyT("partnerRegistrationFullyQualifiedId"), out var __jsonPartnerRegistrationFullyQualifiedId) ? (string)__jsonPartnerRegistrationFullyQualifiedId : (string)PartnerRegistrationFullyQualifiedId;} + {_endpoint = If( json?.PropertyT("endpoint"), out var __jsonEndpoint) ? (string)__jsonEndpoint : (string)Endpoint;} + {_publicNetworkAccess = If( json?.PropertyT("publicNetworkAccess"), out var __jsonPublicNetworkAccess) ? (string)__jsonPublicNetworkAccess : (string)PublicNetworkAccess;} + {_inboundIPRule = If( json?.PropertyT("inboundIpRules"), out var __jsonInboundIPRules) ? If( __jsonInboundIPRules as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule) (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.InboundIPRule.FromJson(__p) )) ))() : null : InboundIPRule;} + {_disableLocalAuth = If( json?.PropertyT("disableLocalAuth"), out var __jsonDisableLocalAuth) ? (bool?)__jsonDisableLocalAuth : DisableLocalAuth;} + {_partnerTopicRoutingMode = If( json?.PropertyT("partnerTopicRoutingMode"), out var __jsonPartnerTopicRoutingMode) ? (string)__jsonPartnerTopicRoutingMode : (string)PartnerTopicRoutingMode;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._privateEndpointConnection) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.XNodeArray(); + foreach( var __x in this._privateEndpointConnection ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("privateEndpointConnections",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); + } + AddIf( null != (((object)this._partnerRegistrationFullyQualifiedId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._partnerRegistrationFullyQualifiedId.ToString()) : null, "partnerRegistrationFullyQualifiedId" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._endpoint)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._endpoint.ToString()) : null, "endpoint" ,container.Add ); + } + AddIf( null != (((object)this._publicNetworkAccess)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._publicNetworkAccess.ToString()) : null, "publicNetworkAccess" ,container.Add ); + if (null != this._inboundIPRule) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.XNodeArray(); + foreach( var __s in this._inboundIPRule ) + { + AddIf(__s?.ToJson(null, serializationMode) ,__r.Add); + } + container.Add("inboundIpRules",__r); + } + AddIf( null != this._disableLocalAuth ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonBoolean((bool)this._disableLocalAuth) : null, "disableLocalAuth" ,container.Add ); + AddIf( null != (((object)this._partnerTopicRoutingMode)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._partnerTopicRoutingMode.ToString()) : null, "partnerTopicRoutingMode" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespaceRegenerateKeyRequest.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespaceRegenerateKeyRequest.PowerShell.cs new file mode 100644 index 000000000000..fe8cc4871b84 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespaceRegenerateKeyRequest.PowerShell.cs @@ -0,0 +1,144 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// PartnerNamespace regenerate shared access key request. + [System.ComponentModel.TypeConverter(typeof(PartnerNamespaceRegenerateKeyRequestTypeConverter))] + public partial class PartnerNamespaceRegenerateKeyRequest + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceRegenerateKeyRequest DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new PartnerNamespaceRegenerateKeyRequest(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceRegenerateKeyRequest DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new PartnerNamespaceRegenerateKeyRequest(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceRegenerateKeyRequest FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal PartnerNamespaceRegenerateKeyRequest(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("KeyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceRegenerateKeyRequestInternal)this).KeyName = (string) content.GetValueForProperty("KeyName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceRegenerateKeyRequestInternal)this).KeyName, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal PartnerNamespaceRegenerateKeyRequest(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("KeyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceRegenerateKeyRequestInternal)this).KeyName = (string) content.GetValueForProperty("KeyName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceRegenerateKeyRequestInternal)this).KeyName, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// PartnerNamespace regenerate shared access key request. + [System.ComponentModel.TypeConverter(typeof(PartnerNamespaceRegenerateKeyRequestTypeConverter))] + public partial interface IPartnerNamespaceRegenerateKeyRequest + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespaceRegenerateKeyRequest.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespaceRegenerateKeyRequest.TypeConverter.cs new file mode 100644 index 000000000000..c66845e54e24 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespaceRegenerateKeyRequest.TypeConverter.cs @@ -0,0 +1,149 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class PartnerNamespaceRegenerateKeyRequestTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceRegenerateKeyRequest ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceRegenerateKeyRequest).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return PartnerNamespaceRegenerateKeyRequest.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return PartnerNamespaceRegenerateKeyRequest.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return PartnerNamespaceRegenerateKeyRequest.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespaceRegenerateKeyRequest.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespaceRegenerateKeyRequest.cs new file mode 100644 index 000000000000..93070c8dfbcf --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespaceRegenerateKeyRequest.cs @@ -0,0 +1,51 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// PartnerNamespace regenerate shared access key request. + public partial class PartnerNamespaceRegenerateKeyRequest : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceRegenerateKeyRequest, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceRegenerateKeyRequestInternal + { + + /// Backing field for property. + private string _keyName; + + /// Key name to regenerate (key1 or key2). + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string KeyName { get => this._keyName; set => this._keyName = value; } + + /// Creates an new instance. + public PartnerNamespaceRegenerateKeyRequest() + { + + } + } + /// PartnerNamespace regenerate shared access key request. + public partial interface IPartnerNamespaceRegenerateKeyRequest : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// Key name to regenerate (key1 or key2). + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Key name to regenerate (key1 or key2).", + SerializedName = @"keyName", + PossibleTypes = new [] { typeof(string) })] + string KeyName { get; set; } + + } + /// PartnerNamespace regenerate shared access key request. + internal partial interface IPartnerNamespaceRegenerateKeyRequestInternal + + { + /// Key name to regenerate (key1 or key2). + string KeyName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespaceRegenerateKeyRequest.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespaceRegenerateKeyRequest.json.cs new file mode 100644 index 000000000000..25fb5c1af158 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespaceRegenerateKeyRequest.json.cs @@ -0,0 +1,107 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// PartnerNamespace regenerate shared access key request. + public partial class PartnerNamespaceRegenerateKeyRequest + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceRegenerateKeyRequest. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceRegenerateKeyRequest. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceRegenerateKeyRequest FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new PartnerNamespaceRegenerateKeyRequest(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal PartnerNamespaceRegenerateKeyRequest(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_keyName = If( json?.PropertyT("keyName"), out var __jsonKeyName) ? (string)__jsonKeyName : (string)KeyName;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._keyName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._keyName.ToString()) : null, "keyName" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespaceSharedAccessKeys.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespaceSharedAccessKeys.PowerShell.cs new file mode 100644 index 000000000000..a1f58a86a251 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespaceSharedAccessKeys.PowerShell.cs @@ -0,0 +1,152 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Shared access keys of the partner namespace. + [System.ComponentModel.TypeConverter(typeof(PartnerNamespaceSharedAccessKeysTypeConverter))] + public partial class PartnerNamespaceSharedAccessKeys + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceSharedAccessKeys DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new PartnerNamespaceSharedAccessKeys(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceSharedAccessKeys DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new PartnerNamespaceSharedAccessKeys(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceSharedAccessKeys FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal PartnerNamespaceSharedAccessKeys(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Key1")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceSharedAccessKeysInternal)this).Key1 = (string) content.GetValueForProperty("Key1",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceSharedAccessKeysInternal)this).Key1, global::System.Convert.ToString); + } + if (content.Contains("Key2")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceSharedAccessKeysInternal)this).Key2 = (string) content.GetValueForProperty("Key2",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceSharedAccessKeysInternal)this).Key2, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal PartnerNamespaceSharedAccessKeys(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Key1")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceSharedAccessKeysInternal)this).Key1 = (string) content.GetValueForProperty("Key1",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceSharedAccessKeysInternal)this).Key1, global::System.Convert.ToString); + } + if (content.Contains("Key2")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceSharedAccessKeysInternal)this).Key2 = (string) content.GetValueForProperty("Key2",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceSharedAccessKeysInternal)this).Key2, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Shared access keys of the partner namespace. + [System.ComponentModel.TypeConverter(typeof(PartnerNamespaceSharedAccessKeysTypeConverter))] + public partial interface IPartnerNamespaceSharedAccessKeys + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespaceSharedAccessKeys.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespaceSharedAccessKeys.TypeConverter.cs new file mode 100644 index 000000000000..0e5ce1059b12 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespaceSharedAccessKeys.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class PartnerNamespaceSharedAccessKeysTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceSharedAccessKeys ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceSharedAccessKeys).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return PartnerNamespaceSharedAccessKeys.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return PartnerNamespaceSharedAccessKeys.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return PartnerNamespaceSharedAccessKeys.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespaceSharedAccessKeys.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespaceSharedAccessKeys.cs new file mode 100644 index 000000000000..f7bf3149b8ac --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespaceSharedAccessKeys.cs @@ -0,0 +1,68 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Shared access keys of the partner namespace. + public partial class PartnerNamespaceSharedAccessKeys : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceSharedAccessKeys, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceSharedAccessKeysInternal + { + + /// Backing field for property. + private string _key1; + + /// Shared access key1 for the partner namespace. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string Key1 { get => this._key1; set => this._key1 = value; } + + /// Backing field for property. + private string _key2; + + /// Shared access key2 for the partner namespace. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string Key2 { get => this._key2; set => this._key2 = value; } + + /// Creates an new instance. + public PartnerNamespaceSharedAccessKeys() + { + + } + } + /// Shared access keys of the partner namespace. + public partial interface IPartnerNamespaceSharedAccessKeys : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// Shared access key1 for the partner namespace. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Shared access key1 for the partner namespace.", + SerializedName = @"key1", + PossibleTypes = new [] { typeof(string) })] + string Key1 { get; set; } + /// Shared access key2 for the partner namespace. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Shared access key2 for the partner namespace.", + SerializedName = @"key2", + PossibleTypes = new [] { typeof(string) })] + string Key2 { get; set; } + + } + /// Shared access keys of the partner namespace. + internal partial interface IPartnerNamespaceSharedAccessKeysInternal + + { + /// Shared access key1 for the partner namespace. + string Key1 { get; set; } + /// Shared access key2 for the partner namespace. + string Key2 { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespaceSharedAccessKeys.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespaceSharedAccessKeys.json.cs new file mode 100644 index 000000000000..05a5d70d305d --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespaceSharedAccessKeys.json.cs @@ -0,0 +1,108 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Shared access keys of the partner namespace. + public partial class PartnerNamespaceSharedAccessKeys + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceSharedAccessKeys. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceSharedAccessKeys. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceSharedAccessKeys FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new PartnerNamespaceSharedAccessKeys(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal PartnerNamespaceSharedAccessKeys(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_key1 = If( json?.PropertyT("key1"), out var __jsonKey1) ? (string)__jsonKey1 : (string)Key1;} + {_key2 = If( json?.PropertyT("key2"), out var __jsonKey2) ? (string)__jsonKey2 : (string)Key2;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._key1)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._key1.ToString()) : null, "key1" ,container.Add ); + AddIf( null != (((object)this._key2)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._key2.ToString()) : null, "key2" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespaceUpdateParameterProperties.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespaceUpdateParameterProperties.PowerShell.cs new file mode 100644 index 000000000000..26d55a7aad0e --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespaceUpdateParameterProperties.PowerShell.cs @@ -0,0 +1,161 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Information of Partner Namespace update parameter properties. + [System.ComponentModel.TypeConverter(typeof(PartnerNamespaceUpdateParameterPropertiesTypeConverter))] + public partial class PartnerNamespaceUpdateParameterProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParameterProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new PartnerNamespaceUpdateParameterProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParameterProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new PartnerNamespaceUpdateParameterProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json + /// string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParameterProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal PartnerNamespaceUpdateParameterProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("PublicNetworkAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParameterPropertiesInternal)this).PublicNetworkAccess = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess?) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParameterPropertiesInternal)this).PublicNetworkAccess, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess.CreateFrom); + } + if (content.Contains("InboundIPRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParameterPropertiesInternal)this).InboundIPRule = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[]) content.GetValueForProperty("InboundIPRule",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParameterPropertiesInternal)this).InboundIPRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.InboundIPRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("DisableLocalAuth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParameterPropertiesInternal)this).DisableLocalAuth = (bool?) content.GetValueForProperty("DisableLocalAuth",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParameterPropertiesInternal)this).DisableLocalAuth, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal PartnerNamespaceUpdateParameterProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("PublicNetworkAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParameterPropertiesInternal)this).PublicNetworkAccess = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess?) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParameterPropertiesInternal)this).PublicNetworkAccess, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess.CreateFrom); + } + if (content.Contains("InboundIPRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParameterPropertiesInternal)this).InboundIPRule = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[]) content.GetValueForProperty("InboundIPRule",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParameterPropertiesInternal)this).InboundIPRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.InboundIPRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("DisableLocalAuth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParameterPropertiesInternal)this).DisableLocalAuth = (bool?) content.GetValueForProperty("DisableLocalAuth",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParameterPropertiesInternal)this).DisableLocalAuth, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Information of Partner Namespace update parameter properties. + [System.ComponentModel.TypeConverter(typeof(PartnerNamespaceUpdateParameterPropertiesTypeConverter))] + public partial interface IPartnerNamespaceUpdateParameterProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespaceUpdateParameterProperties.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespaceUpdateParameterProperties.TypeConverter.cs new file mode 100644 index 000000000000..2fea828f9473 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespaceUpdateParameterProperties.TypeConverter.cs @@ -0,0 +1,150 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class PartnerNamespaceUpdateParameterPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParameterProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParameterProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return PartnerNamespaceUpdateParameterProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return PartnerNamespaceUpdateParameterProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return PartnerNamespaceUpdateParameterProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespaceUpdateParameterProperties.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespaceUpdateParameterProperties.cs new file mode 100644 index 000000000000..e8a0d537bfc4 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespaceUpdateParameterProperties.cs @@ -0,0 +1,118 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Information of Partner Namespace update parameter properties. + public partial class PartnerNamespaceUpdateParameterProperties : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParameterProperties, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParameterPropertiesInternal + { + + /// Backing field for property. + private bool? _disableLocalAuth; + + /// + /// This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD + /// token will be used to authenticate if user is allowed to publish to the partner namespace. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public bool? DisableLocalAuth { get => this._disableLocalAuth; set => this._disableLocalAuth = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[] _inboundIPRule; + + /// + /// This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess + /// is enabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[] InboundIPRule { get => this._inboundIPRule; set => this._inboundIPRule = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess? _publicNetworkAccess; + + /// + /// This determines if traffic is allowed over public network. By default it is enabled. + /// You can further restrict to specific IPs by configuring + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess? PublicNetworkAccess { get => this._publicNetworkAccess; set => this._publicNetworkAccess = value; } + + /// + /// Creates an new instance. + /// + public PartnerNamespaceUpdateParameterProperties() + { + + } + } + /// Information of Partner Namespace update parameter properties. + public partial interface IPartnerNamespaceUpdateParameterProperties : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// + /// This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD + /// token will be used to authenticate if user is allowed to publish to the partner namespace. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD token will be used to authenticate if user is allowed to publish to the partner namespace.", + SerializedName = @"disableLocalAuth", + PossibleTypes = new [] { typeof(bool) })] + bool? DisableLocalAuth { get; set; } + /// + /// This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess + /// is enabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess is enabled.", + SerializedName = @"inboundIpRules", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[] InboundIPRule { get; set; } + /// + /// This determines if traffic is allowed over public network. By default it is enabled. + /// You can further restrict to specific IPs by configuring + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This determines if traffic is allowed over public network. By default it is enabled. + You can further restrict to specific IPs by configuring ", + SerializedName = @"publicNetworkAccess", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess? PublicNetworkAccess { get; set; } + + } + /// Information of Partner Namespace update parameter properties. + internal partial interface IPartnerNamespaceUpdateParameterPropertiesInternal + + { + /// + /// This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD + /// token will be used to authenticate if user is allowed to publish to the partner namespace. + /// + bool? DisableLocalAuth { get; set; } + /// + /// This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess + /// is enabled. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[] InboundIPRule { get; set; } + /// + /// This determines if traffic is allowed over public network. By default it is enabled. + /// You can further restrict to specific IPs by configuring + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess? PublicNetworkAccess { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespaceUpdateParameterProperties.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespaceUpdateParameterProperties.json.cs new file mode 100644 index 000000000000..cdc064cde5ad --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespaceUpdateParameterProperties.json.cs @@ -0,0 +1,120 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Information of Partner Namespace update parameter properties. + public partial class PartnerNamespaceUpdateParameterProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParameterProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParameterProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParameterProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new PartnerNamespaceUpdateParameterProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal PartnerNamespaceUpdateParameterProperties(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_publicNetworkAccess = If( json?.PropertyT("publicNetworkAccess"), out var __jsonPublicNetworkAccess) ? (string)__jsonPublicNetworkAccess : (string)PublicNetworkAccess;} + {_inboundIPRule = If( json?.PropertyT("inboundIpRules"), out var __jsonInboundIPRules) ? If( __jsonInboundIPRules as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule) (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.InboundIPRule.FromJson(__u) )) ))() : null : InboundIPRule;} + {_disableLocalAuth = If( json?.PropertyT("disableLocalAuth"), out var __jsonDisableLocalAuth) ? (bool?)__jsonDisableLocalAuth : DisableLocalAuth;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._publicNetworkAccess)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._publicNetworkAccess.ToString()) : null, "publicNetworkAccess" ,container.Add ); + if (null != this._inboundIPRule) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.XNodeArray(); + foreach( var __x in this._inboundIPRule ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("inboundIpRules",__w); + } + AddIf( null != this._disableLocalAuth ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonBoolean((bool)this._disableLocalAuth) : null, "disableLocalAuth" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespaceUpdateParameters.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespaceUpdateParameters.PowerShell.cs new file mode 100644 index 000000000000..9c962a901add --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespaceUpdateParameters.PowerShell.cs @@ -0,0 +1,176 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Properties of the Partner Namespace update. + [System.ComponentModel.TypeConverter(typeof(PartnerNamespaceUpdateParametersTypeConverter))] + public partial class PartnerNamespaceUpdateParameters + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new PartnerNamespaceUpdateParameters(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new PartnerNamespaceUpdateParameters(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal PartnerNamespaceUpdateParameters(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParametersInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParameterProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParametersInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerNamespaceUpdateParameterPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerNamespaceUpdateParametersTagsTypeConverter.ConvertFrom); + } + if (content.Contains("PublicNetworkAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParametersInternal)this).PublicNetworkAccess = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess?) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParametersInternal)this).PublicNetworkAccess, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess.CreateFrom); + } + if (content.Contains("InboundIPRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParametersInternal)this).InboundIPRule = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[]) content.GetValueForProperty("InboundIPRule",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParametersInternal)this).InboundIPRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.InboundIPRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("DisableLocalAuth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParametersInternal)this).DisableLocalAuth = (bool?) content.GetValueForProperty("DisableLocalAuth",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParametersInternal)this).DisableLocalAuth, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal PartnerNamespaceUpdateParameters(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParametersInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParameterProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParametersInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerNamespaceUpdateParameterPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerNamespaceUpdateParametersTagsTypeConverter.ConvertFrom); + } + if (content.Contains("PublicNetworkAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParametersInternal)this).PublicNetworkAccess = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess?) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParametersInternal)this).PublicNetworkAccess, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess.CreateFrom); + } + if (content.Contains("InboundIPRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParametersInternal)this).InboundIPRule = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[]) content.GetValueForProperty("InboundIPRule",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParametersInternal)this).InboundIPRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.InboundIPRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("DisableLocalAuth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParametersInternal)this).DisableLocalAuth = (bool?) content.GetValueForProperty("DisableLocalAuth",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParametersInternal)this).DisableLocalAuth, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties of the Partner Namespace update. + [System.ComponentModel.TypeConverter(typeof(PartnerNamespaceUpdateParametersTypeConverter))] + public partial interface IPartnerNamespaceUpdateParameters + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespaceUpdateParameters.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespaceUpdateParameters.TypeConverter.cs new file mode 100644 index 000000000000..cd0115ada69d --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespaceUpdateParameters.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class PartnerNamespaceUpdateParametersTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParameters ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParameters).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return PartnerNamespaceUpdateParameters.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return PartnerNamespaceUpdateParameters.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return PartnerNamespaceUpdateParameters.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespaceUpdateParameters.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespaceUpdateParameters.cs new file mode 100644 index 000000000000..7b8ec46bc4c9 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespaceUpdateParameters.cs @@ -0,0 +1,136 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Properties of the Partner Namespace update. + public partial class PartnerNamespaceUpdateParameters : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParameters, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParametersInternal + { + + /// + /// This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD + /// token will be used to authenticate if user is allowed to publish to the partner namespace. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public bool? DisableLocalAuth { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParameterPropertiesInternal)Property).DisableLocalAuth; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParameterPropertiesInternal)Property).DisableLocalAuth = value ?? default(bool); } + + /// + /// This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess + /// is enabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[] InboundIPRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParameterPropertiesInternal)Property).InboundIPRule; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParameterPropertiesInternal)Property).InboundIPRule = value ?? null /* arrayOf */; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParameterProperties Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParametersInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerNamespaceUpdateParameterProperties()); set { {_property = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParameterProperties _property; + + /// Properties of the Partner Namespace. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParameterProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerNamespaceUpdateParameterProperties()); set => this._property = value; } + + /// + /// This determines if traffic is allowed over public network. By default it is enabled. + /// You can further restrict to specific IPs by configuring + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess? PublicNetworkAccess { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParameterPropertiesInternal)Property).PublicNetworkAccess; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParameterPropertiesInternal)Property).PublicNetworkAccess = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess)""); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParametersTags _tag; + + /// Tags of the Partner Namespace. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParametersTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerNamespaceUpdateParametersTags()); set => this._tag = value; } + + /// Creates an new instance. + public PartnerNamespaceUpdateParameters() + { + + } + } + /// Properties of the Partner Namespace update. + public partial interface IPartnerNamespaceUpdateParameters : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// + /// This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD + /// token will be used to authenticate if user is allowed to publish to the partner namespace. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD token will be used to authenticate if user is allowed to publish to the partner namespace.", + SerializedName = @"disableLocalAuth", + PossibleTypes = new [] { typeof(bool) })] + bool? DisableLocalAuth { get; set; } + /// + /// This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess + /// is enabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess is enabled.", + SerializedName = @"inboundIpRules", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[] InboundIPRule { get; set; } + /// + /// This determines if traffic is allowed over public network. By default it is enabled. + /// You can further restrict to specific IPs by configuring + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This determines if traffic is allowed over public network. By default it is enabled. + You can further restrict to specific IPs by configuring ", + SerializedName = @"publicNetworkAccess", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess? PublicNetworkAccess { get; set; } + /// Tags of the Partner Namespace. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Tags of the Partner Namespace.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParametersTags) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParametersTags Tag { get; set; } + + } + /// Properties of the Partner Namespace update. + internal partial interface IPartnerNamespaceUpdateParametersInternal + + { + /// + /// This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD + /// token will be used to authenticate if user is allowed to publish to the partner namespace. + /// + bool? DisableLocalAuth { get; set; } + /// + /// This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess + /// is enabled. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[] InboundIPRule { get; set; } + /// Properties of the Partner Namespace. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParameterProperties Property { get; set; } + /// + /// This determines if traffic is allowed over public network. By default it is enabled. + /// You can further restrict to specific IPs by configuring + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess? PublicNetworkAccess { get; set; } + /// Tags of the Partner Namespace. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParametersTags Tag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespaceUpdateParameters.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespaceUpdateParameters.json.cs new file mode 100644 index 000000000000..86cd3ba7c3bf --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespaceUpdateParameters.json.cs @@ -0,0 +1,108 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Properties of the Partner Namespace update. + public partial class PartnerNamespaceUpdateParameters + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParameters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParameters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new PartnerNamespaceUpdateParameters(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal PartnerNamespaceUpdateParameters(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerNamespaceUpdateParameterProperties.FromJson(__jsonProperties) : Property;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerNamespaceUpdateParametersTags.FromJson(__jsonTags) : Tag;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AddIf( null != this._tag ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._tag.ToJson(null,serializationMode) : null, "tags" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespaceUpdateParametersTags.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespaceUpdateParametersTags.PowerShell.cs new file mode 100644 index 000000000000..704091cec145 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespaceUpdateParametersTags.PowerShell.cs @@ -0,0 +1,140 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Tags of the Partner Namespace. + [System.ComponentModel.TypeConverter(typeof(PartnerNamespaceUpdateParametersTagsTypeConverter))] + public partial class PartnerNamespaceUpdateParametersTags + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParametersTags DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new PartnerNamespaceUpdateParametersTags(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParametersTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new PartnerNamespaceUpdateParametersTags(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParametersTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal PartnerNamespaceUpdateParametersTags(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal PartnerNamespaceUpdateParametersTags(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Tags of the Partner Namespace. + [System.ComponentModel.TypeConverter(typeof(PartnerNamespaceUpdateParametersTagsTypeConverter))] + public partial interface IPartnerNamespaceUpdateParametersTags + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespaceUpdateParametersTags.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespaceUpdateParametersTags.TypeConverter.cs new file mode 100644 index 000000000000..e705420bc354 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespaceUpdateParametersTags.TypeConverter.cs @@ -0,0 +1,149 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class PartnerNamespaceUpdateParametersTagsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParametersTags ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParametersTags).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return PartnerNamespaceUpdateParametersTags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return PartnerNamespaceUpdateParametersTags.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return PartnerNamespaceUpdateParametersTags.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespaceUpdateParametersTags.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespaceUpdateParametersTags.cs new file mode 100644 index 000000000000..d659df0a7117 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespaceUpdateParametersTags.cs @@ -0,0 +1,35 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Tags of the Partner Namespace. + public partial class PartnerNamespaceUpdateParametersTags : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParametersTags, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParametersTagsInternal + { + + /// Creates an new instance. + public PartnerNamespaceUpdateParametersTags() + { + + } + } + /// Tags of the Partner Namespace. + public partial interface IPartnerNamespaceUpdateParametersTags : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray + { + + } + /// Tags of the Partner Namespace. + internal partial interface IPartnerNamespaceUpdateParametersTagsInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespaceUpdateParametersTags.dictionary.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespaceUpdateParametersTags.dictionary.cs new file mode 100644 index 000000000000..19c6123dc6a0 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespaceUpdateParametersTags.dictionary.cs @@ -0,0 +1,75 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + public partial class PartnerNamespaceUpdateParametersTags : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerNamespaceUpdateParametersTags source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespaceUpdateParametersTags.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespaceUpdateParametersTags.json.cs new file mode 100644 index 000000000000..bd07d779428d --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespaceUpdateParametersTags.json.cs @@ -0,0 +1,108 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Tags of the Partner Namespace. + public partial class PartnerNamespaceUpdateParametersTags + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParametersTags. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParametersTags. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParametersTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new PartnerNamespaceUpdateParametersTags(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + /// + internal PartnerNamespaceUpdateParametersTags(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespacesListResult.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespacesListResult.PowerShell.cs new file mode 100644 index 000000000000..8b7d5fdb80fb --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespacesListResult.PowerShell.cs @@ -0,0 +1,152 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Result of the List Partner Namespaces operation + [System.ComponentModel.TypeConverter(typeof(PartnerNamespacesListResultTypeConverter))] + public partial class PartnerNamespacesListResult + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespacesListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new PartnerNamespacesListResult(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespacesListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new PartnerNamespacesListResult(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespacesListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal PartnerNamespacesListResult(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespacesListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespace[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespacesListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerNamespaceTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespacesListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespacesListResultInternal)this).NextLink, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal PartnerNamespacesListResult(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespacesListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespace[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespacesListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerNamespaceTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespacesListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespacesListResultInternal)this).NextLink, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Result of the List Partner Namespaces operation + [System.ComponentModel.TypeConverter(typeof(PartnerNamespacesListResultTypeConverter))] + public partial interface IPartnerNamespacesListResult + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespacesListResult.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespacesListResult.TypeConverter.cs new file mode 100644 index 000000000000..caa22bd59098 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespacesListResult.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class PartnerNamespacesListResultTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespacesListResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespacesListResult).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return PartnerNamespacesListResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return PartnerNamespacesListResult.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return PartnerNamespacesListResult.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespacesListResult.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespacesListResult.cs new file mode 100644 index 000000000000..ca54ee63a59f --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespacesListResult.cs @@ -0,0 +1,68 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Result of the List Partner Namespaces operation + public partial class PartnerNamespacesListResult : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespacesListResult, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespacesListResultInternal + { + + /// Backing field for property. + private string _nextLink; + + /// A link for the next page of partner namespaces. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespace[] _value; + + /// A collection of partner namespaces. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespace[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public PartnerNamespacesListResult() + { + + } + } + /// Result of the List Partner Namespaces operation + public partial interface IPartnerNamespacesListResult : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// A link for the next page of partner namespaces. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A link for the next page of partner namespaces.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// A collection of partner namespaces. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A collection of partner namespaces.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespace) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespace[] Value { get; set; } + + } + /// Result of the List Partner Namespaces operation + internal partial interface IPartnerNamespacesListResultInternal + + { + /// A link for the next page of partner namespaces. + string NextLink { get; set; } + /// A collection of partner namespaces. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespace[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespacesListResult.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespacesListResult.json.cs new file mode 100644 index 000000000000..cd33d93ae1dc --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerNamespacesListResult.json.cs @@ -0,0 +1,116 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Result of the List Partner Namespaces operation + public partial class PartnerNamespacesListResult + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespacesListResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespacesListResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespacesListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new PartnerNamespacesListResult(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal PartnerNamespacesListResult(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespace) (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerNamespace.FromJson(__u) )) ))() : null : Value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerRegistration.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerRegistration.PowerShell.cs new file mode 100644 index 000000000000..15624ed7823e --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerRegistration.PowerShell.cs @@ -0,0 +1,352 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Information about a partner registration. + [System.ComponentModel.TypeConverter(typeof(PartnerRegistrationTypeConverter))] + public partial class PartnerRegistration + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistration DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new PartnerRegistration(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new PartnerRegistration(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistration FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal PartnerRegistration(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerRegistrationPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.TrackedResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerRegistrationProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerRegistrationProvisioningState.CreateFrom); + } + if (content.Contains("ImmutableId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationInternal)this).ImmutableId = (string) content.GetValueForProperty("ImmutableId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationInternal)this).ImmutableId, global::System.Convert.ToString); + } + if (content.Contains("PartnerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationInternal)this).PartnerName = (string) content.GetValueForProperty("PartnerName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationInternal)this).PartnerName, global::System.Convert.ToString); + } + if (content.Contains("PartnerResourceTypeName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationInternal)this).PartnerResourceTypeName = (string) content.GetValueForProperty("PartnerResourceTypeName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationInternal)this).PartnerResourceTypeName, global::System.Convert.ToString); + } + if (content.Contains("PartnerResourceTypeDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationInternal)this).PartnerResourceTypeDisplayName = (string) content.GetValueForProperty("PartnerResourceTypeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationInternal)this).PartnerResourceTypeDisplayName, global::System.Convert.ToString); + } + if (content.Contains("PartnerResourceTypeDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationInternal)this).PartnerResourceTypeDescription = (string) content.GetValueForProperty("PartnerResourceTypeDescription",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationInternal)this).PartnerResourceTypeDescription, global::System.Convert.ToString); + } + if (content.Contains("LongDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationInternal)this).LongDescription = (string) content.GetValueForProperty("LongDescription",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationInternal)this).LongDescription, global::System.Convert.ToString); + } + if (content.Contains("PartnerCustomerServiceNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationInternal)this).PartnerCustomerServiceNumber = (string) content.GetValueForProperty("PartnerCustomerServiceNumber",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationInternal)this).PartnerCustomerServiceNumber, global::System.Convert.ToString); + } + if (content.Contains("PartnerCustomerServiceExtension")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationInternal)this).PartnerCustomerServiceExtension = (string) content.GetValueForProperty("PartnerCustomerServiceExtension",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationInternal)this).PartnerCustomerServiceExtension, global::System.Convert.ToString); + } + if (content.Contains("CustomerServiceUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationInternal)this).CustomerServiceUri = (string) content.GetValueForProperty("CustomerServiceUri",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationInternal)this).CustomerServiceUri, global::System.Convert.ToString); + } + if (content.Contains("SetupUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationInternal)this).SetupUri = (string) content.GetValueForProperty("SetupUri",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationInternal)this).SetupUri, global::System.Convert.ToString); + } + if (content.Contains("LogoUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationInternal)this).LogoUri = (string) content.GetValueForProperty("LogoUri",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationInternal)this).LogoUri, global::System.Convert.ToString); + } + if (content.Contains("VisibilityState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationInternal)this).VisibilityState = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerRegistrationVisibilityState?) content.GetValueForProperty("VisibilityState",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationInternal)this).VisibilityState, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerRegistrationVisibilityState.CreateFrom); + } + if (content.Contains("AuthorizedAzureSubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationInternal)this).AuthorizedAzureSubscriptionId = (string[]) content.GetValueForProperty("AuthorizedAzureSubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationInternal)this).AuthorizedAzureSubscriptionId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal PartnerRegistration(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerRegistrationPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.TrackedResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerRegistrationProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerRegistrationProvisioningState.CreateFrom); + } + if (content.Contains("ImmutableId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationInternal)this).ImmutableId = (string) content.GetValueForProperty("ImmutableId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationInternal)this).ImmutableId, global::System.Convert.ToString); + } + if (content.Contains("PartnerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationInternal)this).PartnerName = (string) content.GetValueForProperty("PartnerName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationInternal)this).PartnerName, global::System.Convert.ToString); + } + if (content.Contains("PartnerResourceTypeName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationInternal)this).PartnerResourceTypeName = (string) content.GetValueForProperty("PartnerResourceTypeName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationInternal)this).PartnerResourceTypeName, global::System.Convert.ToString); + } + if (content.Contains("PartnerResourceTypeDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationInternal)this).PartnerResourceTypeDisplayName = (string) content.GetValueForProperty("PartnerResourceTypeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationInternal)this).PartnerResourceTypeDisplayName, global::System.Convert.ToString); + } + if (content.Contains("PartnerResourceTypeDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationInternal)this).PartnerResourceTypeDescription = (string) content.GetValueForProperty("PartnerResourceTypeDescription",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationInternal)this).PartnerResourceTypeDescription, global::System.Convert.ToString); + } + if (content.Contains("LongDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationInternal)this).LongDescription = (string) content.GetValueForProperty("LongDescription",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationInternal)this).LongDescription, global::System.Convert.ToString); + } + if (content.Contains("PartnerCustomerServiceNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationInternal)this).PartnerCustomerServiceNumber = (string) content.GetValueForProperty("PartnerCustomerServiceNumber",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationInternal)this).PartnerCustomerServiceNumber, global::System.Convert.ToString); + } + if (content.Contains("PartnerCustomerServiceExtension")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationInternal)this).PartnerCustomerServiceExtension = (string) content.GetValueForProperty("PartnerCustomerServiceExtension",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationInternal)this).PartnerCustomerServiceExtension, global::System.Convert.ToString); + } + if (content.Contains("CustomerServiceUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationInternal)this).CustomerServiceUri = (string) content.GetValueForProperty("CustomerServiceUri",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationInternal)this).CustomerServiceUri, global::System.Convert.ToString); + } + if (content.Contains("SetupUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationInternal)this).SetupUri = (string) content.GetValueForProperty("SetupUri",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationInternal)this).SetupUri, global::System.Convert.ToString); + } + if (content.Contains("LogoUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationInternal)this).LogoUri = (string) content.GetValueForProperty("LogoUri",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationInternal)this).LogoUri, global::System.Convert.ToString); + } + if (content.Contains("VisibilityState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationInternal)this).VisibilityState = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerRegistrationVisibilityState?) content.GetValueForProperty("VisibilityState",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationInternal)this).VisibilityState, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerRegistrationVisibilityState.CreateFrom); + } + if (content.Contains("AuthorizedAzureSubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationInternal)this).AuthorizedAzureSubscriptionId = (string[]) content.GetValueForProperty("AuthorizedAzureSubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationInternal)this).AuthorizedAzureSubscriptionId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Information about a partner registration. + [System.ComponentModel.TypeConverter(typeof(PartnerRegistrationTypeConverter))] + public partial interface IPartnerRegistration + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerRegistration.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerRegistration.TypeConverter.cs new file mode 100644 index 000000000000..f83775b93876 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerRegistration.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class PartnerRegistrationTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistration ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistration).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return PartnerRegistration.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return PartnerRegistration.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return PartnerRegistration.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerRegistration.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerRegistration.cs new file mode 100644 index 000000000000..5d37f9e8ff6a --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerRegistration.cs @@ -0,0 +1,463 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Information about a partner registration. + public partial class PartnerRegistration : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistration, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationInternal, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResource __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.TrackedResource(); + + /// + /// List of Azure subscription Ids that are authorized to create a partner namespace + /// associated with this partner registration. This is an optional property. Creating + /// partner namespaces is always permitted under the same Azure subscription as the one used + /// for creating the partner registration. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string[] AuthorizedAzureSubscriptionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationPropertiesInternal)Property).AuthorizedAzureSubscriptionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationPropertiesInternal)Property).AuthorizedAzureSubscriptionId = value ?? null /* arrayOf */; } + + /// The extension of the customer service URI of the publisher. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string CustomerServiceUri { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationPropertiesInternal)Property).CustomerServiceUri; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationPropertiesInternal)Property).CustomerServiceUri = value ?? null; } + + /// Fully qualified identifier of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__trackedResource).Id; } + + /// The immutableId of the corresponding partner registration. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string ImmutableId { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationPropertiesInternal)Property).PartnerRegistrationImmutableId; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationPropertiesInternal)Property).PartnerRegistrationImmutableId = value ?? null; } + + /// Location of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal)__trackedResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal)__trackedResource).Location = value ; } + + /// URI of the logo. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string LogoUri { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationPropertiesInternal)Property).LogoUri; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationPropertiesInternal)Property).LogoUri = value ?? null; } + + /// + /// Long description for the custom scenarios and integration to be displayed in the portal if needed. + /// Length of this description should not exceed 2048 characters. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string LongDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationPropertiesInternal)Property).LongDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationPropertiesInternal)Property).LongDescription = value ?? null; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationProperties Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerRegistrationProperties()); set { {_property = value;} } } + + /// Internal Acessors for ProvisioningState + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerRegistrationProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationPropertiesInternal)Property).ProvisioningState = value; } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.SystemData()); set { {_systemData = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__trackedResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__trackedResource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__trackedResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__trackedResource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__trackedResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__trackedResource).Type = value; } + + /// Name of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__trackedResource).Name; } + + /// + /// The extension of the customer service number of the publisher. Only digits are allowed and number of digits should not + /// exceed 10. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string PartnerCustomerServiceExtension { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationPropertiesInternal)Property).PartnerCustomerServiceExtension; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationPropertiesInternal)Property).PartnerCustomerServiceExtension = value ?? null; } + + /// + /// The customer service number of the publisher. The expected phone format should start with a '+' sign + /// followed by the country code. The remaining digits are then followed. Only digits and spaces are allowed and its + /// length cannot exceed 16 digits including country code. Examples of valid phone numbers are: +1 515 123 4567 and + /// +966 7 5115 2471. Examples of invalid phone numbers are: +1 (515) 123-4567, 1 515 123 4567 and +966 121 5115 24 7 551 + /// 1234 43 + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string PartnerCustomerServiceNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationPropertiesInternal)Property).PartnerCustomerServiceNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationPropertiesInternal)Property).PartnerCustomerServiceNumber = value ?? null; } + + /// Official name of the partner name. For example: "Contoso". + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string PartnerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationPropertiesInternal)Property).PartnerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationPropertiesInternal)Property).PartnerName = value ?? null; } + + /// + /// Short description of the partner resource type. The length of this description should not exceed 256 characters. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string PartnerResourceTypeDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationPropertiesInternal)Property).PartnerResourceTypeDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationPropertiesInternal)Property).PartnerResourceTypeDescription = value ?? null; } + + /// Display name of the partner resource type. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string PartnerResourceTypeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationPropertiesInternal)Property).PartnerResourceTypeDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationPropertiesInternal)Property).PartnerResourceTypeDisplayName = value ?? null; } + + /// Name of the partner resource type. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string PartnerResourceTypeName { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationPropertiesInternal)Property).PartnerResourceTypeName; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationPropertiesInternal)Property).PartnerResourceTypeName = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationProperties _property; + + /// Properties of the partner registration. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerRegistrationProperties()); set => this._property = value; } + + /// Provisioning state of the partner registration. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerRegistrationProvisioningState? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationPropertiesInternal)Property).ProvisioningState; } + + /// + /// URI of the partner website that can be used by Azure customers to setup Event Grid + /// integration on an event source. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string SetupUri { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationPropertiesInternal)Property).SetupUri; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationPropertiesInternal)Property).SetupUri = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData _systemData; + + /// The system metadata relating to Partner Registration resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.SystemData()); } + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).CreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType)""); } + + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType)""); } + + /// Tags of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal)__trackedResource).Tag = value ?? null /* model class */; } + + /// Type of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__trackedResource).Type; } + + /// Visibility state of the partner registration. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerRegistrationVisibilityState? VisibilityState { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationPropertiesInternal)Property).VisibilityState; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationPropertiesInternal)Property).VisibilityState = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerRegistrationVisibilityState)""); } + + /// Creates an new instance. + public PartnerRegistration() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__trackedResource), __trackedResource); + await eventListener.AssertObjectIsValid(nameof(__trackedResource), __trackedResource); + } + } + /// Information about a partner registration. + public partial interface IPartnerRegistration : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResource + { + /// + /// List of Azure subscription Ids that are authorized to create a partner namespace + /// associated with this partner registration. This is an optional property. Creating + /// partner namespaces is always permitted under the same Azure subscription as the one used + /// for creating the partner registration. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of Azure subscription Ids that are authorized to create a partner namespace + associated with this partner registration. This is an optional property. Creating + partner namespaces is always permitted under the same Azure subscription as the one used + for creating the partner registration.", + SerializedName = @"authorizedAzureSubscriptionIds", + PossibleTypes = new [] { typeof(string) })] + string[] AuthorizedAzureSubscriptionId { get; set; } + /// The extension of the customer service URI of the publisher. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The extension of the customer service URI of the publisher.", + SerializedName = @"customerServiceUri", + PossibleTypes = new [] { typeof(string) })] + string CustomerServiceUri { get; set; } + /// The immutableId of the corresponding partner registration. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The immutableId of the corresponding partner registration.", + SerializedName = @"partnerRegistrationImmutableId", + PossibleTypes = new [] { typeof(string) })] + string ImmutableId { get; set; } + /// URI of the logo. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"URI of the logo.", + SerializedName = @"logoUri", + PossibleTypes = new [] { typeof(string) })] + string LogoUri { get; set; } + /// + /// Long description for the custom scenarios and integration to be displayed in the portal if needed. + /// Length of this description should not exceed 2048 characters. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Long description for the custom scenarios and integration to be displayed in the portal if needed. + Length of this description should not exceed 2048 characters.", + SerializedName = @"longDescription", + PossibleTypes = new [] { typeof(string) })] + string LongDescription { get; set; } + /// + /// The extension of the customer service number of the publisher. Only digits are allowed and number of digits should not + /// exceed 10. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The extension of the customer service number of the publisher. Only digits are allowed and number of digits should not exceed 10.", + SerializedName = @"partnerCustomerServiceExtension", + PossibleTypes = new [] { typeof(string) })] + string PartnerCustomerServiceExtension { get; set; } + /// + /// The customer service number of the publisher. The expected phone format should start with a '+' sign + /// followed by the country code. The remaining digits are then followed. Only digits and spaces are allowed and its + /// length cannot exceed 16 digits including country code. Examples of valid phone numbers are: +1 515 123 4567 and + /// +966 7 5115 2471. Examples of invalid phone numbers are: +1 (515) 123-4567, 1 515 123 4567 and +966 121 5115 24 7 551 + /// 1234 43 + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The customer service number of the publisher. The expected phone format should start with a '+' sign + followed by the country code. The remaining digits are then followed. Only digits and spaces are allowed and its + length cannot exceed 16 digits including country code. Examples of valid phone numbers are: +1 515 123 4567 and + +966 7 5115 2471. Examples of invalid phone numbers are: +1 (515) 123-4567, 1 515 123 4567 and +966 121 5115 24 7 551 1234 43", + SerializedName = @"partnerCustomerServiceNumber", + PossibleTypes = new [] { typeof(string) })] + string PartnerCustomerServiceNumber { get; set; } + /// Official name of the partner name. For example: "Contoso". + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Official name of the partner name. For example: ""Contoso"".", + SerializedName = @"partnerName", + PossibleTypes = new [] { typeof(string) })] + string PartnerName { get; set; } + /// + /// Short description of the partner resource type. The length of this description should not exceed 256 characters. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Short description of the partner resource type. The length of this description should not exceed 256 characters.", + SerializedName = @"partnerResourceTypeDescription", + PossibleTypes = new [] { typeof(string) })] + string PartnerResourceTypeDescription { get; set; } + /// Display name of the partner resource type. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Display name of the partner resource type.", + SerializedName = @"partnerResourceTypeDisplayName", + PossibleTypes = new [] { typeof(string) })] + string PartnerResourceTypeDisplayName { get; set; } + /// Name of the partner resource type. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the partner resource type.", + SerializedName = @"partnerResourceTypeName", + PossibleTypes = new [] { typeof(string) })] + string PartnerResourceTypeName { get; set; } + /// Provisioning state of the partner registration. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Provisioning state of the partner registration.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerRegistrationProvisioningState) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerRegistrationProvisioningState? ProvisioningState { get; } + /// + /// URI of the partner website that can be used by Azure customers to setup Event Grid + /// integration on an event source. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"URI of the partner website that can be used by Azure customers to setup Event Grid + integration on an event source.", + SerializedName = @"setupUri", + PossibleTypes = new [] { typeof(string) })] + string SetupUri { get; set; } + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timestamp of resource creation (UTC).", + SerializedName = @"createdAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SystemDataCreatedAt { get; set; } + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identity that created the resource.", + SerializedName = @"createdBy", + PossibleTypes = new [] { typeof(string) })] + string SystemDataCreatedBy { get; set; } + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of identity that created the resource.", + SerializedName = @"createdByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType? SystemDataCreatedByType { get; set; } + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timestamp of resource last modification (UTC)", + SerializedName = @"lastModifiedAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SystemDataLastModifiedAt { get; set; } + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identity that last modified the resource.", + SerializedName = @"lastModifiedBy", + PossibleTypes = new [] { typeof(string) })] + string SystemDataLastModifiedBy { get; set; } + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of identity that last modified the resource.", + SerializedName = @"lastModifiedByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + /// Visibility state of the partner registration. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Visibility state of the partner registration.", + SerializedName = @"visibilityState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerRegistrationVisibilityState) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerRegistrationVisibilityState? VisibilityState { get; set; } + + } + /// Information about a partner registration. + internal partial interface IPartnerRegistrationInternal : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal + { + /// + /// List of Azure subscription Ids that are authorized to create a partner namespace + /// associated with this partner registration. This is an optional property. Creating + /// partner namespaces is always permitted under the same Azure subscription as the one used + /// for creating the partner registration. + /// + string[] AuthorizedAzureSubscriptionId { get; set; } + /// The extension of the customer service URI of the publisher. + string CustomerServiceUri { get; set; } + /// The immutableId of the corresponding partner registration. + string ImmutableId { get; set; } + /// URI of the logo. + string LogoUri { get; set; } + /// + /// Long description for the custom scenarios and integration to be displayed in the portal if needed. + /// Length of this description should not exceed 2048 characters. + /// + string LongDescription { get; set; } + /// + /// The extension of the customer service number of the publisher. Only digits are allowed and number of digits should not + /// exceed 10. + /// + string PartnerCustomerServiceExtension { get; set; } + /// + /// The customer service number of the publisher. The expected phone format should start with a '+' sign + /// followed by the country code. The remaining digits are then followed. Only digits and spaces are allowed and its + /// length cannot exceed 16 digits including country code. Examples of valid phone numbers are: +1 515 123 4567 and + /// +966 7 5115 2471. Examples of invalid phone numbers are: +1 (515) 123-4567, 1 515 123 4567 and +966 121 5115 24 7 551 + /// 1234 43 + /// + string PartnerCustomerServiceNumber { get; set; } + /// Official name of the partner name. For example: "Contoso". + string PartnerName { get; set; } + /// + /// Short description of the partner resource type. The length of this description should not exceed 256 characters. + /// + string PartnerResourceTypeDescription { get; set; } + /// Display name of the partner resource type. + string PartnerResourceTypeDisplayName { get; set; } + /// Name of the partner resource type. + string PartnerResourceTypeName { get; set; } + /// Properties of the partner registration. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationProperties Property { get; set; } + /// Provisioning state of the partner registration. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerRegistrationProvisioningState? ProvisioningState { get; set; } + /// + /// URI of the partner website that can be used by Azure customers to setup Event Grid + /// integration on an event source. + /// + string SetupUri { get; set; } + /// The system metadata relating to Partner Registration resource. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData SystemData { get; set; } + /// The timestamp of resource creation (UTC). + global::System.DateTime? SystemDataCreatedAt { get; set; } + /// The identity that created the resource. + string SystemDataCreatedBy { get; set; } + /// The type of identity that created the resource. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType? SystemDataCreatedByType { get; set; } + /// The timestamp of resource last modification (UTC) + global::System.DateTime? SystemDataLastModifiedAt { get; set; } + /// The identity that last modified the resource. + string SystemDataLastModifiedBy { get; set; } + /// The type of identity that last modified the resource. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + /// Visibility state of the partner registration. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerRegistrationVisibilityState? VisibilityState { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerRegistration.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerRegistration.json.cs new file mode 100644 index 000000000000..ce49c43db7c2 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerRegistration.json.cs @@ -0,0 +1,113 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Information about a partner registration. + public partial class PartnerRegistration + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistration. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistration. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistration FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new PartnerRegistration(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal PartnerRegistration(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.TrackedResource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerRegistrationProperties.FromJson(__jsonProperties) : Property;} + {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.SystemData.FromJson(__jsonSystemData) : SystemData;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __trackedResource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._systemData ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._systemData.ToJson(null,serializationMode) : null, "systemData" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerRegistrationProperties.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerRegistrationProperties.PowerShell.cs new file mode 100644 index 000000000000..03c1ad7ff879 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerRegistrationProperties.PowerShell.cs @@ -0,0 +1,248 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Properties of the partner registration. + [System.ComponentModel.TypeConverter(typeof(PartnerRegistrationPropertiesTypeConverter))] + public partial class PartnerRegistrationProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new PartnerRegistrationProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new PartnerRegistrationProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal PartnerRegistrationProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerRegistrationProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerRegistrationProvisioningState.CreateFrom); + } + if (content.Contains("PartnerRegistrationImmutableId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationPropertiesInternal)this).PartnerRegistrationImmutableId = (string) content.GetValueForProperty("PartnerRegistrationImmutableId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationPropertiesInternal)this).PartnerRegistrationImmutableId, global::System.Convert.ToString); + } + if (content.Contains("PartnerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationPropertiesInternal)this).PartnerName = (string) content.GetValueForProperty("PartnerName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationPropertiesInternal)this).PartnerName, global::System.Convert.ToString); + } + if (content.Contains("PartnerResourceTypeName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationPropertiesInternal)this).PartnerResourceTypeName = (string) content.GetValueForProperty("PartnerResourceTypeName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationPropertiesInternal)this).PartnerResourceTypeName, global::System.Convert.ToString); + } + if (content.Contains("PartnerResourceTypeDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationPropertiesInternal)this).PartnerResourceTypeDisplayName = (string) content.GetValueForProperty("PartnerResourceTypeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationPropertiesInternal)this).PartnerResourceTypeDisplayName, global::System.Convert.ToString); + } + if (content.Contains("PartnerResourceTypeDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationPropertiesInternal)this).PartnerResourceTypeDescription = (string) content.GetValueForProperty("PartnerResourceTypeDescription",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationPropertiesInternal)this).PartnerResourceTypeDescription, global::System.Convert.ToString); + } + if (content.Contains("LongDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationPropertiesInternal)this).LongDescription = (string) content.GetValueForProperty("LongDescription",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationPropertiesInternal)this).LongDescription, global::System.Convert.ToString); + } + if (content.Contains("PartnerCustomerServiceNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationPropertiesInternal)this).PartnerCustomerServiceNumber = (string) content.GetValueForProperty("PartnerCustomerServiceNumber",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationPropertiesInternal)this).PartnerCustomerServiceNumber, global::System.Convert.ToString); + } + if (content.Contains("PartnerCustomerServiceExtension")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationPropertiesInternal)this).PartnerCustomerServiceExtension = (string) content.GetValueForProperty("PartnerCustomerServiceExtension",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationPropertiesInternal)this).PartnerCustomerServiceExtension, global::System.Convert.ToString); + } + if (content.Contains("CustomerServiceUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationPropertiesInternal)this).CustomerServiceUri = (string) content.GetValueForProperty("CustomerServiceUri",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationPropertiesInternal)this).CustomerServiceUri, global::System.Convert.ToString); + } + if (content.Contains("SetupUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationPropertiesInternal)this).SetupUri = (string) content.GetValueForProperty("SetupUri",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationPropertiesInternal)this).SetupUri, global::System.Convert.ToString); + } + if (content.Contains("LogoUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationPropertiesInternal)this).LogoUri = (string) content.GetValueForProperty("LogoUri",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationPropertiesInternal)this).LogoUri, global::System.Convert.ToString); + } + if (content.Contains("VisibilityState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationPropertiesInternal)this).VisibilityState = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerRegistrationVisibilityState?) content.GetValueForProperty("VisibilityState",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationPropertiesInternal)this).VisibilityState, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerRegistrationVisibilityState.CreateFrom); + } + if (content.Contains("AuthorizedAzureSubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationPropertiesInternal)this).AuthorizedAzureSubscriptionId = (string[]) content.GetValueForProperty("AuthorizedAzureSubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationPropertiesInternal)this).AuthorizedAzureSubscriptionId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal PartnerRegistrationProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerRegistrationProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerRegistrationProvisioningState.CreateFrom); + } + if (content.Contains("PartnerRegistrationImmutableId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationPropertiesInternal)this).PartnerRegistrationImmutableId = (string) content.GetValueForProperty("PartnerRegistrationImmutableId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationPropertiesInternal)this).PartnerRegistrationImmutableId, global::System.Convert.ToString); + } + if (content.Contains("PartnerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationPropertiesInternal)this).PartnerName = (string) content.GetValueForProperty("PartnerName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationPropertiesInternal)this).PartnerName, global::System.Convert.ToString); + } + if (content.Contains("PartnerResourceTypeName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationPropertiesInternal)this).PartnerResourceTypeName = (string) content.GetValueForProperty("PartnerResourceTypeName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationPropertiesInternal)this).PartnerResourceTypeName, global::System.Convert.ToString); + } + if (content.Contains("PartnerResourceTypeDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationPropertiesInternal)this).PartnerResourceTypeDisplayName = (string) content.GetValueForProperty("PartnerResourceTypeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationPropertiesInternal)this).PartnerResourceTypeDisplayName, global::System.Convert.ToString); + } + if (content.Contains("PartnerResourceTypeDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationPropertiesInternal)this).PartnerResourceTypeDescription = (string) content.GetValueForProperty("PartnerResourceTypeDescription",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationPropertiesInternal)this).PartnerResourceTypeDescription, global::System.Convert.ToString); + } + if (content.Contains("LongDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationPropertiesInternal)this).LongDescription = (string) content.GetValueForProperty("LongDescription",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationPropertiesInternal)this).LongDescription, global::System.Convert.ToString); + } + if (content.Contains("PartnerCustomerServiceNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationPropertiesInternal)this).PartnerCustomerServiceNumber = (string) content.GetValueForProperty("PartnerCustomerServiceNumber",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationPropertiesInternal)this).PartnerCustomerServiceNumber, global::System.Convert.ToString); + } + if (content.Contains("PartnerCustomerServiceExtension")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationPropertiesInternal)this).PartnerCustomerServiceExtension = (string) content.GetValueForProperty("PartnerCustomerServiceExtension",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationPropertiesInternal)this).PartnerCustomerServiceExtension, global::System.Convert.ToString); + } + if (content.Contains("CustomerServiceUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationPropertiesInternal)this).CustomerServiceUri = (string) content.GetValueForProperty("CustomerServiceUri",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationPropertiesInternal)this).CustomerServiceUri, global::System.Convert.ToString); + } + if (content.Contains("SetupUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationPropertiesInternal)this).SetupUri = (string) content.GetValueForProperty("SetupUri",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationPropertiesInternal)this).SetupUri, global::System.Convert.ToString); + } + if (content.Contains("LogoUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationPropertiesInternal)this).LogoUri = (string) content.GetValueForProperty("LogoUri",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationPropertiesInternal)this).LogoUri, global::System.Convert.ToString); + } + if (content.Contains("VisibilityState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationPropertiesInternal)this).VisibilityState = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerRegistrationVisibilityState?) content.GetValueForProperty("VisibilityState",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationPropertiesInternal)this).VisibilityState, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerRegistrationVisibilityState.CreateFrom); + } + if (content.Contains("AuthorizedAzureSubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationPropertiesInternal)this).AuthorizedAzureSubscriptionId = (string[]) content.GetValueForProperty("AuthorizedAzureSubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationPropertiesInternal)this).AuthorizedAzureSubscriptionId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties of the partner registration. + [System.ComponentModel.TypeConverter(typeof(PartnerRegistrationPropertiesTypeConverter))] + public partial interface IPartnerRegistrationProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerRegistrationProperties.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerRegistrationProperties.TypeConverter.cs new file mode 100644 index 000000000000..a5dee2c6cc40 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerRegistrationProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class PartnerRegistrationPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return PartnerRegistrationProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return PartnerRegistrationProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return PartnerRegistrationProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerRegistrationProperties.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerRegistrationProperties.cs new file mode 100644 index 000000000000..17102425a88a --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerRegistrationProperties.cs @@ -0,0 +1,349 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Properties of the partner registration. + public partial class PartnerRegistrationProperties : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationProperties, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationPropertiesInternal + { + + /// Backing field for property. + private string[] _authorizedAzureSubscriptionId; + + /// + /// List of Azure subscription Ids that are authorized to create a partner namespace + /// associated with this partner registration. This is an optional property. Creating + /// partner namespaces is always permitted under the same Azure subscription as the one used + /// for creating the partner registration. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string[] AuthorizedAzureSubscriptionId { get => this._authorizedAzureSubscriptionId; set => this._authorizedAzureSubscriptionId = value; } + + /// Backing field for property. + private string _customerServiceUri; + + /// The extension of the customer service URI of the publisher. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string CustomerServiceUri { get => this._customerServiceUri; set => this._customerServiceUri = value; } + + /// Backing field for property. + private string _logoUri; + + /// URI of the logo. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string LogoUri { get => this._logoUri; set => this._logoUri = value; } + + /// Backing field for property. + private string _longDescription; + + /// + /// Long description for the custom scenarios and integration to be displayed in the portal if needed. + /// Length of this description should not exceed 2048 characters. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string LongDescription { get => this._longDescription; set => this._longDescription = value; } + + /// Internal Acessors for ProvisioningState + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerRegistrationProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + + /// Backing field for property. + private string _partnerCustomerServiceExtension; + + /// + /// The extension of the customer service number of the publisher. Only digits are allowed and number of digits should not + /// exceed 10. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string PartnerCustomerServiceExtension { get => this._partnerCustomerServiceExtension; set => this._partnerCustomerServiceExtension = value; } + + /// Backing field for property. + private string _partnerCustomerServiceNumber; + + /// + /// The customer service number of the publisher. The expected phone format should start with a '+' sign + /// followed by the country code. The remaining digits are then followed. Only digits and spaces are allowed and its + /// length cannot exceed 16 digits including country code. Examples of valid phone numbers are: +1 515 123 4567 and + /// +966 7 5115 2471. Examples of invalid phone numbers are: +1 (515) 123-4567, 1 515 123 4567 and +966 121 5115 24 7 551 + /// 1234 43 + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string PartnerCustomerServiceNumber { get => this._partnerCustomerServiceNumber; set => this._partnerCustomerServiceNumber = value; } + + /// Backing field for property. + private string _partnerName; + + /// Official name of the partner name. For example: "Contoso". + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string PartnerName { get => this._partnerName; set => this._partnerName = value; } + + /// Backing field for property. + private string _partnerRegistrationImmutableId; + + /// The immutableId of the corresponding partner registration. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string PartnerRegistrationImmutableId { get => this._partnerRegistrationImmutableId; set => this._partnerRegistrationImmutableId = value; } + + /// Backing field for property. + private string _partnerResourceTypeDescription; + + /// + /// Short description of the partner resource type. The length of this description should not exceed 256 characters. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string PartnerResourceTypeDescription { get => this._partnerResourceTypeDescription; set => this._partnerResourceTypeDescription = value; } + + /// Backing field for property. + private string _partnerResourceTypeDisplayName; + + /// Display name of the partner resource type. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string PartnerResourceTypeDisplayName { get => this._partnerResourceTypeDisplayName; set => this._partnerResourceTypeDisplayName = value; } + + /// Backing field for property. + private string _partnerResourceTypeName; + + /// Name of the partner resource type. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string PartnerResourceTypeName { get => this._partnerResourceTypeName; set => this._partnerResourceTypeName = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerRegistrationProvisioningState? _provisioningState; + + /// Provisioning state of the partner registration. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerRegistrationProvisioningState? ProvisioningState { get => this._provisioningState; } + + /// Backing field for property. + private string _setupUri; + + /// + /// URI of the partner website that can be used by Azure customers to setup Event Grid + /// integration on an event source. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string SetupUri { get => this._setupUri; set => this._setupUri = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerRegistrationVisibilityState? _visibilityState; + + /// Visibility state of the partner registration. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerRegistrationVisibilityState? VisibilityState { get => this._visibilityState; set => this._visibilityState = value; } + + /// Creates an new instance. + public PartnerRegistrationProperties() + { + + } + } + /// Properties of the partner registration. + public partial interface IPartnerRegistrationProperties : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// + /// List of Azure subscription Ids that are authorized to create a partner namespace + /// associated with this partner registration. This is an optional property. Creating + /// partner namespaces is always permitted under the same Azure subscription as the one used + /// for creating the partner registration. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of Azure subscription Ids that are authorized to create a partner namespace + associated with this partner registration. This is an optional property. Creating + partner namespaces is always permitted under the same Azure subscription as the one used + for creating the partner registration.", + SerializedName = @"authorizedAzureSubscriptionIds", + PossibleTypes = new [] { typeof(string) })] + string[] AuthorizedAzureSubscriptionId { get; set; } + /// The extension of the customer service URI of the publisher. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The extension of the customer service URI of the publisher.", + SerializedName = @"customerServiceUri", + PossibleTypes = new [] { typeof(string) })] + string CustomerServiceUri { get; set; } + /// URI of the logo. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"URI of the logo.", + SerializedName = @"logoUri", + PossibleTypes = new [] { typeof(string) })] + string LogoUri { get; set; } + /// + /// Long description for the custom scenarios and integration to be displayed in the portal if needed. + /// Length of this description should not exceed 2048 characters. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Long description for the custom scenarios and integration to be displayed in the portal if needed. + Length of this description should not exceed 2048 characters.", + SerializedName = @"longDescription", + PossibleTypes = new [] { typeof(string) })] + string LongDescription { get; set; } + /// + /// The extension of the customer service number of the publisher. Only digits are allowed and number of digits should not + /// exceed 10. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The extension of the customer service number of the publisher. Only digits are allowed and number of digits should not exceed 10.", + SerializedName = @"partnerCustomerServiceExtension", + PossibleTypes = new [] { typeof(string) })] + string PartnerCustomerServiceExtension { get; set; } + /// + /// The customer service number of the publisher. The expected phone format should start with a '+' sign + /// followed by the country code. The remaining digits are then followed. Only digits and spaces are allowed and its + /// length cannot exceed 16 digits including country code. Examples of valid phone numbers are: +1 515 123 4567 and + /// +966 7 5115 2471. Examples of invalid phone numbers are: +1 (515) 123-4567, 1 515 123 4567 and +966 121 5115 24 7 551 + /// 1234 43 + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The customer service number of the publisher. The expected phone format should start with a '+' sign + followed by the country code. The remaining digits are then followed. Only digits and spaces are allowed and its + length cannot exceed 16 digits including country code. Examples of valid phone numbers are: +1 515 123 4567 and + +966 7 5115 2471. Examples of invalid phone numbers are: +1 (515) 123-4567, 1 515 123 4567 and +966 121 5115 24 7 551 1234 43", + SerializedName = @"partnerCustomerServiceNumber", + PossibleTypes = new [] { typeof(string) })] + string PartnerCustomerServiceNumber { get; set; } + /// Official name of the partner name. For example: "Contoso". + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Official name of the partner name. For example: ""Contoso"".", + SerializedName = @"partnerName", + PossibleTypes = new [] { typeof(string) })] + string PartnerName { get; set; } + /// The immutableId of the corresponding partner registration. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The immutableId of the corresponding partner registration.", + SerializedName = @"partnerRegistrationImmutableId", + PossibleTypes = new [] { typeof(string) })] + string PartnerRegistrationImmutableId { get; set; } + /// + /// Short description of the partner resource type. The length of this description should not exceed 256 characters. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Short description of the partner resource type. The length of this description should not exceed 256 characters.", + SerializedName = @"partnerResourceTypeDescription", + PossibleTypes = new [] { typeof(string) })] + string PartnerResourceTypeDescription { get; set; } + /// Display name of the partner resource type. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Display name of the partner resource type.", + SerializedName = @"partnerResourceTypeDisplayName", + PossibleTypes = new [] { typeof(string) })] + string PartnerResourceTypeDisplayName { get; set; } + /// Name of the partner resource type. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the partner resource type.", + SerializedName = @"partnerResourceTypeName", + PossibleTypes = new [] { typeof(string) })] + string PartnerResourceTypeName { get; set; } + /// Provisioning state of the partner registration. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Provisioning state of the partner registration.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerRegistrationProvisioningState) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerRegistrationProvisioningState? ProvisioningState { get; } + /// + /// URI of the partner website that can be used by Azure customers to setup Event Grid + /// integration on an event source. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"URI of the partner website that can be used by Azure customers to setup Event Grid + integration on an event source.", + SerializedName = @"setupUri", + PossibleTypes = new [] { typeof(string) })] + string SetupUri { get; set; } + /// Visibility state of the partner registration. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Visibility state of the partner registration.", + SerializedName = @"visibilityState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerRegistrationVisibilityState) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerRegistrationVisibilityState? VisibilityState { get; set; } + + } + /// Properties of the partner registration. + internal partial interface IPartnerRegistrationPropertiesInternal + + { + /// + /// List of Azure subscription Ids that are authorized to create a partner namespace + /// associated with this partner registration. This is an optional property. Creating + /// partner namespaces is always permitted under the same Azure subscription as the one used + /// for creating the partner registration. + /// + string[] AuthorizedAzureSubscriptionId { get; set; } + /// The extension of the customer service URI of the publisher. + string CustomerServiceUri { get; set; } + /// URI of the logo. + string LogoUri { get; set; } + /// + /// Long description for the custom scenarios and integration to be displayed in the portal if needed. + /// Length of this description should not exceed 2048 characters. + /// + string LongDescription { get; set; } + /// + /// The extension of the customer service number of the publisher. Only digits are allowed and number of digits should not + /// exceed 10. + /// + string PartnerCustomerServiceExtension { get; set; } + /// + /// The customer service number of the publisher. The expected phone format should start with a '+' sign + /// followed by the country code. The remaining digits are then followed. Only digits and spaces are allowed and its + /// length cannot exceed 16 digits including country code. Examples of valid phone numbers are: +1 515 123 4567 and + /// +966 7 5115 2471. Examples of invalid phone numbers are: +1 (515) 123-4567, 1 515 123 4567 and +966 121 5115 24 7 551 + /// 1234 43 + /// + string PartnerCustomerServiceNumber { get; set; } + /// Official name of the partner name. For example: "Contoso". + string PartnerName { get; set; } + /// The immutableId of the corresponding partner registration. + string PartnerRegistrationImmutableId { get; set; } + /// + /// Short description of the partner resource type. The length of this description should not exceed 256 characters. + /// + string PartnerResourceTypeDescription { get; set; } + /// Display name of the partner resource type. + string PartnerResourceTypeDisplayName { get; set; } + /// Name of the partner resource type. + string PartnerResourceTypeName { get; set; } + /// Provisioning state of the partner registration. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerRegistrationProvisioningState? ProvisioningState { get; set; } + /// + /// URI of the partner website that can be used by Azure customers to setup Event Grid + /// integration on an event source. + /// + string SetupUri { get; set; } + /// Visibility state of the partner registration. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerRegistrationVisibilityState? VisibilityState { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerRegistrationProperties.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerRegistrationProperties.json.cs new file mode 100644 index 000000000000..700d847b4477 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerRegistrationProperties.json.cs @@ -0,0 +1,143 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Properties of the partner registration. + public partial class PartnerRegistrationProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new PartnerRegistrationProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal PartnerRegistrationProperties(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} + {_partnerRegistrationImmutableId = If( json?.PropertyT("partnerRegistrationImmutableId"), out var __jsonPartnerRegistrationImmutableId) ? (string)__jsonPartnerRegistrationImmutableId : (string)PartnerRegistrationImmutableId;} + {_partnerName = If( json?.PropertyT("partnerName"), out var __jsonPartnerName) ? (string)__jsonPartnerName : (string)PartnerName;} + {_partnerResourceTypeName = If( json?.PropertyT("partnerResourceTypeName"), out var __jsonPartnerResourceTypeName) ? (string)__jsonPartnerResourceTypeName : (string)PartnerResourceTypeName;} + {_partnerResourceTypeDisplayName = If( json?.PropertyT("partnerResourceTypeDisplayName"), out var __jsonPartnerResourceTypeDisplayName) ? (string)__jsonPartnerResourceTypeDisplayName : (string)PartnerResourceTypeDisplayName;} + {_partnerResourceTypeDescription = If( json?.PropertyT("partnerResourceTypeDescription"), out var __jsonPartnerResourceTypeDescription) ? (string)__jsonPartnerResourceTypeDescription : (string)PartnerResourceTypeDescription;} + {_longDescription = If( json?.PropertyT("longDescription"), out var __jsonLongDescription) ? (string)__jsonLongDescription : (string)LongDescription;} + {_partnerCustomerServiceNumber = If( json?.PropertyT("partnerCustomerServiceNumber"), out var __jsonPartnerCustomerServiceNumber) ? (string)__jsonPartnerCustomerServiceNumber : (string)PartnerCustomerServiceNumber;} + {_partnerCustomerServiceExtension = If( json?.PropertyT("partnerCustomerServiceExtension"), out var __jsonPartnerCustomerServiceExtension) ? (string)__jsonPartnerCustomerServiceExtension : (string)PartnerCustomerServiceExtension;} + {_customerServiceUri = If( json?.PropertyT("customerServiceUri"), out var __jsonCustomerServiceUri) ? (string)__jsonCustomerServiceUri : (string)CustomerServiceUri;} + {_setupUri = If( json?.PropertyT("setupUri"), out var __jsonSetupUri) ? (string)__jsonSetupUri : (string)SetupUri;} + {_logoUri = If( json?.PropertyT("logoUri"), out var __jsonLogoUri) ? (string)__jsonLogoUri : (string)LogoUri;} + {_visibilityState = If( json?.PropertyT("visibilityState"), out var __jsonVisibilityState) ? (string)__jsonVisibilityState : (string)VisibilityState;} + {_authorizedAzureSubscriptionId = If( json?.PropertyT("authorizedAzureSubscriptionIds"), out var __jsonAuthorizedAzureSubscriptionIds) ? If( __jsonAuthorizedAzureSubscriptionIds as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : AuthorizedAzureSubscriptionId;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); + } + AddIf( null != (((object)this._partnerRegistrationImmutableId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._partnerRegistrationImmutableId.ToString()) : null, "partnerRegistrationImmutableId" ,container.Add ); + AddIf( null != (((object)this._partnerName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._partnerName.ToString()) : null, "partnerName" ,container.Add ); + AddIf( null != (((object)this._partnerResourceTypeName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._partnerResourceTypeName.ToString()) : null, "partnerResourceTypeName" ,container.Add ); + AddIf( null != (((object)this._partnerResourceTypeDisplayName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._partnerResourceTypeDisplayName.ToString()) : null, "partnerResourceTypeDisplayName" ,container.Add ); + AddIf( null != (((object)this._partnerResourceTypeDescription)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._partnerResourceTypeDescription.ToString()) : null, "partnerResourceTypeDescription" ,container.Add ); + AddIf( null != (((object)this._longDescription)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._longDescription.ToString()) : null, "longDescription" ,container.Add ); + AddIf( null != (((object)this._partnerCustomerServiceNumber)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._partnerCustomerServiceNumber.ToString()) : null, "partnerCustomerServiceNumber" ,container.Add ); + AddIf( null != (((object)this._partnerCustomerServiceExtension)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._partnerCustomerServiceExtension.ToString()) : null, "partnerCustomerServiceExtension" ,container.Add ); + AddIf( null != (((object)this._customerServiceUri)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._customerServiceUri.ToString()) : null, "customerServiceUri" ,container.Add ); + AddIf( null != (((object)this._setupUri)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._setupUri.ToString()) : null, "setupUri" ,container.Add ); + AddIf( null != (((object)this._logoUri)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._logoUri.ToString()) : null, "logoUri" ,container.Add ); + AddIf( null != (((object)this._visibilityState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._visibilityState.ToString()) : null, "visibilityState" ,container.Add ); + if (null != this._authorizedAzureSubscriptionId) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.XNodeArray(); + foreach( var __x in this._authorizedAzureSubscriptionId ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("authorizedAzureSubscriptionIds",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerRegistrationUpdateParameters.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerRegistrationUpdateParameters.PowerShell.cs new file mode 100644 index 000000000000..8fcf2fdc9306 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerRegistrationUpdateParameters.PowerShell.cs @@ -0,0 +1,192 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Properties of the Partner Registration update. + [System.ComponentModel.TypeConverter(typeof(PartnerRegistrationUpdateParametersTypeConverter))] + public partial class PartnerRegistrationUpdateParameters + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationUpdateParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new PartnerRegistrationUpdateParameters(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationUpdateParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new PartnerRegistrationUpdateParameters(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationUpdateParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal PartnerRegistrationUpdateParameters(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationUpdateParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationUpdateParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationUpdateParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerRegistrationUpdateParametersTagsTypeConverter.ConvertFrom); + } + if (content.Contains("PartnerTopicTypeName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationUpdateParametersInternal)this).PartnerTopicTypeName = (string) content.GetValueForProperty("PartnerTopicTypeName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationUpdateParametersInternal)this).PartnerTopicTypeName, global::System.Convert.ToString); + } + if (content.Contains("PartnerTopicTypeDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationUpdateParametersInternal)this).PartnerTopicTypeDisplayName = (string) content.GetValueForProperty("PartnerTopicTypeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationUpdateParametersInternal)this).PartnerTopicTypeDisplayName, global::System.Convert.ToString); + } + if (content.Contains("PartnerTopicTypeDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationUpdateParametersInternal)this).PartnerTopicTypeDescription = (string) content.GetValueForProperty("PartnerTopicTypeDescription",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationUpdateParametersInternal)this).PartnerTopicTypeDescription, global::System.Convert.ToString); + } + if (content.Contains("SetupUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationUpdateParametersInternal)this).SetupUri = (string) content.GetValueForProperty("SetupUri",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationUpdateParametersInternal)this).SetupUri, global::System.Convert.ToString); + } + if (content.Contains("LogoUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationUpdateParametersInternal)this).LogoUri = (string) content.GetValueForProperty("LogoUri",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationUpdateParametersInternal)this).LogoUri, global::System.Convert.ToString); + } + if (content.Contains("AuthorizedAzureSubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationUpdateParametersInternal)this).AuthorizedAzureSubscriptionId = (string[]) content.GetValueForProperty("AuthorizedAzureSubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationUpdateParametersInternal)this).AuthorizedAzureSubscriptionId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal PartnerRegistrationUpdateParameters(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationUpdateParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationUpdateParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationUpdateParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerRegistrationUpdateParametersTagsTypeConverter.ConvertFrom); + } + if (content.Contains("PartnerTopicTypeName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationUpdateParametersInternal)this).PartnerTopicTypeName = (string) content.GetValueForProperty("PartnerTopicTypeName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationUpdateParametersInternal)this).PartnerTopicTypeName, global::System.Convert.ToString); + } + if (content.Contains("PartnerTopicTypeDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationUpdateParametersInternal)this).PartnerTopicTypeDisplayName = (string) content.GetValueForProperty("PartnerTopicTypeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationUpdateParametersInternal)this).PartnerTopicTypeDisplayName, global::System.Convert.ToString); + } + if (content.Contains("PartnerTopicTypeDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationUpdateParametersInternal)this).PartnerTopicTypeDescription = (string) content.GetValueForProperty("PartnerTopicTypeDescription",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationUpdateParametersInternal)this).PartnerTopicTypeDescription, global::System.Convert.ToString); + } + if (content.Contains("SetupUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationUpdateParametersInternal)this).SetupUri = (string) content.GetValueForProperty("SetupUri",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationUpdateParametersInternal)this).SetupUri, global::System.Convert.ToString); + } + if (content.Contains("LogoUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationUpdateParametersInternal)this).LogoUri = (string) content.GetValueForProperty("LogoUri",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationUpdateParametersInternal)this).LogoUri, global::System.Convert.ToString); + } + if (content.Contains("AuthorizedAzureSubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationUpdateParametersInternal)this).AuthorizedAzureSubscriptionId = (string[]) content.GetValueForProperty("AuthorizedAzureSubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationUpdateParametersInternal)this).AuthorizedAzureSubscriptionId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties of the Partner Registration update. + [System.ComponentModel.TypeConverter(typeof(PartnerRegistrationUpdateParametersTypeConverter))] + public partial interface IPartnerRegistrationUpdateParameters + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerRegistrationUpdateParameters.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerRegistrationUpdateParameters.TypeConverter.cs new file mode 100644 index 000000000000..e778ec526e4e --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerRegistrationUpdateParameters.TypeConverter.cs @@ -0,0 +1,148 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class PartnerRegistrationUpdateParametersTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationUpdateParameters ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationUpdateParameters).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return PartnerRegistrationUpdateParameters.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return PartnerRegistrationUpdateParameters.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return PartnerRegistrationUpdateParameters.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerRegistrationUpdateParameters.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerRegistrationUpdateParameters.cs new file mode 100644 index 000000000000..91e6772a1e06 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerRegistrationUpdateParameters.cs @@ -0,0 +1,181 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Properties of the Partner Registration update. + public partial class PartnerRegistrationUpdateParameters : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationUpdateParameters, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationUpdateParametersInternal + { + + /// Backing field for property. + private string[] _authorizedAzureSubscriptionId; + + /// + /// List of IDs of Azure AD applications that are authorized to create a partner namespace + /// associated with this partner registration. This is an optional property. Creating + /// partner namespaces is always permitted under the same Azure subscription as the one used + /// for creating the partner registration. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string[] AuthorizedAzureSubscriptionId { get => this._authorizedAzureSubscriptionId; set => this._authorizedAzureSubscriptionId = value; } + + /// Backing field for property. + private string _logoUri; + + /// URI of the partner logo. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string LogoUri { get => this._logoUri; set => this._logoUri = value; } + + /// Backing field for property. + private string _partnerTopicTypeDescription; + + /// Description of the partner topic type. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string PartnerTopicTypeDescription { get => this._partnerTopicTypeDescription; set => this._partnerTopicTypeDescription = value; } + + /// Backing field for property. + private string _partnerTopicTypeDisplayName; + + /// Display name of the partner topic type. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string PartnerTopicTypeDisplayName { get => this._partnerTopicTypeDisplayName; set => this._partnerTopicTypeDisplayName = value; } + + /// Backing field for property. + private string _partnerTopicTypeName; + + /// Name of the partner topic type. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string PartnerTopicTypeName { get => this._partnerTopicTypeName; set => this._partnerTopicTypeName = value; } + + /// Backing field for property. + private string _setupUri; + + /// + /// URI of the partner website that can be used by Azure customers to setup Event Grid + /// integration on an event source. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string SetupUri { get => this._setupUri; set => this._setupUri = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationUpdateParametersTags _tag; + + /// Tags of the partner registration resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationUpdateParametersTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerRegistrationUpdateParametersTags()); set => this._tag = value; } + + /// Creates an new instance. + public PartnerRegistrationUpdateParameters() + { + + } + } + /// Properties of the Partner Registration update. + public partial interface IPartnerRegistrationUpdateParameters : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// + /// List of IDs of Azure AD applications that are authorized to create a partner namespace + /// associated with this partner registration. This is an optional property. Creating + /// partner namespaces is always permitted under the same Azure subscription as the one used + /// for creating the partner registration. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of IDs of Azure AD applications that are authorized to create a partner namespace + associated with this partner registration. This is an optional property. Creating + partner namespaces is always permitted under the same Azure subscription as the one used + for creating the partner registration.", + SerializedName = @"authorizedAzureSubscriptionIds", + PossibleTypes = new [] { typeof(string) })] + string[] AuthorizedAzureSubscriptionId { get; set; } + /// URI of the partner logo. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"URI of the partner logo.", + SerializedName = @"logoUri", + PossibleTypes = new [] { typeof(string) })] + string LogoUri { get; set; } + /// Description of the partner topic type. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Description of the partner topic type.", + SerializedName = @"partnerTopicTypeDescription", + PossibleTypes = new [] { typeof(string) })] + string PartnerTopicTypeDescription { get; set; } + /// Display name of the partner topic type. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Display name of the partner topic type.", + SerializedName = @"partnerTopicTypeDisplayName", + PossibleTypes = new [] { typeof(string) })] + string PartnerTopicTypeDisplayName { get; set; } + /// Name of the partner topic type. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the partner topic type.", + SerializedName = @"partnerTopicTypeName", + PossibleTypes = new [] { typeof(string) })] + string PartnerTopicTypeName { get; set; } + /// + /// URI of the partner website that can be used by Azure customers to setup Event Grid + /// integration on an event source. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"URI of the partner website that can be used by Azure customers to setup Event Grid + integration on an event source.", + SerializedName = @"setupUri", + PossibleTypes = new [] { typeof(string) })] + string SetupUri { get; set; } + /// Tags of the partner registration resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Tags of the partner registration resource.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationUpdateParametersTags) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationUpdateParametersTags Tag { get; set; } + + } + /// Properties of the Partner Registration update. + internal partial interface IPartnerRegistrationUpdateParametersInternal + + { + /// + /// List of IDs of Azure AD applications that are authorized to create a partner namespace + /// associated with this partner registration. This is an optional property. Creating + /// partner namespaces is always permitted under the same Azure subscription as the one used + /// for creating the partner registration. + /// + string[] AuthorizedAzureSubscriptionId { get; set; } + /// URI of the partner logo. + string LogoUri { get; set; } + /// Description of the partner topic type. + string PartnerTopicTypeDescription { get; set; } + /// Display name of the partner topic type. + string PartnerTopicTypeDisplayName { get; set; } + /// Name of the partner topic type. + string PartnerTopicTypeName { get; set; } + /// + /// URI of the partner website that can be used by Azure customers to setup Event Grid + /// integration on an event source. + /// + string SetupUri { get; set; } + /// Tags of the partner registration resource. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationUpdateParametersTags Tag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerRegistrationUpdateParameters.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerRegistrationUpdateParameters.json.cs new file mode 100644 index 000000000000..43a2a679cb95 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerRegistrationUpdateParameters.json.cs @@ -0,0 +1,127 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Properties of the Partner Registration update. + public partial class PartnerRegistrationUpdateParameters + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationUpdateParameters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationUpdateParameters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationUpdateParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new PartnerRegistrationUpdateParameters(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal PartnerRegistrationUpdateParameters(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerRegistrationUpdateParametersTags.FromJson(__jsonTags) : Tag;} + {_partnerTopicTypeName = If( json?.PropertyT("partnerTopicTypeName"), out var __jsonPartnerTopicTypeName) ? (string)__jsonPartnerTopicTypeName : (string)PartnerTopicTypeName;} + {_partnerTopicTypeDisplayName = If( json?.PropertyT("partnerTopicTypeDisplayName"), out var __jsonPartnerTopicTypeDisplayName) ? (string)__jsonPartnerTopicTypeDisplayName : (string)PartnerTopicTypeDisplayName;} + {_partnerTopicTypeDescription = If( json?.PropertyT("partnerTopicTypeDescription"), out var __jsonPartnerTopicTypeDescription) ? (string)__jsonPartnerTopicTypeDescription : (string)PartnerTopicTypeDescription;} + {_setupUri = If( json?.PropertyT("setupUri"), out var __jsonSetupUri) ? (string)__jsonSetupUri : (string)SetupUri;} + {_logoUri = If( json?.PropertyT("logoUri"), out var __jsonLogoUri) ? (string)__jsonLogoUri : (string)LogoUri;} + {_authorizedAzureSubscriptionId = If( json?.PropertyT("authorizedAzureSubscriptionIds"), out var __jsonAuthorizedAzureSubscriptionIds) ? If( __jsonAuthorizedAzureSubscriptionIds as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : AuthorizedAzureSubscriptionId;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._tag ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._tag.ToJson(null,serializationMode) : null, "tags" ,container.Add ); + AddIf( null != (((object)this._partnerTopicTypeName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._partnerTopicTypeName.ToString()) : null, "partnerTopicTypeName" ,container.Add ); + AddIf( null != (((object)this._partnerTopicTypeDisplayName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._partnerTopicTypeDisplayName.ToString()) : null, "partnerTopicTypeDisplayName" ,container.Add ); + AddIf( null != (((object)this._partnerTopicTypeDescription)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._partnerTopicTypeDescription.ToString()) : null, "partnerTopicTypeDescription" ,container.Add ); + AddIf( null != (((object)this._setupUri)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._setupUri.ToString()) : null, "setupUri" ,container.Add ); + AddIf( null != (((object)this._logoUri)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._logoUri.ToString()) : null, "logoUri" ,container.Add ); + if (null != this._authorizedAzureSubscriptionId) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.XNodeArray(); + foreach( var __x in this._authorizedAzureSubscriptionId ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("authorizedAzureSubscriptionIds",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerRegistrationUpdateParametersTags.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerRegistrationUpdateParametersTags.PowerShell.cs new file mode 100644 index 000000000000..d1edcecab4c3 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerRegistrationUpdateParametersTags.PowerShell.cs @@ -0,0 +1,141 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Tags of the partner registration resource. + [System.ComponentModel.TypeConverter(typeof(PartnerRegistrationUpdateParametersTagsTypeConverter))] + public partial class PartnerRegistrationUpdateParametersTags + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationUpdateParametersTags DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new PartnerRegistrationUpdateParametersTags(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationUpdateParametersTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new PartnerRegistrationUpdateParametersTags(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json + /// string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationUpdateParametersTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal PartnerRegistrationUpdateParametersTags(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal PartnerRegistrationUpdateParametersTags(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Tags of the partner registration resource. + [System.ComponentModel.TypeConverter(typeof(PartnerRegistrationUpdateParametersTagsTypeConverter))] + public partial interface IPartnerRegistrationUpdateParametersTags + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerRegistrationUpdateParametersTags.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerRegistrationUpdateParametersTags.TypeConverter.cs new file mode 100644 index 000000000000..8dce46e7d10f --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerRegistrationUpdateParametersTags.TypeConverter.cs @@ -0,0 +1,150 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class PartnerRegistrationUpdateParametersTagsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationUpdateParametersTags ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationUpdateParametersTags).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return PartnerRegistrationUpdateParametersTags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return PartnerRegistrationUpdateParametersTags.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return PartnerRegistrationUpdateParametersTags.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerRegistrationUpdateParametersTags.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerRegistrationUpdateParametersTags.cs new file mode 100644 index 000000000000..ab988db9281d --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerRegistrationUpdateParametersTags.cs @@ -0,0 +1,35 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Tags of the partner registration resource. + public partial class PartnerRegistrationUpdateParametersTags : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationUpdateParametersTags, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationUpdateParametersTagsInternal + { + + /// Creates an new instance. + public PartnerRegistrationUpdateParametersTags() + { + + } + } + /// Tags of the partner registration resource. + public partial interface IPartnerRegistrationUpdateParametersTags : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray + { + + } + /// Tags of the partner registration resource. + internal partial interface IPartnerRegistrationUpdateParametersTagsInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerRegistrationUpdateParametersTags.dictionary.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerRegistrationUpdateParametersTags.dictionary.cs new file mode 100644 index 000000000000..a12e1a7e6854 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerRegistrationUpdateParametersTags.dictionary.cs @@ -0,0 +1,75 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + public partial class PartnerRegistrationUpdateParametersTags : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerRegistrationUpdateParametersTags source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerRegistrationUpdateParametersTags.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerRegistrationUpdateParametersTags.json.cs new file mode 100644 index 000000000000..45d44095b03f --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerRegistrationUpdateParametersTags.json.cs @@ -0,0 +1,109 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Tags of the partner registration resource. + public partial class PartnerRegistrationUpdateParametersTags + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationUpdateParametersTags. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationUpdateParametersTags. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationUpdateParametersTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new PartnerRegistrationUpdateParametersTags(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + /// + internal PartnerRegistrationUpdateParametersTags(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerRegistrationsListResult.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerRegistrationsListResult.PowerShell.cs new file mode 100644 index 000000000000..5226c71e0203 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerRegistrationsListResult.PowerShell.cs @@ -0,0 +1,152 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Result of the List Partner Registrations operation. + [System.ComponentModel.TypeConverter(typeof(PartnerRegistrationsListResultTypeConverter))] + public partial class PartnerRegistrationsListResult + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationsListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new PartnerRegistrationsListResult(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationsListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new PartnerRegistrationsListResult(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationsListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal PartnerRegistrationsListResult(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationsListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistration[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationsListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerRegistrationTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationsListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationsListResultInternal)this).NextLink, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal PartnerRegistrationsListResult(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationsListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistration[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationsListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerRegistrationTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationsListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationsListResultInternal)this).NextLink, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Result of the List Partner Registrations operation. + [System.ComponentModel.TypeConverter(typeof(PartnerRegistrationsListResultTypeConverter))] + public partial interface IPartnerRegistrationsListResult + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerRegistrationsListResult.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerRegistrationsListResult.TypeConverter.cs new file mode 100644 index 000000000000..8ddc77ec07f7 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerRegistrationsListResult.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class PartnerRegistrationsListResultTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationsListResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationsListResult).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return PartnerRegistrationsListResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return PartnerRegistrationsListResult.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return PartnerRegistrationsListResult.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerRegistrationsListResult.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerRegistrationsListResult.cs new file mode 100644 index 000000000000..2a3a8663fe93 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerRegistrationsListResult.cs @@ -0,0 +1,68 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Result of the List Partner Registrations operation. + public partial class PartnerRegistrationsListResult : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationsListResult, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationsListResultInternal + { + + /// Backing field for property. + private string _nextLink; + + /// A link for the next page of partner registrations. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistration[] _value; + + /// A collection of partner registrations. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistration[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public PartnerRegistrationsListResult() + { + + } + } + /// Result of the List Partner Registrations operation. + public partial interface IPartnerRegistrationsListResult : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// A link for the next page of partner registrations. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A link for the next page of partner registrations.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// A collection of partner registrations. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A collection of partner registrations.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistration) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistration[] Value { get; set; } + + } + /// Result of the List Partner Registrations operation. + internal partial interface IPartnerRegistrationsListResultInternal + + { + /// A link for the next page of partner registrations. + string NextLink { get; set; } + /// A collection of partner registrations. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistration[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerRegistrationsListResult.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerRegistrationsListResult.json.cs new file mode 100644 index 000000000000..822b2f732312 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerRegistrationsListResult.json.cs @@ -0,0 +1,116 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Result of the List Partner Registrations operation. + public partial class PartnerRegistrationsListResult + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationsListResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationsListResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationsListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new PartnerRegistrationsListResult(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal PartnerRegistrationsListResult(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistration) (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerRegistration.FromJson(__u) )) ))() : null : Value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerTopic.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerTopic.PowerShell.cs new file mode 100644 index 000000000000..862307c46172 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerTopic.PowerShell.cs @@ -0,0 +1,358 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Event Grid Partner Topic. + [System.ComponentModel.TypeConverter(typeof(PartnerTopicTypeConverter))] + public partial class PartnerTopic + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopic DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new PartnerTopic(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopic DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new PartnerTopic(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopic FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal PartnerTopic(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerTopicPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Identity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfo) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IdentityInfoTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.TrackedResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("IdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal)this).IdentityType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType?) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal)this).IdentityType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType.CreateFrom); + } + if (content.Contains("EventTypeInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal)this).EventTypeInfo = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfo) content.GetValueForProperty("EventTypeInfo",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal)this).EventTypeInfo, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventTypeInfoTypeConverter.ConvertFrom); + } + if (content.Contains("PartnerRegistrationImmutableId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal)this).PartnerRegistrationImmutableId = (string) content.GetValueForProperty("PartnerRegistrationImmutableId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal)this).PartnerRegistrationImmutableId, global::System.Convert.ToString); + } + if (content.Contains("Source")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal)this).Source = (string) content.GetValueForProperty("Source",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal)this).Source, global::System.Convert.ToString); + } + if (content.Contains("ExpirationTimeIfNotActivatedUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal)this).ExpirationTimeIfNotActivatedUtc = (global::System.DateTime?) content.GetValueForProperty("ExpirationTimeIfNotActivatedUtc",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal)this).ExpirationTimeIfNotActivatedUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicProvisioningState.CreateFrom); + } + if (content.Contains("ActivationState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal)this).ActivationState = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicActivationState?) content.GetValueForProperty("ActivationState",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal)this).ActivationState, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicActivationState.CreateFrom); + } + if (content.Contains("FriendlyDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal)this).FriendlyDescription = (string) content.GetValueForProperty("FriendlyDescription",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal)this).FriendlyDescription, global::System.Convert.ToString); + } + if (content.Contains("MessageForActivation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal)this).MessageForActivation = (string) content.GetValueForProperty("MessageForActivation",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal)this).MessageForActivation, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("IdentityPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal)this).IdentityPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("IdentityTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal)this).IdentityTenantId, global::System.Convert.ToString); + } + if (content.Contains("IdentityUserAssignedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IdentityInfoUserAssignedIdentitiesTypeConverter.ConvertFrom); + } + if (content.Contains("EventTypeInfoKind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal)this).EventTypeInfoKind = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind?) content.GetValueForProperty("EventTypeInfoKind",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal)this).EventTypeInfoKind, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind.CreateFrom); + } + if (content.Contains("EventTypeInfoInlineEventType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal)this).EventTypeInfoInlineEventType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInlineEventTypes) content.GetValueForProperty("EventTypeInfoInlineEventType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal)this).EventTypeInfoInlineEventType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventTypeInfoInlineEventTypesTypeConverter.ConvertFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal PartnerTopic(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerTopicPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Identity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfo) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IdentityInfoTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.TrackedResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("IdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal)this).IdentityType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType?) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal)this).IdentityType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType.CreateFrom); + } + if (content.Contains("EventTypeInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal)this).EventTypeInfo = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfo) content.GetValueForProperty("EventTypeInfo",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal)this).EventTypeInfo, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventTypeInfoTypeConverter.ConvertFrom); + } + if (content.Contains("PartnerRegistrationImmutableId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal)this).PartnerRegistrationImmutableId = (string) content.GetValueForProperty("PartnerRegistrationImmutableId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal)this).PartnerRegistrationImmutableId, global::System.Convert.ToString); + } + if (content.Contains("Source")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal)this).Source = (string) content.GetValueForProperty("Source",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal)this).Source, global::System.Convert.ToString); + } + if (content.Contains("ExpirationTimeIfNotActivatedUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal)this).ExpirationTimeIfNotActivatedUtc = (global::System.DateTime?) content.GetValueForProperty("ExpirationTimeIfNotActivatedUtc",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal)this).ExpirationTimeIfNotActivatedUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicProvisioningState.CreateFrom); + } + if (content.Contains("ActivationState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal)this).ActivationState = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicActivationState?) content.GetValueForProperty("ActivationState",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal)this).ActivationState, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicActivationState.CreateFrom); + } + if (content.Contains("FriendlyDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal)this).FriendlyDescription = (string) content.GetValueForProperty("FriendlyDescription",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal)this).FriendlyDescription, global::System.Convert.ToString); + } + if (content.Contains("MessageForActivation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal)this).MessageForActivation = (string) content.GetValueForProperty("MessageForActivation",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal)this).MessageForActivation, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("IdentityPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal)this).IdentityPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("IdentityTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal)this).IdentityTenantId, global::System.Convert.ToString); + } + if (content.Contains("IdentityUserAssignedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IdentityInfoUserAssignedIdentitiesTypeConverter.ConvertFrom); + } + if (content.Contains("EventTypeInfoKind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal)this).EventTypeInfoKind = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind?) content.GetValueForProperty("EventTypeInfoKind",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal)this).EventTypeInfoKind, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind.CreateFrom); + } + if (content.Contains("EventTypeInfoInlineEventType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal)this).EventTypeInfoInlineEventType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInlineEventTypes) content.GetValueForProperty("EventTypeInfoInlineEventType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal)this).EventTypeInfoInlineEventType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventTypeInfoInlineEventTypesTypeConverter.ConvertFrom); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Event Grid Partner Topic. + [System.ComponentModel.TypeConverter(typeof(PartnerTopicTypeConverter))] + public partial interface IPartnerTopic + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerTopic.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerTopic.TypeConverter.cs new file mode 100644 index 000000000000..505533833d23 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerTopic.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class PartnerTopicTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopic ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopic).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return PartnerTopic.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return PartnerTopic.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return PartnerTopic.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerTopic.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerTopic.cs new file mode 100644 index 000000000000..61f3b505caff --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerTopic.cs @@ -0,0 +1,473 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Event Grid Partner Topic. + public partial class PartnerTopic : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopic, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResource __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.TrackedResource(); + + /// Activation state of the partner topic. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicActivationState? ActivationState { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicPropertiesInternal)Property).ActivationState; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicPropertiesInternal)Property).ActivationState = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicActivationState)""); } + + /// + /// A collection of inline event types for the resource. The inline event type keys are of type string which represents the + /// name of the event. + /// An example of a valid inline event name is "Contoso.OrderCreated". + /// The inline event type values are of type InlineEventProperties and will contain additional information for every inline + /// event type. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInlineEventTypes EventTypeInfoInlineEventType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicPropertiesInternal)Property).EventTypeInfoInlineEventType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicPropertiesInternal)Property).EventTypeInfoInlineEventType = value ?? null /* model class */; } + + /// The kind of event type used. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind? EventTypeInfoKind { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicPropertiesInternal)Property).EventTypeInfoKind; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicPropertiesInternal)Property).EventTypeInfoKind = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind)""); } + + /// + /// Expiration time of the partner topic. If this timer expires while the partner topic is still never activated, + /// the partner topic and corresponding event channel are deleted. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public global::System.DateTime? ExpirationTimeIfNotActivatedUtc { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicPropertiesInternal)Property).ExpirationTimeIfNotActivatedUtc; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicPropertiesInternal)Property).ExpirationTimeIfNotActivatedUtc = value ?? default(global::System.DateTime); } + + /// + /// Friendly description about the topic. This can be set by the publisher/partner to show custom description for the customer + /// partner topic. + /// This will be helpful to remove any ambiguity of the origin of creation of the partner topic for the customer. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string FriendlyDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicPropertiesInternal)Property).PartnerTopicFriendlyDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicPropertiesInternal)Property).PartnerTopicFriendlyDescription = value ?? null; } + + /// Fully qualified identifier of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__trackedResource).Id; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfo _identity; + + /// Identity information for the Partner Topic resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfo Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IdentityInfo()); set => this._identity = value; } + + /// The principal ID of resource identity. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoInternal)Identity).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoInternal)Identity).PrincipalId = value ?? null; } + + /// The tenant ID of resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoInternal)Identity).TenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoInternal)Identity).TenantId = value ?? null; } + + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType? IdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoInternal)Identity).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoInternal)Identity).Type = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType)""); } + + /// + /// The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource + /// ids in the form: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + /// This property is currently not used and reserved for future usage. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoInternal)Identity).UserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoInternal)Identity).UserAssignedIdentity = value ?? null /* model class */; } + + /// Location of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal)__trackedResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal)__trackedResource).Location = value ; } + + /// + /// Context or helpful message that can be used during the approval process by the subscriber. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string MessageForActivation { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicPropertiesInternal)Property).MessageForActivation; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicPropertiesInternal)Property).MessageForActivation = value ?? null; } + + /// Internal Acessors for EventTypeInfo + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfo Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal.EventTypeInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicPropertiesInternal)Property).EventTypeInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicPropertiesInternal)Property).EventTypeInfo = value; } + + /// Internal Acessors for Identity + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfo Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal.Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IdentityInfo()); set { {_identity = value;} } } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicProperties Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerTopicProperties()); set { {_property = value;} } } + + /// Internal Acessors for ProvisioningState + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicPropertiesInternal)Property).ProvisioningState = value; } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.SystemData()); set { {_systemData = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__trackedResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__trackedResource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__trackedResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__trackedResource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__trackedResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__trackedResource).Type = value; } + + /// Name of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__trackedResource).Name; } + + /// The immutableId of the corresponding partner registration. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string PartnerRegistrationImmutableId { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicPropertiesInternal)Property).PartnerRegistrationImmutableId; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicPropertiesInternal)Property).PartnerRegistrationImmutableId = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicProperties _property; + + /// Properties of the Partner Topic. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerTopicProperties()); set => this._property = value; } + + /// Provisioning state of the partner topic. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicProvisioningState? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicPropertiesInternal)Property).ProvisioningState; } + + /// + /// Source associated with this partner topic. This represents a unique partner resource. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string Source { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicPropertiesInternal)Property).Source; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicPropertiesInternal)Property).Source = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData _systemData; + + /// The system metadata relating to Partner Topic resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.SystemData()); } + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).CreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType)""); } + + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType)""); } + + /// Tags of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal)__trackedResource).Tag = value ?? null /* model class */; } + + /// Type of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__trackedResource).Type; } + + /// Creates an new instance. + public PartnerTopic() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__trackedResource), __trackedResource); + await eventListener.AssertObjectIsValid(nameof(__trackedResource), __trackedResource); + } + } + /// Event Grid Partner Topic. + public partial interface IPartnerTopic : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResource + { + /// Activation state of the partner topic. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Activation state of the partner topic.", + SerializedName = @"activationState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicActivationState) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicActivationState? ActivationState { get; set; } + /// + /// A collection of inline event types for the resource. The inline event type keys are of type string which represents the + /// name of the event. + /// An example of a valid inline event name is "Contoso.OrderCreated". + /// The inline event type values are of type InlineEventProperties and will contain additional information for every inline + /// event type. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A collection of inline event types for the resource. The inline event type keys are of type string which represents the name of the event. + An example of a valid inline event name is ""Contoso.OrderCreated"". + The inline event type values are of type InlineEventProperties and will contain additional information for every inline event type.", + SerializedName = @"inlineEventTypes", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInlineEventTypes) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInlineEventTypes EventTypeInfoInlineEventType { get; set; } + /// The kind of event type used. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The kind of event type used.", + SerializedName = @"kind", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind? EventTypeInfoKind { get; set; } + /// + /// Expiration time of the partner topic. If this timer expires while the partner topic is still never activated, + /// the partner topic and corresponding event channel are deleted. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Expiration time of the partner topic. If this timer expires while the partner topic is still never activated, + the partner topic and corresponding event channel are deleted.", + SerializedName = @"expirationTimeIfNotActivatedUtc", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ExpirationTimeIfNotActivatedUtc { get; set; } + /// + /// Friendly description about the topic. This can be set by the publisher/partner to show custom description for the customer + /// partner topic. + /// This will be helpful to remove any ambiguity of the origin of creation of the partner topic for the customer. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Friendly description about the topic. This can be set by the publisher/partner to show custom description for the customer partner topic. + This will be helpful to remove any ambiguity of the origin of creation of the partner topic for the customer.", + SerializedName = @"partnerTopicFriendlyDescription", + PossibleTypes = new [] { typeof(string) })] + string FriendlyDescription { get; set; } + /// The principal ID of resource identity. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The principal ID of resource identity.", + SerializedName = @"principalId", + PossibleTypes = new [] { typeof(string) })] + string IdentityPrincipalId { get; set; } + /// The tenant ID of resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The tenant ID of resource.", + SerializedName = @"tenantId", + PossibleTypes = new [] { typeof(string) })] + string IdentityTenantId { get; set; } + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType? IdentityType { get; set; } + /// + /// The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource + /// ids in the form: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + /// This property is currently not used and reserved for future usage. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + This property is currently not used and reserved for future usage.", + SerializedName = @"userAssignedIdentities", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } + /// + /// Context or helpful message that can be used during the approval process by the subscriber. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Context or helpful message that can be used during the approval process by the subscriber.", + SerializedName = @"messageForActivation", + PossibleTypes = new [] { typeof(string) })] + string MessageForActivation { get; set; } + /// The immutableId of the corresponding partner registration. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The immutableId of the corresponding partner registration.", + SerializedName = @"partnerRegistrationImmutableId", + PossibleTypes = new [] { typeof(string) })] + string PartnerRegistrationImmutableId { get; set; } + /// Provisioning state of the partner topic. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Provisioning state of the partner topic.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicProvisioningState) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicProvisioningState? ProvisioningState { get; } + /// + /// Source associated with this partner topic. This represents a unique partner resource. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Source associated with this partner topic. This represents a unique partner resource.", + SerializedName = @"source", + PossibleTypes = new [] { typeof(string) })] + string Source { get; set; } + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timestamp of resource creation (UTC).", + SerializedName = @"createdAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SystemDataCreatedAt { get; set; } + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identity that created the resource.", + SerializedName = @"createdBy", + PossibleTypes = new [] { typeof(string) })] + string SystemDataCreatedBy { get; set; } + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of identity that created the resource.", + SerializedName = @"createdByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType? SystemDataCreatedByType { get; set; } + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timestamp of resource last modification (UTC)", + SerializedName = @"lastModifiedAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SystemDataLastModifiedAt { get; set; } + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identity that last modified the resource.", + SerializedName = @"lastModifiedBy", + PossibleTypes = new [] { typeof(string) })] + string SystemDataLastModifiedBy { get; set; } + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of identity that last modified the resource.", + SerializedName = @"lastModifiedByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + + } + /// Event Grid Partner Topic. + internal partial interface IPartnerTopicInternal : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal + { + /// Activation state of the partner topic. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicActivationState? ActivationState { get; set; } + /// Event Type information from the corresponding event channel. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfo EventTypeInfo { get; set; } + /// + /// A collection of inline event types for the resource. The inline event type keys are of type string which represents the + /// name of the event. + /// An example of a valid inline event name is "Contoso.OrderCreated". + /// The inline event type values are of type InlineEventProperties and will contain additional information for every inline + /// event type. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInlineEventTypes EventTypeInfoInlineEventType { get; set; } + /// The kind of event type used. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind? EventTypeInfoKind { get; set; } + /// + /// Expiration time of the partner topic. If this timer expires while the partner topic is still never activated, + /// the partner topic and corresponding event channel are deleted. + /// + global::System.DateTime? ExpirationTimeIfNotActivatedUtc { get; set; } + /// + /// Friendly description about the topic. This can be set by the publisher/partner to show custom description for the customer + /// partner topic. + /// This will be helpful to remove any ambiguity of the origin of creation of the partner topic for the customer. + /// + string FriendlyDescription { get; set; } + /// Identity information for the Partner Topic resource. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfo Identity { get; set; } + /// The principal ID of resource identity. + string IdentityPrincipalId { get; set; } + /// The tenant ID of resource. + string IdentityTenantId { get; set; } + /// + /// 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. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType? IdentityType { get; set; } + /// + /// The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource + /// ids in the form: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + /// This property is currently not used and reserved for future usage. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } + /// + /// Context or helpful message that can be used during the approval process by the subscriber. + /// + string MessageForActivation { get; set; } + /// The immutableId of the corresponding partner registration. + string PartnerRegistrationImmutableId { get; set; } + /// Properties of the Partner Topic. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicProperties Property { get; set; } + /// Provisioning state of the partner topic. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicProvisioningState? ProvisioningState { get; set; } + /// + /// Source associated with this partner topic. This represents a unique partner resource. + /// + string Source { get; set; } + /// The system metadata relating to Partner Topic resource. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData SystemData { get; set; } + /// The timestamp of resource creation (UTC). + global::System.DateTime? SystemDataCreatedAt { get; set; } + /// The identity that created the resource. + string SystemDataCreatedBy { get; set; } + /// The type of identity that created the resource. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType? SystemDataCreatedByType { get; set; } + /// The timestamp of resource last modification (UTC) + global::System.DateTime? SystemDataLastModifiedAt { get; set; } + /// The identity that last modified the resource. + string SystemDataLastModifiedBy { get; set; } + /// The type of identity that last modified the resource. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerTopic.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerTopic.json.cs new file mode 100644 index 000000000000..60cedfd16938 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerTopic.json.cs @@ -0,0 +1,115 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Event Grid Partner Topic. + public partial class PartnerTopic + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopic. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopic. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopic FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new PartnerTopic(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal PartnerTopic(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.TrackedResource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerTopicProperties.FromJson(__jsonProperties) : Property;} + {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.SystemData.FromJson(__jsonSystemData) : SystemData;} + {_identity = If( json?.PropertyT("identity"), out var __jsonIdentity) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IdentityInfo.FromJson(__jsonIdentity) : Identity;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __trackedResource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._systemData ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._systemData.ToJson(null,serializationMode) : null, "systemData" ,container.Add ); + } + AddIf( null != this._identity ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._identity.ToJson(null,serializationMode) : null, "identity" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerTopicInfo.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerTopicInfo.PowerShell.cs new file mode 100644 index 000000000000..9b959e156776 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerTopicInfo.PowerShell.cs @@ -0,0 +1,190 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Properties of the corresponding partner topic of a Channel. + [System.ComponentModel.TypeConverter(typeof(PartnerTopicInfoTypeConverter))] + public partial class PartnerTopicInfo + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new PartnerTopicInfo(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new PartnerTopicInfo(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal PartnerTopicInfo(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("EventTypeInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInfoInternal)this).EventTypeInfo = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfo) content.GetValueForProperty("EventTypeInfo",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInfoInternal)this).EventTypeInfo, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventTypeInfoTypeConverter.ConvertFrom); + } + if (content.Contains("AzureSubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInfoInternal)this).AzureSubscriptionId = (string) content.GetValueForProperty("AzureSubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInfoInternal)this).AzureSubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("ResourceGroupName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInfoInternal)this).ResourceGroupName = (string) content.GetValueForProperty("ResourceGroupName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInfoInternal)this).ResourceGroupName, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInfoInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInfoInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Source")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInfoInternal)this).Source = (string) content.GetValueForProperty("Source",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInfoInternal)this).Source, global::System.Convert.ToString); + } + if (content.Contains("EventTypeInfoKind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInfoInternal)this).EventTypeInfoKind = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind?) content.GetValueForProperty("EventTypeInfoKind",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInfoInternal)this).EventTypeInfoKind, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind.CreateFrom); + } + if (content.Contains("EventTypeInfoInlineEventType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInfoInternal)this).EventTypeInfoInlineEventType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInlineEventTypes) content.GetValueForProperty("EventTypeInfoInlineEventType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInfoInternal)this).EventTypeInfoInlineEventType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventTypeInfoInlineEventTypesTypeConverter.ConvertFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal PartnerTopicInfo(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("EventTypeInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInfoInternal)this).EventTypeInfo = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfo) content.GetValueForProperty("EventTypeInfo",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInfoInternal)this).EventTypeInfo, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventTypeInfoTypeConverter.ConvertFrom); + } + if (content.Contains("AzureSubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInfoInternal)this).AzureSubscriptionId = (string) content.GetValueForProperty("AzureSubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInfoInternal)this).AzureSubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("ResourceGroupName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInfoInternal)this).ResourceGroupName = (string) content.GetValueForProperty("ResourceGroupName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInfoInternal)this).ResourceGroupName, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInfoInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInfoInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Source")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInfoInternal)this).Source = (string) content.GetValueForProperty("Source",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInfoInternal)this).Source, global::System.Convert.ToString); + } + if (content.Contains("EventTypeInfoKind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInfoInternal)this).EventTypeInfoKind = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind?) content.GetValueForProperty("EventTypeInfoKind",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInfoInternal)this).EventTypeInfoKind, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind.CreateFrom); + } + if (content.Contains("EventTypeInfoInlineEventType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInfoInternal)this).EventTypeInfoInlineEventType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInlineEventTypes) content.GetValueForProperty("EventTypeInfoInlineEventType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInfoInternal)this).EventTypeInfoInlineEventType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventTypeInfoInlineEventTypesTypeConverter.ConvertFrom); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties of the corresponding partner topic of a Channel. + [System.ComponentModel.TypeConverter(typeof(PartnerTopicInfoTypeConverter))] + public partial interface IPartnerTopicInfo + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerTopicInfo.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerTopicInfo.TypeConverter.cs new file mode 100644 index 000000000000..d362d2dc11e8 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerTopicInfo.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class PartnerTopicInfoTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInfo ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInfo).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return PartnerTopicInfo.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return PartnerTopicInfo.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return PartnerTopicInfo.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerTopicInfo.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerTopicInfo.cs new file mode 100644 index 000000000000..134c57feb29b --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerTopicInfo.cs @@ -0,0 +1,202 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Properties of the corresponding partner topic of a Channel. + public partial class PartnerTopicInfo : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInfo, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInfoInternal + { + + /// Backing field for property. + private string _azureSubscriptionId; + + /// + /// Azure subscription ID of the subscriber. The partner topic associated with the channel will be + /// created under this Azure subscription. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string AzureSubscriptionId { get => this._azureSubscriptionId; set => this._azureSubscriptionId = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfo _eventTypeInfo; + + /// + /// Event Type Information for the partner topic. This information is provided by the publisher and can be used by the + /// subscriber to view different types of events that are published. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfo EventTypeInfo { get => (this._eventTypeInfo = this._eventTypeInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventTypeInfo()); set => this._eventTypeInfo = value; } + + /// + /// A collection of inline event types for the resource. The inline event type keys are of type string which represents the + /// name of the event. + /// An example of a valid inline event name is "Contoso.OrderCreated". + /// The inline event type values are of type InlineEventProperties and will contain additional information for every inline + /// event type. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInlineEventTypes EventTypeInfoInlineEventType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInternal)EventTypeInfo).InlineEventType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInternal)EventTypeInfo).InlineEventType = value ?? null /* model class */; } + + /// The kind of event type used. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind? EventTypeInfoKind { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInternal)EventTypeInfo).Kind; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInternal)EventTypeInfo).Kind = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind)""); } + + /// Internal Acessors for EventTypeInfo + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfo Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInfoInternal.EventTypeInfo { get => (this._eventTypeInfo = this._eventTypeInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventTypeInfo()); set { {_eventTypeInfo = value;} } } + + /// Backing field for property. + private string _name; + + /// Name of the partner topic associated with the channel. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// Azure Resource Group of the subscriber. The partner topic associated with the channel will be + /// created under this resource group. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _source; + + /// + /// The source information is provided by the publisher to determine the scope or context from which the events + /// are originating. This information can be used by the subscriber during the approval process of the + /// created partner topic. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string Source { get => this._source; set => this._source = value; } + + /// Creates an new instance. + public PartnerTopicInfo() + { + + } + } + /// Properties of the corresponding partner topic of a Channel. + public partial interface IPartnerTopicInfo : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// + /// Azure subscription ID of the subscriber. The partner topic associated with the channel will be + /// created under this Azure subscription. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Azure subscription ID of the subscriber. The partner topic associated with the channel will be + created under this Azure subscription.", + SerializedName = @"azureSubscriptionId", + PossibleTypes = new [] { typeof(string) })] + string AzureSubscriptionId { get; set; } + /// + /// A collection of inline event types for the resource. The inline event type keys are of type string which represents the + /// name of the event. + /// An example of a valid inline event name is "Contoso.OrderCreated". + /// The inline event type values are of type InlineEventProperties and will contain additional information for every inline + /// event type. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A collection of inline event types for the resource. The inline event type keys are of type string which represents the name of the event. + An example of a valid inline event name is ""Contoso.OrderCreated"". + The inline event type values are of type InlineEventProperties and will contain additional information for every inline event type.", + SerializedName = @"inlineEventTypes", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInlineEventTypes) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInlineEventTypes EventTypeInfoInlineEventType { get; set; } + /// The kind of event type used. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The kind of event type used.", + SerializedName = @"kind", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind? EventTypeInfoKind { get; set; } + /// Name of the partner topic associated with the channel. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the partner topic associated with the channel.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + /// + /// Azure Resource Group of the subscriber. The partner topic associated with the channel will be + /// created under this resource group. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Azure Resource Group of the subscriber. The partner topic associated with the channel will be + created under this resource group.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + string ResourceGroupName { get; set; } + /// + /// The source information is provided by the publisher to determine the scope or context from which the events + /// are originating. This information can be used by the subscriber during the approval process of the + /// created partner topic. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The source information is provided by the publisher to determine the scope or context from which the events + are originating. This information can be used by the subscriber during the approval process of the + created partner topic.", + SerializedName = @"source", + PossibleTypes = new [] { typeof(string) })] + string Source { get; set; } + + } + /// Properties of the corresponding partner topic of a Channel. + internal partial interface IPartnerTopicInfoInternal + + { + /// + /// Azure subscription ID of the subscriber. The partner topic associated with the channel will be + /// created under this Azure subscription. + /// + string AzureSubscriptionId { get; set; } + /// + /// Event Type Information for the partner topic. This information is provided by the publisher and can be used by the + /// subscriber to view different types of events that are published. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfo EventTypeInfo { get; set; } + /// + /// A collection of inline event types for the resource. The inline event type keys are of type string which represents the + /// name of the event. + /// An example of a valid inline event name is "Contoso.OrderCreated". + /// The inline event type values are of type InlineEventProperties and will contain additional information for every inline + /// event type. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInlineEventTypes EventTypeInfoInlineEventType { get; set; } + /// The kind of event type used. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind? EventTypeInfoKind { get; set; } + /// Name of the partner topic associated with the channel. + string Name { get; set; } + /// + /// Azure Resource Group of the subscriber. The partner topic associated with the channel will be + /// created under this resource group. + /// + string ResourceGroupName { get; set; } + /// + /// The source information is provided by the publisher to determine the scope or context from which the events + /// are originating. This information can be used by the subscriber during the approval process of the + /// created partner topic. + /// + string Source { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerTopicInfo.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerTopicInfo.json.cs new file mode 100644 index 000000000000..2e40cab2ad78 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerTopicInfo.json.cs @@ -0,0 +1,114 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Properties of the corresponding partner topic of a Channel. + public partial class PartnerTopicInfo + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new PartnerTopicInfo(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal PartnerTopicInfo(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_eventTypeInfo = If( json?.PropertyT("eventTypeInfo"), out var __jsonEventTypeInfo) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventTypeInfo.FromJson(__jsonEventTypeInfo) : EventTypeInfo;} + {_azureSubscriptionId = If( json?.PropertyT("azureSubscriptionId"), out var __jsonAzureSubscriptionId) ? (string)__jsonAzureSubscriptionId : (string)AzureSubscriptionId;} + {_resourceGroupName = If( json?.PropertyT("resourceGroupName"), out var __jsonResourceGroupName) ? (string)__jsonResourceGroupName : (string)ResourceGroupName;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_source = If( json?.PropertyT("source"), out var __jsonSource) ? (string)__jsonSource : (string)Source;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._eventTypeInfo ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._eventTypeInfo.ToJson(null,serializationMode) : null, "eventTypeInfo" ,container.Add ); + AddIf( null != (((object)this._azureSubscriptionId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._azureSubscriptionId.ToString()) : null, "azureSubscriptionId" ,container.Add ); + AddIf( null != (((object)this._resourceGroupName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._resourceGroupName.ToString()) : null, "resourceGroupName" ,container.Add ); + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AddIf( null != (((object)this._source)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._source.ToString()) : null, "source" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerTopicProperties.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerTopicProperties.PowerShell.cs new file mode 100644 index 000000000000..b566aad8a6a8 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerTopicProperties.PowerShell.cs @@ -0,0 +1,216 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Properties of the Partner Topic. + [System.ComponentModel.TypeConverter(typeof(PartnerTopicPropertiesTypeConverter))] + public partial class PartnerTopicProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new PartnerTopicProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new PartnerTopicProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal PartnerTopicProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("EventTypeInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicPropertiesInternal)this).EventTypeInfo = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfo) content.GetValueForProperty("EventTypeInfo",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicPropertiesInternal)this).EventTypeInfo, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventTypeInfoTypeConverter.ConvertFrom); + } + if (content.Contains("PartnerRegistrationImmutableId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicPropertiesInternal)this).PartnerRegistrationImmutableId = (string) content.GetValueForProperty("PartnerRegistrationImmutableId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicPropertiesInternal)this).PartnerRegistrationImmutableId, global::System.Convert.ToString); + } + if (content.Contains("Source")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicPropertiesInternal)this).Source = (string) content.GetValueForProperty("Source",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicPropertiesInternal)this).Source, global::System.Convert.ToString); + } + if (content.Contains("ExpirationTimeIfNotActivatedUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicPropertiesInternal)this).ExpirationTimeIfNotActivatedUtc = (global::System.DateTime?) content.GetValueForProperty("ExpirationTimeIfNotActivatedUtc",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicPropertiesInternal)this).ExpirationTimeIfNotActivatedUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicProvisioningState.CreateFrom); + } + if (content.Contains("ActivationState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicPropertiesInternal)this).ActivationState = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicActivationState?) content.GetValueForProperty("ActivationState",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicPropertiesInternal)this).ActivationState, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicActivationState.CreateFrom); + } + if (content.Contains("PartnerTopicFriendlyDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicPropertiesInternal)this).PartnerTopicFriendlyDescription = (string) content.GetValueForProperty("PartnerTopicFriendlyDescription",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicPropertiesInternal)this).PartnerTopicFriendlyDescription, global::System.Convert.ToString); + } + if (content.Contains("MessageForActivation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicPropertiesInternal)this).MessageForActivation = (string) content.GetValueForProperty("MessageForActivation",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicPropertiesInternal)this).MessageForActivation, global::System.Convert.ToString); + } + if (content.Contains("EventTypeInfoKind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicPropertiesInternal)this).EventTypeInfoKind = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind?) content.GetValueForProperty("EventTypeInfoKind",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicPropertiesInternal)this).EventTypeInfoKind, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind.CreateFrom); + } + if (content.Contains("EventTypeInfoInlineEventType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicPropertiesInternal)this).EventTypeInfoInlineEventType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInlineEventTypes) content.GetValueForProperty("EventTypeInfoInlineEventType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicPropertiesInternal)this).EventTypeInfoInlineEventType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventTypeInfoInlineEventTypesTypeConverter.ConvertFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal PartnerTopicProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("EventTypeInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicPropertiesInternal)this).EventTypeInfo = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfo) content.GetValueForProperty("EventTypeInfo",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicPropertiesInternal)this).EventTypeInfo, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventTypeInfoTypeConverter.ConvertFrom); + } + if (content.Contains("PartnerRegistrationImmutableId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicPropertiesInternal)this).PartnerRegistrationImmutableId = (string) content.GetValueForProperty("PartnerRegistrationImmutableId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicPropertiesInternal)this).PartnerRegistrationImmutableId, global::System.Convert.ToString); + } + if (content.Contains("Source")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicPropertiesInternal)this).Source = (string) content.GetValueForProperty("Source",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicPropertiesInternal)this).Source, global::System.Convert.ToString); + } + if (content.Contains("ExpirationTimeIfNotActivatedUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicPropertiesInternal)this).ExpirationTimeIfNotActivatedUtc = (global::System.DateTime?) content.GetValueForProperty("ExpirationTimeIfNotActivatedUtc",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicPropertiesInternal)this).ExpirationTimeIfNotActivatedUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicProvisioningState.CreateFrom); + } + if (content.Contains("ActivationState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicPropertiesInternal)this).ActivationState = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicActivationState?) content.GetValueForProperty("ActivationState",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicPropertiesInternal)this).ActivationState, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicActivationState.CreateFrom); + } + if (content.Contains("PartnerTopicFriendlyDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicPropertiesInternal)this).PartnerTopicFriendlyDescription = (string) content.GetValueForProperty("PartnerTopicFriendlyDescription",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicPropertiesInternal)this).PartnerTopicFriendlyDescription, global::System.Convert.ToString); + } + if (content.Contains("MessageForActivation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicPropertiesInternal)this).MessageForActivation = (string) content.GetValueForProperty("MessageForActivation",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicPropertiesInternal)this).MessageForActivation, global::System.Convert.ToString); + } + if (content.Contains("EventTypeInfoKind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicPropertiesInternal)this).EventTypeInfoKind = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind?) content.GetValueForProperty("EventTypeInfoKind",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicPropertiesInternal)this).EventTypeInfoKind, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind.CreateFrom); + } + if (content.Contains("EventTypeInfoInlineEventType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicPropertiesInternal)this).EventTypeInfoInlineEventType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInlineEventTypes) content.GetValueForProperty("EventTypeInfoInlineEventType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicPropertiesInternal)this).EventTypeInfoInlineEventType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventTypeInfoInlineEventTypesTypeConverter.ConvertFrom); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties of the Partner Topic. + [System.ComponentModel.TypeConverter(typeof(PartnerTopicPropertiesTypeConverter))] + public partial interface IPartnerTopicProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerTopicProperties.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerTopicProperties.TypeConverter.cs new file mode 100644 index 000000000000..9e02085f224f --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerTopicProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class PartnerTopicPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return PartnerTopicProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return PartnerTopicProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return PartnerTopicProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerTopicProperties.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerTopicProperties.cs new file mode 100644 index 000000000000..507c17301894 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerTopicProperties.cs @@ -0,0 +1,251 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Properties of the Partner Topic. + public partial class PartnerTopicProperties : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicProperties, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicPropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicActivationState? _activationState; + + /// Activation state of the partner topic. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicActivationState? ActivationState { get => this._activationState; set => this._activationState = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfo _eventTypeInfo; + + /// Event Type information from the corresponding event channel. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfo EventTypeInfo { get => (this._eventTypeInfo = this._eventTypeInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventTypeInfo()); set => this._eventTypeInfo = value; } + + /// + /// A collection of inline event types for the resource. The inline event type keys are of type string which represents the + /// name of the event. + /// An example of a valid inline event name is "Contoso.OrderCreated". + /// The inline event type values are of type InlineEventProperties and will contain additional information for every inline + /// event type. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInlineEventTypes EventTypeInfoInlineEventType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInternal)EventTypeInfo).InlineEventType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInternal)EventTypeInfo).InlineEventType = value ?? null /* model class */; } + + /// The kind of event type used. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind? EventTypeInfoKind { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInternal)EventTypeInfo).Kind; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInternal)EventTypeInfo).Kind = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind)""); } + + /// Backing field for property. + private global::System.DateTime? _expirationTimeIfNotActivatedUtc; + + /// + /// Expiration time of the partner topic. If this timer expires while the partner topic is still never activated, + /// the partner topic and corresponding event channel are deleted. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public global::System.DateTime? ExpirationTimeIfNotActivatedUtc { get => this._expirationTimeIfNotActivatedUtc; set => this._expirationTimeIfNotActivatedUtc = value; } + + /// Backing field for property. + private string _messageForActivation; + + /// + /// Context or helpful message that can be used during the approval process by the subscriber. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string MessageForActivation { get => this._messageForActivation; set => this._messageForActivation = value; } + + /// Internal Acessors for EventTypeInfo + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfo Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicPropertiesInternal.EventTypeInfo { get => (this._eventTypeInfo = this._eventTypeInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventTypeInfo()); set { {_eventTypeInfo = value;} } } + + /// Internal Acessors for ProvisioningState + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + + /// Backing field for property. + private string _partnerRegistrationImmutableId; + + /// The immutableId of the corresponding partner registration. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string PartnerRegistrationImmutableId { get => this._partnerRegistrationImmutableId; set => this._partnerRegistrationImmutableId = value; } + + /// Backing field for property. + private string _partnerTopicFriendlyDescription; + + /// + /// Friendly description about the topic. This can be set by the publisher/partner to show custom description for the customer + /// partner topic. + /// This will be helpful to remove any ambiguity of the origin of creation of the partner topic for the customer. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string PartnerTopicFriendlyDescription { get => this._partnerTopicFriendlyDescription; set => this._partnerTopicFriendlyDescription = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicProvisioningState? _provisioningState; + + /// Provisioning state of the partner topic. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicProvisioningState? ProvisioningState { get => this._provisioningState; } + + /// Backing field for property. + private string _source; + + /// + /// Source associated with this partner topic. This represents a unique partner resource. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string Source { get => this._source; set => this._source = value; } + + /// Creates an new instance. + public PartnerTopicProperties() + { + + } + } + /// Properties of the Partner Topic. + public partial interface IPartnerTopicProperties : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// Activation state of the partner topic. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Activation state of the partner topic.", + SerializedName = @"activationState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicActivationState) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicActivationState? ActivationState { get; set; } + /// + /// A collection of inline event types for the resource. The inline event type keys are of type string which represents the + /// name of the event. + /// An example of a valid inline event name is "Contoso.OrderCreated". + /// The inline event type values are of type InlineEventProperties and will contain additional information for every inline + /// event type. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A collection of inline event types for the resource. The inline event type keys are of type string which represents the name of the event. + An example of a valid inline event name is ""Contoso.OrderCreated"". + The inline event type values are of type InlineEventProperties and will contain additional information for every inline event type.", + SerializedName = @"inlineEventTypes", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInlineEventTypes) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInlineEventTypes EventTypeInfoInlineEventType { get; set; } + /// The kind of event type used. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The kind of event type used.", + SerializedName = @"kind", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind? EventTypeInfoKind { get; set; } + /// + /// Expiration time of the partner topic. If this timer expires while the partner topic is still never activated, + /// the partner topic and corresponding event channel are deleted. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Expiration time of the partner topic. If this timer expires while the partner topic is still never activated, + the partner topic and corresponding event channel are deleted.", + SerializedName = @"expirationTimeIfNotActivatedUtc", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ExpirationTimeIfNotActivatedUtc { get; set; } + /// + /// Context or helpful message that can be used during the approval process by the subscriber. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Context or helpful message that can be used during the approval process by the subscriber.", + SerializedName = @"messageForActivation", + PossibleTypes = new [] { typeof(string) })] + string MessageForActivation { get; set; } + /// The immutableId of the corresponding partner registration. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The immutableId of the corresponding partner registration.", + SerializedName = @"partnerRegistrationImmutableId", + PossibleTypes = new [] { typeof(string) })] + string PartnerRegistrationImmutableId { get; set; } + /// + /// Friendly description about the topic. This can be set by the publisher/partner to show custom description for the customer + /// partner topic. + /// This will be helpful to remove any ambiguity of the origin of creation of the partner topic for the customer. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Friendly description about the topic. This can be set by the publisher/partner to show custom description for the customer partner topic. + This will be helpful to remove any ambiguity of the origin of creation of the partner topic for the customer.", + SerializedName = @"partnerTopicFriendlyDescription", + PossibleTypes = new [] { typeof(string) })] + string PartnerTopicFriendlyDescription { get; set; } + /// Provisioning state of the partner topic. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Provisioning state of the partner topic.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicProvisioningState) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicProvisioningState? ProvisioningState { get; } + /// + /// Source associated with this partner topic. This represents a unique partner resource. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Source associated with this partner topic. This represents a unique partner resource.", + SerializedName = @"source", + PossibleTypes = new [] { typeof(string) })] + string Source { get; set; } + + } + /// Properties of the Partner Topic. + internal partial interface IPartnerTopicPropertiesInternal + + { + /// Activation state of the partner topic. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicActivationState? ActivationState { get; set; } + /// Event Type information from the corresponding event channel. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfo EventTypeInfo { get; set; } + /// + /// A collection of inline event types for the resource. The inline event type keys are of type string which represents the + /// name of the event. + /// An example of a valid inline event name is "Contoso.OrderCreated". + /// The inline event type values are of type InlineEventProperties and will contain additional information for every inline + /// event type. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInlineEventTypes EventTypeInfoInlineEventType { get; set; } + /// The kind of event type used. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind? EventTypeInfoKind { get; set; } + /// + /// Expiration time of the partner topic. If this timer expires while the partner topic is still never activated, + /// the partner topic and corresponding event channel are deleted. + /// + global::System.DateTime? ExpirationTimeIfNotActivatedUtc { get; set; } + /// + /// Context or helpful message that can be used during the approval process by the subscriber. + /// + string MessageForActivation { get; set; } + /// The immutableId of the corresponding partner registration. + string PartnerRegistrationImmutableId { get; set; } + /// + /// Friendly description about the topic. This can be set by the publisher/partner to show custom description for the customer + /// partner topic. + /// This will be helpful to remove any ambiguity of the origin of creation of the partner topic for the customer. + /// + string PartnerTopicFriendlyDescription { get; set; } + /// Provisioning state of the partner topic. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicProvisioningState? ProvisioningState { get; set; } + /// + /// Source associated with this partner topic. This represents a unique partner resource. + /// + string Source { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerTopicProperties.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerTopicProperties.json.cs new file mode 100644 index 000000000000..4df9e0b15eb3 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerTopicProperties.json.cs @@ -0,0 +1,123 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Properties of the Partner Topic. + public partial class PartnerTopicProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new PartnerTopicProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal PartnerTopicProperties(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_eventTypeInfo = If( json?.PropertyT("eventTypeInfo"), out var __jsonEventTypeInfo) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventTypeInfo.FromJson(__jsonEventTypeInfo) : EventTypeInfo;} + {_partnerRegistrationImmutableId = If( json?.PropertyT("partnerRegistrationImmutableId"), out var __jsonPartnerRegistrationImmutableId) ? (string)__jsonPartnerRegistrationImmutableId : (string)PartnerRegistrationImmutableId;} + {_source = If( json?.PropertyT("source"), out var __jsonSource) ? (string)__jsonSource : (string)Source;} + {_expirationTimeIfNotActivatedUtc = If( json?.PropertyT("expirationTimeIfNotActivatedUtc"), out var __jsonExpirationTimeIfNotActivatedUtc) ? global::System.DateTime.TryParse((string)__jsonExpirationTimeIfNotActivatedUtc, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonExpirationTimeIfNotActivatedUtcValue) ? __jsonExpirationTimeIfNotActivatedUtcValue : ExpirationTimeIfNotActivatedUtc : ExpirationTimeIfNotActivatedUtc;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} + {_activationState = If( json?.PropertyT("activationState"), out var __jsonActivationState) ? (string)__jsonActivationState : (string)ActivationState;} + {_partnerTopicFriendlyDescription = If( json?.PropertyT("partnerTopicFriendlyDescription"), out var __jsonPartnerTopicFriendlyDescription) ? (string)__jsonPartnerTopicFriendlyDescription : (string)PartnerTopicFriendlyDescription;} + {_messageForActivation = If( json?.PropertyT("messageForActivation"), out var __jsonMessageForActivation) ? (string)__jsonMessageForActivation : (string)MessageForActivation;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._eventTypeInfo ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._eventTypeInfo.ToJson(null,serializationMode) : null, "eventTypeInfo" ,container.Add ); + AddIf( null != (((object)this._partnerRegistrationImmutableId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._partnerRegistrationImmutableId.ToString()) : null, "partnerRegistrationImmutableId" ,container.Add ); + AddIf( null != (((object)this._source)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._source.ToString()) : null, "source" ,container.Add ); + AddIf( null != this._expirationTimeIfNotActivatedUtc ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._expirationTimeIfNotActivatedUtc?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "expirationTimeIfNotActivatedUtc" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); + } + AddIf( null != (((object)this._activationState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._activationState.ToString()) : null, "activationState" ,container.Add ); + AddIf( null != (((object)this._partnerTopicFriendlyDescription)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._partnerTopicFriendlyDescription.ToString()) : null, "partnerTopicFriendlyDescription" ,container.Add ); + AddIf( null != (((object)this._messageForActivation)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._messageForActivation.ToString()) : null, "messageForActivation" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerTopicUpdateParameters.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerTopicUpdateParameters.PowerShell.cs new file mode 100644 index 000000000000..81c7894d2bbf --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerTopicUpdateParameters.PowerShell.cs @@ -0,0 +1,184 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Properties of the Partner Topic update. + [System.ComponentModel.TypeConverter(typeof(PartnerTopicUpdateParametersTypeConverter))] + public partial class PartnerTopicUpdateParameters + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicUpdateParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new PartnerTopicUpdateParameters(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicUpdateParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new PartnerTopicUpdateParameters(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicUpdateParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal PartnerTopicUpdateParameters(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Identity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicUpdateParametersInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfo) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicUpdateParametersInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IdentityInfoTypeConverter.ConvertFrom); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicUpdateParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicUpdateParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicUpdateParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerTopicUpdateParametersTagsTypeConverter.ConvertFrom); + } + if (content.Contains("IdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicUpdateParametersInternal)this).IdentityType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType?) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicUpdateParametersInternal)this).IdentityType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType.CreateFrom); + } + if (content.Contains("IdentityPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicUpdateParametersInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicUpdateParametersInternal)this).IdentityPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("IdentityTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicUpdateParametersInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicUpdateParametersInternal)this).IdentityTenantId, global::System.Convert.ToString); + } + if (content.Contains("IdentityUserAssignedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicUpdateParametersInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicUpdateParametersInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IdentityInfoUserAssignedIdentitiesTypeConverter.ConvertFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal PartnerTopicUpdateParameters(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Identity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicUpdateParametersInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfo) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicUpdateParametersInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IdentityInfoTypeConverter.ConvertFrom); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicUpdateParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicUpdateParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicUpdateParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerTopicUpdateParametersTagsTypeConverter.ConvertFrom); + } + if (content.Contains("IdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicUpdateParametersInternal)this).IdentityType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType?) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicUpdateParametersInternal)this).IdentityType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType.CreateFrom); + } + if (content.Contains("IdentityPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicUpdateParametersInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicUpdateParametersInternal)this).IdentityPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("IdentityTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicUpdateParametersInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicUpdateParametersInternal)this).IdentityTenantId, global::System.Convert.ToString); + } + if (content.Contains("IdentityUserAssignedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicUpdateParametersInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicUpdateParametersInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IdentityInfoUserAssignedIdentitiesTypeConverter.ConvertFrom); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties of the Partner Topic update. + [System.ComponentModel.TypeConverter(typeof(PartnerTopicUpdateParametersTypeConverter))] + public partial interface IPartnerTopicUpdateParameters + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerTopicUpdateParameters.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerTopicUpdateParameters.TypeConverter.cs new file mode 100644 index 000000000000..af1d194c4c80 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerTopicUpdateParameters.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class PartnerTopicUpdateParametersTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicUpdateParameters ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicUpdateParameters).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return PartnerTopicUpdateParameters.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return PartnerTopicUpdateParameters.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return PartnerTopicUpdateParameters.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerTopicUpdateParameters.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerTopicUpdateParameters.cs new file mode 100644 index 000000000000..d672f3f29074 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerTopicUpdateParameters.cs @@ -0,0 +1,145 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Properties of the Partner Topic update. + public partial class PartnerTopicUpdateParameters : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicUpdateParameters, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicUpdateParametersInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfo _identity; + + /// Identity information for the Partner Topic resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfo Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IdentityInfo()); set => this._identity = value; } + + /// The principal ID of resource identity. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoInternal)Identity).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoInternal)Identity).PrincipalId = value ?? null; } + + /// The tenant ID of resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoInternal)Identity).TenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoInternal)Identity).TenantId = value ?? null; } + + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType? IdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoInternal)Identity).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoInternal)Identity).Type = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType)""); } + + /// + /// The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource + /// ids in the form: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + /// This property is currently not used and reserved for future usage. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoInternal)Identity).UserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoInternal)Identity).UserAssignedIdentity = value ?? null /* model class */; } + + /// Internal Acessors for Identity + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfo Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicUpdateParametersInternal.Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IdentityInfo()); set { {_identity = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicUpdateParametersTags _tag; + + /// Tags of the Partner Topic resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicUpdateParametersTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerTopicUpdateParametersTags()); set => this._tag = value; } + + /// Creates an new instance. + public PartnerTopicUpdateParameters() + { + + } + } + /// Properties of the Partner Topic update. + public partial interface IPartnerTopicUpdateParameters : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// The principal ID of resource identity. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The principal ID of resource identity.", + SerializedName = @"principalId", + PossibleTypes = new [] { typeof(string) })] + string IdentityPrincipalId { get; set; } + /// The tenant ID of resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The tenant ID of resource.", + SerializedName = @"tenantId", + PossibleTypes = new [] { typeof(string) })] + string IdentityTenantId { get; set; } + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType? IdentityType { get; set; } + /// + /// The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource + /// ids in the form: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + /// This property is currently not used and reserved for future usage. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + This property is currently not used and reserved for future usage.", + SerializedName = @"userAssignedIdentities", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } + /// Tags of the Partner Topic resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Tags of the Partner Topic resource.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicUpdateParametersTags) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicUpdateParametersTags Tag { get; set; } + + } + /// Properties of the Partner Topic update. + internal partial interface IPartnerTopicUpdateParametersInternal + + { + /// Identity information for the Partner Topic resource. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfo Identity { get; set; } + /// The principal ID of resource identity. + string IdentityPrincipalId { get; set; } + /// The tenant ID of resource. + string IdentityTenantId { get; set; } + /// + /// 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. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType? IdentityType { get; set; } + /// + /// The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource + /// ids in the form: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + /// This property is currently not used and reserved for future usage. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } + /// Tags of the Partner Topic resource. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicUpdateParametersTags Tag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerTopicUpdateParameters.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerTopicUpdateParameters.json.cs new file mode 100644 index 000000000000..f33a57aa21da --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerTopicUpdateParameters.json.cs @@ -0,0 +1,108 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Properties of the Partner Topic update. + public partial class PartnerTopicUpdateParameters + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicUpdateParameters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicUpdateParameters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicUpdateParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new PartnerTopicUpdateParameters(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal PartnerTopicUpdateParameters(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_identity = If( json?.PropertyT("identity"), out var __jsonIdentity) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IdentityInfo.FromJson(__jsonIdentity) : Identity;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerTopicUpdateParametersTags.FromJson(__jsonTags) : Tag;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._identity ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._identity.ToJson(null,serializationMode) : null, "identity" ,container.Add ); + AddIf( null != this._tag ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._tag.ToJson(null,serializationMode) : null, "tags" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerTopicUpdateParametersTags.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerTopicUpdateParametersTags.PowerShell.cs new file mode 100644 index 000000000000..8e35605427f7 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerTopicUpdateParametersTags.PowerShell.cs @@ -0,0 +1,140 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Tags of the Partner Topic resource. + [System.ComponentModel.TypeConverter(typeof(PartnerTopicUpdateParametersTagsTypeConverter))] + public partial class PartnerTopicUpdateParametersTags + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicUpdateParametersTags DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new PartnerTopicUpdateParametersTags(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicUpdateParametersTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new PartnerTopicUpdateParametersTags(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicUpdateParametersTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal PartnerTopicUpdateParametersTags(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal PartnerTopicUpdateParametersTags(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Tags of the Partner Topic resource. + [System.ComponentModel.TypeConverter(typeof(PartnerTopicUpdateParametersTagsTypeConverter))] + public partial interface IPartnerTopicUpdateParametersTags + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerTopicUpdateParametersTags.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerTopicUpdateParametersTags.TypeConverter.cs new file mode 100644 index 000000000000..777acec16c5a --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerTopicUpdateParametersTags.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class PartnerTopicUpdateParametersTagsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicUpdateParametersTags ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicUpdateParametersTags).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return PartnerTopicUpdateParametersTags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return PartnerTopicUpdateParametersTags.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return PartnerTopicUpdateParametersTags.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerTopicUpdateParametersTags.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerTopicUpdateParametersTags.cs new file mode 100644 index 000000000000..432e75570ae4 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerTopicUpdateParametersTags.cs @@ -0,0 +1,35 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Tags of the Partner Topic resource. + public partial class PartnerTopicUpdateParametersTags : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicUpdateParametersTags, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicUpdateParametersTagsInternal + { + + /// Creates an new instance. + public PartnerTopicUpdateParametersTags() + { + + } + } + /// Tags of the Partner Topic resource. + public partial interface IPartnerTopicUpdateParametersTags : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray + { + + } + /// Tags of the Partner Topic resource. + internal partial interface IPartnerTopicUpdateParametersTagsInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerTopicUpdateParametersTags.dictionary.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerTopicUpdateParametersTags.dictionary.cs new file mode 100644 index 000000000000..0ecf9302aadb --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerTopicUpdateParametersTags.dictionary.cs @@ -0,0 +1,75 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + public partial class PartnerTopicUpdateParametersTags : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerTopicUpdateParametersTags source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerTopicUpdateParametersTags.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerTopicUpdateParametersTags.json.cs new file mode 100644 index 000000000000..f00aa7462e8b --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerTopicUpdateParametersTags.json.cs @@ -0,0 +1,107 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Tags of the Partner Topic resource. + public partial class PartnerTopicUpdateParametersTags + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicUpdateParametersTags. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicUpdateParametersTags. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicUpdateParametersTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new PartnerTopicUpdateParametersTags(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + /// + internal PartnerTopicUpdateParametersTags(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerTopicsListResult.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerTopicsListResult.PowerShell.cs new file mode 100644 index 000000000000..8f92674ea58e --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerTopicsListResult.PowerShell.cs @@ -0,0 +1,152 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Result of the List Partner Topics operation. + [System.ComponentModel.TypeConverter(typeof(PartnerTopicsListResultTypeConverter))] + public partial class PartnerTopicsListResult + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicsListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new PartnerTopicsListResult(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicsListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new PartnerTopicsListResult(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicsListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal PartnerTopicsListResult(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicsListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopic[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicsListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerTopicTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicsListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicsListResultInternal)this).NextLink, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal PartnerTopicsListResult(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicsListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopic[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicsListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerTopicTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicsListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicsListResultInternal)this).NextLink, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Result of the List Partner Topics operation. + [System.ComponentModel.TypeConverter(typeof(PartnerTopicsListResultTypeConverter))] + public partial interface IPartnerTopicsListResult + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerTopicsListResult.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerTopicsListResult.TypeConverter.cs new file mode 100644 index 000000000000..5a8bd21c276f --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerTopicsListResult.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class PartnerTopicsListResultTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicsListResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicsListResult).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return PartnerTopicsListResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return PartnerTopicsListResult.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return PartnerTopicsListResult.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerTopicsListResult.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerTopicsListResult.cs new file mode 100644 index 000000000000..2cf9e163a17b --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerTopicsListResult.cs @@ -0,0 +1,68 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Result of the List Partner Topics operation. + public partial class PartnerTopicsListResult : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicsListResult, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicsListResultInternal + { + + /// Backing field for property. + private string _nextLink; + + /// A link for the next page of partner topics. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopic[] _value; + + /// A collection of partner topics. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopic[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public PartnerTopicsListResult() + { + + } + } + /// Result of the List Partner Topics operation. + public partial interface IPartnerTopicsListResult : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// A link for the next page of partner topics. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A link for the next page of partner topics.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// A collection of partner topics. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A collection of partner topics.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopic) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopic[] Value { get; set; } + + } + /// Result of the List Partner Topics operation. + internal partial interface IPartnerTopicsListResultInternal + + { + /// A link for the next page of partner topics. + string NextLink { get; set; } + /// A collection of partner topics. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopic[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerTopicsListResult.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerTopicsListResult.json.cs new file mode 100644 index 000000000000..60194bb68788 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerTopicsListResult.json.cs @@ -0,0 +1,116 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Result of the List Partner Topics operation. + public partial class PartnerTopicsListResult + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicsListResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicsListResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicsListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new PartnerTopicsListResult(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal PartnerTopicsListResult(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopic) (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerTopic.FromJson(__u) )) ))() : null : Value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerUpdateDestinationInfo.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerUpdateDestinationInfo.PowerShell.cs new file mode 100644 index 000000000000..3b2adfa3031c --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerUpdateDestinationInfo.PowerShell.cs @@ -0,0 +1,144 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Properties of the corresponding partner destination of a Channel. + [System.ComponentModel.TypeConverter(typeof(PartnerUpdateDestinationInfoTypeConverter))] + public partial class PartnerUpdateDestinationInfo + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerUpdateDestinationInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new PartnerUpdateDestinationInfo(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerUpdateDestinationInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new PartnerUpdateDestinationInfo(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerUpdateDestinationInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal PartnerUpdateDestinationInfo(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("EndpointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerUpdateDestinationInfoInternal)this).EndpointType = (string) content.GetValueForProperty("EndpointType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerUpdateDestinationInfoInternal)this).EndpointType, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal PartnerUpdateDestinationInfo(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("EndpointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerUpdateDestinationInfoInternal)this).EndpointType = (string) content.GetValueForProperty("EndpointType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerUpdateDestinationInfoInternal)this).EndpointType, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties of the corresponding partner destination of a Channel. + [System.ComponentModel.TypeConverter(typeof(PartnerUpdateDestinationInfoTypeConverter))] + public partial interface IPartnerUpdateDestinationInfo + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerUpdateDestinationInfo.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerUpdateDestinationInfo.TypeConverter.cs new file mode 100644 index 000000000000..1ff537421b5f --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerUpdateDestinationInfo.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class PartnerUpdateDestinationInfoTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerUpdateDestinationInfo ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerUpdateDestinationInfo).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return PartnerUpdateDestinationInfo.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return PartnerUpdateDestinationInfo.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return PartnerUpdateDestinationInfo.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerUpdateDestinationInfo.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerUpdateDestinationInfo.cs new file mode 100644 index 000000000000..195dbadf34a8 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerUpdateDestinationInfo.cs @@ -0,0 +1,54 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Properties of the corresponding partner destination of a Channel. + public partial class PartnerUpdateDestinationInfo : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerUpdateDestinationInfo, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerUpdateDestinationInfoInternal + { + + /// Backing field for property. + private string _endpointType= @"WebHook"; + + /// Type of the endpoint for the partner destination + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string EndpointType { get => this._endpointType; } + + /// Internal Acessors for EndpointType + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerUpdateDestinationInfoInternal.EndpointType { get => this._endpointType; set { {_endpointType = value;} } } + + /// Creates an new instance. + public PartnerUpdateDestinationInfo() + { + + } + } + /// Properties of the corresponding partner destination of a Channel. + public partial interface IPartnerUpdateDestinationInfo : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// Type of the endpoint for the partner destination + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = true, + Description = @"Type of the endpoint for the partner destination", + SerializedName = @"endpointType", + PossibleTypes = new [] { typeof(string) })] + string EndpointType { get; } + + } + /// Properties of the corresponding partner destination of a Channel. + internal partial interface IPartnerUpdateDestinationInfoInternal + + { + /// Type of the endpoint for the partner destination + string EndpointType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerUpdateDestinationInfo.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerUpdateDestinationInfo.json.cs new file mode 100644 index 000000000000..b864e41555d4 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerUpdateDestinationInfo.json.cs @@ -0,0 +1,121 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Properties of the corresponding partner destination of a Channel. + public partial class PartnerUpdateDestinationInfo + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerUpdateDestinationInfo. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerUpdateDestinationInfo interface + /// is polymorphic, and the precise model class that will get deserialized is determined at runtime based on the payload. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerUpdateDestinationInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerUpdateDestinationInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + if (!(node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json)) + { + return null; + } + // Polymorphic type -- select the appropriate constructor using the discriminator + + switch ( json.StringProperty("endpointType") ) + { + case "WebHook": + { + return new WebhookUpdatePartnerDestinationInfo(json); + } + } + return new PartnerUpdateDestinationInfo(json); + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal PartnerUpdateDestinationInfo(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_endpointType = If( json?.PropertyT("endpointType"), out var __jsonEndpointType) ? (string)__jsonEndpointType : (string)EndpointType;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._endpointType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._endpointType.ToString()) : null, "endpointType" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerUpdateTopicInfo.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerUpdateTopicInfo.PowerShell.cs new file mode 100644 index 000000000000..b2f1172fd257 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerUpdateTopicInfo.PowerShell.cs @@ -0,0 +1,160 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Update properties for the corresponding partner topic of a channel. + [System.ComponentModel.TypeConverter(typeof(PartnerUpdateTopicInfoTypeConverter))] + public partial class PartnerUpdateTopicInfo + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerUpdateTopicInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new PartnerUpdateTopicInfo(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerUpdateTopicInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new PartnerUpdateTopicInfo(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerUpdateTopicInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal PartnerUpdateTopicInfo(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("EventTypeInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerUpdateTopicInfoInternal)this).EventTypeInfo = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfo) content.GetValueForProperty("EventTypeInfo",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerUpdateTopicInfoInternal)this).EventTypeInfo, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventTypeInfoTypeConverter.ConvertFrom); + } + if (content.Contains("EventTypeInfoKind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerUpdateTopicInfoInternal)this).EventTypeInfoKind = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind?) content.GetValueForProperty("EventTypeInfoKind",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerUpdateTopicInfoInternal)this).EventTypeInfoKind, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind.CreateFrom); + } + if (content.Contains("EventTypeInfoInlineEventType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerUpdateTopicInfoInternal)this).EventTypeInfoInlineEventType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInlineEventTypes) content.GetValueForProperty("EventTypeInfoInlineEventType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerUpdateTopicInfoInternal)this).EventTypeInfoInlineEventType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventTypeInfoInlineEventTypesTypeConverter.ConvertFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal PartnerUpdateTopicInfo(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("EventTypeInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerUpdateTopicInfoInternal)this).EventTypeInfo = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfo) content.GetValueForProperty("EventTypeInfo",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerUpdateTopicInfoInternal)this).EventTypeInfo, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventTypeInfoTypeConverter.ConvertFrom); + } + if (content.Contains("EventTypeInfoKind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerUpdateTopicInfoInternal)this).EventTypeInfoKind = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind?) content.GetValueForProperty("EventTypeInfoKind",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerUpdateTopicInfoInternal)this).EventTypeInfoKind, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind.CreateFrom); + } + if (content.Contains("EventTypeInfoInlineEventType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerUpdateTopicInfoInternal)this).EventTypeInfoInlineEventType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInlineEventTypes) content.GetValueForProperty("EventTypeInfoInlineEventType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerUpdateTopicInfoInternal)this).EventTypeInfoInlineEventType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventTypeInfoInlineEventTypesTypeConverter.ConvertFrom); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Update properties for the corresponding partner topic of a channel. + [System.ComponentModel.TypeConverter(typeof(PartnerUpdateTopicInfoTypeConverter))] + public partial interface IPartnerUpdateTopicInfo + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerUpdateTopicInfo.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerUpdateTopicInfo.TypeConverter.cs new file mode 100644 index 000000000000..09e6315d85de --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerUpdateTopicInfo.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class PartnerUpdateTopicInfoTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerUpdateTopicInfo ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerUpdateTopicInfo).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return PartnerUpdateTopicInfo.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return PartnerUpdateTopicInfo.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return PartnerUpdateTopicInfo.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerUpdateTopicInfo.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerUpdateTopicInfo.cs new file mode 100644 index 000000000000..28f675709bde --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerUpdateTopicInfo.cs @@ -0,0 +1,94 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Update properties for the corresponding partner topic of a channel. + public partial class PartnerUpdateTopicInfo : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerUpdateTopicInfo, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerUpdateTopicInfoInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfo _eventTypeInfo; + + /// Event type info for the partner topic + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfo EventTypeInfo { get => (this._eventTypeInfo = this._eventTypeInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventTypeInfo()); set => this._eventTypeInfo = value; } + + /// + /// A collection of inline event types for the resource. The inline event type keys are of type string which represents the + /// name of the event. + /// An example of a valid inline event name is "Contoso.OrderCreated". + /// The inline event type values are of type InlineEventProperties and will contain additional information for every inline + /// event type. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInlineEventTypes EventTypeInfoInlineEventType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInternal)EventTypeInfo).InlineEventType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInternal)EventTypeInfo).InlineEventType = value ?? null /* model class */; } + + /// The kind of event type used. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind? EventTypeInfoKind { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInternal)EventTypeInfo).Kind; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInternal)EventTypeInfo).Kind = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind)""); } + + /// Internal Acessors for EventTypeInfo + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfo Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerUpdateTopicInfoInternal.EventTypeInfo { get => (this._eventTypeInfo = this._eventTypeInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventTypeInfo()); set { {_eventTypeInfo = value;} } } + + /// Creates an new instance. + public PartnerUpdateTopicInfo() + { + + } + } + /// Update properties for the corresponding partner topic of a channel. + public partial interface IPartnerUpdateTopicInfo : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// + /// A collection of inline event types for the resource. The inline event type keys are of type string which represents the + /// name of the event. + /// An example of a valid inline event name is "Contoso.OrderCreated". + /// The inline event type values are of type InlineEventProperties and will contain additional information for every inline + /// event type. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A collection of inline event types for the resource. The inline event type keys are of type string which represents the name of the event. + An example of a valid inline event name is ""Contoso.OrderCreated"". + The inline event type values are of type InlineEventProperties and will contain additional information for every inline event type.", + SerializedName = @"inlineEventTypes", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInlineEventTypes) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInlineEventTypes EventTypeInfoInlineEventType { get; set; } + /// The kind of event type used. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The kind of event type used.", + SerializedName = @"kind", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind? EventTypeInfoKind { get; set; } + + } + /// Update properties for the corresponding partner topic of a channel. + internal partial interface IPartnerUpdateTopicInfoInternal + + { + /// Event type info for the partner topic + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfo EventTypeInfo { get; set; } + /// + /// A collection of inline event types for the resource. The inline event type keys are of type string which represents the + /// name of the event. + /// An example of a valid inline event name is "Contoso.OrderCreated". + /// The inline event type values are of type InlineEventProperties and will contain additional information for every inline + /// event type. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInlineEventTypes EventTypeInfoInlineEventType { get; set; } + /// The kind of event type used. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind? EventTypeInfoKind { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerUpdateTopicInfo.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerUpdateTopicInfo.json.cs new file mode 100644 index 000000000000..f4ce9c02ca90 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PartnerUpdateTopicInfo.json.cs @@ -0,0 +1,106 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Update properties for the corresponding partner topic of a channel. + public partial class PartnerUpdateTopicInfo + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerUpdateTopicInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerUpdateTopicInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerUpdateTopicInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new PartnerUpdateTopicInfo(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal PartnerUpdateTopicInfo(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_eventTypeInfo = If( json?.PropertyT("eventTypeInfo"), out var __jsonEventTypeInfo) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventTypeInfo.FromJson(__jsonEventTypeInfo) : EventTypeInfo;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._eventTypeInfo ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._eventTypeInfo.ToJson(null,serializationMode) : null, "eventTypeInfo" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PrivateEndpoint.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PrivateEndpoint.PowerShell.cs new file mode 100644 index 000000000000..efe65ea35528 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PrivateEndpoint.PowerShell.cs @@ -0,0 +1,142 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// PrivateEndpoint information. + [System.ComponentModel.TypeConverter(typeof(PrivateEndpointTypeConverter))] + public partial class PrivateEndpoint + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpoint DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new PrivateEndpoint(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpoint DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new PrivateEndpoint(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpoint FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal PrivateEndpoint(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointInternal)this).Id, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal PrivateEndpoint(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointInternal)this).Id, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// PrivateEndpoint information. + [System.ComponentModel.TypeConverter(typeof(PrivateEndpointTypeConverter))] + public partial interface IPrivateEndpoint + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PrivateEndpoint.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PrivateEndpoint.TypeConverter.cs new file mode 100644 index 000000000000..3931b2f93ee4 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PrivateEndpoint.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class PrivateEndpointTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpoint ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpoint).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return PrivateEndpoint.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return PrivateEndpoint.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return PrivateEndpoint.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PrivateEndpoint.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PrivateEndpoint.cs new file mode 100644 index 000000000000..8fba0ebe8f44 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PrivateEndpoint.cs @@ -0,0 +1,51 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// PrivateEndpoint information. + public partial class PrivateEndpoint : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpoint, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointInternal + { + + /// Backing field for property. + private string _id; + + /// The ARM identifier for Private Endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string Id { get => this._id; set => this._id = value; } + + /// Creates an new instance. + public PrivateEndpoint() + { + + } + } + /// PrivateEndpoint information. + public partial interface IPrivateEndpoint : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// The ARM identifier for Private Endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ARM identifier for Private Endpoint.", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; set; } + + } + /// PrivateEndpoint information. + internal partial interface IPrivateEndpointInternal + + { + /// The ARM identifier for Private Endpoint. + string Id { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PrivateEndpoint.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PrivateEndpoint.json.cs new file mode 100644 index 000000000000..74c257edbff4 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PrivateEndpoint.json.cs @@ -0,0 +1,106 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// PrivateEndpoint information. + public partial class PrivateEndpoint + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpoint. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpoint. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpoint FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new PrivateEndpoint(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal PrivateEndpoint(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PrivateEndpointConnection.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PrivateEndpointConnection.PowerShell.cs new file mode 100644 index 000000000000..4c33a38ba84b --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PrivateEndpointConnection.PowerShell.cs @@ -0,0 +1,230 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(PrivateEndpointConnectionTypeConverter))] + public partial class PrivateEndpointConnection + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnection DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new PrivateEndpointConnection(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnection DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new PrivateEndpointConnection(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnection FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal PrivateEndpointConnection(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PrivateEndpointConnectionPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("PrivateEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionInternal)this).PrivateEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpoint) content.GetValueForProperty("PrivateEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionInternal)this).PrivateEndpoint, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PrivateEndpointTypeConverter.ConvertFrom); + } + if (content.Contains("PrivateLinkServiceConnectionState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionState = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IConnectionState) content.GetValueForProperty("PrivateLinkServiceConnectionState",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionState, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ConnectionStateTypeConverter.ConvertFrom); + } + if (content.Contains("GroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionInternal)this).GroupId = (string[]) content.GetValueForProperty("GroupId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionInternal)this).GroupId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceProvisioningState.CreateFrom); + } + if (content.Contains("PrivateEndpointId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionInternal)this).PrivateEndpointId = (string) content.GetValueForProperty("PrivateEndpointId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionInternal)this).PrivateEndpointId, global::System.Convert.ToString); + } + if (content.Contains("PrivateLinkServiceConnectionStateStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateStatus = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PersistedConnectionStatus?) content.GetValueForProperty("PrivateLinkServiceConnectionStateStatus",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateStatus, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PersistedConnectionStatus.CreateFrom); + } + if (content.Contains("PrivateLinkServiceConnectionStateDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateDescription = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateDescription",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateDescription, global::System.Convert.ToString); + } + if (content.Contains("PrivateLinkServiceConnectionStateActionsRequired")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateActionsRequired = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateActionsRequired",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateActionsRequired, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal PrivateEndpointConnection(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PrivateEndpointConnectionPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("PrivateEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionInternal)this).PrivateEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpoint) content.GetValueForProperty("PrivateEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionInternal)this).PrivateEndpoint, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PrivateEndpointTypeConverter.ConvertFrom); + } + if (content.Contains("PrivateLinkServiceConnectionState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionState = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IConnectionState) content.GetValueForProperty("PrivateLinkServiceConnectionState",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionState, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ConnectionStateTypeConverter.ConvertFrom); + } + if (content.Contains("GroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionInternal)this).GroupId = (string[]) content.GetValueForProperty("GroupId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionInternal)this).GroupId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceProvisioningState.CreateFrom); + } + if (content.Contains("PrivateEndpointId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionInternal)this).PrivateEndpointId = (string) content.GetValueForProperty("PrivateEndpointId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionInternal)this).PrivateEndpointId, global::System.Convert.ToString); + } + if (content.Contains("PrivateLinkServiceConnectionStateStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateStatus = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PersistedConnectionStatus?) content.GetValueForProperty("PrivateLinkServiceConnectionStateStatus",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateStatus, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PersistedConnectionStatus.CreateFrom); + } + if (content.Contains("PrivateLinkServiceConnectionStateDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateDescription = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateDescription",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateDescription, global::System.Convert.ToString); + } + if (content.Contains("PrivateLinkServiceConnectionStateActionsRequired")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateActionsRequired = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateActionsRequired",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateActionsRequired, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(PrivateEndpointConnectionTypeConverter))] + public partial interface IPrivateEndpointConnection + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PrivateEndpointConnection.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PrivateEndpointConnection.TypeConverter.cs new file mode 100644 index 000000000000..07e990fd6910 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PrivateEndpointConnection.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class PrivateEndpointConnectionTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnection ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnection).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return PrivateEndpointConnection.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return PrivateEndpointConnection.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return PrivateEndpointConnection.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PrivateEndpointConnection.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PrivateEndpointConnection.cs new file mode 100644 index 000000000000..54b8e843e4ae --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PrivateEndpointConnection.cs @@ -0,0 +1,177 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + public partial class PrivateEndpointConnection : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnection, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionInternal, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.Resource(); + + /// GroupIds from the private link service resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string[] GroupId { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionPropertiesInternal)Property).GroupId; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionPropertiesInternal)Property).GroupId = value ?? null /* arrayOf */; } + + /// Fully qualified identifier of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Id; } + + /// Internal Acessors for PrivateEndpoint + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpoint Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionInternal.PrivateEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateEndpoint = value; } + + /// Internal Acessors for PrivateLinkServiceConnectionState + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IConnectionState Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionInternal.PrivateLinkServiceConnectionState { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateLinkServiceConnectionState; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateLinkServiceConnectionState = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionProperties Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PrivateEndpointConnectionProperties()); set { {_property = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Type = value; } + + /// Name of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Name; } + + /// The ARM identifier for Private Endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string PrivateEndpointId { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateEndpointId; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateEndpointId = value ?? null; } + + /// Actions required (if any). + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string PrivateLinkServiceConnectionStateActionsRequired { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateLinkServiceConnectionStateActionsRequired; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateLinkServiceConnectionStateActionsRequired = value ?? null; } + + /// Description of the connection state. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string PrivateLinkServiceConnectionStateDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateLinkServiceConnectionStateDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateLinkServiceConnectionStateDescription = value ?? null; } + + /// Status of the connection. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PersistedConnectionStatus? PrivateLinkServiceConnectionStateStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateLinkServiceConnectionStateStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateLinkServiceConnectionStateStatus = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PersistedConnectionStatus)""); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionProperties _property; + + /// Properties of the PrivateEndpointConnection. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PrivateEndpointConnectionProperties()); set => this._property = value; } + + /// Provisioning state of the Private Endpoint Connection. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceProvisioningState? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionPropertiesInternal)Property).ProvisioningState = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceProvisioningState)""); } + + /// Type of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public PrivateEndpointConnection() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + public partial interface IPrivateEndpointConnection : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResource + { + /// GroupIds from the private link service resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"GroupIds from the private link service resource.", + SerializedName = @"groupIds", + PossibleTypes = new [] { typeof(string) })] + string[] GroupId { get; set; } + /// The ARM identifier for Private Endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ARM identifier for Private Endpoint.", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string PrivateEndpointId { get; set; } + /// Actions required (if any). + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Actions required (if any).", + SerializedName = @"actionsRequired", + PossibleTypes = new [] { typeof(string) })] + string PrivateLinkServiceConnectionStateActionsRequired { get; set; } + /// Description of the connection state. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Description of the connection state.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string PrivateLinkServiceConnectionStateDescription { get; set; } + /// Status of the connection. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Status of the connection.", + SerializedName = @"status", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PersistedConnectionStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PersistedConnectionStatus? PrivateLinkServiceConnectionStateStatus { get; set; } + /// Provisioning state of the Private Endpoint Connection. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Provisioning state of the Private Endpoint Connection.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceProvisioningState) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceProvisioningState? ProvisioningState { get; set; } + + } + internal partial interface IPrivateEndpointConnectionInternal : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal + { + /// GroupIds from the private link service resource. + string[] GroupId { get; set; } + /// The Private Endpoint resource for this Connection. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpoint PrivateEndpoint { get; set; } + /// The ARM identifier for Private Endpoint. + string PrivateEndpointId { get; set; } + /// Details about the state of the connection. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IConnectionState PrivateLinkServiceConnectionState { get; set; } + /// Actions required (if any). + string PrivateLinkServiceConnectionStateActionsRequired { get; set; } + /// Description of the connection state. + string PrivateLinkServiceConnectionStateDescription { get; set; } + /// Status of the connection. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PersistedConnectionStatus? PrivateLinkServiceConnectionStateStatus { get; set; } + /// Properties of the PrivateEndpointConnection. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionProperties Property { get; set; } + /// Provisioning state of the Private Endpoint Connection. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceProvisioningState? ProvisioningState { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PrivateEndpointConnection.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PrivateEndpointConnection.json.cs new file mode 100644 index 000000000000..30146a7840aa --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PrivateEndpointConnection.json.cs @@ -0,0 +1,107 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + public partial class PrivateEndpointConnection + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnection FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new PrivateEndpointConnection(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal PrivateEndpointConnection(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PrivateEndpointConnectionProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PrivateEndpointConnectionListResult.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PrivateEndpointConnectionListResult.PowerShell.cs new file mode 100644 index 000000000000..ef8d1b454adc --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PrivateEndpointConnectionListResult.PowerShell.cs @@ -0,0 +1,152 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Result of the list of all private endpoint connections operation. + [System.ComponentModel.TypeConverter(typeof(PrivateEndpointConnectionListResultTypeConverter))] + public partial class PrivateEndpointConnectionListResult + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new PrivateEndpointConnectionListResult(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new PrivateEndpointConnectionListResult(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal PrivateEndpointConnectionListResult(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnection[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PrivateEndpointConnectionTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionListResultInternal)this).NextLink, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal PrivateEndpointConnectionListResult(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnection[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PrivateEndpointConnectionTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionListResultInternal)this).NextLink, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Result of the list of all private endpoint connections operation. + [System.ComponentModel.TypeConverter(typeof(PrivateEndpointConnectionListResultTypeConverter))] + public partial interface IPrivateEndpointConnectionListResult + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PrivateEndpointConnectionListResult.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PrivateEndpointConnectionListResult.TypeConverter.cs new file mode 100644 index 000000000000..373b8549f647 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PrivateEndpointConnectionListResult.TypeConverter.cs @@ -0,0 +1,148 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class PrivateEndpointConnectionListResultTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionListResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionListResult).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return PrivateEndpointConnectionListResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return PrivateEndpointConnectionListResult.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return PrivateEndpointConnectionListResult.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PrivateEndpointConnectionListResult.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PrivateEndpointConnectionListResult.cs new file mode 100644 index 000000000000..11c6bcf211e3 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PrivateEndpointConnectionListResult.cs @@ -0,0 +1,68 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Result of the list of all private endpoint connections operation. + public partial class PrivateEndpointConnectionListResult : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionListResult, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionListResultInternal + { + + /// Backing field for property. + private string _nextLink; + + /// A link for the next page of private endpoint connection resources. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnection[] _value; + + /// A collection of private endpoint connection resources. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnection[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public PrivateEndpointConnectionListResult() + { + + } + } + /// Result of the list of all private endpoint connections operation. + public partial interface IPrivateEndpointConnectionListResult : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// A link for the next page of private endpoint connection resources. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A link for the next page of private endpoint connection resources.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// A collection of private endpoint connection resources. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A collection of private endpoint connection resources.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnection) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnection[] Value { get; set; } + + } + /// Result of the list of all private endpoint connections operation. + internal partial interface IPrivateEndpointConnectionListResultInternal + + { + /// A link for the next page of private endpoint connection resources. + string NextLink { get; set; } + /// A collection of private endpoint connection resources. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnection[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PrivateEndpointConnectionListResult.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PrivateEndpointConnectionListResult.json.cs new file mode 100644 index 000000000000..6d0b9bdc01a6 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PrivateEndpointConnectionListResult.json.cs @@ -0,0 +1,117 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Result of the list of all private endpoint connections operation. + public partial class PrivateEndpointConnectionListResult + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionListResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionListResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new PrivateEndpointConnectionListResult(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal PrivateEndpointConnectionListResult(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnection) (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PrivateEndpointConnection.FromJson(__u) )) ))() : null : Value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PrivateEndpointConnectionProperties.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PrivateEndpointConnectionProperties.PowerShell.cs new file mode 100644 index 000000000000..027383cfa97e --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PrivateEndpointConnectionProperties.PowerShell.cs @@ -0,0 +1,200 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Properties of the private endpoint connection resource. + [System.ComponentModel.TypeConverter(typeof(PrivateEndpointConnectionPropertiesTypeConverter))] + public partial class PrivateEndpointConnectionProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new PrivateEndpointConnectionProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new PrivateEndpointConnectionProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal PrivateEndpointConnectionProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("PrivateEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionPropertiesInternal)this).PrivateEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpoint) content.GetValueForProperty("PrivateEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionPropertiesInternal)this).PrivateEndpoint, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PrivateEndpointTypeConverter.ConvertFrom); + } + if (content.Contains("PrivateLinkServiceConnectionState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionState = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IConnectionState) content.GetValueForProperty("PrivateLinkServiceConnectionState",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionState, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ConnectionStateTypeConverter.ConvertFrom); + } + if (content.Contains("GroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionPropertiesInternal)this).GroupId = (string[]) content.GetValueForProperty("GroupId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionPropertiesInternal)this).GroupId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceProvisioningState.CreateFrom); + } + if (content.Contains("PrivateEndpointId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionPropertiesInternal)this).PrivateEndpointId = (string) content.GetValueForProperty("PrivateEndpointId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionPropertiesInternal)this).PrivateEndpointId, global::System.Convert.ToString); + } + if (content.Contains("PrivateLinkServiceConnectionStateStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateStatus = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PersistedConnectionStatus?) content.GetValueForProperty("PrivateLinkServiceConnectionStateStatus",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateStatus, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PersistedConnectionStatus.CreateFrom); + } + if (content.Contains("PrivateLinkServiceConnectionStateDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateDescription = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateDescription",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateDescription, global::System.Convert.ToString); + } + if (content.Contains("PrivateLinkServiceConnectionStateActionsRequired")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateActionsRequired = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateActionsRequired",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateActionsRequired, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal PrivateEndpointConnectionProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("PrivateEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionPropertiesInternal)this).PrivateEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpoint) content.GetValueForProperty("PrivateEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionPropertiesInternal)this).PrivateEndpoint, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PrivateEndpointTypeConverter.ConvertFrom); + } + if (content.Contains("PrivateLinkServiceConnectionState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionState = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IConnectionState) content.GetValueForProperty("PrivateLinkServiceConnectionState",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionState, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ConnectionStateTypeConverter.ConvertFrom); + } + if (content.Contains("GroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionPropertiesInternal)this).GroupId = (string[]) content.GetValueForProperty("GroupId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionPropertiesInternal)this).GroupId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceProvisioningState.CreateFrom); + } + if (content.Contains("PrivateEndpointId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionPropertiesInternal)this).PrivateEndpointId = (string) content.GetValueForProperty("PrivateEndpointId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionPropertiesInternal)this).PrivateEndpointId, global::System.Convert.ToString); + } + if (content.Contains("PrivateLinkServiceConnectionStateStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateStatus = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PersistedConnectionStatus?) content.GetValueForProperty("PrivateLinkServiceConnectionStateStatus",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateStatus, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PersistedConnectionStatus.CreateFrom); + } + if (content.Contains("PrivateLinkServiceConnectionStateDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateDescription = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateDescription",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateDescription, global::System.Convert.ToString); + } + if (content.Contains("PrivateLinkServiceConnectionStateActionsRequired")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateActionsRequired = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateActionsRequired",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateActionsRequired, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties of the private endpoint connection resource. + [System.ComponentModel.TypeConverter(typeof(PrivateEndpointConnectionPropertiesTypeConverter))] + public partial interface IPrivateEndpointConnectionProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PrivateEndpointConnectionProperties.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PrivateEndpointConnectionProperties.TypeConverter.cs new file mode 100644 index 000000000000..05f66b86e1e5 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PrivateEndpointConnectionProperties.TypeConverter.cs @@ -0,0 +1,148 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class PrivateEndpointConnectionPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return PrivateEndpointConnectionProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return PrivateEndpointConnectionProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return PrivateEndpointConnectionProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PrivateEndpointConnectionProperties.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PrivateEndpointConnectionProperties.cs new file mode 100644 index 000000000000..b69c7acc4589 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PrivateEndpointConnectionProperties.cs @@ -0,0 +1,148 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Properties of the private endpoint connection resource. + public partial class PrivateEndpointConnectionProperties : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionProperties, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionPropertiesInternal + { + + /// Backing field for property. + private string[] _groupId; + + /// GroupIds from the private link service resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string[] GroupId { get => this._groupId; set => this._groupId = value; } + + /// Internal Acessors for PrivateEndpoint + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpoint Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionPropertiesInternal.PrivateEndpoint { get => (this._privateEndpoint = this._privateEndpoint ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PrivateEndpoint()); set { {_privateEndpoint = value;} } } + + /// Internal Acessors for PrivateLinkServiceConnectionState + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IConnectionState Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionPropertiesInternal.PrivateLinkServiceConnectionState { get => (this._privateLinkServiceConnectionState = this._privateLinkServiceConnectionState ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ConnectionState()); set { {_privateLinkServiceConnectionState = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpoint _privateEndpoint; + + /// The Private Endpoint resource for this Connection. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpoint PrivateEndpoint { get => (this._privateEndpoint = this._privateEndpoint ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PrivateEndpoint()); set => this._privateEndpoint = value; } + + /// The ARM identifier for Private Endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string PrivateEndpointId { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointInternal)PrivateEndpoint).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointInternal)PrivateEndpoint).Id = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IConnectionState _privateLinkServiceConnectionState; + + /// Details about the state of the connection. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IConnectionState PrivateLinkServiceConnectionState { get => (this._privateLinkServiceConnectionState = this._privateLinkServiceConnectionState ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ConnectionState()); set => this._privateLinkServiceConnectionState = value; } + + /// Actions required (if any). + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string PrivateLinkServiceConnectionStateActionsRequired { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IConnectionStateInternal)PrivateLinkServiceConnectionState).ActionsRequired; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IConnectionStateInternal)PrivateLinkServiceConnectionState).ActionsRequired = value ?? null; } + + /// Description of the connection state. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string PrivateLinkServiceConnectionStateDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IConnectionStateInternal)PrivateLinkServiceConnectionState).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IConnectionStateInternal)PrivateLinkServiceConnectionState).Description = value ?? null; } + + /// Status of the connection. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PersistedConnectionStatus? PrivateLinkServiceConnectionStateStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IConnectionStateInternal)PrivateLinkServiceConnectionState).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IConnectionStateInternal)PrivateLinkServiceConnectionState).Status = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PersistedConnectionStatus)""); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceProvisioningState? _provisioningState; + + /// Provisioning state of the Private Endpoint Connection. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceProvisioningState? ProvisioningState { get => this._provisioningState; set => this._provisioningState = value; } + + /// Creates an new instance. + public PrivateEndpointConnectionProperties() + { + + } + } + /// Properties of the private endpoint connection resource. + public partial interface IPrivateEndpointConnectionProperties : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// GroupIds from the private link service resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"GroupIds from the private link service resource.", + SerializedName = @"groupIds", + PossibleTypes = new [] { typeof(string) })] + string[] GroupId { get; set; } + /// The ARM identifier for Private Endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ARM identifier for Private Endpoint.", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string PrivateEndpointId { get; set; } + /// Actions required (if any). + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Actions required (if any).", + SerializedName = @"actionsRequired", + PossibleTypes = new [] { typeof(string) })] + string PrivateLinkServiceConnectionStateActionsRequired { get; set; } + /// Description of the connection state. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Description of the connection state.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string PrivateLinkServiceConnectionStateDescription { get; set; } + /// Status of the connection. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Status of the connection.", + SerializedName = @"status", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PersistedConnectionStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PersistedConnectionStatus? PrivateLinkServiceConnectionStateStatus { get; set; } + /// Provisioning state of the Private Endpoint Connection. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Provisioning state of the Private Endpoint Connection.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceProvisioningState) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceProvisioningState? ProvisioningState { get; set; } + + } + /// Properties of the private endpoint connection resource. + internal partial interface IPrivateEndpointConnectionPropertiesInternal + + { + /// GroupIds from the private link service resource. + string[] GroupId { get; set; } + /// The Private Endpoint resource for this Connection. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpoint PrivateEndpoint { get; set; } + /// The ARM identifier for Private Endpoint. + string PrivateEndpointId { get; set; } + /// Details about the state of the connection. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IConnectionState PrivateLinkServiceConnectionState { get; set; } + /// Actions required (if any). + string PrivateLinkServiceConnectionStateActionsRequired { get; set; } + /// Description of the connection state. + string PrivateLinkServiceConnectionStateDescription { get; set; } + /// Status of the connection. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PersistedConnectionStatus? PrivateLinkServiceConnectionStateStatus { get; set; } + /// Provisioning state of the Private Endpoint Connection. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceProvisioningState? ProvisioningState { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PrivateEndpointConnectionProperties.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PrivateEndpointConnectionProperties.json.cs new file mode 100644 index 000000000000..ac01df26a112 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PrivateEndpointConnectionProperties.json.cs @@ -0,0 +1,121 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Properties of the private endpoint connection resource. + public partial class PrivateEndpointConnectionProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnectionProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new PrivateEndpointConnectionProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal PrivateEndpointConnectionProperties(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_privateEndpoint = If( json?.PropertyT("privateEndpoint"), out var __jsonPrivateEndpoint) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PrivateEndpoint.FromJson(__jsonPrivateEndpoint) : PrivateEndpoint;} + {_privateLinkServiceConnectionState = If( json?.PropertyT("privateLinkServiceConnectionState"), out var __jsonPrivateLinkServiceConnectionState) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ConnectionState.FromJson(__jsonPrivateLinkServiceConnectionState) : PrivateLinkServiceConnectionState;} + {_groupId = If( json?.PropertyT("groupIds"), out var __jsonGroupIds) ? If( __jsonGroupIds as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : GroupId;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._privateEndpoint ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._privateEndpoint.ToJson(null,serializationMode) : null, "privateEndpoint" ,container.Add ); + AddIf( null != this._privateLinkServiceConnectionState ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._privateLinkServiceConnectionState.ToJson(null,serializationMode) : null, "privateLinkServiceConnectionState" ,container.Add ); + if (null != this._groupId) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.XNodeArray(); + foreach( var __x in this._groupId ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("groupIds",__w); + } + AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PrivateLinkResource.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PrivateLinkResource.PowerShell.cs new file mode 100644 index 000000000000..842039b83cf1 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PrivateLinkResource.PowerShell.cs @@ -0,0 +1,200 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Information of the private link resource. + [System.ComponentModel.TypeConverter(typeof(PrivateLinkResourceTypeConverter))] + public partial class PrivateLinkResource + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new PrivateLinkResource(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new PrivateLinkResource(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal PrivateLinkResource(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResourceProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PrivateLinkResourcePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("GroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResourceInternal)this).GroupId = (string) content.GetValueForProperty("GroupId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResourceInternal)this).GroupId, global::System.Convert.ToString); + } + if (content.Contains("DisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResourceInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResourceInternal)this).DisplayName, global::System.Convert.ToString); + } + if (content.Contains("RequiredMember")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResourceInternal)this).RequiredMember = (string[]) content.GetValueForProperty("RequiredMember",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResourceInternal)this).RequiredMember, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("RequiredZoneName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResourceInternal)this).RequiredZoneName = (string[]) content.GetValueForProperty("RequiredZoneName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResourceInternal)this).RequiredZoneName, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal PrivateLinkResource(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResourceProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PrivateLinkResourcePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("GroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResourceInternal)this).GroupId = (string) content.GetValueForProperty("GroupId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResourceInternal)this).GroupId, global::System.Convert.ToString); + } + if (content.Contains("DisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResourceInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResourceInternal)this).DisplayName, global::System.Convert.ToString); + } + if (content.Contains("RequiredMember")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResourceInternal)this).RequiredMember = (string[]) content.GetValueForProperty("RequiredMember",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResourceInternal)this).RequiredMember, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("RequiredZoneName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResourceInternal)this).RequiredZoneName = (string[]) content.GetValueForProperty("RequiredZoneName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResourceInternal)this).RequiredZoneName, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Information of the private link resource. + [System.ComponentModel.TypeConverter(typeof(PrivateLinkResourceTypeConverter))] + public partial interface IPrivateLinkResource + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PrivateLinkResource.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PrivateLinkResource.TypeConverter.cs new file mode 100644 index 000000000000..e224b5bdf705 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PrivateLinkResource.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class PrivateLinkResourceTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResource ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResource).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return PrivateLinkResource.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return PrivateLinkResource.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return PrivateLinkResource.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PrivateLinkResource.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PrivateLinkResource.cs new file mode 100644 index 000000000000..c983b963ff50 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PrivateLinkResource.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Information of the private link resource. + public partial class PrivateLinkResource : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResource, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResourceInternal + { + + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResourcePropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResourcePropertiesInternal)Property).DisplayName = value ?? null; } + + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string GroupId { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResourcePropertiesInternal)Property).GroupId; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResourcePropertiesInternal)Property).GroupId = value ?? null; } + + /// Backing field for property. + private string _id; + + /// Fully qualified identifier of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string Id { get => this._id; set => this._id = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResourceProperties Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResourceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PrivateLinkResourceProperties()); set { {_property = value;} } } + + /// Backing field for property. + private string _name; + + /// Name of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResourceProperties _property; + + /// Properties of the private link resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResourceProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PrivateLinkResourceProperties()); set => this._property = value; } + + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string[] RequiredMember { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResourcePropertiesInternal)Property).RequiredMember; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResourcePropertiesInternal)Property).RequiredMember = value ?? null /* arrayOf */; } + + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string[] RequiredZoneName { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResourcePropertiesInternal)Property).RequiredZoneName; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResourcePropertiesInternal)Property).RequiredZoneName = value ?? null /* arrayOf */; } + + /// Backing field for property. + private string _type; + + /// Type of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string Type { get => this._type; set => this._type = value; } + + /// Creates an new instance. + public PrivateLinkResource() + { + + } + } + /// Information of the private link resource. + public partial interface IPrivateLinkResource : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + string DisplayName { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"groupId", + PossibleTypes = new [] { typeof(string) })] + string GroupId { get; set; } + /// Fully qualified identifier of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Fully qualified identifier of the resource.", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; set; } + /// Name of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the resource.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"requiredMembers", + PossibleTypes = new [] { typeof(string) })] + string[] RequiredMember { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"requiredZoneNames", + PossibleTypes = new [] { typeof(string) })] + string[] RequiredZoneName { get; set; } + /// Type of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of the resource.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string Type { get; set; } + + } + /// Information of the private link resource. + internal partial interface IPrivateLinkResourceInternal + + { + string DisplayName { get; set; } + + string GroupId { get; set; } + /// Fully qualified identifier of the resource. + string Id { get; set; } + /// Name of the resource. + string Name { get; set; } + /// Properties of the private link resource. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResourceProperties Property { get; set; } + + string[] RequiredMember { get; set; } + + string[] RequiredZoneName { get; set; } + /// Type of the resource. + string Type { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PrivateLinkResource.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PrivateLinkResource.json.cs new file mode 100644 index 000000000000..820bae8818e2 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PrivateLinkResource.json.cs @@ -0,0 +1,112 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Information of the private link resource. + public partial class PrivateLinkResource + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResource. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResource. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new PrivateLinkResource(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal PrivateLinkResource(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PrivateLinkResourceProperties.FromJson(__jsonProperties) : Property;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PrivateLinkResourceProperties.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PrivateLinkResourceProperties.PowerShell.cs new file mode 100644 index 000000000000..f7699d68a801 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PrivateLinkResourceProperties.PowerShell.cs @@ -0,0 +1,166 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(PrivateLinkResourcePropertiesTypeConverter))] + public partial class PrivateLinkResourceProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResourceProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new PrivateLinkResourceProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResourceProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new PrivateLinkResourceProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResourceProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal PrivateLinkResourceProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("GroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResourcePropertiesInternal)this).GroupId = (string) content.GetValueForProperty("GroupId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResourcePropertiesInternal)this).GroupId, global::System.Convert.ToString); + } + if (content.Contains("DisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResourcePropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResourcePropertiesInternal)this).DisplayName, global::System.Convert.ToString); + } + if (content.Contains("RequiredMember")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResourcePropertiesInternal)this).RequiredMember = (string[]) content.GetValueForProperty("RequiredMember",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResourcePropertiesInternal)this).RequiredMember, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("RequiredZoneName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResourcePropertiesInternal)this).RequiredZoneName = (string[]) content.GetValueForProperty("RequiredZoneName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResourcePropertiesInternal)this).RequiredZoneName, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal PrivateLinkResourceProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("GroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResourcePropertiesInternal)this).GroupId = (string) content.GetValueForProperty("GroupId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResourcePropertiesInternal)this).GroupId, global::System.Convert.ToString); + } + if (content.Contains("DisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResourcePropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResourcePropertiesInternal)this).DisplayName, global::System.Convert.ToString); + } + if (content.Contains("RequiredMember")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResourcePropertiesInternal)this).RequiredMember = (string[]) content.GetValueForProperty("RequiredMember",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResourcePropertiesInternal)this).RequiredMember, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("RequiredZoneName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResourcePropertiesInternal)this).RequiredZoneName = (string[]) content.GetValueForProperty("RequiredZoneName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResourcePropertiesInternal)this).RequiredZoneName, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(PrivateLinkResourcePropertiesTypeConverter))] + public partial interface IPrivateLinkResourceProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PrivateLinkResourceProperties.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PrivateLinkResourceProperties.TypeConverter.cs new file mode 100644 index 000000000000..8cdaf0afe20e --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PrivateLinkResourceProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class PrivateLinkResourcePropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResourceProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResourceProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return PrivateLinkResourceProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return PrivateLinkResourceProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return PrivateLinkResourceProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PrivateLinkResourceProperties.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PrivateLinkResourceProperties.cs new file mode 100644 index 000000000000..1c443b8d21bb --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PrivateLinkResourceProperties.cs @@ -0,0 +1,93 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + public partial class PrivateLinkResourceProperties : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResourceProperties, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResourcePropertiesInternal + { + + /// Backing field for property. + private string _displayName; + + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string DisplayName { get => this._displayName; set => this._displayName = value; } + + /// Backing field for property. + private string _groupId; + + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string GroupId { get => this._groupId; set => this._groupId = value; } + + /// Backing field for property. + private string[] _requiredMember; + + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string[] RequiredMember { get => this._requiredMember; set => this._requiredMember = value; } + + /// Backing field for property. + private string[] _requiredZoneName; + + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string[] RequiredZoneName { get => this._requiredZoneName; set => this._requiredZoneName = value; } + + /// Creates an new instance. + public PrivateLinkResourceProperties() + { + + } + } + public partial interface IPrivateLinkResourceProperties : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + string DisplayName { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"groupId", + PossibleTypes = new [] { typeof(string) })] + string GroupId { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"requiredMembers", + PossibleTypes = new [] { typeof(string) })] + string[] RequiredMember { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"requiredZoneNames", + PossibleTypes = new [] { typeof(string) })] + string[] RequiredZoneName { get; set; } + + } + internal partial interface IPrivateLinkResourcePropertiesInternal + + { + string DisplayName { get; set; } + + string GroupId { get; set; } + + string[] RequiredMember { get; set; } + + string[] RequiredZoneName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PrivateLinkResourceProperties.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PrivateLinkResourceProperties.json.cs new file mode 100644 index 000000000000..12f3623d57eb --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PrivateLinkResourceProperties.json.cs @@ -0,0 +1,127 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + public partial class PrivateLinkResourceProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResourceProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResourceProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResourceProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new PrivateLinkResourceProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal PrivateLinkResourceProperties(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_groupId = If( json?.PropertyT("groupId"), out var __jsonGroupId) ? (string)__jsonGroupId : (string)GroupId;} + {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)DisplayName;} + {_requiredMember = If( json?.PropertyT("requiredMembers"), out var __jsonRequiredMembers) ? If( __jsonRequiredMembers as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : RequiredMember;} + {_requiredZoneName = If( json?.PropertyT("requiredZoneNames"), out var __jsonRequiredZoneNames) ? If( __jsonRequiredZoneNames as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(string) (__p is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : RequiredZoneName;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._groupId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._groupId.ToString()) : null, "groupId" ,container.Add ); + AddIf( null != (((object)this._displayName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._displayName.ToString()) : null, "displayName" ,container.Add ); + if (null != this._requiredMember) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.XNodeArray(); + foreach( var __x in this._requiredMember ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("requiredMembers",__w); + } + if (null != this._requiredZoneName) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.XNodeArray(); + foreach( var __s in this._requiredZoneName ) + { + AddIf(null != (((object)__s)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(__s.ToString()) : null ,__r.Add); + } + container.Add("requiredZoneNames",__r); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PrivateLinkResourcesListResult.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PrivateLinkResourcesListResult.PowerShell.cs new file mode 100644 index 000000000000..2a900ed39171 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PrivateLinkResourcesListResult.PowerShell.cs @@ -0,0 +1,152 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Result of the List private link resources operation. + [System.ComponentModel.TypeConverter(typeof(PrivateLinkResourcesListResultTypeConverter))] + public partial class PrivateLinkResourcesListResult + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResourcesListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new PrivateLinkResourcesListResult(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResourcesListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new PrivateLinkResourcesListResult(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResourcesListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal PrivateLinkResourcesListResult(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResourcesListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResource[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResourcesListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PrivateLinkResourceTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResourcesListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResourcesListResultInternal)this).NextLink, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal PrivateLinkResourcesListResult(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResourcesListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResource[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResourcesListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PrivateLinkResourceTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResourcesListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResourcesListResultInternal)this).NextLink, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Result of the List private link resources operation. + [System.ComponentModel.TypeConverter(typeof(PrivateLinkResourcesListResultTypeConverter))] + public partial interface IPrivateLinkResourcesListResult + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PrivateLinkResourcesListResult.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PrivateLinkResourcesListResult.TypeConverter.cs new file mode 100644 index 000000000000..a57da4b25074 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PrivateLinkResourcesListResult.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class PrivateLinkResourcesListResultTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResourcesListResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResourcesListResult).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return PrivateLinkResourcesListResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return PrivateLinkResourcesListResult.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return PrivateLinkResourcesListResult.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PrivateLinkResourcesListResult.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PrivateLinkResourcesListResult.cs new file mode 100644 index 000000000000..d52543fe65e9 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PrivateLinkResourcesListResult.cs @@ -0,0 +1,68 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Result of the List private link resources operation. + public partial class PrivateLinkResourcesListResult : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResourcesListResult, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResourcesListResultInternal + { + + /// Backing field for property. + private string _nextLink; + + /// A link for the next page of private link resources. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResource[] _value; + + /// A collection of private link resources + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResource[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public PrivateLinkResourcesListResult() + { + + } + } + /// Result of the List private link resources operation. + public partial interface IPrivateLinkResourcesListResult : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// A link for the next page of private link resources. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A link for the next page of private link resources.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// A collection of private link resources + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A collection of private link resources", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResource) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResource[] Value { get; set; } + + } + /// Result of the List private link resources operation. + internal partial interface IPrivateLinkResourcesListResultInternal + + { + /// A link for the next page of private link resources. + string NextLink { get; set; } + /// A collection of private link resources + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResource[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PrivateLinkResourcesListResult.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PrivateLinkResourcesListResult.json.cs new file mode 100644 index 000000000000..1ee7aa5ab512 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/PrivateLinkResourcesListResult.json.cs @@ -0,0 +1,116 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Result of the List private link resources operation. + public partial class PrivateLinkResourcesListResult + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResourcesListResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResourcesListResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResourcesListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new PrivateLinkResourcesListResult(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal PrivateLinkResourcesListResult(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResource) (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PrivateLinkResource.FromJson(__u) )) ))() : null : Value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/Resource.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/Resource.PowerShell.cs new file mode 100644 index 000000000000..d7ac7cad9be4 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/Resource.PowerShell.cs @@ -0,0 +1,158 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Definition of a Resource + [System.ComponentModel.TypeConverter(typeof(ResourceTypeConverter))] + public partial class Resource + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new Resource(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new Resource(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal Resource(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Type, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal Resource(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Type, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Definition of a Resource + [System.ComponentModel.TypeConverter(typeof(ResourceTypeConverter))] + public partial interface IResource + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/Resource.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/Resource.TypeConverter.cs new file mode 100644 index 000000000000..0a813ddfe975 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/Resource.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ResourceTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResource ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResource).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return Resource.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return Resource.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return Resource.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/Resource.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/Resource.cs new file mode 100644 index 000000000000..7928bf858905 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/Resource.cs @@ -0,0 +1,94 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Definition of a Resource + public partial class Resource : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResource, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal + { + + /// Backing field for property. + private string _id; + + /// Fully qualified identifier of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string Id { get => this._id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal.Id { get => this._id; set { {_id = value;} } } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal.Name { get => this._name; set { {_name = value;} } } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal.Type { get => this._type; set { {_type = value;} } } + + /// Backing field for property. + private string _name; + + /// Name of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string Name { get => this._name; } + + /// Backing field for property. + private string _type; + + /// Type of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string Type { get => this._type; } + + /// Creates an new instance. + public Resource() + { + + } + } + /// Definition of a Resource + public partial interface IResource : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// Fully qualified identifier of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Fully qualified identifier of the resource.", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; } + /// Name of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Name of the resource.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; } + /// Type of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Type of the resource.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string Type { get; } + + } + /// Definition of a Resource + internal partial interface IResourceInternal + + { + /// Fully qualified identifier of the resource. + string Id { get; set; } + /// Name of the resource. + string Name { get; set; } + /// Type of the resource. + string Type { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/Resource.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/Resource.json.cs new file mode 100644 index 000000000000..8c3edf11db5d --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/Resource.json.cs @@ -0,0 +1,119 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Definition of a Resource + public partial class Resource + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResource. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResource. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new Resource(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal Resource(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ResourceMoveChangeHistory.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ResourceMoveChangeHistory.PowerShell.cs new file mode 100644 index 000000000000..78b5016fc697 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ResourceMoveChangeHistory.PowerShell.cs @@ -0,0 +1,160 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// The change history of the resource move. + [System.ComponentModel.TypeConverter(typeof(ResourceMoveChangeHistoryTypeConverter))] + public partial class ResourceMoveChangeHistory + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceMoveChangeHistory DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ResourceMoveChangeHistory(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceMoveChangeHistory DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ResourceMoveChangeHistory(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceMoveChangeHistory FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ResourceMoveChangeHistory(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AzureSubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceMoveChangeHistoryInternal)this).AzureSubscriptionId = (string) content.GetValueForProperty("AzureSubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceMoveChangeHistoryInternal)this).AzureSubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("ResourceGroupName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceMoveChangeHistoryInternal)this).ResourceGroupName = (string) content.GetValueForProperty("ResourceGroupName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceMoveChangeHistoryInternal)this).ResourceGroupName, global::System.Convert.ToString); + } + if (content.Contains("ChangedTimeUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceMoveChangeHistoryInternal)this).ChangedTimeUtc = (global::System.DateTime?) content.GetValueForProperty("ChangedTimeUtc",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceMoveChangeHistoryInternal)this).ChangedTimeUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ResourceMoveChangeHistory(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AzureSubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceMoveChangeHistoryInternal)this).AzureSubscriptionId = (string) content.GetValueForProperty("AzureSubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceMoveChangeHistoryInternal)this).AzureSubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("ResourceGroupName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceMoveChangeHistoryInternal)this).ResourceGroupName = (string) content.GetValueForProperty("ResourceGroupName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceMoveChangeHistoryInternal)this).ResourceGroupName, global::System.Convert.ToString); + } + if (content.Contains("ChangedTimeUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceMoveChangeHistoryInternal)this).ChangedTimeUtc = (global::System.DateTime?) content.GetValueForProperty("ChangedTimeUtc",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceMoveChangeHistoryInternal)this).ChangedTimeUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The change history of the resource move. + [System.ComponentModel.TypeConverter(typeof(ResourceMoveChangeHistoryTypeConverter))] + public partial interface IResourceMoveChangeHistory + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ResourceMoveChangeHistory.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ResourceMoveChangeHistory.TypeConverter.cs new file mode 100644 index 000000000000..87761a85bbab --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ResourceMoveChangeHistory.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ResourceMoveChangeHistoryTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceMoveChangeHistory ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceMoveChangeHistory).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ResourceMoveChangeHistory.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ResourceMoveChangeHistory.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ResourceMoveChangeHistory.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ResourceMoveChangeHistory.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ResourceMoveChangeHistory.cs new file mode 100644 index 000000000000..9b1361a91d64 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ResourceMoveChangeHistory.cs @@ -0,0 +1,85 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// The change history of the resource move. + public partial class ResourceMoveChangeHistory : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceMoveChangeHistory, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceMoveChangeHistoryInternal + { + + /// Backing field for property. + private string _azureSubscriptionId; + + /// Azure subscription ID of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string AzureSubscriptionId { get => this._azureSubscriptionId; set => this._azureSubscriptionId = value; } + + /// Backing field for property. + private global::System.DateTime? _changedTimeUtc; + + /// UTC timestamp of when the resource was changed. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public global::System.DateTime? ChangedTimeUtc { get => this._changedTimeUtc; set => this._changedTimeUtc = value; } + + /// Backing field for property. + private string _resourceGroupName; + + /// Azure Resource Group of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Creates an new instance. + public ResourceMoveChangeHistory() + { + + } + } + /// The change history of the resource move. + public partial interface IResourceMoveChangeHistory : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// Azure subscription ID of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Azure subscription ID of the resource.", + SerializedName = @"azureSubscriptionId", + PossibleTypes = new [] { typeof(string) })] + string AzureSubscriptionId { get; set; } + /// UTC timestamp of when the resource was changed. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"UTC timestamp of when the resource was changed.", + SerializedName = @"changedTimeUtc", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ChangedTimeUtc { get; set; } + /// Azure Resource Group of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Azure Resource Group of the resource.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + string ResourceGroupName { get; set; } + + } + /// The change history of the resource move. + internal partial interface IResourceMoveChangeHistoryInternal + + { + /// Azure subscription ID of the resource. + string AzureSubscriptionId { get; set; } + /// UTC timestamp of when the resource was changed. + global::System.DateTime? ChangedTimeUtc { get; set; } + /// Azure Resource Group of the resource. + string ResourceGroupName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ResourceMoveChangeHistory.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ResourceMoveChangeHistory.json.cs new file mode 100644 index 000000000000..345c2ff951e2 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ResourceMoveChangeHistory.json.cs @@ -0,0 +1,110 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// The change history of the resource move. + public partial class ResourceMoveChangeHistory + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceMoveChangeHistory. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceMoveChangeHistory. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceMoveChangeHistory FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new ResourceMoveChangeHistory(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal ResourceMoveChangeHistory(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_azureSubscriptionId = If( json?.PropertyT("azureSubscriptionId"), out var __jsonAzureSubscriptionId) ? (string)__jsonAzureSubscriptionId : (string)AzureSubscriptionId;} + {_resourceGroupName = If( json?.PropertyT("resourceGroupName"), out var __jsonResourceGroupName) ? (string)__jsonResourceGroupName : (string)ResourceGroupName;} + {_changedTimeUtc = If( json?.PropertyT("changedTimeUtc"), out var __jsonChangedTimeUtc) ? global::System.DateTime.TryParse((string)__jsonChangedTimeUtc, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonChangedTimeUtcValue) ? __jsonChangedTimeUtcValue : ChangedTimeUtc : ChangedTimeUtc;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._azureSubscriptionId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._azureSubscriptionId.ToString()) : null, "azureSubscriptionId" ,container.Add ); + AddIf( null != (((object)this._resourceGroupName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._resourceGroupName.ToString()) : null, "resourceGroupName" ,container.Add ); + AddIf( null != this._changedTimeUtc ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._changedTimeUtc?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "changedTimeUtc" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ResourceSku.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ResourceSku.PowerShell.cs new file mode 100644 index 000000000000..ed23f3296363 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ResourceSku.PowerShell.cs @@ -0,0 +1,142 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Describes an EventGrid Resource Sku. + [System.ComponentModel.TypeConverter(typeof(ResourceSkuTypeConverter))] + public partial class ResourceSku + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceSku DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ResourceSku(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceSku DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ResourceSku(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceSku FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ResourceSku(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceSkuInternal)this).Name = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku?) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceSkuInternal)this).Name, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ResourceSku(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceSkuInternal)this).Name = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku?) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceSkuInternal)this).Name, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku.CreateFrom); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Describes an EventGrid Resource Sku. + [System.ComponentModel.TypeConverter(typeof(ResourceSkuTypeConverter))] + public partial interface IResourceSku + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ResourceSku.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ResourceSku.TypeConverter.cs new file mode 100644 index 000000000000..b19aed63dc53 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ResourceSku.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ResourceSkuTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceSku ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceSku).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ResourceSku.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ResourceSku.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ResourceSku.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ResourceSku.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ResourceSku.cs new file mode 100644 index 000000000000..93753da5b79e --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ResourceSku.cs @@ -0,0 +1,51 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Describes an EventGrid Resource Sku. + public partial class ResourceSku : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceSku, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceSkuInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku? _name; + + /// The Sku name of the resource. The possible values are: Basic or Premium. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku? Name { get => this._name; set => this._name = value; } + + /// Creates an new instance. + public ResourceSku() + { + + } + } + /// Describes an EventGrid Resource Sku. + public partial interface IResourceSku : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// The Sku name of the resource. The possible values are: Basic or Premium. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Sku name of the resource. The possible values are: Basic or Premium.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku? Name { get; set; } + + } + /// Describes an EventGrid Resource Sku. + internal partial interface IResourceSkuInternal + + { + /// The Sku name of the resource. The possible values are: Basic or Premium. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku? Name { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ResourceSku.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ResourceSku.json.cs new file mode 100644 index 000000000000..ccdfad80da30 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ResourceSku.json.cs @@ -0,0 +1,106 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Describes an EventGrid Resource Sku. + public partial class ResourceSku + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceSku. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceSku. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceSku FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new ResourceSku(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal ResourceSku(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/RetryPolicy.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/RetryPolicy.PowerShell.cs new file mode 100644 index 000000000000..e3d2189ecf41 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/RetryPolicy.PowerShell.cs @@ -0,0 +1,150 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Information about the retry policy for an event subscription. + [System.ComponentModel.TypeConverter(typeof(RetryPolicyTypeConverter))] + public partial class RetryPolicy + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IRetryPolicy DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new RetryPolicy(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IRetryPolicy DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new RetryPolicy(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IRetryPolicy FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal RetryPolicy(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("MaxDeliveryAttempt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IRetryPolicyInternal)this).MaxDeliveryAttempt = (int?) content.GetValueForProperty("MaxDeliveryAttempt",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IRetryPolicyInternal)this).MaxDeliveryAttempt, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("EventTimeToLiveInMinute")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IRetryPolicyInternal)this).EventTimeToLiveInMinute = (int?) content.GetValueForProperty("EventTimeToLiveInMinute",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IRetryPolicyInternal)this).EventTimeToLiveInMinute, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal RetryPolicy(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("MaxDeliveryAttempt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IRetryPolicyInternal)this).MaxDeliveryAttempt = (int?) content.GetValueForProperty("MaxDeliveryAttempt",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IRetryPolicyInternal)this).MaxDeliveryAttempt, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("EventTimeToLiveInMinute")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IRetryPolicyInternal)this).EventTimeToLiveInMinute = (int?) content.GetValueForProperty("EventTimeToLiveInMinute",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IRetryPolicyInternal)this).EventTimeToLiveInMinute, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Information about the retry policy for an event subscription. + [System.ComponentModel.TypeConverter(typeof(RetryPolicyTypeConverter))] + public partial interface IRetryPolicy + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/RetryPolicy.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/RetryPolicy.TypeConverter.cs new file mode 100644 index 000000000000..bb6c227465a0 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/RetryPolicy.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class RetryPolicyTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IRetryPolicy ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IRetryPolicy).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return RetryPolicy.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return RetryPolicy.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return RetryPolicy.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/RetryPolicy.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/RetryPolicy.cs new file mode 100644 index 000000000000..35140d2f93cc --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/RetryPolicy.cs @@ -0,0 +1,68 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Information about the retry policy for an event subscription. + public partial class RetryPolicy : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IRetryPolicy, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IRetryPolicyInternal + { + + /// Backing field for property. + private int? _eventTimeToLiveInMinute; + + /// Time To Live (in minutes) for events. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public int? EventTimeToLiveInMinute { get => this._eventTimeToLiveInMinute; set => this._eventTimeToLiveInMinute = value; } + + /// Backing field for property. + private int? _maxDeliveryAttempt; + + /// Maximum number of delivery retry attempts for events. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public int? MaxDeliveryAttempt { get => this._maxDeliveryAttempt; set => this._maxDeliveryAttempt = value; } + + /// Creates an new instance. + public RetryPolicy() + { + + } + } + /// Information about the retry policy for an event subscription. + public partial interface IRetryPolicy : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// Time To Live (in minutes) for events. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Time To Live (in minutes) for events.", + SerializedName = @"eventTimeToLiveInMinutes", + PossibleTypes = new [] { typeof(int) })] + int? EventTimeToLiveInMinute { get; set; } + /// Maximum number of delivery retry attempts for events. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Maximum number of delivery retry attempts for events.", + SerializedName = @"maxDeliveryAttempts", + PossibleTypes = new [] { typeof(int) })] + int? MaxDeliveryAttempt { get; set; } + + } + /// Information about the retry policy for an event subscription. + internal partial interface IRetryPolicyInternal + + { + /// Time To Live (in minutes) for events. + int? EventTimeToLiveInMinute { get; set; } + /// Maximum number of delivery retry attempts for events. + int? MaxDeliveryAttempt { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/RetryPolicy.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/RetryPolicy.json.cs new file mode 100644 index 000000000000..ff41ef591fce --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/RetryPolicy.json.cs @@ -0,0 +1,108 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Information about the retry policy for an event subscription. + public partial class RetryPolicy + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IRetryPolicy. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IRetryPolicy. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IRetryPolicy FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new RetryPolicy(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal RetryPolicy(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_maxDeliveryAttempt = If( json?.PropertyT("maxDeliveryAttempts"), out var __jsonMaxDeliveryAttempts) ? (int?)__jsonMaxDeliveryAttempts : MaxDeliveryAttempt;} + {_eventTimeToLiveInMinute = If( json?.PropertyT("eventTimeToLiveInMinutes"), out var __jsonEventTimeToLiveInMinutes) ? (int?)__jsonEventTimeToLiveInMinutes : EventTimeToLiveInMinute;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._maxDeliveryAttempt ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNumber((int)this._maxDeliveryAttempt) : null, "maxDeliveryAttempts" ,container.Add ); + AddIf( null != this._eventTimeToLiveInMinute ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNumber((int)this._eventTimeToLiveInMinute) : null, "eventTimeToLiveInMinutes" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ServiceBusQueueEventSubscriptionDestination.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ServiceBusQueueEventSubscriptionDestination.PowerShell.cs new file mode 100644 index 000000000000..8d820e0d7a0f --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ServiceBusQueueEventSubscriptionDestination.PowerShell.cs @@ -0,0 +1,169 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Information about the service bus destination for an event subscription. + [System.ComponentModel.TypeConverter(typeof(ServiceBusQueueEventSubscriptionDestinationTypeConverter))] + public partial class ServiceBusQueueEventSubscriptionDestination + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusQueueEventSubscriptionDestination DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ServiceBusQueueEventSubscriptionDestination(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusQueueEventSubscriptionDestination DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ServiceBusQueueEventSubscriptionDestination(content); + } + + /// + /// Creates a new instance of , deserializing the content from a + /// json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusQueueEventSubscriptionDestination FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ServiceBusQueueEventSubscriptionDestination(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusQueueEventSubscriptionDestinationInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusQueueEventSubscriptionDestinationProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusQueueEventSubscriptionDestinationInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ServiceBusQueueEventSubscriptionDestinationPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("EndpointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestinationInternal)this).EndpointType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType) content.GetValueForProperty("EndpointType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestinationInternal)this).EndpointType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType.CreateFrom); + } + if (content.Contains("ResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusQueueEventSubscriptionDestinationInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusQueueEventSubscriptionDestinationInternal)this).ResourceId, global::System.Convert.ToString); + } + if (content.Contains("DeliveryAttributeMapping")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusQueueEventSubscriptionDestinationInternal)this).DeliveryAttributeMapping = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping[]) content.GetValueForProperty("DeliveryAttributeMapping",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusQueueEventSubscriptionDestinationInternal)this).DeliveryAttributeMapping, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeliveryAttributeMappingTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ServiceBusQueueEventSubscriptionDestination(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusQueueEventSubscriptionDestinationInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusQueueEventSubscriptionDestinationProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusQueueEventSubscriptionDestinationInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ServiceBusQueueEventSubscriptionDestinationPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("EndpointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestinationInternal)this).EndpointType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType) content.GetValueForProperty("EndpointType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestinationInternal)this).EndpointType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType.CreateFrom); + } + if (content.Contains("ResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusQueueEventSubscriptionDestinationInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusQueueEventSubscriptionDestinationInternal)this).ResourceId, global::System.Convert.ToString); + } + if (content.Contains("DeliveryAttributeMapping")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusQueueEventSubscriptionDestinationInternal)this).DeliveryAttributeMapping = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping[]) content.GetValueForProperty("DeliveryAttributeMapping",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusQueueEventSubscriptionDestinationInternal)this).DeliveryAttributeMapping, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeliveryAttributeMappingTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Information about the service bus destination for an event subscription. + [System.ComponentModel.TypeConverter(typeof(ServiceBusQueueEventSubscriptionDestinationTypeConverter))] + public partial interface IServiceBusQueueEventSubscriptionDestination + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ServiceBusQueueEventSubscriptionDestination.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ServiceBusQueueEventSubscriptionDestination.TypeConverter.cs new file mode 100644 index 000000000000..37c638e371aa --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ServiceBusQueueEventSubscriptionDestination.TypeConverter.cs @@ -0,0 +1,150 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ServiceBusQueueEventSubscriptionDestinationTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusQueueEventSubscriptionDestination ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusQueueEventSubscriptionDestination).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ServiceBusQueueEventSubscriptionDestination.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ServiceBusQueueEventSubscriptionDestination.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ServiceBusQueueEventSubscriptionDestination.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ServiceBusQueueEventSubscriptionDestination.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ServiceBusQueueEventSubscriptionDestination.cs new file mode 100644 index 000000000000..eb5b537cd127 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ServiceBusQueueEventSubscriptionDestination.cs @@ -0,0 +1,105 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Information about the service bus destination for an event subscription. + public partial class ServiceBusQueueEventSubscriptionDestination : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusQueueEventSubscriptionDestination, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusQueueEventSubscriptionDestinationInternal, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestination __eventSubscriptionDestination = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionDestination(); + + /// Delivery attribute details. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping[] DeliveryAttributeMapping { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusQueueEventSubscriptionDestinationPropertiesInternal)Property).DeliveryAttributeMapping; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusQueueEventSubscriptionDestinationPropertiesInternal)Property).DeliveryAttributeMapping = value ?? null /* arrayOf */; } + + /// Type of the endpoint for the event subscription destination. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType EndpointType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestinationInternal)__eventSubscriptionDestination).EndpointType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestinationInternal)__eventSubscriptionDestination).EndpointType = value ; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusQueueEventSubscriptionDestinationProperties Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusQueueEventSubscriptionDestinationInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ServiceBusQueueEventSubscriptionDestinationProperties()); set { {_property = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusQueueEventSubscriptionDestinationProperties _property; + + /// Service Bus Properties of the event subscription destination. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusQueueEventSubscriptionDestinationProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ServiceBusQueueEventSubscriptionDestinationProperties()); set => this._property = value; } + + /// + /// The Azure Resource Id that represents the endpoint of the Service Bus destination of an event subscription. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string ResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusQueueEventSubscriptionDestinationPropertiesInternal)Property).ResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusQueueEventSubscriptionDestinationPropertiesInternal)Property).ResourceId = value ?? null; } + + /// + /// Creates an new instance. + /// + public ServiceBusQueueEventSubscriptionDestination() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__eventSubscriptionDestination), __eventSubscriptionDestination); + await eventListener.AssertObjectIsValid(nameof(__eventSubscriptionDestination), __eventSubscriptionDestination); + } + } + /// Information about the service bus destination for an event subscription. + public partial interface IServiceBusQueueEventSubscriptionDestination : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestination + { + /// Delivery attribute details. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Delivery attribute details.", + SerializedName = @"deliveryAttributeMappings", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping),typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStaticDeliveryAttributeMapping),typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDynamicDeliveryAttributeMapping) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping[] DeliveryAttributeMapping { get; set; } + /// + /// The Azure Resource Id that represents the endpoint of the Service Bus destination of an event subscription. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Azure Resource Id that represents the endpoint of the Service Bus destination of an event subscription.", + SerializedName = @"resourceId", + PossibleTypes = new [] { typeof(string) })] + string ResourceId { get; set; } + + } + /// Information about the service bus destination for an event subscription. + internal partial interface IServiceBusQueueEventSubscriptionDestinationInternal : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestinationInternal + { + /// Delivery attribute details. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping[] DeliveryAttributeMapping { get; set; } + /// Service Bus Properties of the event subscription destination. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusQueueEventSubscriptionDestinationProperties Property { get; set; } + /// + /// The Azure Resource Id that represents the endpoint of the Service Bus destination of an event subscription. + /// + string ResourceId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ServiceBusQueueEventSubscriptionDestination.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ServiceBusQueueEventSubscriptionDestination.json.cs new file mode 100644 index 000000000000..7c8af5ddacd9 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ServiceBusQueueEventSubscriptionDestination.json.cs @@ -0,0 +1,110 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Information about the service bus destination for an event subscription. + public partial class ServiceBusQueueEventSubscriptionDestination + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusQueueEventSubscriptionDestination. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusQueueEventSubscriptionDestination. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusQueueEventSubscriptionDestination FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new ServiceBusQueueEventSubscriptionDestination(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal ServiceBusQueueEventSubscriptionDestination(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __eventSubscriptionDestination = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionDestination(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ServiceBusQueueEventSubscriptionDestinationProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __eventSubscriptionDestination?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ServiceBusQueueEventSubscriptionDestinationProperties.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ServiceBusQueueEventSubscriptionDestinationProperties.PowerShell.cs new file mode 100644 index 000000000000..98375e701263 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ServiceBusQueueEventSubscriptionDestinationProperties.PowerShell.cs @@ -0,0 +1,155 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// The properties that represent the Service Bus destination of an event subscription. + /// + [System.ComponentModel.TypeConverter(typeof(ServiceBusQueueEventSubscriptionDestinationPropertiesTypeConverter))] + public partial class ServiceBusQueueEventSubscriptionDestinationProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusQueueEventSubscriptionDestinationProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ServiceBusQueueEventSubscriptionDestinationProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusQueueEventSubscriptionDestinationProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ServiceBusQueueEventSubscriptionDestinationProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content + /// from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusQueueEventSubscriptionDestinationProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ServiceBusQueueEventSubscriptionDestinationProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusQueueEventSubscriptionDestinationPropertiesInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusQueueEventSubscriptionDestinationPropertiesInternal)this).ResourceId, global::System.Convert.ToString); + } + if (content.Contains("DeliveryAttributeMapping")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusQueueEventSubscriptionDestinationPropertiesInternal)this).DeliveryAttributeMapping = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping[]) content.GetValueForProperty("DeliveryAttributeMapping",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusQueueEventSubscriptionDestinationPropertiesInternal)this).DeliveryAttributeMapping, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeliveryAttributeMappingTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ServiceBusQueueEventSubscriptionDestinationProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusQueueEventSubscriptionDestinationPropertiesInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusQueueEventSubscriptionDestinationPropertiesInternal)this).ResourceId, global::System.Convert.ToString); + } + if (content.Contains("DeliveryAttributeMapping")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusQueueEventSubscriptionDestinationPropertiesInternal)this).DeliveryAttributeMapping = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping[]) content.GetValueForProperty("DeliveryAttributeMapping",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusQueueEventSubscriptionDestinationPropertiesInternal)this).DeliveryAttributeMapping, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeliveryAttributeMappingTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The properties that represent the Service Bus destination of an event subscription. + [System.ComponentModel.TypeConverter(typeof(ServiceBusQueueEventSubscriptionDestinationPropertiesTypeConverter))] + public partial interface IServiceBusQueueEventSubscriptionDestinationProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ServiceBusQueueEventSubscriptionDestinationProperties.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ServiceBusQueueEventSubscriptionDestinationProperties.TypeConverter.cs new file mode 100644 index 000000000000..ec5cc4b024c2 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ServiceBusQueueEventSubscriptionDestinationProperties.TypeConverter.cs @@ -0,0 +1,152 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ServiceBusQueueEventSubscriptionDestinationPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusQueueEventSubscriptionDestinationProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusQueueEventSubscriptionDestinationProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ServiceBusQueueEventSubscriptionDestinationProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ServiceBusQueueEventSubscriptionDestinationProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ServiceBusQueueEventSubscriptionDestinationProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ServiceBusQueueEventSubscriptionDestinationProperties.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ServiceBusQueueEventSubscriptionDestinationProperties.cs new file mode 100644 index 000000000000..2d5fe7ac6584 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ServiceBusQueueEventSubscriptionDestinationProperties.cs @@ -0,0 +1,78 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// + /// The properties that represent the Service Bus destination of an event subscription. + /// + public partial class ServiceBusQueueEventSubscriptionDestinationProperties : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusQueueEventSubscriptionDestinationProperties, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusQueueEventSubscriptionDestinationPropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping[] _deliveryAttributeMapping; + + /// Delivery attribute details. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping[] DeliveryAttributeMapping { get => this._deliveryAttributeMapping; set => this._deliveryAttributeMapping = value; } + + /// Backing field for property. + private string _resourceId; + + /// + /// The Azure Resource Id that represents the endpoint of the Service Bus destination of an event subscription. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string ResourceId { get => this._resourceId; set => this._resourceId = value; } + + /// + /// Creates an new instance. + /// + public ServiceBusQueueEventSubscriptionDestinationProperties() + { + + } + } + /// The properties that represent the Service Bus destination of an event subscription. + public partial interface IServiceBusQueueEventSubscriptionDestinationProperties : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// Delivery attribute details. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Delivery attribute details.", + SerializedName = @"deliveryAttributeMappings", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping),typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStaticDeliveryAttributeMapping),typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDynamicDeliveryAttributeMapping) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping[] DeliveryAttributeMapping { get; set; } + /// + /// The Azure Resource Id that represents the endpoint of the Service Bus destination of an event subscription. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Azure Resource Id that represents the endpoint of the Service Bus destination of an event subscription.", + SerializedName = @"resourceId", + PossibleTypes = new [] { typeof(string) })] + string ResourceId { get; set; } + + } + /// The properties that represent the Service Bus destination of an event subscription. + internal partial interface IServiceBusQueueEventSubscriptionDestinationPropertiesInternal + + { + /// Delivery attribute details. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping[] DeliveryAttributeMapping { get; set; } + /// + /// The Azure Resource Id that represents the endpoint of the Service Bus destination of an event subscription. + /// + string ResourceId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ServiceBusQueueEventSubscriptionDestinationProperties.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ServiceBusQueueEventSubscriptionDestinationProperties.json.cs new file mode 100644 index 000000000000..9597c8913f06 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ServiceBusQueueEventSubscriptionDestinationProperties.json.cs @@ -0,0 +1,121 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// + /// The properties that represent the Service Bus destination of an event subscription. + /// + public partial class ServiceBusQueueEventSubscriptionDestinationProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusQueueEventSubscriptionDestinationProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusQueueEventSubscriptionDestinationProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusQueueEventSubscriptionDestinationProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new ServiceBusQueueEventSubscriptionDestinationProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal ServiceBusQueueEventSubscriptionDestinationProperties(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_resourceId = If( json?.PropertyT("resourceId"), out var __jsonResourceId) ? (string)__jsonResourceId : (string)ResourceId;} + {_deliveryAttributeMapping = If( json?.PropertyT("deliveryAttributeMappings"), out var __jsonDeliveryAttributeMappings) ? If( __jsonDeliveryAttributeMappings as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping) (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeliveryAttributeMapping.FromJson(__u) )) ))() : null : DeliveryAttributeMapping;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._resourceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._resourceId.ToString()) : null, "resourceId" ,container.Add ); + if (null != this._deliveryAttributeMapping) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.XNodeArray(); + foreach( var __x in this._deliveryAttributeMapping ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("deliveryAttributeMappings",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ServiceBusTopicEventSubscriptionDestination.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ServiceBusTopicEventSubscriptionDestination.PowerShell.cs new file mode 100644 index 000000000000..bd071e3aeb9c --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ServiceBusTopicEventSubscriptionDestination.PowerShell.cs @@ -0,0 +1,169 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Information about the service bus topic destination for an event subscription. + [System.ComponentModel.TypeConverter(typeof(ServiceBusTopicEventSubscriptionDestinationTypeConverter))] + public partial class ServiceBusTopicEventSubscriptionDestination + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusTopicEventSubscriptionDestination DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ServiceBusTopicEventSubscriptionDestination(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusTopicEventSubscriptionDestination DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ServiceBusTopicEventSubscriptionDestination(content); + } + + /// + /// Creates a new instance of , deserializing the content from a + /// json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusTopicEventSubscriptionDestination FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ServiceBusTopicEventSubscriptionDestination(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusTopicEventSubscriptionDestinationInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusTopicEventSubscriptionDestinationProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusTopicEventSubscriptionDestinationInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ServiceBusTopicEventSubscriptionDestinationPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("EndpointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestinationInternal)this).EndpointType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType) content.GetValueForProperty("EndpointType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestinationInternal)this).EndpointType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType.CreateFrom); + } + if (content.Contains("ResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusTopicEventSubscriptionDestinationInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusTopicEventSubscriptionDestinationInternal)this).ResourceId, global::System.Convert.ToString); + } + if (content.Contains("DeliveryAttributeMapping")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusTopicEventSubscriptionDestinationInternal)this).DeliveryAttributeMapping = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping[]) content.GetValueForProperty("DeliveryAttributeMapping",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusTopicEventSubscriptionDestinationInternal)this).DeliveryAttributeMapping, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeliveryAttributeMappingTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ServiceBusTopicEventSubscriptionDestination(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusTopicEventSubscriptionDestinationInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusTopicEventSubscriptionDestinationProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusTopicEventSubscriptionDestinationInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ServiceBusTopicEventSubscriptionDestinationPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("EndpointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestinationInternal)this).EndpointType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType) content.GetValueForProperty("EndpointType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestinationInternal)this).EndpointType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType.CreateFrom); + } + if (content.Contains("ResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusTopicEventSubscriptionDestinationInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusTopicEventSubscriptionDestinationInternal)this).ResourceId, global::System.Convert.ToString); + } + if (content.Contains("DeliveryAttributeMapping")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusTopicEventSubscriptionDestinationInternal)this).DeliveryAttributeMapping = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping[]) content.GetValueForProperty("DeliveryAttributeMapping",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusTopicEventSubscriptionDestinationInternal)this).DeliveryAttributeMapping, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeliveryAttributeMappingTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Information about the service bus topic destination for an event subscription. + [System.ComponentModel.TypeConverter(typeof(ServiceBusTopicEventSubscriptionDestinationTypeConverter))] + public partial interface IServiceBusTopicEventSubscriptionDestination + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ServiceBusTopicEventSubscriptionDestination.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ServiceBusTopicEventSubscriptionDestination.TypeConverter.cs new file mode 100644 index 000000000000..3b7906d82520 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ServiceBusTopicEventSubscriptionDestination.TypeConverter.cs @@ -0,0 +1,150 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ServiceBusTopicEventSubscriptionDestinationTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusTopicEventSubscriptionDestination ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusTopicEventSubscriptionDestination).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ServiceBusTopicEventSubscriptionDestination.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ServiceBusTopicEventSubscriptionDestination.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ServiceBusTopicEventSubscriptionDestination.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ServiceBusTopicEventSubscriptionDestination.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ServiceBusTopicEventSubscriptionDestination.cs new file mode 100644 index 000000000000..376a1a9dcc0e --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ServiceBusTopicEventSubscriptionDestination.cs @@ -0,0 +1,105 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Information about the service bus topic destination for an event subscription. + public partial class ServiceBusTopicEventSubscriptionDestination : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusTopicEventSubscriptionDestination, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusTopicEventSubscriptionDestinationInternal, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestination __eventSubscriptionDestination = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionDestination(); + + /// Delivery attribute details. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping[] DeliveryAttributeMapping { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusTopicEventSubscriptionDestinationPropertiesInternal)Property).DeliveryAttributeMapping; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusTopicEventSubscriptionDestinationPropertiesInternal)Property).DeliveryAttributeMapping = value ?? null /* arrayOf */; } + + /// Type of the endpoint for the event subscription destination. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType EndpointType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestinationInternal)__eventSubscriptionDestination).EndpointType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestinationInternal)__eventSubscriptionDestination).EndpointType = value ; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusTopicEventSubscriptionDestinationProperties Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusTopicEventSubscriptionDestinationInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ServiceBusTopicEventSubscriptionDestinationProperties()); set { {_property = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusTopicEventSubscriptionDestinationProperties _property; + + /// Service Bus Topic Properties of the event subscription destination. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusTopicEventSubscriptionDestinationProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ServiceBusTopicEventSubscriptionDestinationProperties()); set => this._property = value; } + + /// + /// The Azure Resource Id that represents the endpoint of the Service Bus Topic destination of an event subscription. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string ResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusTopicEventSubscriptionDestinationPropertiesInternal)Property).ResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusTopicEventSubscriptionDestinationPropertiesInternal)Property).ResourceId = value ?? null; } + + /// + /// Creates an new instance. + /// + public ServiceBusTopicEventSubscriptionDestination() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__eventSubscriptionDestination), __eventSubscriptionDestination); + await eventListener.AssertObjectIsValid(nameof(__eventSubscriptionDestination), __eventSubscriptionDestination); + } + } + /// Information about the service bus topic destination for an event subscription. + public partial interface IServiceBusTopicEventSubscriptionDestination : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestination + { + /// Delivery attribute details. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Delivery attribute details.", + SerializedName = @"deliveryAttributeMappings", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping),typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStaticDeliveryAttributeMapping),typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDynamicDeliveryAttributeMapping) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping[] DeliveryAttributeMapping { get; set; } + /// + /// The Azure Resource Id that represents the endpoint of the Service Bus Topic destination of an event subscription. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Azure Resource Id that represents the endpoint of the Service Bus Topic destination of an event subscription.", + SerializedName = @"resourceId", + PossibleTypes = new [] { typeof(string) })] + string ResourceId { get; set; } + + } + /// Information about the service bus topic destination for an event subscription. + internal partial interface IServiceBusTopicEventSubscriptionDestinationInternal : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestinationInternal + { + /// Delivery attribute details. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping[] DeliveryAttributeMapping { get; set; } + /// Service Bus Topic Properties of the event subscription destination. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusTopicEventSubscriptionDestinationProperties Property { get; set; } + /// + /// The Azure Resource Id that represents the endpoint of the Service Bus Topic destination of an event subscription. + /// + string ResourceId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ServiceBusTopicEventSubscriptionDestination.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ServiceBusTopicEventSubscriptionDestination.json.cs new file mode 100644 index 000000000000..e4c6bf5101fe --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ServiceBusTopicEventSubscriptionDestination.json.cs @@ -0,0 +1,110 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Information about the service bus topic destination for an event subscription. + public partial class ServiceBusTopicEventSubscriptionDestination + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusTopicEventSubscriptionDestination. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusTopicEventSubscriptionDestination. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusTopicEventSubscriptionDestination FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new ServiceBusTopicEventSubscriptionDestination(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal ServiceBusTopicEventSubscriptionDestination(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __eventSubscriptionDestination = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionDestination(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ServiceBusTopicEventSubscriptionDestinationProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __eventSubscriptionDestination?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ServiceBusTopicEventSubscriptionDestinationProperties.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ServiceBusTopicEventSubscriptionDestinationProperties.PowerShell.cs new file mode 100644 index 000000000000..2c392824c76c --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ServiceBusTopicEventSubscriptionDestinationProperties.PowerShell.cs @@ -0,0 +1,155 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// The properties that represent the Service Bus Topic destination of an event subscription. + /// + [System.ComponentModel.TypeConverter(typeof(ServiceBusTopicEventSubscriptionDestinationPropertiesTypeConverter))] + public partial class ServiceBusTopicEventSubscriptionDestinationProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusTopicEventSubscriptionDestinationProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ServiceBusTopicEventSubscriptionDestinationProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusTopicEventSubscriptionDestinationProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ServiceBusTopicEventSubscriptionDestinationProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content + /// from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusTopicEventSubscriptionDestinationProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ServiceBusTopicEventSubscriptionDestinationProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusTopicEventSubscriptionDestinationPropertiesInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusTopicEventSubscriptionDestinationPropertiesInternal)this).ResourceId, global::System.Convert.ToString); + } + if (content.Contains("DeliveryAttributeMapping")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusTopicEventSubscriptionDestinationPropertiesInternal)this).DeliveryAttributeMapping = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping[]) content.GetValueForProperty("DeliveryAttributeMapping",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusTopicEventSubscriptionDestinationPropertiesInternal)this).DeliveryAttributeMapping, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeliveryAttributeMappingTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ServiceBusTopicEventSubscriptionDestinationProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusTopicEventSubscriptionDestinationPropertiesInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusTopicEventSubscriptionDestinationPropertiesInternal)this).ResourceId, global::System.Convert.ToString); + } + if (content.Contains("DeliveryAttributeMapping")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusTopicEventSubscriptionDestinationPropertiesInternal)this).DeliveryAttributeMapping = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping[]) content.GetValueForProperty("DeliveryAttributeMapping",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusTopicEventSubscriptionDestinationPropertiesInternal)this).DeliveryAttributeMapping, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeliveryAttributeMappingTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The properties that represent the Service Bus Topic destination of an event subscription. + [System.ComponentModel.TypeConverter(typeof(ServiceBusTopicEventSubscriptionDestinationPropertiesTypeConverter))] + public partial interface IServiceBusTopicEventSubscriptionDestinationProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ServiceBusTopicEventSubscriptionDestinationProperties.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ServiceBusTopicEventSubscriptionDestinationProperties.TypeConverter.cs new file mode 100644 index 000000000000..f2f8fb6534ed --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ServiceBusTopicEventSubscriptionDestinationProperties.TypeConverter.cs @@ -0,0 +1,152 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ServiceBusTopicEventSubscriptionDestinationPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusTopicEventSubscriptionDestinationProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusTopicEventSubscriptionDestinationProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ServiceBusTopicEventSubscriptionDestinationProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ServiceBusTopicEventSubscriptionDestinationProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ServiceBusTopicEventSubscriptionDestinationProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ServiceBusTopicEventSubscriptionDestinationProperties.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ServiceBusTopicEventSubscriptionDestinationProperties.cs new file mode 100644 index 000000000000..8fd03733394d --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ServiceBusTopicEventSubscriptionDestinationProperties.cs @@ -0,0 +1,78 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// + /// The properties that represent the Service Bus Topic destination of an event subscription. + /// + public partial class ServiceBusTopicEventSubscriptionDestinationProperties : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusTopicEventSubscriptionDestinationProperties, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusTopicEventSubscriptionDestinationPropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping[] _deliveryAttributeMapping; + + /// Delivery attribute details. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping[] DeliveryAttributeMapping { get => this._deliveryAttributeMapping; set => this._deliveryAttributeMapping = value; } + + /// Backing field for property. + private string _resourceId; + + /// + /// The Azure Resource Id that represents the endpoint of the Service Bus Topic destination of an event subscription. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string ResourceId { get => this._resourceId; set => this._resourceId = value; } + + /// + /// Creates an new instance. + /// + public ServiceBusTopicEventSubscriptionDestinationProperties() + { + + } + } + /// The properties that represent the Service Bus Topic destination of an event subscription. + public partial interface IServiceBusTopicEventSubscriptionDestinationProperties : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// Delivery attribute details. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Delivery attribute details.", + SerializedName = @"deliveryAttributeMappings", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping),typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStaticDeliveryAttributeMapping),typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDynamicDeliveryAttributeMapping) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping[] DeliveryAttributeMapping { get; set; } + /// + /// The Azure Resource Id that represents the endpoint of the Service Bus Topic destination of an event subscription. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Azure Resource Id that represents the endpoint of the Service Bus Topic destination of an event subscription.", + SerializedName = @"resourceId", + PossibleTypes = new [] { typeof(string) })] + string ResourceId { get; set; } + + } + /// The properties that represent the Service Bus Topic destination of an event subscription. + internal partial interface IServiceBusTopicEventSubscriptionDestinationPropertiesInternal + + { + /// Delivery attribute details. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping[] DeliveryAttributeMapping { get; set; } + /// + /// The Azure Resource Id that represents the endpoint of the Service Bus Topic destination of an event subscription. + /// + string ResourceId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ServiceBusTopicEventSubscriptionDestinationProperties.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ServiceBusTopicEventSubscriptionDestinationProperties.json.cs new file mode 100644 index 000000000000..650487469292 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/ServiceBusTopicEventSubscriptionDestinationProperties.json.cs @@ -0,0 +1,121 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// + /// The properties that represent the Service Bus Topic destination of an event subscription. + /// + public partial class ServiceBusTopicEventSubscriptionDestinationProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusTopicEventSubscriptionDestinationProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusTopicEventSubscriptionDestinationProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IServiceBusTopicEventSubscriptionDestinationProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new ServiceBusTopicEventSubscriptionDestinationProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal ServiceBusTopicEventSubscriptionDestinationProperties(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_resourceId = If( json?.PropertyT("resourceId"), out var __jsonResourceId) ? (string)__jsonResourceId : (string)ResourceId;} + {_deliveryAttributeMapping = If( json?.PropertyT("deliveryAttributeMappings"), out var __jsonDeliveryAttributeMappings) ? If( __jsonDeliveryAttributeMappings as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping) (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeliveryAttributeMapping.FromJson(__u) )) ))() : null : DeliveryAttributeMapping;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._resourceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._resourceId.ToString()) : null, "resourceId" ,container.Add ); + if (null != this._deliveryAttributeMapping) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.XNodeArray(); + foreach( var __x in this._deliveryAttributeMapping ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("deliveryAttributeMappings",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StaticDeliveryAttributeMapping.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StaticDeliveryAttributeMapping.PowerShell.cs new file mode 100644 index 000000000000..caeb2a7acf44 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StaticDeliveryAttributeMapping.PowerShell.cs @@ -0,0 +1,176 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Static delivery attribute mapping details. + [System.ComponentModel.TypeConverter(typeof(StaticDeliveryAttributeMappingTypeConverter))] + public partial class StaticDeliveryAttributeMapping + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStaticDeliveryAttributeMapping DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new StaticDeliveryAttributeMapping(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStaticDeliveryAttributeMapping DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new StaticDeliveryAttributeMapping(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStaticDeliveryAttributeMapping FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal StaticDeliveryAttributeMapping(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStaticDeliveryAttributeMappingInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStaticDeliveryAttributeMappingProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStaticDeliveryAttributeMappingInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.StaticDeliveryAttributeMappingPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMappingInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMappingInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMappingInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DeliveryAttributeMappingType) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMappingInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DeliveryAttributeMappingType.CreateFrom); + } + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStaticDeliveryAttributeMappingInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStaticDeliveryAttributeMappingInternal)this).Value, global::System.Convert.ToString); + } + if (content.Contains("IsSecret")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStaticDeliveryAttributeMappingInternal)this).IsSecret = (bool?) content.GetValueForProperty("IsSecret",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStaticDeliveryAttributeMappingInternal)this).IsSecret, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal StaticDeliveryAttributeMapping(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStaticDeliveryAttributeMappingInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStaticDeliveryAttributeMappingProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStaticDeliveryAttributeMappingInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.StaticDeliveryAttributeMappingPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMappingInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMappingInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMappingInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DeliveryAttributeMappingType) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMappingInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DeliveryAttributeMappingType.CreateFrom); + } + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStaticDeliveryAttributeMappingInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStaticDeliveryAttributeMappingInternal)this).Value, global::System.Convert.ToString); + } + if (content.Contains("IsSecret")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStaticDeliveryAttributeMappingInternal)this).IsSecret = (bool?) content.GetValueForProperty("IsSecret",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStaticDeliveryAttributeMappingInternal)this).IsSecret, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Static delivery attribute mapping details. + [System.ComponentModel.TypeConverter(typeof(StaticDeliveryAttributeMappingTypeConverter))] + public partial interface IStaticDeliveryAttributeMapping + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StaticDeliveryAttributeMapping.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StaticDeliveryAttributeMapping.TypeConverter.cs new file mode 100644 index 000000000000..5203b761c931 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StaticDeliveryAttributeMapping.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class StaticDeliveryAttributeMappingTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStaticDeliveryAttributeMapping ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStaticDeliveryAttributeMapping).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return StaticDeliveryAttributeMapping.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return StaticDeliveryAttributeMapping.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return StaticDeliveryAttributeMapping.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StaticDeliveryAttributeMapping.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StaticDeliveryAttributeMapping.cs new file mode 100644 index 000000000000..54738f0c166a --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StaticDeliveryAttributeMapping.cs @@ -0,0 +1,101 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Static delivery attribute mapping details. + public partial class StaticDeliveryAttributeMapping : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStaticDeliveryAttributeMapping, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStaticDeliveryAttributeMappingInternal, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping __deliveryAttributeMapping = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeliveryAttributeMapping(); + + /// Boolean flag to tell if the attribute contains sensitive information . + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public bool? IsSecret { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStaticDeliveryAttributeMappingPropertiesInternal)Property).IsSecret; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStaticDeliveryAttributeMappingPropertiesInternal)Property).IsSecret = value ?? default(bool); } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStaticDeliveryAttributeMappingProperties Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStaticDeliveryAttributeMappingInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.StaticDeliveryAttributeMappingProperties()); set { {_property = value;} } } + + /// Name of the delivery attribute or header. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMappingInternal)__deliveryAttributeMapping).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMappingInternal)__deliveryAttributeMapping).Name = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStaticDeliveryAttributeMappingProperties _property; + + /// Properties of static delivery attribute mapping. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStaticDeliveryAttributeMappingProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.StaticDeliveryAttributeMappingProperties()); set => this._property = value; } + + /// Type of the delivery attribute or header name. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DeliveryAttributeMappingType Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMappingInternal)__deliveryAttributeMapping).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMappingInternal)__deliveryAttributeMapping).Type = value ; } + + /// Value of the delivery attribute. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string Value { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStaticDeliveryAttributeMappingPropertiesInternal)Property).Value; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStaticDeliveryAttributeMappingPropertiesInternal)Property).Value = value ?? null; } + + /// Creates an new instance. + public StaticDeliveryAttributeMapping() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__deliveryAttributeMapping), __deliveryAttributeMapping); + await eventListener.AssertObjectIsValid(nameof(__deliveryAttributeMapping), __deliveryAttributeMapping); + } + } + /// Static delivery attribute mapping details. + public partial interface IStaticDeliveryAttributeMapping : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping + { + /// Boolean flag to tell if the attribute contains sensitive information . + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Boolean flag to tell if the attribute contains sensitive information .", + SerializedName = @"isSecret", + PossibleTypes = new [] { typeof(bool) })] + bool? IsSecret { get; set; } + /// Value of the delivery attribute. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Value of the delivery attribute.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(string) })] + string Value { get; set; } + + } + /// Static delivery attribute mapping details. + internal partial interface IStaticDeliveryAttributeMappingInternal : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMappingInternal + { + /// Boolean flag to tell if the attribute contains sensitive information . + bool? IsSecret { get; set; } + /// Properties of static delivery attribute mapping. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStaticDeliveryAttributeMappingProperties Property { get; set; } + /// Value of the delivery attribute. + string Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StaticDeliveryAttributeMapping.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StaticDeliveryAttributeMapping.json.cs new file mode 100644 index 000000000000..ba343209af27 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StaticDeliveryAttributeMapping.json.cs @@ -0,0 +1,108 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Static delivery attribute mapping details. + public partial class StaticDeliveryAttributeMapping + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStaticDeliveryAttributeMapping. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStaticDeliveryAttributeMapping. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStaticDeliveryAttributeMapping FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new StaticDeliveryAttributeMapping(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal StaticDeliveryAttributeMapping(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __deliveryAttributeMapping = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeliveryAttributeMapping(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.StaticDeliveryAttributeMappingProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __deliveryAttributeMapping?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StaticDeliveryAttributeMappingProperties.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StaticDeliveryAttributeMappingProperties.PowerShell.cs new file mode 100644 index 000000000000..4a2b7b148872 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StaticDeliveryAttributeMappingProperties.PowerShell.cs @@ -0,0 +1,153 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Properties of static delivery attribute mapping. + [System.ComponentModel.TypeConverter(typeof(StaticDeliveryAttributeMappingPropertiesTypeConverter))] + public partial class StaticDeliveryAttributeMappingProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStaticDeliveryAttributeMappingProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new StaticDeliveryAttributeMappingProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStaticDeliveryAttributeMappingProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new StaticDeliveryAttributeMappingProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json + /// string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStaticDeliveryAttributeMappingProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal StaticDeliveryAttributeMappingProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStaticDeliveryAttributeMappingPropertiesInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStaticDeliveryAttributeMappingPropertiesInternal)this).Value, global::System.Convert.ToString); + } + if (content.Contains("IsSecret")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStaticDeliveryAttributeMappingPropertiesInternal)this).IsSecret = (bool?) content.GetValueForProperty("IsSecret",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStaticDeliveryAttributeMappingPropertiesInternal)this).IsSecret, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal StaticDeliveryAttributeMappingProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStaticDeliveryAttributeMappingPropertiesInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStaticDeliveryAttributeMappingPropertiesInternal)this).Value, global::System.Convert.ToString); + } + if (content.Contains("IsSecret")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStaticDeliveryAttributeMappingPropertiesInternal)this).IsSecret = (bool?) content.GetValueForProperty("IsSecret",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStaticDeliveryAttributeMappingPropertiesInternal)this).IsSecret, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties of static delivery attribute mapping. + [System.ComponentModel.TypeConverter(typeof(StaticDeliveryAttributeMappingPropertiesTypeConverter))] + public partial interface IStaticDeliveryAttributeMappingProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StaticDeliveryAttributeMappingProperties.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StaticDeliveryAttributeMappingProperties.TypeConverter.cs new file mode 100644 index 000000000000..a3bef76495d0 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StaticDeliveryAttributeMappingProperties.TypeConverter.cs @@ -0,0 +1,150 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class StaticDeliveryAttributeMappingPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStaticDeliveryAttributeMappingProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStaticDeliveryAttributeMappingProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return StaticDeliveryAttributeMappingProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return StaticDeliveryAttributeMappingProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return StaticDeliveryAttributeMappingProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StaticDeliveryAttributeMappingProperties.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StaticDeliveryAttributeMappingProperties.cs new file mode 100644 index 000000000000..4b427c137548 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StaticDeliveryAttributeMappingProperties.cs @@ -0,0 +1,70 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Properties of static delivery attribute mapping. + public partial class StaticDeliveryAttributeMappingProperties : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStaticDeliveryAttributeMappingProperties, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStaticDeliveryAttributeMappingPropertiesInternal + { + + /// Backing field for property. + private bool? _isSecret; + + /// Boolean flag to tell if the attribute contains sensitive information . + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public bool? IsSecret { get => this._isSecret; set => this._isSecret = value; } + + /// Backing field for property. + private string _value; + + /// Value of the delivery attribute. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string Value { get => this._value; set => this._value = value; } + + /// + /// Creates an new instance. + /// + public StaticDeliveryAttributeMappingProperties() + { + + } + } + /// Properties of static delivery attribute mapping. + public partial interface IStaticDeliveryAttributeMappingProperties : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// Boolean flag to tell if the attribute contains sensitive information . + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Boolean flag to tell if the attribute contains sensitive information .", + SerializedName = @"isSecret", + PossibleTypes = new [] { typeof(bool) })] + bool? IsSecret { get; set; } + /// Value of the delivery attribute. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Value of the delivery attribute.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(string) })] + string Value { get; set; } + + } + /// Properties of static delivery attribute mapping. + internal partial interface IStaticDeliveryAttributeMappingPropertiesInternal + + { + /// Boolean flag to tell if the attribute contains sensitive information . + bool? IsSecret { get; set; } + /// Value of the delivery attribute. + string Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StaticDeliveryAttributeMappingProperties.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StaticDeliveryAttributeMappingProperties.json.cs new file mode 100644 index 000000000000..58dfe1bafd17 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StaticDeliveryAttributeMappingProperties.json.cs @@ -0,0 +1,110 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Properties of static delivery attribute mapping. + public partial class StaticDeliveryAttributeMappingProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStaticDeliveryAttributeMappingProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStaticDeliveryAttributeMappingProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStaticDeliveryAttributeMappingProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new StaticDeliveryAttributeMappingProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal StaticDeliveryAttributeMappingProperties(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? (string)__jsonValue : (string)Value;} + {_isSecret = If( json?.PropertyT("isSecret"), out var __jsonIsSecret) ? (bool?)__jsonIsSecret : IsSecret;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._value)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._value.ToString()) : null, "value" ,container.Add ); + AddIf( null != this._isSecret ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonBoolean((bool)this._isSecret) : null, "isSecret" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StorageBlobDeadLetterDestination.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StorageBlobDeadLetterDestination.PowerShell.cs new file mode 100644 index 000000000000..b46d62dae86e --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StorageBlobDeadLetterDestination.PowerShell.cs @@ -0,0 +1,168 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Information about the storage blob based dead letter destination. + [System.ComponentModel.TypeConverter(typeof(StorageBlobDeadLetterDestinationTypeConverter))] + public partial class StorageBlobDeadLetterDestination + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageBlobDeadLetterDestination DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new StorageBlobDeadLetterDestination(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageBlobDeadLetterDestination DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new StorageBlobDeadLetterDestination(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageBlobDeadLetterDestination FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal StorageBlobDeadLetterDestination(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageBlobDeadLetterDestinationInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageBlobDeadLetterDestinationProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageBlobDeadLetterDestinationInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.StorageBlobDeadLetterDestinationPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("EndpointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterDestinationInternal)this).EndpointType = (string) content.GetValueForProperty("EndpointType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterDestinationInternal)this).EndpointType, global::System.Convert.ToString); + } + if (content.Contains("ResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageBlobDeadLetterDestinationInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageBlobDeadLetterDestinationInternal)this).ResourceId, global::System.Convert.ToString); + } + if (content.Contains("BlobContainerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageBlobDeadLetterDestinationInternal)this).BlobContainerName = (string) content.GetValueForProperty("BlobContainerName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageBlobDeadLetterDestinationInternal)this).BlobContainerName, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal StorageBlobDeadLetterDestination(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageBlobDeadLetterDestinationInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageBlobDeadLetterDestinationProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageBlobDeadLetterDestinationInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.StorageBlobDeadLetterDestinationPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("EndpointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterDestinationInternal)this).EndpointType = (string) content.GetValueForProperty("EndpointType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterDestinationInternal)this).EndpointType, global::System.Convert.ToString); + } + if (content.Contains("ResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageBlobDeadLetterDestinationInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageBlobDeadLetterDestinationInternal)this).ResourceId, global::System.Convert.ToString); + } + if (content.Contains("BlobContainerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageBlobDeadLetterDestinationInternal)this).BlobContainerName = (string) content.GetValueForProperty("BlobContainerName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageBlobDeadLetterDestinationInternal)this).BlobContainerName, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Information about the storage blob based dead letter destination. + [System.ComponentModel.TypeConverter(typeof(StorageBlobDeadLetterDestinationTypeConverter))] + public partial interface IStorageBlobDeadLetterDestination + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StorageBlobDeadLetterDestination.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StorageBlobDeadLetterDestination.TypeConverter.cs new file mode 100644 index 000000000000..ce32be35d140 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StorageBlobDeadLetterDestination.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class StorageBlobDeadLetterDestinationTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageBlobDeadLetterDestination ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageBlobDeadLetterDestination).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return StorageBlobDeadLetterDestination.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return StorageBlobDeadLetterDestination.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return StorageBlobDeadLetterDestination.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StorageBlobDeadLetterDestination.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StorageBlobDeadLetterDestination.cs new file mode 100644 index 000000000000..660d8f5cee17 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StorageBlobDeadLetterDestination.cs @@ -0,0 +1,112 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Information about the storage blob based dead letter destination. + public partial class StorageBlobDeadLetterDestination : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageBlobDeadLetterDestination, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageBlobDeadLetterDestinationInternal, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterDestination __deadLetterDestination = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeadLetterDestination(); + + /// + /// The name of the Storage blob container that is the destination of the deadletter events + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string BlobContainerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageBlobDeadLetterDestinationPropertiesInternal)Property).BlobContainerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageBlobDeadLetterDestinationPropertiesInternal)Property).BlobContainerName = value ?? null; } + + /// Type of the endpoint for the dead letter destination + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public string EndpointType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterDestinationInternal)__deadLetterDestination).EndpointType; } + + /// Internal Acessors for EndpointType + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterDestinationInternal.EndpointType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterDestinationInternal)__deadLetterDestination).EndpointType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterDestinationInternal)__deadLetterDestination).EndpointType = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageBlobDeadLetterDestinationProperties Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageBlobDeadLetterDestinationInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.StorageBlobDeadLetterDestinationProperties()); set { {_property = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageBlobDeadLetterDestinationProperties _property; + + /// The properties of the Storage Blob based deadletter destination + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageBlobDeadLetterDestinationProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.StorageBlobDeadLetterDestinationProperties()); set => this._property = value; } + + /// + /// The Azure Resource ID of the storage account that is the destination of the deadletter events + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string ResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageBlobDeadLetterDestinationPropertiesInternal)Property).ResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageBlobDeadLetterDestinationPropertiesInternal)Property).ResourceId = value ?? null; } + + /// Creates an new instance. + public StorageBlobDeadLetterDestination() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__deadLetterDestination), __deadLetterDestination); + await eventListener.AssertObjectIsValid(nameof(__deadLetterDestination), __deadLetterDestination); + } + } + /// Information about the storage blob based dead letter destination. + public partial interface IStorageBlobDeadLetterDestination : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterDestination + { + /// + /// The name of the Storage blob container that is the destination of the deadletter events + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the Storage blob container that is the destination of the deadletter events", + SerializedName = @"blobContainerName", + PossibleTypes = new [] { typeof(string) })] + string BlobContainerName { get; set; } + /// + /// The Azure Resource ID of the storage account that is the destination of the deadletter events + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Azure Resource ID of the storage account that is the destination of the deadletter events", + SerializedName = @"resourceId", + PossibleTypes = new [] { typeof(string) })] + string ResourceId { get; set; } + + } + /// Information about the storage blob based dead letter destination. + internal partial interface IStorageBlobDeadLetterDestinationInternal : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeadLetterDestinationInternal + { + /// + /// The name of the Storage blob container that is the destination of the deadletter events + /// + string BlobContainerName { get; set; } + /// The properties of the Storage Blob based deadletter destination + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageBlobDeadLetterDestinationProperties Property { get; set; } + /// + /// The Azure Resource ID of the storage account that is the destination of the deadletter events + /// + string ResourceId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StorageBlobDeadLetterDestination.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StorageBlobDeadLetterDestination.json.cs new file mode 100644 index 000000000000..69ad026b4a48 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StorageBlobDeadLetterDestination.json.cs @@ -0,0 +1,108 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Information about the storage blob based dead letter destination. + public partial class StorageBlobDeadLetterDestination + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageBlobDeadLetterDestination. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageBlobDeadLetterDestination. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageBlobDeadLetterDestination FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new StorageBlobDeadLetterDestination(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal StorageBlobDeadLetterDestination(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __deadLetterDestination = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeadLetterDestination(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.StorageBlobDeadLetterDestinationProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __deadLetterDestination?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StorageBlobDeadLetterDestinationProperties.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StorageBlobDeadLetterDestinationProperties.PowerShell.cs new file mode 100644 index 000000000000..a8beac508d0f --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StorageBlobDeadLetterDestinationProperties.PowerShell.cs @@ -0,0 +1,153 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Properties of the storage blob based dead letter destination. + [System.ComponentModel.TypeConverter(typeof(StorageBlobDeadLetterDestinationPropertiesTypeConverter))] + public partial class StorageBlobDeadLetterDestinationProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageBlobDeadLetterDestinationProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new StorageBlobDeadLetterDestinationProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageBlobDeadLetterDestinationProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new StorageBlobDeadLetterDestinationProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a + /// json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageBlobDeadLetterDestinationProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal StorageBlobDeadLetterDestinationProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageBlobDeadLetterDestinationPropertiesInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageBlobDeadLetterDestinationPropertiesInternal)this).ResourceId, global::System.Convert.ToString); + } + if (content.Contains("BlobContainerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageBlobDeadLetterDestinationPropertiesInternal)this).BlobContainerName = (string) content.GetValueForProperty("BlobContainerName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageBlobDeadLetterDestinationPropertiesInternal)this).BlobContainerName, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal StorageBlobDeadLetterDestinationProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageBlobDeadLetterDestinationPropertiesInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageBlobDeadLetterDestinationPropertiesInternal)this).ResourceId, global::System.Convert.ToString); + } + if (content.Contains("BlobContainerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageBlobDeadLetterDestinationPropertiesInternal)this).BlobContainerName = (string) content.GetValueForProperty("BlobContainerName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageBlobDeadLetterDestinationPropertiesInternal)this).BlobContainerName, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties of the storage blob based dead letter destination. + [System.ComponentModel.TypeConverter(typeof(StorageBlobDeadLetterDestinationPropertiesTypeConverter))] + public partial interface IStorageBlobDeadLetterDestinationProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StorageBlobDeadLetterDestinationProperties.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StorageBlobDeadLetterDestinationProperties.TypeConverter.cs new file mode 100644 index 000000000000..71010ed1d59d --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StorageBlobDeadLetterDestinationProperties.TypeConverter.cs @@ -0,0 +1,150 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class StorageBlobDeadLetterDestinationPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageBlobDeadLetterDestinationProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageBlobDeadLetterDestinationProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return StorageBlobDeadLetterDestinationProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return StorageBlobDeadLetterDestinationProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return StorageBlobDeadLetterDestinationProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StorageBlobDeadLetterDestinationProperties.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StorageBlobDeadLetterDestinationProperties.cs new file mode 100644 index 000000000000..ab3334c4672a --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StorageBlobDeadLetterDestinationProperties.cs @@ -0,0 +1,82 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Properties of the storage blob based dead letter destination. + public partial class StorageBlobDeadLetterDestinationProperties : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageBlobDeadLetterDestinationProperties, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageBlobDeadLetterDestinationPropertiesInternal + { + + /// Backing field for property. + private string _blobContainerName; + + /// + /// The name of the Storage blob container that is the destination of the deadletter events + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string BlobContainerName { get => this._blobContainerName; set => this._blobContainerName = value; } + + /// Backing field for property. + private string _resourceId; + + /// + /// The Azure Resource ID of the storage account that is the destination of the deadletter events + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string ResourceId { get => this._resourceId; set => this._resourceId = value; } + + /// + /// Creates an new instance. + /// + public StorageBlobDeadLetterDestinationProperties() + { + + } + } + /// Properties of the storage blob based dead letter destination. + public partial interface IStorageBlobDeadLetterDestinationProperties : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// + /// The name of the Storage blob container that is the destination of the deadletter events + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the Storage blob container that is the destination of the deadletter events", + SerializedName = @"blobContainerName", + PossibleTypes = new [] { typeof(string) })] + string BlobContainerName { get; set; } + /// + /// The Azure Resource ID of the storage account that is the destination of the deadletter events + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Azure Resource ID of the storage account that is the destination of the deadletter events", + SerializedName = @"resourceId", + PossibleTypes = new [] { typeof(string) })] + string ResourceId { get; set; } + + } + /// Properties of the storage blob based dead letter destination. + internal partial interface IStorageBlobDeadLetterDestinationPropertiesInternal + + { + /// + /// The name of the Storage blob container that is the destination of the deadletter events + /// + string BlobContainerName { get; set; } + /// + /// The Azure Resource ID of the storage account that is the destination of the deadletter events + /// + string ResourceId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StorageBlobDeadLetterDestinationProperties.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StorageBlobDeadLetterDestinationProperties.json.cs new file mode 100644 index 000000000000..c044d12aef06 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StorageBlobDeadLetterDestinationProperties.json.cs @@ -0,0 +1,110 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Properties of the storage blob based dead letter destination. + public partial class StorageBlobDeadLetterDestinationProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageBlobDeadLetterDestinationProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageBlobDeadLetterDestinationProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageBlobDeadLetterDestinationProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new StorageBlobDeadLetterDestinationProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal StorageBlobDeadLetterDestinationProperties(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_resourceId = If( json?.PropertyT("resourceId"), out var __jsonResourceId) ? (string)__jsonResourceId : (string)ResourceId;} + {_blobContainerName = If( json?.PropertyT("blobContainerName"), out var __jsonBlobContainerName) ? (string)__jsonBlobContainerName : (string)BlobContainerName;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._resourceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._resourceId.ToString()) : null, "resourceId" ,container.Add ); + AddIf( null != (((object)this._blobContainerName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._blobContainerName.ToString()) : null, "blobContainerName" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StorageQueueEventSubscriptionDestination.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StorageQueueEventSubscriptionDestination.PowerShell.cs new file mode 100644 index 000000000000..4c29c9a6b29c --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StorageQueueEventSubscriptionDestination.PowerShell.cs @@ -0,0 +1,177 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Information about the storage queue destination for an event subscription. + [System.ComponentModel.TypeConverter(typeof(StorageQueueEventSubscriptionDestinationTypeConverter))] + public partial class StorageQueueEventSubscriptionDestination + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageQueueEventSubscriptionDestination DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new StorageQueueEventSubscriptionDestination(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageQueueEventSubscriptionDestination DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new StorageQueueEventSubscriptionDestination(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json + /// string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageQueueEventSubscriptionDestination FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal StorageQueueEventSubscriptionDestination(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageQueueEventSubscriptionDestinationInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageQueueEventSubscriptionDestinationProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageQueueEventSubscriptionDestinationInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.StorageQueueEventSubscriptionDestinationPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("EndpointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestinationInternal)this).EndpointType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType) content.GetValueForProperty("EndpointType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestinationInternal)this).EndpointType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType.CreateFrom); + } + if (content.Contains("ResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageQueueEventSubscriptionDestinationInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageQueueEventSubscriptionDestinationInternal)this).ResourceId, global::System.Convert.ToString); + } + if (content.Contains("QueueName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageQueueEventSubscriptionDestinationInternal)this).QueueName = (string) content.GetValueForProperty("QueueName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageQueueEventSubscriptionDestinationInternal)this).QueueName, global::System.Convert.ToString); + } + if (content.Contains("QueueMessageTimeToLiveInSecond")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageQueueEventSubscriptionDestinationInternal)this).QueueMessageTimeToLiveInSecond = (long?) content.GetValueForProperty("QueueMessageTimeToLiveInSecond",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageQueueEventSubscriptionDestinationInternal)this).QueueMessageTimeToLiveInSecond, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal StorageQueueEventSubscriptionDestination(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageQueueEventSubscriptionDestinationInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageQueueEventSubscriptionDestinationProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageQueueEventSubscriptionDestinationInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.StorageQueueEventSubscriptionDestinationPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("EndpointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestinationInternal)this).EndpointType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType) content.GetValueForProperty("EndpointType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestinationInternal)this).EndpointType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType.CreateFrom); + } + if (content.Contains("ResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageQueueEventSubscriptionDestinationInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageQueueEventSubscriptionDestinationInternal)this).ResourceId, global::System.Convert.ToString); + } + if (content.Contains("QueueName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageQueueEventSubscriptionDestinationInternal)this).QueueName = (string) content.GetValueForProperty("QueueName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageQueueEventSubscriptionDestinationInternal)this).QueueName, global::System.Convert.ToString); + } + if (content.Contains("QueueMessageTimeToLiveInSecond")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageQueueEventSubscriptionDestinationInternal)this).QueueMessageTimeToLiveInSecond = (long?) content.GetValueForProperty("QueueMessageTimeToLiveInSecond",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageQueueEventSubscriptionDestinationInternal)this).QueueMessageTimeToLiveInSecond, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Information about the storage queue destination for an event subscription. + [System.ComponentModel.TypeConverter(typeof(StorageQueueEventSubscriptionDestinationTypeConverter))] + public partial interface IStorageQueueEventSubscriptionDestination + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StorageQueueEventSubscriptionDestination.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StorageQueueEventSubscriptionDestination.TypeConverter.cs new file mode 100644 index 000000000000..428edff297ad --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StorageQueueEventSubscriptionDestination.TypeConverter.cs @@ -0,0 +1,150 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class StorageQueueEventSubscriptionDestinationTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageQueueEventSubscriptionDestination ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageQueueEventSubscriptionDestination).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return StorageQueueEventSubscriptionDestination.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return StorageQueueEventSubscriptionDestination.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return StorageQueueEventSubscriptionDestination.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StorageQueueEventSubscriptionDestination.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StorageQueueEventSubscriptionDestination.cs new file mode 100644 index 000000000000..d7196e962f0d --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StorageQueueEventSubscriptionDestination.cs @@ -0,0 +1,125 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Information about the storage queue destination for an event subscription. + public partial class StorageQueueEventSubscriptionDestination : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageQueueEventSubscriptionDestination, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageQueueEventSubscriptionDestinationInternal, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestination __eventSubscriptionDestination = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionDestination(); + + /// Type of the endpoint for the event subscription destination. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType EndpointType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestinationInternal)__eventSubscriptionDestination).EndpointType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestinationInternal)__eventSubscriptionDestination).EndpointType = value ; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageQueueEventSubscriptionDestinationProperties Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageQueueEventSubscriptionDestinationInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.StorageQueueEventSubscriptionDestinationProperties()); set { {_property = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageQueueEventSubscriptionDestinationProperties _property; + + /// Storage Queue Properties of the event subscription destination. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageQueueEventSubscriptionDestinationProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.StorageQueueEventSubscriptionDestinationProperties()); set => this._property = value; } + + /// Storage queue message time to live in seconds. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public long? QueueMessageTimeToLiveInSecond { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageQueueEventSubscriptionDestinationPropertiesInternal)Property).QueueMessageTimeToLiveInSecond; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageQueueEventSubscriptionDestinationPropertiesInternal)Property).QueueMessageTimeToLiveInSecond = value ?? default(long); } + + /// + /// The name of the Storage queue under a storage account that is the destination of an event subscription. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string QueueName { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageQueueEventSubscriptionDestinationPropertiesInternal)Property).QueueName; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageQueueEventSubscriptionDestinationPropertiesInternal)Property).QueueName = value ?? null; } + + /// + /// The Azure Resource ID of the storage account that contains the queue that is the destination of an event subscription. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string ResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageQueueEventSubscriptionDestinationPropertiesInternal)Property).ResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageQueueEventSubscriptionDestinationPropertiesInternal)Property).ResourceId = value ?? null; } + + /// + /// Creates an new instance. + /// + public StorageQueueEventSubscriptionDestination() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__eventSubscriptionDestination), __eventSubscriptionDestination); + await eventListener.AssertObjectIsValid(nameof(__eventSubscriptionDestination), __eventSubscriptionDestination); + } + } + /// Information about the storage queue destination for an event subscription. + public partial interface IStorageQueueEventSubscriptionDestination : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestination + { + /// Storage queue message time to live in seconds. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Storage queue message time to live in seconds.", + SerializedName = @"queueMessageTimeToLiveInSeconds", + PossibleTypes = new [] { typeof(long) })] + long? QueueMessageTimeToLiveInSecond { get; set; } + /// + /// The name of the Storage queue under a storage account that is the destination of an event subscription. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the Storage queue under a storage account that is the destination of an event subscription.", + SerializedName = @"queueName", + PossibleTypes = new [] { typeof(string) })] + string QueueName { get; set; } + /// + /// The Azure Resource ID of the storage account that contains the queue that is the destination of an event subscription. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Azure Resource ID of the storage account that contains the queue that is the destination of an event subscription.", + SerializedName = @"resourceId", + PossibleTypes = new [] { typeof(string) })] + string ResourceId { get; set; } + + } + /// Information about the storage queue destination for an event subscription. + internal partial interface IStorageQueueEventSubscriptionDestinationInternal : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestinationInternal + { + /// Storage Queue Properties of the event subscription destination. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageQueueEventSubscriptionDestinationProperties Property { get; set; } + /// Storage queue message time to live in seconds. + long? QueueMessageTimeToLiveInSecond { get; set; } + /// + /// The name of the Storage queue under a storage account that is the destination of an event subscription. + /// + string QueueName { get; set; } + /// + /// The Azure Resource ID of the storage account that contains the queue that is the destination of an event subscription. + /// + string ResourceId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StorageQueueEventSubscriptionDestination.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StorageQueueEventSubscriptionDestination.json.cs new file mode 100644 index 000000000000..2b29d6c9e83a --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StorageQueueEventSubscriptionDestination.json.cs @@ -0,0 +1,110 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Information about the storage queue destination for an event subscription. + public partial class StorageQueueEventSubscriptionDestination + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageQueueEventSubscriptionDestination. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageQueueEventSubscriptionDestination. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageQueueEventSubscriptionDestination FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new StorageQueueEventSubscriptionDestination(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal StorageQueueEventSubscriptionDestination(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __eventSubscriptionDestination = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionDestination(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.StorageQueueEventSubscriptionDestinationProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __eventSubscriptionDestination?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StorageQueueEventSubscriptionDestinationProperties.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StorageQueueEventSubscriptionDestinationProperties.PowerShell.cs new file mode 100644 index 000000000000..32505301e5c3 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StorageQueueEventSubscriptionDestinationProperties.PowerShell.cs @@ -0,0 +1,161 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// The properties for a storage queue destination. + [System.ComponentModel.TypeConverter(typeof(StorageQueueEventSubscriptionDestinationPropertiesTypeConverter))] + public partial class StorageQueueEventSubscriptionDestinationProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageQueueEventSubscriptionDestinationProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new StorageQueueEventSubscriptionDestinationProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageQueueEventSubscriptionDestinationProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new StorageQueueEventSubscriptionDestinationProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content + /// from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageQueueEventSubscriptionDestinationProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal StorageQueueEventSubscriptionDestinationProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageQueueEventSubscriptionDestinationPropertiesInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageQueueEventSubscriptionDestinationPropertiesInternal)this).ResourceId, global::System.Convert.ToString); + } + if (content.Contains("QueueName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageQueueEventSubscriptionDestinationPropertiesInternal)this).QueueName = (string) content.GetValueForProperty("QueueName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageQueueEventSubscriptionDestinationPropertiesInternal)this).QueueName, global::System.Convert.ToString); + } + if (content.Contains("QueueMessageTimeToLiveInSecond")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageQueueEventSubscriptionDestinationPropertiesInternal)this).QueueMessageTimeToLiveInSecond = (long?) content.GetValueForProperty("QueueMessageTimeToLiveInSecond",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageQueueEventSubscriptionDestinationPropertiesInternal)this).QueueMessageTimeToLiveInSecond, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal StorageQueueEventSubscriptionDestinationProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageQueueEventSubscriptionDestinationPropertiesInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageQueueEventSubscriptionDestinationPropertiesInternal)this).ResourceId, global::System.Convert.ToString); + } + if (content.Contains("QueueName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageQueueEventSubscriptionDestinationPropertiesInternal)this).QueueName = (string) content.GetValueForProperty("QueueName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageQueueEventSubscriptionDestinationPropertiesInternal)this).QueueName, global::System.Convert.ToString); + } + if (content.Contains("QueueMessageTimeToLiveInSecond")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageQueueEventSubscriptionDestinationPropertiesInternal)this).QueueMessageTimeToLiveInSecond = (long?) content.GetValueForProperty("QueueMessageTimeToLiveInSecond",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageQueueEventSubscriptionDestinationPropertiesInternal)this).QueueMessageTimeToLiveInSecond, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The properties for a storage queue destination. + [System.ComponentModel.TypeConverter(typeof(StorageQueueEventSubscriptionDestinationPropertiesTypeConverter))] + public partial interface IStorageQueueEventSubscriptionDestinationProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StorageQueueEventSubscriptionDestinationProperties.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StorageQueueEventSubscriptionDestinationProperties.TypeConverter.cs new file mode 100644 index 000000000000..c4978b5f2fdd --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StorageQueueEventSubscriptionDestinationProperties.TypeConverter.cs @@ -0,0 +1,152 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class StorageQueueEventSubscriptionDestinationPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a + /// type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageQueueEventSubscriptionDestinationProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageQueueEventSubscriptionDestinationProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return StorageQueueEventSubscriptionDestinationProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return StorageQueueEventSubscriptionDestinationProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return StorageQueueEventSubscriptionDestinationProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StorageQueueEventSubscriptionDestinationProperties.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StorageQueueEventSubscriptionDestinationProperties.cs new file mode 100644 index 000000000000..442855f11c28 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StorageQueueEventSubscriptionDestinationProperties.cs @@ -0,0 +1,99 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// The properties for a storage queue destination. + public partial class StorageQueueEventSubscriptionDestinationProperties : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageQueueEventSubscriptionDestinationProperties, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageQueueEventSubscriptionDestinationPropertiesInternal + { + + /// Backing field for property. + private long? _queueMessageTimeToLiveInSecond; + + /// Storage queue message time to live in seconds. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public long? QueueMessageTimeToLiveInSecond { get => this._queueMessageTimeToLiveInSecond; set => this._queueMessageTimeToLiveInSecond = value; } + + /// Backing field for property. + private string _queueName; + + /// + /// The name of the Storage queue under a storage account that is the destination of an event subscription. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string QueueName { get => this._queueName; set => this._queueName = value; } + + /// Backing field for property. + private string _resourceId; + + /// + /// The Azure Resource ID of the storage account that contains the queue that is the destination of an event subscription. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string ResourceId { get => this._resourceId; set => this._resourceId = value; } + + /// + /// Creates an new instance. + /// + public StorageQueueEventSubscriptionDestinationProperties() + { + + } + } + /// The properties for a storage queue destination. + public partial interface IStorageQueueEventSubscriptionDestinationProperties : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// Storage queue message time to live in seconds. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Storage queue message time to live in seconds.", + SerializedName = @"queueMessageTimeToLiveInSeconds", + PossibleTypes = new [] { typeof(long) })] + long? QueueMessageTimeToLiveInSecond { get; set; } + /// + /// The name of the Storage queue under a storage account that is the destination of an event subscription. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the Storage queue under a storage account that is the destination of an event subscription.", + SerializedName = @"queueName", + PossibleTypes = new [] { typeof(string) })] + string QueueName { get; set; } + /// + /// The Azure Resource ID of the storage account that contains the queue that is the destination of an event subscription. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Azure Resource ID of the storage account that contains the queue that is the destination of an event subscription.", + SerializedName = @"resourceId", + PossibleTypes = new [] { typeof(string) })] + string ResourceId { get; set; } + + } + /// The properties for a storage queue destination. + internal partial interface IStorageQueueEventSubscriptionDestinationPropertiesInternal + + { + /// Storage queue message time to live in seconds. + long? QueueMessageTimeToLiveInSecond { get; set; } + /// + /// The name of the Storage queue under a storage account that is the destination of an event subscription. + /// + string QueueName { get; set; } + /// + /// The Azure Resource ID of the storage account that contains the queue that is the destination of an event subscription. + /// + string ResourceId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StorageQueueEventSubscriptionDestinationProperties.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StorageQueueEventSubscriptionDestinationProperties.json.cs new file mode 100644 index 000000000000..8b057c03741a --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StorageQueueEventSubscriptionDestinationProperties.json.cs @@ -0,0 +1,113 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// The properties for a storage queue destination. + public partial class StorageQueueEventSubscriptionDestinationProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageQueueEventSubscriptionDestinationProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageQueueEventSubscriptionDestinationProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStorageQueueEventSubscriptionDestinationProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new StorageQueueEventSubscriptionDestinationProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal StorageQueueEventSubscriptionDestinationProperties(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_resourceId = If( json?.PropertyT("resourceId"), out var __jsonResourceId) ? (string)__jsonResourceId : (string)ResourceId;} + {_queueName = If( json?.PropertyT("queueName"), out var __jsonQueueName) ? (string)__jsonQueueName : (string)QueueName;} + {_queueMessageTimeToLiveInSecond = If( json?.PropertyT("queueMessageTimeToLiveInSeconds"), out var __jsonQueueMessageTimeToLiveInSeconds) ? (long?)__jsonQueueMessageTimeToLiveInSeconds : QueueMessageTimeToLiveInSecond;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._resourceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._resourceId.ToString()) : null, "resourceId" ,container.Add ); + AddIf( null != (((object)this._queueName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._queueName.ToString()) : null, "queueName" ,container.Add ); + AddIf( null != this._queueMessageTimeToLiveInSecond ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNumber((long)this._queueMessageTimeToLiveInSecond) : null, "queueMessageTimeToLiveInSeconds" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringBeginsWithAdvancedFilter.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringBeginsWithAdvancedFilter.PowerShell.cs new file mode 100644 index 000000000000..9d0318964703 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringBeginsWithAdvancedFilter.PowerShell.cs @@ -0,0 +1,160 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// StringBeginsWith Advanced Filter. + [System.ComponentModel.TypeConverter(typeof(StringBeginsWithAdvancedFilterTypeConverter))] + public partial class StringBeginsWithAdvancedFilter + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringBeginsWithAdvancedFilter DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new StringBeginsWithAdvancedFilter(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringBeginsWithAdvancedFilter DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new StringBeginsWithAdvancedFilter(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringBeginsWithAdvancedFilter FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal StringBeginsWithAdvancedFilter(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringBeginsWithAdvancedFilterInternal)this).Value = (string[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringBeginsWithAdvancedFilterInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("OperatorType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).OperatorType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType) content.GetValueForProperty("OperatorType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).OperatorType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType.CreateFrom); + } + if (content.Contains("Key")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).Key = (string) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).Key, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal StringBeginsWithAdvancedFilter(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringBeginsWithAdvancedFilterInternal)this).Value = (string[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringBeginsWithAdvancedFilterInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("OperatorType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).OperatorType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType) content.GetValueForProperty("OperatorType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).OperatorType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType.CreateFrom); + } + if (content.Contains("Key")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).Key = (string) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).Key, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// StringBeginsWith Advanced Filter. + [System.ComponentModel.TypeConverter(typeof(StringBeginsWithAdvancedFilterTypeConverter))] + public partial interface IStringBeginsWithAdvancedFilter + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringBeginsWithAdvancedFilter.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringBeginsWithAdvancedFilter.TypeConverter.cs new file mode 100644 index 000000000000..db1725e56546 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringBeginsWithAdvancedFilter.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class StringBeginsWithAdvancedFilterTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringBeginsWithAdvancedFilter ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringBeginsWithAdvancedFilter).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return StringBeginsWithAdvancedFilter.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return StringBeginsWithAdvancedFilter.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return StringBeginsWithAdvancedFilter.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringBeginsWithAdvancedFilter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringBeginsWithAdvancedFilter.cs new file mode 100644 index 000000000000..2ef2885dbacc --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringBeginsWithAdvancedFilter.cs @@ -0,0 +1,80 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// StringBeginsWith Advanced Filter. + public partial class StringBeginsWithAdvancedFilter : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringBeginsWithAdvancedFilter, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringBeginsWithAdvancedFilterInternal, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter __advancedFilter = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.AdvancedFilter(); + + /// The field/property in the event based on which you want to filter. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public string Key { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)__advancedFilter).Key; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)__advancedFilter).Key = value ?? null; } + + /// + /// The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType OperatorType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)__advancedFilter).OperatorType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)__advancedFilter).OperatorType = value ; } + + /// Backing field for property. + private string[] _value; + + /// The set of filter values. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public StringBeginsWithAdvancedFilter() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__advancedFilter), __advancedFilter); + await eventListener.AssertObjectIsValid(nameof(__advancedFilter), __advancedFilter); + } + } + /// StringBeginsWith Advanced Filter. + public partial interface IStringBeginsWithAdvancedFilter : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter + { + /// The set of filter values. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The set of filter values.", + SerializedName = @"values", + PossibleTypes = new [] { typeof(string) })] + string[] Value { get; set; } + + } + /// StringBeginsWith Advanced Filter. + internal partial interface IStringBeginsWithAdvancedFilterInternal : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal + { + /// The set of filter values. + string[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringBeginsWithAdvancedFilter.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringBeginsWithAdvancedFilter.json.cs new file mode 100644 index 000000000000..227d8e93644c --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringBeginsWithAdvancedFilter.json.cs @@ -0,0 +1,116 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// StringBeginsWith Advanced Filter. + public partial class StringBeginsWithAdvancedFilter + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringBeginsWithAdvancedFilter. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringBeginsWithAdvancedFilter. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringBeginsWithAdvancedFilter FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new StringBeginsWithAdvancedFilter(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal StringBeginsWithAdvancedFilter(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __advancedFilter = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.AdvancedFilter(json); + {_value = If( json?.PropertyT("values"), out var __jsonValues) ? If( __jsonValues as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Value;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __advancedFilter?.ToJson(container, serializationMode); + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("values",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringContainsAdvancedFilter.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringContainsAdvancedFilter.PowerShell.cs new file mode 100644 index 000000000000..3605b2d25b61 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringContainsAdvancedFilter.PowerShell.cs @@ -0,0 +1,160 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// StringContains Advanced Filter. + [System.ComponentModel.TypeConverter(typeof(StringContainsAdvancedFilterTypeConverter))] + public partial class StringContainsAdvancedFilter + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringContainsAdvancedFilter DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new StringContainsAdvancedFilter(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringContainsAdvancedFilter DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new StringContainsAdvancedFilter(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringContainsAdvancedFilter FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal StringContainsAdvancedFilter(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringContainsAdvancedFilterInternal)this).Value = (string[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringContainsAdvancedFilterInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("OperatorType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).OperatorType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType) content.GetValueForProperty("OperatorType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).OperatorType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType.CreateFrom); + } + if (content.Contains("Key")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).Key = (string) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).Key, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal StringContainsAdvancedFilter(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringContainsAdvancedFilterInternal)this).Value = (string[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringContainsAdvancedFilterInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("OperatorType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).OperatorType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType) content.GetValueForProperty("OperatorType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).OperatorType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType.CreateFrom); + } + if (content.Contains("Key")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).Key = (string) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).Key, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// StringContains Advanced Filter. + [System.ComponentModel.TypeConverter(typeof(StringContainsAdvancedFilterTypeConverter))] + public partial interface IStringContainsAdvancedFilter + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringContainsAdvancedFilter.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringContainsAdvancedFilter.TypeConverter.cs new file mode 100644 index 000000000000..7e62f51c603a --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringContainsAdvancedFilter.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class StringContainsAdvancedFilterTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringContainsAdvancedFilter ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringContainsAdvancedFilter).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return StringContainsAdvancedFilter.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return StringContainsAdvancedFilter.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return StringContainsAdvancedFilter.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringContainsAdvancedFilter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringContainsAdvancedFilter.cs new file mode 100644 index 000000000000..91a7c1c026bd --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringContainsAdvancedFilter.cs @@ -0,0 +1,80 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// StringContains Advanced Filter. + public partial class StringContainsAdvancedFilter : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringContainsAdvancedFilter, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringContainsAdvancedFilterInternal, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter __advancedFilter = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.AdvancedFilter(); + + /// The field/property in the event based on which you want to filter. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public string Key { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)__advancedFilter).Key; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)__advancedFilter).Key = value ?? null; } + + /// + /// The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType OperatorType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)__advancedFilter).OperatorType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)__advancedFilter).OperatorType = value ; } + + /// Backing field for property. + private string[] _value; + + /// The set of filter values. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public StringContainsAdvancedFilter() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__advancedFilter), __advancedFilter); + await eventListener.AssertObjectIsValid(nameof(__advancedFilter), __advancedFilter); + } + } + /// StringContains Advanced Filter. + public partial interface IStringContainsAdvancedFilter : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter + { + /// The set of filter values. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The set of filter values.", + SerializedName = @"values", + PossibleTypes = new [] { typeof(string) })] + string[] Value { get; set; } + + } + /// StringContains Advanced Filter. + internal partial interface IStringContainsAdvancedFilterInternal : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal + { + /// The set of filter values. + string[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringContainsAdvancedFilter.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringContainsAdvancedFilter.json.cs new file mode 100644 index 000000000000..29eafaebeae5 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringContainsAdvancedFilter.json.cs @@ -0,0 +1,116 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// StringContains Advanced Filter. + public partial class StringContainsAdvancedFilter + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringContainsAdvancedFilter. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringContainsAdvancedFilter. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringContainsAdvancedFilter FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new StringContainsAdvancedFilter(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal StringContainsAdvancedFilter(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __advancedFilter = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.AdvancedFilter(json); + {_value = If( json?.PropertyT("values"), out var __jsonValues) ? If( __jsonValues as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Value;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __advancedFilter?.ToJson(container, serializationMode); + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("values",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringEndsWithAdvancedFilter.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringEndsWithAdvancedFilter.PowerShell.cs new file mode 100644 index 000000000000..c38ad19a9e43 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringEndsWithAdvancedFilter.PowerShell.cs @@ -0,0 +1,160 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// StringEndsWith Advanced Filter. + [System.ComponentModel.TypeConverter(typeof(StringEndsWithAdvancedFilterTypeConverter))] + public partial class StringEndsWithAdvancedFilter + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringEndsWithAdvancedFilter DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new StringEndsWithAdvancedFilter(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringEndsWithAdvancedFilter DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new StringEndsWithAdvancedFilter(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringEndsWithAdvancedFilter FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal StringEndsWithAdvancedFilter(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringEndsWithAdvancedFilterInternal)this).Value = (string[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringEndsWithAdvancedFilterInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("OperatorType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).OperatorType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType) content.GetValueForProperty("OperatorType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).OperatorType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType.CreateFrom); + } + if (content.Contains("Key")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).Key = (string) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).Key, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal StringEndsWithAdvancedFilter(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringEndsWithAdvancedFilterInternal)this).Value = (string[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringEndsWithAdvancedFilterInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("OperatorType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).OperatorType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType) content.GetValueForProperty("OperatorType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).OperatorType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType.CreateFrom); + } + if (content.Contains("Key")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).Key = (string) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).Key, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// StringEndsWith Advanced Filter. + [System.ComponentModel.TypeConverter(typeof(StringEndsWithAdvancedFilterTypeConverter))] + public partial interface IStringEndsWithAdvancedFilter + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringEndsWithAdvancedFilter.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringEndsWithAdvancedFilter.TypeConverter.cs new file mode 100644 index 000000000000..2dd350fbe1fe --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringEndsWithAdvancedFilter.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class StringEndsWithAdvancedFilterTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringEndsWithAdvancedFilter ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringEndsWithAdvancedFilter).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return StringEndsWithAdvancedFilter.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return StringEndsWithAdvancedFilter.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return StringEndsWithAdvancedFilter.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringEndsWithAdvancedFilter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringEndsWithAdvancedFilter.cs new file mode 100644 index 000000000000..364d43965e4b --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringEndsWithAdvancedFilter.cs @@ -0,0 +1,80 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// StringEndsWith Advanced Filter. + public partial class StringEndsWithAdvancedFilter : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringEndsWithAdvancedFilter, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringEndsWithAdvancedFilterInternal, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter __advancedFilter = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.AdvancedFilter(); + + /// The field/property in the event based on which you want to filter. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public string Key { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)__advancedFilter).Key; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)__advancedFilter).Key = value ?? null; } + + /// + /// The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType OperatorType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)__advancedFilter).OperatorType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)__advancedFilter).OperatorType = value ; } + + /// Backing field for property. + private string[] _value; + + /// The set of filter values. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public StringEndsWithAdvancedFilter() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__advancedFilter), __advancedFilter); + await eventListener.AssertObjectIsValid(nameof(__advancedFilter), __advancedFilter); + } + } + /// StringEndsWith Advanced Filter. + public partial interface IStringEndsWithAdvancedFilter : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter + { + /// The set of filter values. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The set of filter values.", + SerializedName = @"values", + PossibleTypes = new [] { typeof(string) })] + string[] Value { get; set; } + + } + /// StringEndsWith Advanced Filter. + internal partial interface IStringEndsWithAdvancedFilterInternal : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal + { + /// The set of filter values. + string[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringEndsWithAdvancedFilter.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringEndsWithAdvancedFilter.json.cs new file mode 100644 index 000000000000..41abe2a6878e --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringEndsWithAdvancedFilter.json.cs @@ -0,0 +1,116 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// StringEndsWith Advanced Filter. + public partial class StringEndsWithAdvancedFilter + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringEndsWithAdvancedFilter. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringEndsWithAdvancedFilter. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringEndsWithAdvancedFilter FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new StringEndsWithAdvancedFilter(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal StringEndsWithAdvancedFilter(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __advancedFilter = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.AdvancedFilter(json); + {_value = If( json?.PropertyT("values"), out var __jsonValues) ? If( __jsonValues as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Value;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __advancedFilter?.ToJson(container, serializationMode); + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("values",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringInAdvancedFilter.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringInAdvancedFilter.PowerShell.cs new file mode 100644 index 000000000000..1b07354baabf --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringInAdvancedFilter.PowerShell.cs @@ -0,0 +1,160 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// StringIn Advanced Filter. + [System.ComponentModel.TypeConverter(typeof(StringInAdvancedFilterTypeConverter))] + public partial class StringInAdvancedFilter + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringInAdvancedFilter DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new StringInAdvancedFilter(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringInAdvancedFilter DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new StringInAdvancedFilter(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringInAdvancedFilter FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal StringInAdvancedFilter(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringInAdvancedFilterInternal)this).Value = (string[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringInAdvancedFilterInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("OperatorType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).OperatorType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType) content.GetValueForProperty("OperatorType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).OperatorType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType.CreateFrom); + } + if (content.Contains("Key")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).Key = (string) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).Key, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal StringInAdvancedFilter(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringInAdvancedFilterInternal)this).Value = (string[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringInAdvancedFilterInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("OperatorType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).OperatorType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType) content.GetValueForProperty("OperatorType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).OperatorType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType.CreateFrom); + } + if (content.Contains("Key")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).Key = (string) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).Key, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// StringIn Advanced Filter. + [System.ComponentModel.TypeConverter(typeof(StringInAdvancedFilterTypeConverter))] + public partial interface IStringInAdvancedFilter + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringInAdvancedFilter.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringInAdvancedFilter.TypeConverter.cs new file mode 100644 index 000000000000..805e301312f4 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringInAdvancedFilter.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class StringInAdvancedFilterTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringInAdvancedFilter ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringInAdvancedFilter).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return StringInAdvancedFilter.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return StringInAdvancedFilter.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return StringInAdvancedFilter.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringInAdvancedFilter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringInAdvancedFilter.cs new file mode 100644 index 000000000000..7241588458ac --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringInAdvancedFilter.cs @@ -0,0 +1,80 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// StringIn Advanced Filter. + public partial class StringInAdvancedFilter : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringInAdvancedFilter, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringInAdvancedFilterInternal, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter __advancedFilter = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.AdvancedFilter(); + + /// The field/property in the event based on which you want to filter. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public string Key { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)__advancedFilter).Key; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)__advancedFilter).Key = value ?? null; } + + /// + /// The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType OperatorType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)__advancedFilter).OperatorType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)__advancedFilter).OperatorType = value ; } + + /// Backing field for property. + private string[] _value; + + /// The set of filter values. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public StringInAdvancedFilter() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__advancedFilter), __advancedFilter); + await eventListener.AssertObjectIsValid(nameof(__advancedFilter), __advancedFilter); + } + } + /// StringIn Advanced Filter. + public partial interface IStringInAdvancedFilter : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter + { + /// The set of filter values. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The set of filter values.", + SerializedName = @"values", + PossibleTypes = new [] { typeof(string) })] + string[] Value { get; set; } + + } + /// StringIn Advanced Filter. + internal partial interface IStringInAdvancedFilterInternal : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal + { + /// The set of filter values. + string[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringInAdvancedFilter.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringInAdvancedFilter.json.cs new file mode 100644 index 000000000000..39f875ca70f2 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringInAdvancedFilter.json.cs @@ -0,0 +1,116 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// StringIn Advanced Filter. + public partial class StringInAdvancedFilter + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringInAdvancedFilter. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringInAdvancedFilter. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringInAdvancedFilter FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new StringInAdvancedFilter(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal StringInAdvancedFilter(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __advancedFilter = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.AdvancedFilter(json); + {_value = If( json?.PropertyT("values"), out var __jsonValues) ? If( __jsonValues as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Value;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __advancedFilter?.ToJson(container, serializationMode); + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("values",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringNotBeginsWithAdvancedFilter.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringNotBeginsWithAdvancedFilter.PowerShell.cs new file mode 100644 index 000000000000..ba837e718313 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringNotBeginsWithAdvancedFilter.PowerShell.cs @@ -0,0 +1,160 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// StringNotBeginsWith Advanced Filter. + [System.ComponentModel.TypeConverter(typeof(StringNotBeginsWithAdvancedFilterTypeConverter))] + public partial class StringNotBeginsWithAdvancedFilter + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringNotBeginsWithAdvancedFilter DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new StringNotBeginsWithAdvancedFilter(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringNotBeginsWithAdvancedFilter DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new StringNotBeginsWithAdvancedFilter(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringNotBeginsWithAdvancedFilter FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal StringNotBeginsWithAdvancedFilter(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringNotBeginsWithAdvancedFilterInternal)this).Value = (string[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringNotBeginsWithAdvancedFilterInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("OperatorType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).OperatorType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType) content.GetValueForProperty("OperatorType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).OperatorType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType.CreateFrom); + } + if (content.Contains("Key")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).Key = (string) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).Key, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal StringNotBeginsWithAdvancedFilter(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringNotBeginsWithAdvancedFilterInternal)this).Value = (string[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringNotBeginsWithAdvancedFilterInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("OperatorType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).OperatorType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType) content.GetValueForProperty("OperatorType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).OperatorType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType.CreateFrom); + } + if (content.Contains("Key")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).Key = (string) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).Key, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// StringNotBeginsWith Advanced Filter. + [System.ComponentModel.TypeConverter(typeof(StringNotBeginsWithAdvancedFilterTypeConverter))] + public partial interface IStringNotBeginsWithAdvancedFilter + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringNotBeginsWithAdvancedFilter.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringNotBeginsWithAdvancedFilter.TypeConverter.cs new file mode 100644 index 000000000000..a082fa227e64 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringNotBeginsWithAdvancedFilter.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class StringNotBeginsWithAdvancedFilterTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringNotBeginsWithAdvancedFilter ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringNotBeginsWithAdvancedFilter).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return StringNotBeginsWithAdvancedFilter.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return StringNotBeginsWithAdvancedFilter.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return StringNotBeginsWithAdvancedFilter.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringNotBeginsWithAdvancedFilter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringNotBeginsWithAdvancedFilter.cs new file mode 100644 index 000000000000..360775f87b30 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringNotBeginsWithAdvancedFilter.cs @@ -0,0 +1,80 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// StringNotBeginsWith Advanced Filter. + public partial class StringNotBeginsWithAdvancedFilter : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringNotBeginsWithAdvancedFilter, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringNotBeginsWithAdvancedFilterInternal, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter __advancedFilter = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.AdvancedFilter(); + + /// The field/property in the event based on which you want to filter. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public string Key { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)__advancedFilter).Key; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)__advancedFilter).Key = value ?? null; } + + /// + /// The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType OperatorType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)__advancedFilter).OperatorType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)__advancedFilter).OperatorType = value ; } + + /// Backing field for property. + private string[] _value; + + /// The set of filter values. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public StringNotBeginsWithAdvancedFilter() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__advancedFilter), __advancedFilter); + await eventListener.AssertObjectIsValid(nameof(__advancedFilter), __advancedFilter); + } + } + /// StringNotBeginsWith Advanced Filter. + public partial interface IStringNotBeginsWithAdvancedFilter : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter + { + /// The set of filter values. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The set of filter values.", + SerializedName = @"values", + PossibleTypes = new [] { typeof(string) })] + string[] Value { get; set; } + + } + /// StringNotBeginsWith Advanced Filter. + internal partial interface IStringNotBeginsWithAdvancedFilterInternal : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal + { + /// The set of filter values. + string[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringNotBeginsWithAdvancedFilter.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringNotBeginsWithAdvancedFilter.json.cs new file mode 100644 index 000000000000..ac5040361013 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringNotBeginsWithAdvancedFilter.json.cs @@ -0,0 +1,116 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// StringNotBeginsWith Advanced Filter. + public partial class StringNotBeginsWithAdvancedFilter + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringNotBeginsWithAdvancedFilter. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringNotBeginsWithAdvancedFilter. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringNotBeginsWithAdvancedFilter FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new StringNotBeginsWithAdvancedFilter(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal StringNotBeginsWithAdvancedFilter(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __advancedFilter = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.AdvancedFilter(json); + {_value = If( json?.PropertyT("values"), out var __jsonValues) ? If( __jsonValues as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Value;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __advancedFilter?.ToJson(container, serializationMode); + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("values",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringNotContainsAdvancedFilter.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringNotContainsAdvancedFilter.PowerShell.cs new file mode 100644 index 000000000000..262fc939462c --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringNotContainsAdvancedFilter.PowerShell.cs @@ -0,0 +1,160 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// StringNotContains Advanced Filter. + [System.ComponentModel.TypeConverter(typeof(StringNotContainsAdvancedFilterTypeConverter))] + public partial class StringNotContainsAdvancedFilter + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringNotContainsAdvancedFilter DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new StringNotContainsAdvancedFilter(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringNotContainsAdvancedFilter DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new StringNotContainsAdvancedFilter(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringNotContainsAdvancedFilter FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal StringNotContainsAdvancedFilter(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringNotContainsAdvancedFilterInternal)this).Value = (string[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringNotContainsAdvancedFilterInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("OperatorType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).OperatorType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType) content.GetValueForProperty("OperatorType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).OperatorType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType.CreateFrom); + } + if (content.Contains("Key")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).Key = (string) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).Key, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal StringNotContainsAdvancedFilter(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringNotContainsAdvancedFilterInternal)this).Value = (string[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringNotContainsAdvancedFilterInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("OperatorType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).OperatorType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType) content.GetValueForProperty("OperatorType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).OperatorType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType.CreateFrom); + } + if (content.Contains("Key")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).Key = (string) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).Key, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// StringNotContains Advanced Filter. + [System.ComponentModel.TypeConverter(typeof(StringNotContainsAdvancedFilterTypeConverter))] + public partial interface IStringNotContainsAdvancedFilter + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringNotContainsAdvancedFilter.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringNotContainsAdvancedFilter.TypeConverter.cs new file mode 100644 index 000000000000..9d80ae8d1b74 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringNotContainsAdvancedFilter.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class StringNotContainsAdvancedFilterTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringNotContainsAdvancedFilter ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringNotContainsAdvancedFilter).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return StringNotContainsAdvancedFilter.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return StringNotContainsAdvancedFilter.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return StringNotContainsAdvancedFilter.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringNotContainsAdvancedFilter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringNotContainsAdvancedFilter.cs new file mode 100644 index 000000000000..4f4e4fffc1db --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringNotContainsAdvancedFilter.cs @@ -0,0 +1,80 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// StringNotContains Advanced Filter. + public partial class StringNotContainsAdvancedFilter : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringNotContainsAdvancedFilter, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringNotContainsAdvancedFilterInternal, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter __advancedFilter = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.AdvancedFilter(); + + /// The field/property in the event based on which you want to filter. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public string Key { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)__advancedFilter).Key; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)__advancedFilter).Key = value ?? null; } + + /// + /// The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType OperatorType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)__advancedFilter).OperatorType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)__advancedFilter).OperatorType = value ; } + + /// Backing field for property. + private string[] _value; + + /// The set of filter values. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public StringNotContainsAdvancedFilter() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__advancedFilter), __advancedFilter); + await eventListener.AssertObjectIsValid(nameof(__advancedFilter), __advancedFilter); + } + } + /// StringNotContains Advanced Filter. + public partial interface IStringNotContainsAdvancedFilter : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter + { + /// The set of filter values. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The set of filter values.", + SerializedName = @"values", + PossibleTypes = new [] { typeof(string) })] + string[] Value { get; set; } + + } + /// StringNotContains Advanced Filter. + internal partial interface IStringNotContainsAdvancedFilterInternal : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal + { + /// The set of filter values. + string[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringNotContainsAdvancedFilter.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringNotContainsAdvancedFilter.json.cs new file mode 100644 index 000000000000..ec41a29d55f9 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringNotContainsAdvancedFilter.json.cs @@ -0,0 +1,116 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// StringNotContains Advanced Filter. + public partial class StringNotContainsAdvancedFilter + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringNotContainsAdvancedFilter. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringNotContainsAdvancedFilter. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringNotContainsAdvancedFilter FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new StringNotContainsAdvancedFilter(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal StringNotContainsAdvancedFilter(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __advancedFilter = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.AdvancedFilter(json); + {_value = If( json?.PropertyT("values"), out var __jsonValues) ? If( __jsonValues as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Value;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __advancedFilter?.ToJson(container, serializationMode); + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("values",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringNotEndsWithAdvancedFilter.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringNotEndsWithAdvancedFilter.PowerShell.cs new file mode 100644 index 000000000000..111d8b7956d1 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringNotEndsWithAdvancedFilter.PowerShell.cs @@ -0,0 +1,160 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// StringNotEndsWith Advanced Filter. + [System.ComponentModel.TypeConverter(typeof(StringNotEndsWithAdvancedFilterTypeConverter))] + public partial class StringNotEndsWithAdvancedFilter + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringNotEndsWithAdvancedFilter DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new StringNotEndsWithAdvancedFilter(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringNotEndsWithAdvancedFilter DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new StringNotEndsWithAdvancedFilter(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringNotEndsWithAdvancedFilter FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal StringNotEndsWithAdvancedFilter(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringNotEndsWithAdvancedFilterInternal)this).Value = (string[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringNotEndsWithAdvancedFilterInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("OperatorType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).OperatorType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType) content.GetValueForProperty("OperatorType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).OperatorType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType.CreateFrom); + } + if (content.Contains("Key")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).Key = (string) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).Key, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal StringNotEndsWithAdvancedFilter(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringNotEndsWithAdvancedFilterInternal)this).Value = (string[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringNotEndsWithAdvancedFilterInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("OperatorType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).OperatorType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType) content.GetValueForProperty("OperatorType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).OperatorType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType.CreateFrom); + } + if (content.Contains("Key")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).Key = (string) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).Key, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// StringNotEndsWith Advanced Filter. + [System.ComponentModel.TypeConverter(typeof(StringNotEndsWithAdvancedFilterTypeConverter))] + public partial interface IStringNotEndsWithAdvancedFilter + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringNotEndsWithAdvancedFilter.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringNotEndsWithAdvancedFilter.TypeConverter.cs new file mode 100644 index 000000000000..c79e31c52258 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringNotEndsWithAdvancedFilter.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class StringNotEndsWithAdvancedFilterTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringNotEndsWithAdvancedFilter ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringNotEndsWithAdvancedFilter).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return StringNotEndsWithAdvancedFilter.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return StringNotEndsWithAdvancedFilter.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return StringNotEndsWithAdvancedFilter.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringNotEndsWithAdvancedFilter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringNotEndsWithAdvancedFilter.cs new file mode 100644 index 000000000000..6d19a0b77214 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringNotEndsWithAdvancedFilter.cs @@ -0,0 +1,80 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// StringNotEndsWith Advanced Filter. + public partial class StringNotEndsWithAdvancedFilter : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringNotEndsWithAdvancedFilter, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringNotEndsWithAdvancedFilterInternal, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter __advancedFilter = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.AdvancedFilter(); + + /// The field/property in the event based on which you want to filter. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public string Key { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)__advancedFilter).Key; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)__advancedFilter).Key = value ?? null; } + + /// + /// The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType OperatorType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)__advancedFilter).OperatorType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)__advancedFilter).OperatorType = value ; } + + /// Backing field for property. + private string[] _value; + + /// The set of filter values. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public StringNotEndsWithAdvancedFilter() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__advancedFilter), __advancedFilter); + await eventListener.AssertObjectIsValid(nameof(__advancedFilter), __advancedFilter); + } + } + /// StringNotEndsWith Advanced Filter. + public partial interface IStringNotEndsWithAdvancedFilter : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter + { + /// The set of filter values. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The set of filter values.", + SerializedName = @"values", + PossibleTypes = new [] { typeof(string) })] + string[] Value { get; set; } + + } + /// StringNotEndsWith Advanced Filter. + internal partial interface IStringNotEndsWithAdvancedFilterInternal : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal + { + /// The set of filter values. + string[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringNotEndsWithAdvancedFilter.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringNotEndsWithAdvancedFilter.json.cs new file mode 100644 index 000000000000..395d3da03839 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringNotEndsWithAdvancedFilter.json.cs @@ -0,0 +1,116 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// StringNotEndsWith Advanced Filter. + public partial class StringNotEndsWithAdvancedFilter + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringNotEndsWithAdvancedFilter. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringNotEndsWithAdvancedFilter. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringNotEndsWithAdvancedFilter FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new StringNotEndsWithAdvancedFilter(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal StringNotEndsWithAdvancedFilter(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __advancedFilter = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.AdvancedFilter(json); + {_value = If( json?.PropertyT("values"), out var __jsonValues) ? If( __jsonValues as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Value;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __advancedFilter?.ToJson(container, serializationMode); + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("values",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringNotInAdvancedFilter.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringNotInAdvancedFilter.PowerShell.cs new file mode 100644 index 000000000000..c1288eaae2be --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringNotInAdvancedFilter.PowerShell.cs @@ -0,0 +1,160 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// StringNotIn Advanced Filter. + [System.ComponentModel.TypeConverter(typeof(StringNotInAdvancedFilterTypeConverter))] + public partial class StringNotInAdvancedFilter + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringNotInAdvancedFilter DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new StringNotInAdvancedFilter(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringNotInAdvancedFilter DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new StringNotInAdvancedFilter(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringNotInAdvancedFilter FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal StringNotInAdvancedFilter(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringNotInAdvancedFilterInternal)this).Value = (string[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringNotInAdvancedFilterInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("OperatorType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).OperatorType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType) content.GetValueForProperty("OperatorType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).OperatorType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType.CreateFrom); + } + if (content.Contains("Key")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).Key = (string) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).Key, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal StringNotInAdvancedFilter(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringNotInAdvancedFilterInternal)this).Value = (string[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringNotInAdvancedFilterInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("OperatorType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).OperatorType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType) content.GetValueForProperty("OperatorType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).OperatorType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType.CreateFrom); + } + if (content.Contains("Key")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).Key = (string) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)this).Key, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// StringNotIn Advanced Filter. + [System.ComponentModel.TypeConverter(typeof(StringNotInAdvancedFilterTypeConverter))] + public partial interface IStringNotInAdvancedFilter + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringNotInAdvancedFilter.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringNotInAdvancedFilter.TypeConverter.cs new file mode 100644 index 000000000000..ebe74991387c --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringNotInAdvancedFilter.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class StringNotInAdvancedFilterTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringNotInAdvancedFilter ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringNotInAdvancedFilter).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return StringNotInAdvancedFilter.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return StringNotInAdvancedFilter.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return StringNotInAdvancedFilter.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringNotInAdvancedFilter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringNotInAdvancedFilter.cs new file mode 100644 index 000000000000..61a2436bd094 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringNotInAdvancedFilter.cs @@ -0,0 +1,80 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// StringNotIn Advanced Filter. + public partial class StringNotInAdvancedFilter : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringNotInAdvancedFilter, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringNotInAdvancedFilterInternal, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter __advancedFilter = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.AdvancedFilter(); + + /// The field/property in the event based on which you want to filter. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public string Key { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)__advancedFilter).Key; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)__advancedFilter).Key = value ?? null; } + + /// + /// The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType OperatorType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)__advancedFilter).OperatorType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal)__advancedFilter).OperatorType = value ; } + + /// Backing field for property. + private string[] _value; + + /// The set of filter values. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public StringNotInAdvancedFilter() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__advancedFilter), __advancedFilter); + await eventListener.AssertObjectIsValid(nameof(__advancedFilter), __advancedFilter); + } + } + /// StringNotIn Advanced Filter. + public partial interface IStringNotInAdvancedFilter : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter + { + /// The set of filter values. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The set of filter values.", + SerializedName = @"values", + PossibleTypes = new [] { typeof(string) })] + string[] Value { get; set; } + + } + /// StringNotIn Advanced Filter. + internal partial interface IStringNotInAdvancedFilterInternal : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilterInternal + { + /// The set of filter values. + string[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringNotInAdvancedFilter.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringNotInAdvancedFilter.json.cs new file mode 100644 index 000000000000..43707d5c9d78 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/StringNotInAdvancedFilter.json.cs @@ -0,0 +1,116 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// StringNotIn Advanced Filter. + public partial class StringNotInAdvancedFilter + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringNotInAdvancedFilter. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringNotInAdvancedFilter. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStringNotInAdvancedFilter FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new StringNotInAdvancedFilter(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal StringNotInAdvancedFilter(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __advancedFilter = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.AdvancedFilter(json); + {_value = If( json?.PropertyT("values"), out var __jsonValues) ? If( __jsonValues as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Value;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __advancedFilter?.ToJson(container, serializationMode); + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("values",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/SystemTopic.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/SystemTopic.PowerShell.cs new file mode 100644 index 000000000000..9136bb6366ba --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/SystemTopic.PowerShell.cs @@ -0,0 +1,310 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// EventGrid System Topic. + [System.ComponentModel.TypeConverter(typeof(SystemTopicTypeConverter))] + public partial class SystemTopic + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopic DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new SystemTopic(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopic DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new SystemTopic(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopic FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal SystemTopic(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.SystemTopicPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Identity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfo) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IdentityInfoTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.TrackedResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("IdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicInternal)this).IdentityType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType?) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicInternal)this).IdentityType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType.CreateFrom); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceProvisioningState.CreateFrom); + } + if (content.Contains("Source")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicInternal)this).Source = (string) content.GetValueForProperty("Source",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicInternal)this).Source, global::System.Convert.ToString); + } + if (content.Contains("TopicType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicInternal)this).TopicType = (string) content.GetValueForProperty("TopicType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicInternal)this).TopicType, global::System.Convert.ToString); + } + if (content.Contains("MetricResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicInternal)this).MetricResourceId = (string) content.GetValueForProperty("MetricResourceId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicInternal)this).MetricResourceId, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("IdentityPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicInternal)this).IdentityPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("IdentityTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicInternal)this).IdentityTenantId, global::System.Convert.ToString); + } + if (content.Contains("IdentityUserAssignedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IdentityInfoUserAssignedIdentitiesTypeConverter.ConvertFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal SystemTopic(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.SystemTopicPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Identity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfo) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IdentityInfoTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.TrackedResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("IdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicInternal)this).IdentityType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType?) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicInternal)this).IdentityType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType.CreateFrom); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceProvisioningState.CreateFrom); + } + if (content.Contains("Source")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicInternal)this).Source = (string) content.GetValueForProperty("Source",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicInternal)this).Source, global::System.Convert.ToString); + } + if (content.Contains("TopicType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicInternal)this).TopicType = (string) content.GetValueForProperty("TopicType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicInternal)this).TopicType, global::System.Convert.ToString); + } + if (content.Contains("MetricResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicInternal)this).MetricResourceId = (string) content.GetValueForProperty("MetricResourceId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicInternal)this).MetricResourceId, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("IdentityPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicInternal)this).IdentityPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("IdentityTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicInternal)this).IdentityTenantId, global::System.Convert.ToString); + } + if (content.Contains("IdentityUserAssignedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IdentityInfoUserAssignedIdentitiesTypeConverter.ConvertFrom); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// EventGrid System Topic. + [System.ComponentModel.TypeConverter(typeof(SystemTopicTypeConverter))] + public partial interface ISystemTopic + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/SystemTopic.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/SystemTopic.TypeConverter.cs new file mode 100644 index 000000000000..6f956c8eb4a0 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/SystemTopic.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class SystemTopicTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopic ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopic).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return SystemTopic.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return SystemTopic.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return SystemTopic.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/SystemTopic.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/SystemTopic.cs new file mode 100644 index 000000000000..360128c72fc2 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/SystemTopic.cs @@ -0,0 +1,346 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// EventGrid System Topic. + public partial class SystemTopic : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopic, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicInternal, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResource __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.TrackedResource(); + + /// Fully qualified identifier of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__trackedResource).Id; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfo _identity; + + /// Identity information for the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfo Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IdentityInfo()); set => this._identity = value; } + + /// The principal ID of resource identity. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoInternal)Identity).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoInternal)Identity).PrincipalId = value ?? null; } + + /// The tenant ID of resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoInternal)Identity).TenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoInternal)Identity).TenantId = value ?? null; } + + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType? IdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoInternal)Identity).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoInternal)Identity).Type = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType)""); } + + /// + /// The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource + /// ids in the form: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + /// This property is currently not used and reserved for future usage. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoInternal)Identity).UserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoInternal)Identity).UserAssignedIdentity = value ?? null /* model class */; } + + /// Location of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal)__trackedResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal)__trackedResource).Location = value ; } + + /// Metric resource id for the system topic. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string MetricResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicPropertiesInternal)Property).MetricResourceId; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__trackedResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__trackedResource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__trackedResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__trackedResource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__trackedResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__trackedResource).Type = value; } + + /// Internal Acessors for Identity + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfo Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicInternal.Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IdentityInfo()); set { {_identity = value;} } } + + /// Internal Acessors for MetricResourceId + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicInternal.MetricResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicPropertiesInternal)Property).MetricResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicPropertiesInternal)Property).MetricResourceId = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicProperties Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.SystemTopicProperties()); set { {_property = value;} } } + + /// Internal Acessors for ProvisioningState + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicPropertiesInternal)Property).ProvisioningState = value; } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.SystemData()); set { {_systemData = value;} } } + + /// Name of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__trackedResource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicProperties _property; + + /// Properties of the system topic. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.SystemTopicProperties()); set => this._property = value; } + + /// Provisioning state of the system topic. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceProvisioningState? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicPropertiesInternal)Property).ProvisioningState; } + + /// Source for the system topic. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string Source { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicPropertiesInternal)Property).Source; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicPropertiesInternal)Property).Source = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData _systemData; + + /// The system metadata relating to System Topic resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.SystemData()); } + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).CreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType)""); } + + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType)""); } + + /// Tags of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal)__trackedResource).Tag = value ?? null /* model class */; } + + /// TopicType for the system topic. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string TopicType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicPropertiesInternal)Property).TopicType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicPropertiesInternal)Property).TopicType = value ?? null; } + + /// Type of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__trackedResource).Type; } + + /// Creates an new instance. + public SystemTopic() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__trackedResource), __trackedResource); + await eventListener.AssertObjectIsValid(nameof(__trackedResource), __trackedResource); + } + } + /// EventGrid System Topic. + public partial interface ISystemTopic : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResource + { + /// The principal ID of resource identity. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The principal ID of resource identity.", + SerializedName = @"principalId", + PossibleTypes = new [] { typeof(string) })] + string IdentityPrincipalId { get; set; } + /// The tenant ID of resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The tenant ID of resource.", + SerializedName = @"tenantId", + PossibleTypes = new [] { typeof(string) })] + string IdentityTenantId { get; set; } + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType? IdentityType { get; set; } + /// + /// The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource + /// ids in the form: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + /// This property is currently not used and reserved for future usage. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + This property is currently not used and reserved for future usage.", + SerializedName = @"userAssignedIdentities", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } + /// Metric resource id for the system topic. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Metric resource id for the system topic.", + SerializedName = @"metricResourceId", + PossibleTypes = new [] { typeof(string) })] + string MetricResourceId { get; } + /// Provisioning state of the system topic. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Provisioning state of the system topic.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceProvisioningState) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceProvisioningState? ProvisioningState { get; } + /// Source for the system topic. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Source for the system topic.", + SerializedName = @"source", + PossibleTypes = new [] { typeof(string) })] + string Source { get; set; } + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timestamp of resource creation (UTC).", + SerializedName = @"createdAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SystemDataCreatedAt { get; set; } + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identity that created the resource.", + SerializedName = @"createdBy", + PossibleTypes = new [] { typeof(string) })] + string SystemDataCreatedBy { get; set; } + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of identity that created the resource.", + SerializedName = @"createdByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType? SystemDataCreatedByType { get; set; } + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timestamp of resource last modification (UTC)", + SerializedName = @"lastModifiedAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SystemDataLastModifiedAt { get; set; } + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identity that last modified the resource.", + SerializedName = @"lastModifiedBy", + PossibleTypes = new [] { typeof(string) })] + string SystemDataLastModifiedBy { get; set; } + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of identity that last modified the resource.", + SerializedName = @"lastModifiedByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + /// TopicType for the system topic. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"TopicType for the system topic.", + SerializedName = @"topicType", + PossibleTypes = new [] { typeof(string) })] + string TopicType { get; set; } + + } + /// EventGrid System Topic. + internal partial interface ISystemTopicInternal : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal + { + /// Identity information for the resource. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfo Identity { get; set; } + /// The principal ID of resource identity. + string IdentityPrincipalId { get; set; } + /// The tenant ID of resource. + string IdentityTenantId { get; set; } + /// + /// 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. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType? IdentityType { get; set; } + /// + /// The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource + /// ids in the form: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + /// This property is currently not used and reserved for future usage. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } + /// Metric resource id for the system topic. + string MetricResourceId { get; set; } + /// Properties of the system topic. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicProperties Property { get; set; } + /// Provisioning state of the system topic. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceProvisioningState? ProvisioningState { get; set; } + /// Source for the system topic. + string Source { get; set; } + /// The system metadata relating to System Topic resource. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData SystemData { get; set; } + /// The timestamp of resource creation (UTC). + global::System.DateTime? SystemDataCreatedAt { get; set; } + /// The identity that created the resource. + string SystemDataCreatedBy { get; set; } + /// The type of identity that created the resource. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType? SystemDataCreatedByType { get; set; } + /// The timestamp of resource last modification (UTC) + global::System.DateTime? SystemDataLastModifiedAt { get; set; } + /// The identity that last modified the resource. + string SystemDataLastModifiedBy { get; set; } + /// The type of identity that last modified the resource. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + /// TopicType for the system topic. + string TopicType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/SystemTopic.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/SystemTopic.json.cs new file mode 100644 index 000000000000..2baeab8b77d2 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/SystemTopic.json.cs @@ -0,0 +1,115 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// EventGrid System Topic. + public partial class SystemTopic + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopic. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopic. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopic FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new SystemTopic(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal SystemTopic(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.TrackedResource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.SystemTopicProperties.FromJson(__jsonProperties) : Property;} + {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.SystemData.FromJson(__jsonSystemData) : SystemData;} + {_identity = If( json?.PropertyT("identity"), out var __jsonIdentity) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IdentityInfo.FromJson(__jsonIdentity) : Identity;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __trackedResource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._systemData ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._systemData.ToJson(null,serializationMode) : null, "systemData" ,container.Add ); + } + AddIf( null != this._identity ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._identity.ToJson(null,serializationMode) : null, "identity" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/SystemTopicProperties.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/SystemTopicProperties.PowerShell.cs new file mode 100644 index 000000000000..0ffad9d90d55 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/SystemTopicProperties.PowerShell.cs @@ -0,0 +1,168 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Properties of the System Topic. + [System.ComponentModel.TypeConverter(typeof(SystemTopicPropertiesTypeConverter))] + public partial class SystemTopicProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new SystemTopicProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new SystemTopicProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal SystemTopicProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceProvisioningState.CreateFrom); + } + if (content.Contains("Source")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicPropertiesInternal)this).Source = (string) content.GetValueForProperty("Source",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicPropertiesInternal)this).Source, global::System.Convert.ToString); + } + if (content.Contains("TopicType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicPropertiesInternal)this).TopicType = (string) content.GetValueForProperty("TopicType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicPropertiesInternal)this).TopicType, global::System.Convert.ToString); + } + if (content.Contains("MetricResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicPropertiesInternal)this).MetricResourceId = (string) content.GetValueForProperty("MetricResourceId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicPropertiesInternal)this).MetricResourceId, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal SystemTopicProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceProvisioningState.CreateFrom); + } + if (content.Contains("Source")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicPropertiesInternal)this).Source = (string) content.GetValueForProperty("Source",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicPropertiesInternal)this).Source, global::System.Convert.ToString); + } + if (content.Contains("TopicType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicPropertiesInternal)this).TopicType = (string) content.GetValueForProperty("TopicType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicPropertiesInternal)this).TopicType, global::System.Convert.ToString); + } + if (content.Contains("MetricResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicPropertiesInternal)this).MetricResourceId = (string) content.GetValueForProperty("MetricResourceId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicPropertiesInternal)this).MetricResourceId, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties of the System Topic. + [System.ComponentModel.TypeConverter(typeof(SystemTopicPropertiesTypeConverter))] + public partial interface ISystemTopicProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/SystemTopicProperties.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/SystemTopicProperties.TypeConverter.cs new file mode 100644 index 000000000000..c12980c44b7b --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/SystemTopicProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class SystemTopicPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return SystemTopicProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return SystemTopicProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return SystemTopicProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/SystemTopicProperties.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/SystemTopicProperties.cs new file mode 100644 index 000000000000..47d76e07ba8a --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/SystemTopicProperties.cs @@ -0,0 +1,108 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Properties of the System Topic. + public partial class SystemTopicProperties : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicProperties, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicPropertiesInternal + { + + /// Backing field for property. + private string _metricResourceId; + + /// Metric resource id for the system topic. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string MetricResourceId { get => this._metricResourceId; } + + /// Internal Acessors for MetricResourceId + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicPropertiesInternal.MetricResourceId { get => this._metricResourceId; set { {_metricResourceId = value;} } } + + /// Internal Acessors for ProvisioningState + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceProvisioningState? _provisioningState; + + /// Provisioning state of the system topic. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceProvisioningState? ProvisioningState { get => this._provisioningState; } + + /// Backing field for property. + private string _source; + + /// Source for the system topic. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string Source { get => this._source; set => this._source = value; } + + /// Backing field for property. + private string _topicType; + + /// TopicType for the system topic. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string TopicType { get => this._topicType; set => this._topicType = value; } + + /// Creates an new instance. + public SystemTopicProperties() + { + + } + } + /// Properties of the System Topic. + public partial interface ISystemTopicProperties : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// Metric resource id for the system topic. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Metric resource id for the system topic.", + SerializedName = @"metricResourceId", + PossibleTypes = new [] { typeof(string) })] + string MetricResourceId { get; } + /// Provisioning state of the system topic. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Provisioning state of the system topic.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceProvisioningState) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceProvisioningState? ProvisioningState { get; } + /// Source for the system topic. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Source for the system topic.", + SerializedName = @"source", + PossibleTypes = new [] { typeof(string) })] + string Source { get; set; } + /// TopicType for the system topic. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"TopicType for the system topic.", + SerializedName = @"topicType", + PossibleTypes = new [] { typeof(string) })] + string TopicType { get; set; } + + } + /// Properties of the System Topic. + internal partial interface ISystemTopicPropertiesInternal + + { + /// Metric resource id for the system topic. + string MetricResourceId { get; set; } + /// Provisioning state of the system topic. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceProvisioningState? ProvisioningState { get; set; } + /// Source for the system topic. + string Source { get; set; } + /// TopicType for the system topic. + string TopicType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/SystemTopicProperties.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/SystemTopicProperties.json.cs new file mode 100644 index 000000000000..a765a28572bf --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/SystemTopicProperties.json.cs @@ -0,0 +1,118 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Properties of the System Topic. + public partial class SystemTopicProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new SystemTopicProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal SystemTopicProperties(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} + {_source = If( json?.PropertyT("source"), out var __jsonSource) ? (string)__jsonSource : (string)Source;} + {_topicType = If( json?.PropertyT("topicType"), out var __jsonTopicType) ? (string)__jsonTopicType : (string)TopicType;} + {_metricResourceId = If( json?.PropertyT("metricResourceId"), out var __jsonMetricResourceId) ? (string)__jsonMetricResourceId : (string)MetricResourceId;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); + } + AddIf( null != (((object)this._source)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._source.ToString()) : null, "source" ,container.Add ); + AddIf( null != (((object)this._topicType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._topicType.ToString()) : null, "topicType" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._metricResourceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._metricResourceId.ToString()) : null, "metricResourceId" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/SystemTopicUpdateParameters.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/SystemTopicUpdateParameters.PowerShell.cs new file mode 100644 index 000000000000..5e1e8fd28b7d --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/SystemTopicUpdateParameters.PowerShell.cs @@ -0,0 +1,184 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Properties of the System Topic update. + [System.ComponentModel.TypeConverter(typeof(SystemTopicUpdateParametersTypeConverter))] + public partial class SystemTopicUpdateParameters + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicUpdateParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new SystemTopicUpdateParameters(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicUpdateParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new SystemTopicUpdateParameters(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicUpdateParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal SystemTopicUpdateParameters(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Identity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicUpdateParametersInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfo) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicUpdateParametersInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IdentityInfoTypeConverter.ConvertFrom); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicUpdateParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicUpdateParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicUpdateParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.SystemTopicUpdateParametersTagsTypeConverter.ConvertFrom); + } + if (content.Contains("IdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicUpdateParametersInternal)this).IdentityType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType?) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicUpdateParametersInternal)this).IdentityType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType.CreateFrom); + } + if (content.Contains("IdentityPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicUpdateParametersInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicUpdateParametersInternal)this).IdentityPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("IdentityTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicUpdateParametersInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicUpdateParametersInternal)this).IdentityTenantId, global::System.Convert.ToString); + } + if (content.Contains("IdentityUserAssignedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicUpdateParametersInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicUpdateParametersInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IdentityInfoUserAssignedIdentitiesTypeConverter.ConvertFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal SystemTopicUpdateParameters(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Identity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicUpdateParametersInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfo) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicUpdateParametersInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IdentityInfoTypeConverter.ConvertFrom); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicUpdateParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicUpdateParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicUpdateParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.SystemTopicUpdateParametersTagsTypeConverter.ConvertFrom); + } + if (content.Contains("IdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicUpdateParametersInternal)this).IdentityType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType?) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicUpdateParametersInternal)this).IdentityType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType.CreateFrom); + } + if (content.Contains("IdentityPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicUpdateParametersInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicUpdateParametersInternal)this).IdentityPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("IdentityTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicUpdateParametersInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicUpdateParametersInternal)this).IdentityTenantId, global::System.Convert.ToString); + } + if (content.Contains("IdentityUserAssignedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicUpdateParametersInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicUpdateParametersInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IdentityInfoUserAssignedIdentitiesTypeConverter.ConvertFrom); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties of the System Topic update. + [System.ComponentModel.TypeConverter(typeof(SystemTopicUpdateParametersTypeConverter))] + public partial interface ISystemTopicUpdateParameters + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/SystemTopicUpdateParameters.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/SystemTopicUpdateParameters.TypeConverter.cs new file mode 100644 index 000000000000..ac6ce76c08bb --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/SystemTopicUpdateParameters.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class SystemTopicUpdateParametersTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicUpdateParameters ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicUpdateParameters).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return SystemTopicUpdateParameters.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return SystemTopicUpdateParameters.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return SystemTopicUpdateParameters.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/SystemTopicUpdateParameters.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/SystemTopicUpdateParameters.cs new file mode 100644 index 000000000000..529f32459b26 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/SystemTopicUpdateParameters.cs @@ -0,0 +1,145 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Properties of the System Topic update. + public partial class SystemTopicUpdateParameters : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicUpdateParameters, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicUpdateParametersInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfo _identity; + + /// Resource identity information. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfo Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IdentityInfo()); set => this._identity = value; } + + /// The principal ID of resource identity. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoInternal)Identity).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoInternal)Identity).PrincipalId = value ?? null; } + + /// The tenant ID of resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoInternal)Identity).TenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoInternal)Identity).TenantId = value ?? null; } + + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType? IdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoInternal)Identity).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoInternal)Identity).Type = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType)""); } + + /// + /// The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource + /// ids in the form: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + /// This property is currently not used and reserved for future usage. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoInternal)Identity).UserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoInternal)Identity).UserAssignedIdentity = value ?? null /* model class */; } + + /// Internal Acessors for Identity + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfo Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicUpdateParametersInternal.Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IdentityInfo()); set { {_identity = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicUpdateParametersTags _tag; + + /// Tags of the system topic. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicUpdateParametersTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.SystemTopicUpdateParametersTags()); set => this._tag = value; } + + /// Creates an new instance. + public SystemTopicUpdateParameters() + { + + } + } + /// Properties of the System Topic update. + public partial interface ISystemTopicUpdateParameters : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// The principal ID of resource identity. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The principal ID of resource identity.", + SerializedName = @"principalId", + PossibleTypes = new [] { typeof(string) })] + string IdentityPrincipalId { get; set; } + /// The tenant ID of resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The tenant ID of resource.", + SerializedName = @"tenantId", + PossibleTypes = new [] { typeof(string) })] + string IdentityTenantId { get; set; } + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType? IdentityType { get; set; } + /// + /// The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource + /// ids in the form: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + /// This property is currently not used and reserved for future usage. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + This property is currently not used and reserved for future usage.", + SerializedName = @"userAssignedIdentities", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } + /// Tags of the system topic. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Tags of the system topic.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicUpdateParametersTags) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicUpdateParametersTags Tag { get; set; } + + } + /// Properties of the System Topic update. + internal partial interface ISystemTopicUpdateParametersInternal + + { + /// Resource identity information. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfo Identity { get; set; } + /// The principal ID of resource identity. + string IdentityPrincipalId { get; set; } + /// The tenant ID of resource. + string IdentityTenantId { get; set; } + /// + /// 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. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType? IdentityType { get; set; } + /// + /// The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource + /// ids in the form: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + /// This property is currently not used and reserved for future usage. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } + /// Tags of the system topic. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicUpdateParametersTags Tag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/SystemTopicUpdateParameters.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/SystemTopicUpdateParameters.json.cs new file mode 100644 index 000000000000..9f72c4ee5a16 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/SystemTopicUpdateParameters.json.cs @@ -0,0 +1,108 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Properties of the System Topic update. + public partial class SystemTopicUpdateParameters + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicUpdateParameters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicUpdateParameters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicUpdateParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new SystemTopicUpdateParameters(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal SystemTopicUpdateParameters(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_identity = If( json?.PropertyT("identity"), out var __jsonIdentity) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IdentityInfo.FromJson(__jsonIdentity) : Identity;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.SystemTopicUpdateParametersTags.FromJson(__jsonTags) : Tag;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._identity ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._identity.ToJson(null,serializationMode) : null, "identity" ,container.Add ); + AddIf( null != this._tag ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._tag.ToJson(null,serializationMode) : null, "tags" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/SystemTopicUpdateParametersTags.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/SystemTopicUpdateParametersTags.PowerShell.cs new file mode 100644 index 000000000000..6486e2cf121b --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/SystemTopicUpdateParametersTags.PowerShell.cs @@ -0,0 +1,140 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Tags of the system topic. + [System.ComponentModel.TypeConverter(typeof(SystemTopicUpdateParametersTagsTypeConverter))] + public partial class SystemTopicUpdateParametersTags + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicUpdateParametersTags DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new SystemTopicUpdateParametersTags(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicUpdateParametersTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new SystemTopicUpdateParametersTags(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicUpdateParametersTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal SystemTopicUpdateParametersTags(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal SystemTopicUpdateParametersTags(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Tags of the system topic. + [System.ComponentModel.TypeConverter(typeof(SystemTopicUpdateParametersTagsTypeConverter))] + public partial interface ISystemTopicUpdateParametersTags + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/SystemTopicUpdateParametersTags.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/SystemTopicUpdateParametersTags.TypeConverter.cs new file mode 100644 index 000000000000..fb9c3a7b778c --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/SystemTopicUpdateParametersTags.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class SystemTopicUpdateParametersTagsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicUpdateParametersTags ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicUpdateParametersTags).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return SystemTopicUpdateParametersTags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return SystemTopicUpdateParametersTags.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return SystemTopicUpdateParametersTags.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/SystemTopicUpdateParametersTags.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/SystemTopicUpdateParametersTags.cs new file mode 100644 index 000000000000..8e8665e174f5 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/SystemTopicUpdateParametersTags.cs @@ -0,0 +1,35 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Tags of the system topic. + public partial class SystemTopicUpdateParametersTags : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicUpdateParametersTags, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicUpdateParametersTagsInternal + { + + /// Creates an new instance. + public SystemTopicUpdateParametersTags() + { + + } + } + /// Tags of the system topic. + public partial interface ISystemTopicUpdateParametersTags : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray + { + + } + /// Tags of the system topic. + internal partial interface ISystemTopicUpdateParametersTagsInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/SystemTopicUpdateParametersTags.dictionary.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/SystemTopicUpdateParametersTags.dictionary.cs new file mode 100644 index 000000000000..8645d377d68f --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/SystemTopicUpdateParametersTags.dictionary.cs @@ -0,0 +1,75 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + public partial class SystemTopicUpdateParametersTags : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.SystemTopicUpdateParametersTags source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/SystemTopicUpdateParametersTags.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/SystemTopicUpdateParametersTags.json.cs new file mode 100644 index 000000000000..7acefc9f9122 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/SystemTopicUpdateParametersTags.json.cs @@ -0,0 +1,107 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Tags of the system topic. + public partial class SystemTopicUpdateParametersTags + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicUpdateParametersTags. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicUpdateParametersTags. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicUpdateParametersTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new SystemTopicUpdateParametersTags(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + /// + internal SystemTopicUpdateParametersTags(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/SystemTopicsListResult.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/SystemTopicsListResult.PowerShell.cs new file mode 100644 index 000000000000..d65cc3893bf9 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/SystemTopicsListResult.PowerShell.cs @@ -0,0 +1,152 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Result of the List System topics operation. + [System.ComponentModel.TypeConverter(typeof(SystemTopicsListResultTypeConverter))] + public partial class SystemTopicsListResult + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicsListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new SystemTopicsListResult(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicsListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new SystemTopicsListResult(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicsListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal SystemTopicsListResult(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicsListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopic[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicsListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.SystemTopicTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicsListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicsListResultInternal)this).NextLink, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal SystemTopicsListResult(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicsListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopic[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicsListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.SystemTopicTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicsListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicsListResultInternal)this).NextLink, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Result of the List System topics operation. + [System.ComponentModel.TypeConverter(typeof(SystemTopicsListResultTypeConverter))] + public partial interface ISystemTopicsListResult + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/SystemTopicsListResult.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/SystemTopicsListResult.TypeConverter.cs new file mode 100644 index 000000000000..e3fb97df6cc5 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/SystemTopicsListResult.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class SystemTopicsListResultTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicsListResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicsListResult).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return SystemTopicsListResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return SystemTopicsListResult.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return SystemTopicsListResult.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/SystemTopicsListResult.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/SystemTopicsListResult.cs new file mode 100644 index 000000000000..36ac1f9f17ee --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/SystemTopicsListResult.cs @@ -0,0 +1,68 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Result of the List System topics operation. + public partial class SystemTopicsListResult : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicsListResult, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicsListResultInternal + { + + /// Backing field for property. + private string _nextLink; + + /// A link for the next page of topics. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopic[] _value; + + /// A collection of system Topics. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopic[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public SystemTopicsListResult() + { + + } + } + /// Result of the List System topics operation. + public partial interface ISystemTopicsListResult : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// A link for the next page of topics. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A link for the next page of topics.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// A collection of system Topics. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A collection of system Topics.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopic) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopic[] Value { get; set; } + + } + /// Result of the List System topics operation. + internal partial interface ISystemTopicsListResultInternal + + { + /// A link for the next page of topics. + string NextLink { get; set; } + /// A collection of system Topics. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopic[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/SystemTopicsListResult.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/SystemTopicsListResult.json.cs new file mode 100644 index 000000000000..978f5c80a742 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/SystemTopicsListResult.json.cs @@ -0,0 +1,116 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Result of the List System topics operation. + public partial class SystemTopicsListResult + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicsListResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicsListResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicsListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new SystemTopicsListResult(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal SystemTopicsListResult(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopic) (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.SystemTopic.FromJson(__u) )) ))() : null : Value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/Topic.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/Topic.PowerShell.cs new file mode 100644 index 000000000000..65ff21cfa5bd --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/Topic.PowerShell.cs @@ -0,0 +1,414 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// EventGrid Topic + [System.ComponentModel.TypeConverter(typeof(TopicTypeConverter))] + public partial class Topic + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopic DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new Topic(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopic DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new Topic(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopic FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal Topic(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.TopicPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Sku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceSku) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ResourceSkuTypeConverter.ConvertFrom); + } + if (content.Contains("Identity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfo) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IdentityInfoTypeConverter.ConvertFrom); + } + if (content.Contains("ExtendedLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).ExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtendedLocation) content.GetValueForProperty("ExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).ExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ExtendedLocationTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceKind?) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceKind.CreateFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.TrackedResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("InputSchema")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).InputSchema = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.InputSchema?) content.GetValueForProperty("InputSchema",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).InputSchema, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.InputSchema.CreateFrom); + } + if (content.Contains("SkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).SkuName = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku?) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).SkuName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku.CreateFrom); + } + if (content.Contains("IdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).IdentityType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType?) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).IdentityType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType.CreateFrom); + } + if (content.Contains("ExtendedLocationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).ExtendedLocationName = (string) content.GetValueForProperty("ExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).ExtendedLocationName, global::System.Convert.ToString); + } + if (content.Contains("ExtendedLocationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).ExtendedLocationType = (string) content.GetValueForProperty("ExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).ExtendedLocationType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("InputSchemaMapping")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).InputSchemaMapping = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInputSchemaMapping) content.GetValueForProperty("InputSchemaMapping",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).InputSchemaMapping, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.InputSchemaMappingTypeConverter.ConvertFrom); + } + if (content.Contains("PrivateEndpointConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).PrivateEndpointConnection = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnection[]) content.GetValueForProperty("PrivateEndpointConnection",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).PrivateEndpointConnection, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PrivateEndpointConnectionTypeConverter.ConvertFrom)); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.TopicProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.TopicProvisioningState.CreateFrom); + } + if (content.Contains("Endpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).Endpoint = (string) content.GetValueForProperty("Endpoint",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).Endpoint, global::System.Convert.ToString); + } + if (content.Contains("MetricResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).MetricResourceId = (string) content.GetValueForProperty("MetricResourceId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).MetricResourceId, global::System.Convert.ToString); + } + if (content.Contains("PublicNetworkAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).PublicNetworkAccess = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess?) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).PublicNetworkAccess, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess.CreateFrom); + } + if (content.Contains("InboundIPRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).InboundIPRule = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[]) content.GetValueForProperty("InboundIPRule",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).InboundIPRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.InboundIPRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("DisableLocalAuth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).DisableLocalAuth = (bool?) content.GetValueForProperty("DisableLocalAuth",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).DisableLocalAuth, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DataResidencyBoundary")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).DataResidencyBoundary = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary?) content.GetValueForProperty("DataResidencyBoundary",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).DataResidencyBoundary, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary.CreateFrom); + } + if (content.Contains("IdentityPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).IdentityPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("IdentityTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).IdentityTenantId, global::System.Convert.ToString); + } + if (content.Contains("IdentityUserAssignedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IdentityInfoUserAssignedIdentitiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("InputSchemaMappingInputSchemaMappingType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).InputSchemaMappingInputSchemaMappingType = (string) content.GetValueForProperty("InputSchemaMappingInputSchemaMappingType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).InputSchemaMappingInputSchemaMappingType, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal Topic(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.TopicPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Sku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceSku) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ResourceSkuTypeConverter.ConvertFrom); + } + if (content.Contains("Identity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfo) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IdentityInfoTypeConverter.ConvertFrom); + } + if (content.Contains("ExtendedLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).ExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtendedLocation) content.GetValueForProperty("ExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).ExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ExtendedLocationTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceKind?) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceKind.CreateFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.TrackedResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("InputSchema")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).InputSchema = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.InputSchema?) content.GetValueForProperty("InputSchema",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).InputSchema, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.InputSchema.CreateFrom); + } + if (content.Contains("SkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).SkuName = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku?) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).SkuName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku.CreateFrom); + } + if (content.Contains("IdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).IdentityType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType?) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).IdentityType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType.CreateFrom); + } + if (content.Contains("ExtendedLocationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).ExtendedLocationName = (string) content.GetValueForProperty("ExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).ExtendedLocationName, global::System.Convert.ToString); + } + if (content.Contains("ExtendedLocationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).ExtendedLocationType = (string) content.GetValueForProperty("ExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).ExtendedLocationType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("InputSchemaMapping")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).InputSchemaMapping = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInputSchemaMapping) content.GetValueForProperty("InputSchemaMapping",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).InputSchemaMapping, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.InputSchemaMappingTypeConverter.ConvertFrom); + } + if (content.Contains("PrivateEndpointConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).PrivateEndpointConnection = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnection[]) content.GetValueForProperty("PrivateEndpointConnection",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).PrivateEndpointConnection, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PrivateEndpointConnectionTypeConverter.ConvertFrom)); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.TopicProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.TopicProvisioningState.CreateFrom); + } + if (content.Contains("Endpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).Endpoint = (string) content.GetValueForProperty("Endpoint",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).Endpoint, global::System.Convert.ToString); + } + if (content.Contains("MetricResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).MetricResourceId = (string) content.GetValueForProperty("MetricResourceId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).MetricResourceId, global::System.Convert.ToString); + } + if (content.Contains("PublicNetworkAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).PublicNetworkAccess = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess?) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).PublicNetworkAccess, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess.CreateFrom); + } + if (content.Contains("InboundIPRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).InboundIPRule = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[]) content.GetValueForProperty("InboundIPRule",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).InboundIPRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.InboundIPRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("DisableLocalAuth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).DisableLocalAuth = (bool?) content.GetValueForProperty("DisableLocalAuth",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).DisableLocalAuth, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DataResidencyBoundary")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).DataResidencyBoundary = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary?) content.GetValueForProperty("DataResidencyBoundary",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).DataResidencyBoundary, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary.CreateFrom); + } + if (content.Contains("IdentityPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).IdentityPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("IdentityTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).IdentityTenantId, global::System.Convert.ToString); + } + if (content.Contains("IdentityUserAssignedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IdentityInfoUserAssignedIdentitiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("InputSchemaMappingInputSchemaMappingType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).InputSchemaMappingInputSchemaMappingType = (string) content.GetValueForProperty("InputSchemaMappingInputSchemaMappingType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal)this).InputSchemaMappingInputSchemaMappingType, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + } + /// EventGrid Topic + [System.ComponentModel.TypeConverter(typeof(TopicTypeConverter))] + public partial interface ITopic + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/Topic.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/Topic.TypeConverter.cs new file mode 100644 index 000000000000..8ad971b425fd --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/Topic.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class TopicTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopic ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopic).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return Topic.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return Topic.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return Topic.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/Topic.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/Topic.cs new file mode 100644 index 000000000000..5fdd6f51c97f --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/Topic.cs @@ -0,0 +1,566 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// EventGrid Topic + public partial class Topic : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopic, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResource __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.TrackedResource(); + + /// Data Residency Boundary of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary? DataResidencyBoundary { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicPropertiesInternal)Property).DataResidencyBoundary; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicPropertiesInternal)Property).DataResidencyBoundary = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary)""); } + + /// + /// This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD + /// token will be used to authenticate if user is allowed to publish to the topic. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public bool? DisableLocalAuth { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicPropertiesInternal)Property).DisableLocalAuth; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicPropertiesInternal)Property).DisableLocalAuth = value ?? default(bool); } + + /// Endpoint for the topic. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string Endpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicPropertiesInternal)Property).Endpoint; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtendedLocation _extendedLocation; + + /// Extended location of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtendedLocation ExtendedLocation { get => (this._extendedLocation = this._extendedLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ExtendedLocation()); set => this._extendedLocation = value; } + + /// Fully qualified name of the extended location. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string ExtendedLocationName { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtendedLocationInternal)ExtendedLocation).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtendedLocationInternal)ExtendedLocation).Name = value ?? null; } + + /// Type of the extended location. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string ExtendedLocationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtendedLocationInternal)ExtendedLocation).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtendedLocationInternal)ExtendedLocation).Type = value ?? null; } + + /// Fully qualified identifier of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__trackedResource).Id; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfo _identity; + + /// Identity information for the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfo Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IdentityInfo()); set => this._identity = value; } + + /// The principal ID of resource identity. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoInternal)Identity).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoInternal)Identity).PrincipalId = value ?? null; } + + /// The tenant ID of resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoInternal)Identity).TenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoInternal)Identity).TenantId = value ?? null; } + + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType? IdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoInternal)Identity).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoInternal)Identity).Type = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType)""); } + + /// + /// The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource + /// ids in the form: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + /// This property is currently not used and reserved for future usage. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoInternal)Identity).UserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoInternal)Identity).UserAssignedIdentity = value ?? null /* model class */; } + + /// + /// This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess + /// is enabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[] InboundIPRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicPropertiesInternal)Property).InboundIPRule; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicPropertiesInternal)Property).InboundIPRule = value ?? null /* arrayOf */; } + + /// + /// This determines the format that Event Grid should expect for incoming events published to the topic. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.InputSchema? InputSchema { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicPropertiesInternal)Property).InputSchema; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicPropertiesInternal)Property).InputSchema = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.InputSchema)""); } + + /// Type of the custom mapping + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string InputSchemaMappingInputSchemaMappingType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicPropertiesInternal)Property).InputSchemaMappingInputSchemaMappingType; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceKind? _kind; + + /// Kind of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceKind? Kind { get => this._kind; set => this._kind = value; } + + /// Location of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal)__trackedResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal)__trackedResource).Location = value ; } + + /// Metric resource id for the topic. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string MetricResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicPropertiesInternal)Property).MetricResourceId; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__trackedResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__trackedResource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__trackedResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__trackedResource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__trackedResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__trackedResource).Type = value; } + + /// Internal Acessors for Endpoint + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal.Endpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicPropertiesInternal)Property).Endpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicPropertiesInternal)Property).Endpoint = value; } + + /// Internal Acessors for ExtendedLocation + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtendedLocation Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal.ExtendedLocation { get => (this._extendedLocation = this._extendedLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ExtendedLocation()); set { {_extendedLocation = value;} } } + + /// Internal Acessors for Identity + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfo Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal.Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IdentityInfo()); set { {_identity = value;} } } + + /// Internal Acessors for InputSchemaMapping + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInputSchemaMapping Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal.InputSchemaMapping { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicPropertiesInternal)Property).InputSchemaMapping; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicPropertiesInternal)Property).InputSchemaMapping = value; } + + /// Internal Acessors for InputSchemaMappingInputSchemaMappingType + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal.InputSchemaMappingInputSchemaMappingType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicPropertiesInternal)Property).InputSchemaMappingInputSchemaMappingType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicPropertiesInternal)Property).InputSchemaMappingInputSchemaMappingType = value; } + + /// Internal Acessors for MetricResourceId + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal.MetricResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicPropertiesInternal)Property).MetricResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicPropertiesInternal)Property).MetricResourceId = value; } + + /// Internal Acessors for PrivateEndpointConnection + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnection[] Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal.PrivateEndpointConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicPropertiesInternal)Property).PrivateEndpointConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicPropertiesInternal)Property).PrivateEndpointConnection = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicProperties Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.TopicProperties()); set { {_property = value;} } } + + /// Internal Acessors for ProvisioningState + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.TopicProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicPropertiesInternal)Property).ProvisioningState = value; } + + /// Internal Acessors for Sku + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceSku Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal.Sku { get => (this._sku = this._sku ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ResourceSku()); set { {_sku = value;} } } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.SystemData()); set { {_systemData = value;} } } + + /// Name of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__trackedResource).Name; } + + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnection[] PrivateEndpointConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicPropertiesInternal)Property).PrivateEndpointConnection; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicProperties _property; + + /// Properties of the topic. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.TopicProperties()); set => this._property = value; } + + /// Provisioning state of the topic. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.TopicProvisioningState? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicPropertiesInternal)Property).ProvisioningState; } + + /// + /// This determines if traffic is allowed over public network. By default it is enabled. + /// You can further restrict to specific IPs by configuring + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess? PublicNetworkAccess { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicPropertiesInternal)Property).PublicNetworkAccess; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicPropertiesInternal)Property).PublicNetworkAccess = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess)""); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceSku _sku; + + /// The Sku pricing tier for the topic. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceSku Sku { get => (this._sku = this._sku ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ResourceSku()); set => this._sku = value; } + + /// The Sku name of the resource. The possible values are: Basic or Premium. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku? SkuName { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceSkuInternal)Sku).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceSkuInternal)Sku).Name = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku)""); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData _systemData; + + /// The system metadata relating to Topic resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.SystemData()); } + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).CreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType)""); } + + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType)""); } + + /// Tags of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal)__trackedResource).Tag = value ?? null /* model class */; } + + /// Type of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__trackedResource).Type; } + + /// Creates an new instance. + public Topic() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__trackedResource), __trackedResource); + await eventListener.AssertObjectIsValid(nameof(__trackedResource), __trackedResource); + } + } + /// EventGrid Topic + public partial interface ITopic : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResource + { + /// Data Residency Boundary of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Data Residency Boundary of the resource.", + SerializedName = @"dataResidencyBoundary", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary? DataResidencyBoundary { get; set; } + /// + /// This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD + /// token will be used to authenticate if user is allowed to publish to the topic. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD token will be used to authenticate if user is allowed to publish to the topic.", + SerializedName = @"disableLocalAuth", + PossibleTypes = new [] { typeof(bool) })] + bool? DisableLocalAuth { get; set; } + /// Endpoint for the topic. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Endpoint for the topic.", + SerializedName = @"endpoint", + PossibleTypes = new [] { typeof(string) })] + string Endpoint { get; } + /// Fully qualified name of the extended location. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Fully qualified name of the extended location.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string ExtendedLocationName { get; set; } + /// Type of the extended location. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of the extended location.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string ExtendedLocationType { get; set; } + /// The principal ID of resource identity. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The principal ID of resource identity.", + SerializedName = @"principalId", + PossibleTypes = new [] { typeof(string) })] + string IdentityPrincipalId { get; set; } + /// The tenant ID of resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The tenant ID of resource.", + SerializedName = @"tenantId", + PossibleTypes = new [] { typeof(string) })] + string IdentityTenantId { get; set; } + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType? IdentityType { get; set; } + /// + /// The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource + /// ids in the form: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + /// This property is currently not used and reserved for future usage. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + This property is currently not used and reserved for future usage.", + SerializedName = @"userAssignedIdentities", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } + /// + /// This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess + /// is enabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess is enabled.", + SerializedName = @"inboundIpRules", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[] InboundIPRule { get; set; } + /// + /// This determines the format that Event Grid should expect for incoming events published to the topic. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This determines the format that Event Grid should expect for incoming events published to the topic.", + SerializedName = @"inputSchema", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.InputSchema) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.InputSchema? InputSchema { get; set; } + /// Type of the custom mapping + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Type of the custom mapping", + SerializedName = @"inputSchemaMappingType", + PossibleTypes = new [] { typeof(string) })] + string InputSchemaMappingInputSchemaMappingType { get; } + /// Kind of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Kind of the resource.", + SerializedName = @"kind", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceKind) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceKind? Kind { get; set; } + /// Metric resource id for the topic. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Metric resource id for the topic.", + SerializedName = @"metricResourceId", + PossibleTypes = new [] { typeof(string) })] + string MetricResourceId { get; } + + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"", + SerializedName = @"privateEndpointConnections", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnection) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnection[] PrivateEndpointConnection { get; } + /// Provisioning state of the topic. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Provisioning state of the topic.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.TopicProvisioningState) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.TopicProvisioningState? ProvisioningState { get; } + /// + /// This determines if traffic is allowed over public network. By default it is enabled. + /// You can further restrict to specific IPs by configuring + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This determines if traffic is allowed over public network. By default it is enabled. + You can further restrict to specific IPs by configuring ", + SerializedName = @"publicNetworkAccess", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess? PublicNetworkAccess { get; set; } + /// The Sku name of the resource. The possible values are: Basic or Premium. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Sku name of the resource. The possible values are: Basic or Premium.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku? SkuName { get; set; } + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timestamp of resource creation (UTC).", + SerializedName = @"createdAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SystemDataCreatedAt { get; set; } + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identity that created the resource.", + SerializedName = @"createdBy", + PossibleTypes = new [] { typeof(string) })] + string SystemDataCreatedBy { get; set; } + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of identity that created the resource.", + SerializedName = @"createdByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType? SystemDataCreatedByType { get; set; } + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timestamp of resource last modification (UTC)", + SerializedName = @"lastModifiedAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SystemDataLastModifiedAt { get; set; } + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identity that last modified the resource.", + SerializedName = @"lastModifiedBy", + PossibleTypes = new [] { typeof(string) })] + string SystemDataLastModifiedBy { get; set; } + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of identity that last modified the resource.", + SerializedName = @"lastModifiedByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + + } + /// EventGrid Topic + internal partial interface ITopicInternal : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal + { + /// Data Residency Boundary of the resource. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary? DataResidencyBoundary { get; set; } + /// + /// This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD + /// token will be used to authenticate if user is allowed to publish to the topic. + /// + bool? DisableLocalAuth { get; set; } + /// Endpoint for the topic. + string Endpoint { get; set; } + /// Extended location of the resource. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtendedLocation ExtendedLocation { get; set; } + /// Fully qualified name of the extended location. + string ExtendedLocationName { get; set; } + /// Type of the extended location. + string ExtendedLocationType { get; set; } + /// Identity information for the resource. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfo Identity { get; set; } + /// The principal ID of resource identity. + string IdentityPrincipalId { get; set; } + /// The tenant ID of resource. + string IdentityTenantId { get; set; } + /// + /// 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. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType? IdentityType { get; set; } + /// + /// The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource + /// ids in the form: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + /// This property is currently not used and reserved for future usage. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } + /// + /// This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess + /// is enabled. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[] InboundIPRule { get; set; } + /// + /// This determines the format that Event Grid should expect for incoming events published to the topic. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.InputSchema? InputSchema { get; set; } + /// + /// This enables publishing using custom event schemas. An InputSchemaMapping can be specified to map various properties of + /// a source schema to various required properties of the EventGridEvent schema. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInputSchemaMapping InputSchemaMapping { get; set; } + /// Type of the custom mapping + string InputSchemaMappingInputSchemaMappingType { get; set; } + /// Kind of the resource. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceKind? Kind { get; set; } + /// Metric resource id for the topic. + string MetricResourceId { get; set; } + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnection[] PrivateEndpointConnection { get; set; } + /// Properties of the topic. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicProperties Property { get; set; } + /// Provisioning state of the topic. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.TopicProvisioningState? ProvisioningState { get; set; } + /// + /// This determines if traffic is allowed over public network. By default it is enabled. + /// You can further restrict to specific IPs by configuring + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess? PublicNetworkAccess { get; set; } + /// The Sku pricing tier for the topic. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceSku Sku { get; set; } + /// The Sku name of the resource. The possible values are: Basic or Premium. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku? SkuName { get; set; } + /// The system metadata relating to Topic resource. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData SystemData { get; set; } + /// The timestamp of resource creation (UTC). + global::System.DateTime? SystemDataCreatedAt { get; set; } + /// The identity that created the resource. + string SystemDataCreatedBy { get; set; } + /// The type of identity that created the resource. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType? SystemDataCreatedByType { get; set; } + /// The timestamp of resource last modification (UTC) + global::System.DateTime? SystemDataLastModifiedAt { get; set; } + /// The identity that last modified the resource. + string SystemDataLastModifiedBy { get; set; } + /// The type of identity that last modified the resource. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/Topic.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/Topic.json.cs new file mode 100644 index 000000000000..8d8ddcdcf70c --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/Topic.json.cs @@ -0,0 +1,121 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// EventGrid Topic + public partial class Topic + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopic. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopic. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopic FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new Topic(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __trackedResource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AddIf( null != this._sku ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._sku.ToJson(null,serializationMode) : null, "sku" ,container.Add ); + AddIf( null != this._identity ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._identity.ToJson(null,serializationMode) : null, "identity" ,container.Add ); + AddIf( null != this._extendedLocation ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._extendedLocation.ToJson(null,serializationMode) : null, "extendedLocation" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._systemData ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._systemData.ToJson(null,serializationMode) : null, "systemData" ,container.Add ); + } + AddIf( null != (((object)this._kind)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._kind.ToString()) : null, "kind" ,container.Add ); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal Topic(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.TrackedResource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.TopicProperties.FromJson(__jsonProperties) : Property;} + {_sku = If( json?.PropertyT("sku"), out var __jsonSku) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ResourceSku.FromJson(__jsonSku) : Sku;} + {_identity = If( json?.PropertyT("identity"), out var __jsonIdentity) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IdentityInfo.FromJson(__jsonIdentity) : Identity;} + {_extendedLocation = If( json?.PropertyT("extendedLocation"), out var __jsonExtendedLocation) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ExtendedLocation.FromJson(__jsonExtendedLocation) : ExtendedLocation;} + {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.SystemData.FromJson(__jsonSystemData) : SystemData;} + {_kind = If( json?.PropertyT("kind"), out var __jsonKind) ? (string)__jsonKind : (string)Kind;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicProperties.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicProperties.PowerShell.cs new file mode 100644 index 000000000000..2ea208f9d6f5 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicProperties.PowerShell.cs @@ -0,0 +1,222 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Properties of the Topic. + [System.ComponentModel.TypeConverter(typeof(TopicPropertiesTypeConverter))] + public partial class TopicProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new TopicProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new TopicProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal TopicProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("InputSchemaMapping")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicPropertiesInternal)this).InputSchemaMapping = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInputSchemaMapping) content.GetValueForProperty("InputSchemaMapping",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicPropertiesInternal)this).InputSchemaMapping, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.InputSchemaMappingTypeConverter.ConvertFrom); + } + if (content.Contains("PrivateEndpointConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicPropertiesInternal)this).PrivateEndpointConnection = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnection[]) content.GetValueForProperty("PrivateEndpointConnection",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicPropertiesInternal)this).PrivateEndpointConnection, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PrivateEndpointConnectionTypeConverter.ConvertFrom)); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.TopicProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.TopicProvisioningState.CreateFrom); + } + if (content.Contains("Endpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicPropertiesInternal)this).Endpoint = (string) content.GetValueForProperty("Endpoint",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicPropertiesInternal)this).Endpoint, global::System.Convert.ToString); + } + if (content.Contains("InputSchema")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicPropertiesInternal)this).InputSchema = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.InputSchema?) content.GetValueForProperty("InputSchema",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicPropertiesInternal)this).InputSchema, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.InputSchema.CreateFrom); + } + if (content.Contains("MetricResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicPropertiesInternal)this).MetricResourceId = (string) content.GetValueForProperty("MetricResourceId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicPropertiesInternal)this).MetricResourceId, global::System.Convert.ToString); + } + if (content.Contains("PublicNetworkAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicPropertiesInternal)this).PublicNetworkAccess = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess?) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicPropertiesInternal)this).PublicNetworkAccess, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess.CreateFrom); + } + if (content.Contains("InboundIPRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicPropertiesInternal)this).InboundIPRule = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[]) content.GetValueForProperty("InboundIPRule",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicPropertiesInternal)this).InboundIPRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.InboundIPRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("DisableLocalAuth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicPropertiesInternal)this).DisableLocalAuth = (bool?) content.GetValueForProperty("DisableLocalAuth",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicPropertiesInternal)this).DisableLocalAuth, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DataResidencyBoundary")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicPropertiesInternal)this).DataResidencyBoundary = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary?) content.GetValueForProperty("DataResidencyBoundary",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicPropertiesInternal)this).DataResidencyBoundary, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary.CreateFrom); + } + if (content.Contains("InputSchemaMappingInputSchemaMappingType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicPropertiesInternal)this).InputSchemaMappingInputSchemaMappingType = (string) content.GetValueForProperty("InputSchemaMappingInputSchemaMappingType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicPropertiesInternal)this).InputSchemaMappingInputSchemaMappingType, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal TopicProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("InputSchemaMapping")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicPropertiesInternal)this).InputSchemaMapping = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInputSchemaMapping) content.GetValueForProperty("InputSchemaMapping",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicPropertiesInternal)this).InputSchemaMapping, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.InputSchemaMappingTypeConverter.ConvertFrom); + } + if (content.Contains("PrivateEndpointConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicPropertiesInternal)this).PrivateEndpointConnection = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnection[]) content.GetValueForProperty("PrivateEndpointConnection",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicPropertiesInternal)this).PrivateEndpointConnection, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PrivateEndpointConnectionTypeConverter.ConvertFrom)); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.TopicProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.TopicProvisioningState.CreateFrom); + } + if (content.Contains("Endpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicPropertiesInternal)this).Endpoint = (string) content.GetValueForProperty("Endpoint",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicPropertiesInternal)this).Endpoint, global::System.Convert.ToString); + } + if (content.Contains("InputSchema")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicPropertiesInternal)this).InputSchema = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.InputSchema?) content.GetValueForProperty("InputSchema",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicPropertiesInternal)this).InputSchema, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.InputSchema.CreateFrom); + } + if (content.Contains("MetricResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicPropertiesInternal)this).MetricResourceId = (string) content.GetValueForProperty("MetricResourceId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicPropertiesInternal)this).MetricResourceId, global::System.Convert.ToString); + } + if (content.Contains("PublicNetworkAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicPropertiesInternal)this).PublicNetworkAccess = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess?) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicPropertiesInternal)this).PublicNetworkAccess, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess.CreateFrom); + } + if (content.Contains("InboundIPRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicPropertiesInternal)this).InboundIPRule = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[]) content.GetValueForProperty("InboundIPRule",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicPropertiesInternal)this).InboundIPRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.InboundIPRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("DisableLocalAuth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicPropertiesInternal)this).DisableLocalAuth = (bool?) content.GetValueForProperty("DisableLocalAuth",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicPropertiesInternal)this).DisableLocalAuth, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DataResidencyBoundary")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicPropertiesInternal)this).DataResidencyBoundary = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary?) content.GetValueForProperty("DataResidencyBoundary",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicPropertiesInternal)this).DataResidencyBoundary, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary.CreateFrom); + } + if (content.Contains("InputSchemaMappingInputSchemaMappingType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicPropertiesInternal)this).InputSchemaMappingInputSchemaMappingType = (string) content.GetValueForProperty("InputSchemaMappingInputSchemaMappingType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicPropertiesInternal)this).InputSchemaMappingInputSchemaMappingType, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + } + /// Properties of the Topic. + [System.ComponentModel.TypeConverter(typeof(TopicPropertiesTypeConverter))] + public partial interface ITopicProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicProperties.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicProperties.TypeConverter.cs new file mode 100644 index 000000000000..99794672bab3 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class TopicPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return TopicProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return TopicProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return TopicProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicProperties.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicProperties.cs new file mode 100644 index 000000000000..e401cbda114f --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicProperties.cs @@ -0,0 +1,270 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Properties of the Topic. + public partial class TopicProperties : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicProperties, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicPropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary? _dataResidencyBoundary; + + /// Data Residency Boundary of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary? DataResidencyBoundary { get => this._dataResidencyBoundary; set => this._dataResidencyBoundary = value; } + + /// Backing field for property. + private bool? _disableLocalAuth; + + /// + /// This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD + /// token will be used to authenticate if user is allowed to publish to the topic. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public bool? DisableLocalAuth { get => this._disableLocalAuth; set => this._disableLocalAuth = value; } + + /// Backing field for property. + private string _endpoint; + + /// Endpoint for the topic. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string Endpoint { get => this._endpoint; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[] _inboundIPRule; + + /// + /// This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess + /// is enabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[] InboundIPRule { get => this._inboundIPRule; set => this._inboundIPRule = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.InputSchema? _inputSchema; + + /// + /// This determines the format that Event Grid should expect for incoming events published to the topic. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.InputSchema? InputSchema { get => this._inputSchema; set => this._inputSchema = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInputSchemaMapping _inputSchemaMapping; + + /// + /// This enables publishing using custom event schemas. An InputSchemaMapping can be specified to map various properties of + /// a source schema to various required properties of the EventGridEvent schema. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInputSchemaMapping InputSchemaMapping { get => (this._inputSchemaMapping = this._inputSchemaMapping ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.InputSchemaMapping()); set => this._inputSchemaMapping = value; } + + /// Type of the custom mapping + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string InputSchemaMappingInputSchemaMappingType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInputSchemaMappingInternal)InputSchemaMapping).Type; } + + /// Backing field for property. + private string _metricResourceId; + + /// Metric resource id for the topic. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string MetricResourceId { get => this._metricResourceId; } + + /// Internal Acessors for Endpoint + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicPropertiesInternal.Endpoint { get => this._endpoint; set { {_endpoint = value;} } } + + /// Internal Acessors for InputSchemaMapping + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInputSchemaMapping Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicPropertiesInternal.InputSchemaMapping { get => (this._inputSchemaMapping = this._inputSchemaMapping ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.InputSchemaMapping()); set { {_inputSchemaMapping = value;} } } + + /// Internal Acessors for InputSchemaMappingInputSchemaMappingType + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicPropertiesInternal.InputSchemaMappingInputSchemaMappingType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInputSchemaMappingInternal)InputSchemaMapping).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInputSchemaMappingInternal)InputSchemaMapping).Type = value; } + + /// Internal Acessors for MetricResourceId + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicPropertiesInternal.MetricResourceId { get => this._metricResourceId; set { {_metricResourceId = value;} } } + + /// Internal Acessors for PrivateEndpointConnection + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnection[] Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicPropertiesInternal.PrivateEndpointConnection { get => this._privateEndpointConnection; set { {_privateEndpointConnection = value;} } } + + /// Internal Acessors for ProvisioningState + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.TopicProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnection[] _privateEndpointConnection; + + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnection[] PrivateEndpointConnection { get => this._privateEndpointConnection; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.TopicProvisioningState? _provisioningState; + + /// Provisioning state of the topic. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.TopicProvisioningState? ProvisioningState { get => this._provisioningState; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess? _publicNetworkAccess; + + /// + /// This determines if traffic is allowed over public network. By default it is enabled. + /// You can further restrict to specific IPs by configuring + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess? PublicNetworkAccess { get => this._publicNetworkAccess; set => this._publicNetworkAccess = value; } + + /// Creates an new instance. + public TopicProperties() + { + + } + } + /// Properties of the Topic. + public partial interface ITopicProperties : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// Data Residency Boundary of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Data Residency Boundary of the resource.", + SerializedName = @"dataResidencyBoundary", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary? DataResidencyBoundary { get; set; } + /// + /// This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD + /// token will be used to authenticate if user is allowed to publish to the topic. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD token will be used to authenticate if user is allowed to publish to the topic.", + SerializedName = @"disableLocalAuth", + PossibleTypes = new [] { typeof(bool) })] + bool? DisableLocalAuth { get; set; } + /// Endpoint for the topic. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Endpoint for the topic.", + SerializedName = @"endpoint", + PossibleTypes = new [] { typeof(string) })] + string Endpoint { get; } + /// + /// This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess + /// is enabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess is enabled.", + SerializedName = @"inboundIpRules", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[] InboundIPRule { get; set; } + /// + /// This determines the format that Event Grid should expect for incoming events published to the topic. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This determines the format that Event Grid should expect for incoming events published to the topic.", + SerializedName = @"inputSchema", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.InputSchema) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.InputSchema? InputSchema { get; set; } + /// Type of the custom mapping + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Type of the custom mapping", + SerializedName = @"inputSchemaMappingType", + PossibleTypes = new [] { typeof(string) })] + string InputSchemaMappingInputSchemaMappingType { get; } + /// Metric resource id for the topic. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Metric resource id for the topic.", + SerializedName = @"metricResourceId", + PossibleTypes = new [] { typeof(string) })] + string MetricResourceId { get; } + + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"", + SerializedName = @"privateEndpointConnections", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnection) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnection[] PrivateEndpointConnection { get; } + /// Provisioning state of the topic. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Provisioning state of the topic.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.TopicProvisioningState) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.TopicProvisioningState? ProvisioningState { get; } + /// + /// This determines if traffic is allowed over public network. By default it is enabled. + /// You can further restrict to specific IPs by configuring + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This determines if traffic is allowed over public network. By default it is enabled. + You can further restrict to specific IPs by configuring ", + SerializedName = @"publicNetworkAccess", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess? PublicNetworkAccess { get; set; } + + } + /// Properties of the Topic. + internal partial interface ITopicPropertiesInternal + + { + /// Data Residency Boundary of the resource. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary? DataResidencyBoundary { get; set; } + /// + /// This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD + /// token will be used to authenticate if user is allowed to publish to the topic. + /// + bool? DisableLocalAuth { get; set; } + /// Endpoint for the topic. + string Endpoint { get; set; } + /// + /// This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess + /// is enabled. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[] InboundIPRule { get; set; } + /// + /// This determines the format that Event Grid should expect for incoming events published to the topic. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.InputSchema? InputSchema { get; set; } + /// + /// This enables publishing using custom event schemas. An InputSchemaMapping can be specified to map various properties of + /// a source schema to various required properties of the EventGridEvent schema. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInputSchemaMapping InputSchemaMapping { get; set; } + /// Type of the custom mapping + string InputSchemaMappingInputSchemaMappingType { get; set; } + /// Metric resource id for the topic. + string MetricResourceId { get; set; } + + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnection[] PrivateEndpointConnection { get; set; } + /// Provisioning state of the topic. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.TopicProvisioningState? ProvisioningState { get; set; } + /// + /// This determines if traffic is allowed over public network. By default it is enabled. + /// You can further restrict to specific IPs by configuring + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess? PublicNetworkAccess { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicProperties.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicProperties.json.cs new file mode 100644 index 000000000000..b56406225148 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicProperties.json.cs @@ -0,0 +1,152 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Properties of the Topic. + public partial class TopicProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new TopicProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._inputSchemaMapping ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._inputSchemaMapping.ToJson(null,serializationMode) : null, "inputSchemaMapping" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._privateEndpointConnection) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.XNodeArray(); + foreach( var __x in this._privateEndpointConnection ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("privateEndpointConnections",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._endpoint)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._endpoint.ToString()) : null, "endpoint" ,container.Add ); + } + AddIf( null != (((object)this._inputSchema)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._inputSchema.ToString()) : null, "inputSchema" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._metricResourceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._metricResourceId.ToString()) : null, "metricResourceId" ,container.Add ); + } + AddIf( null != (((object)this._publicNetworkAccess)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._publicNetworkAccess.ToString()) : null, "publicNetworkAccess" ,container.Add ); + if (null != this._inboundIPRule) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.XNodeArray(); + foreach( var __s in this._inboundIPRule ) + { + AddIf(__s?.ToJson(null, serializationMode) ,__r.Add); + } + container.Add("inboundIpRules",__r); + } + AddIf( null != this._disableLocalAuth ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonBoolean((bool)this._disableLocalAuth) : null, "disableLocalAuth" ,container.Add ); + AddIf( null != (((object)this._dataResidencyBoundary)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._dataResidencyBoundary.ToString()) : null, "dataResidencyBoundary" ,container.Add ); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal TopicProperties(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_inputSchemaMapping = If( json?.PropertyT("inputSchemaMapping"), out var __jsonInputSchemaMapping) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.InputSchemaMapping.FromJson(__jsonInputSchemaMapping) : InputSchemaMapping;} + {_privateEndpointConnection = If( json?.PropertyT("privateEndpointConnections"), out var __jsonPrivateEndpointConnections) ? If( __jsonPrivateEndpointConnections as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnection) (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PrivateEndpointConnection.FromJson(__u) )) ))() : null : PrivateEndpointConnection;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} + {_endpoint = If( json?.PropertyT("endpoint"), out var __jsonEndpoint) ? (string)__jsonEndpoint : (string)Endpoint;} + {_inputSchema = If( json?.PropertyT("inputSchema"), out var __jsonInputSchema) ? (string)__jsonInputSchema : (string)InputSchema;} + {_metricResourceId = If( json?.PropertyT("metricResourceId"), out var __jsonMetricResourceId) ? (string)__jsonMetricResourceId : (string)MetricResourceId;} + {_publicNetworkAccess = If( json?.PropertyT("publicNetworkAccess"), out var __jsonPublicNetworkAccess) ? (string)__jsonPublicNetworkAccess : (string)PublicNetworkAccess;} + {_inboundIPRule = If( json?.PropertyT("inboundIpRules"), out var __jsonInboundIPRules) ? If( __jsonInboundIPRules as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule) (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.InboundIPRule.FromJson(__p) )) ))() : null : InboundIPRule;} + {_disableLocalAuth = If( json?.PropertyT("disableLocalAuth"), out var __jsonDisableLocalAuth) ? (bool?)__jsonDisableLocalAuth : DisableLocalAuth;} + {_dataResidencyBoundary = If( json?.PropertyT("dataResidencyBoundary"), out var __jsonDataResidencyBoundary) ? (string)__jsonDataResidencyBoundary : (string)DataResidencyBoundary;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicRegenerateKeyRequest.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicRegenerateKeyRequest.PowerShell.cs new file mode 100644 index 000000000000..11ed7cda0928 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicRegenerateKeyRequest.PowerShell.cs @@ -0,0 +1,144 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Topic regenerate share access key request + [System.ComponentModel.TypeConverter(typeof(TopicRegenerateKeyRequestTypeConverter))] + public partial class TopicRegenerateKeyRequest + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicRegenerateKeyRequest DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new TopicRegenerateKeyRequest(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicRegenerateKeyRequest DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new TopicRegenerateKeyRequest(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicRegenerateKeyRequest FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal TopicRegenerateKeyRequest(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("KeyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicRegenerateKeyRequestInternal)this).KeyName = (string) content.GetValueForProperty("KeyName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicRegenerateKeyRequestInternal)this).KeyName, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal TopicRegenerateKeyRequest(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("KeyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicRegenerateKeyRequestInternal)this).KeyName = (string) content.GetValueForProperty("KeyName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicRegenerateKeyRequestInternal)this).KeyName, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + } + /// Topic regenerate share access key request + [System.ComponentModel.TypeConverter(typeof(TopicRegenerateKeyRequestTypeConverter))] + public partial interface ITopicRegenerateKeyRequest + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicRegenerateKeyRequest.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicRegenerateKeyRequest.TypeConverter.cs new file mode 100644 index 000000000000..79a2c32d38c2 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicRegenerateKeyRequest.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class TopicRegenerateKeyRequestTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicRegenerateKeyRequest ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicRegenerateKeyRequest).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return TopicRegenerateKeyRequest.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return TopicRegenerateKeyRequest.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return TopicRegenerateKeyRequest.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicRegenerateKeyRequest.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicRegenerateKeyRequest.cs new file mode 100644 index 000000000000..27c19d8a1723 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicRegenerateKeyRequest.cs @@ -0,0 +1,51 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Topic regenerate share access key request + public partial class TopicRegenerateKeyRequest : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicRegenerateKeyRequest, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicRegenerateKeyRequestInternal + { + + /// Backing field for property. + private string _keyName; + + /// Key name to regenerate key1 or key2 + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string KeyName { get => this._keyName; set => this._keyName = value; } + + /// Creates an new instance. + public TopicRegenerateKeyRequest() + { + + } + } + /// Topic regenerate share access key request + public partial interface ITopicRegenerateKeyRequest : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// Key name to regenerate key1 or key2 + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Key name to regenerate key1 or key2", + SerializedName = @"keyName", + PossibleTypes = new [] { typeof(string) })] + string KeyName { get; set; } + + } + /// Topic regenerate share access key request + internal partial interface ITopicRegenerateKeyRequestInternal + + { + /// Key name to regenerate key1 or key2 + string KeyName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicRegenerateKeyRequest.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicRegenerateKeyRequest.json.cs new file mode 100644 index 000000000000..6760927af66d --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicRegenerateKeyRequest.json.cs @@ -0,0 +1,106 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Topic regenerate share access key request + public partial class TopicRegenerateKeyRequest + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicRegenerateKeyRequest. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicRegenerateKeyRequest. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicRegenerateKeyRequest FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new TopicRegenerateKeyRequest(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._keyName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._keyName.ToString()) : null, "keyName" ,container.Add ); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal TopicRegenerateKeyRequest(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_keyName = If( json?.PropertyT("keyName"), out var __jsonKeyName) ? (string)__jsonKeyName : (string)KeyName;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicSharedAccessKeys.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicSharedAccessKeys.PowerShell.cs new file mode 100644 index 000000000000..42a25a688082 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicSharedAccessKeys.PowerShell.cs @@ -0,0 +1,152 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Shared access keys of the Topic + [System.ComponentModel.TypeConverter(typeof(TopicSharedAccessKeysTypeConverter))] + public partial class TopicSharedAccessKeys + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicSharedAccessKeys DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new TopicSharedAccessKeys(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicSharedAccessKeys DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new TopicSharedAccessKeys(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicSharedAccessKeys FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal TopicSharedAccessKeys(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Key1")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicSharedAccessKeysInternal)this).Key1 = (string) content.GetValueForProperty("Key1",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicSharedAccessKeysInternal)this).Key1, global::System.Convert.ToString); + } + if (content.Contains("Key2")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicSharedAccessKeysInternal)this).Key2 = (string) content.GetValueForProperty("Key2",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicSharedAccessKeysInternal)this).Key2, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal TopicSharedAccessKeys(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Key1")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicSharedAccessKeysInternal)this).Key1 = (string) content.GetValueForProperty("Key1",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicSharedAccessKeysInternal)this).Key1, global::System.Convert.ToString); + } + if (content.Contains("Key2")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicSharedAccessKeysInternal)this).Key2 = (string) content.GetValueForProperty("Key2",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicSharedAccessKeysInternal)this).Key2, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + } + /// Shared access keys of the Topic + [System.ComponentModel.TypeConverter(typeof(TopicSharedAccessKeysTypeConverter))] + public partial interface ITopicSharedAccessKeys + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicSharedAccessKeys.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicSharedAccessKeys.TypeConverter.cs new file mode 100644 index 000000000000..ac5d9e81cdcb --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicSharedAccessKeys.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class TopicSharedAccessKeysTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicSharedAccessKeys ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicSharedAccessKeys).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return TopicSharedAccessKeys.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return TopicSharedAccessKeys.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return TopicSharedAccessKeys.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicSharedAccessKeys.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicSharedAccessKeys.cs new file mode 100644 index 000000000000..521a2054553e --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicSharedAccessKeys.cs @@ -0,0 +1,68 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Shared access keys of the Topic + public partial class TopicSharedAccessKeys : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicSharedAccessKeys, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicSharedAccessKeysInternal + { + + /// Backing field for property. + private string _key1; + + /// Shared access key1 for the topic. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string Key1 { get => this._key1; set => this._key1 = value; } + + /// Backing field for property. + private string _key2; + + /// Shared access key2 for the topic. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string Key2 { get => this._key2; set => this._key2 = value; } + + /// Creates an new instance. + public TopicSharedAccessKeys() + { + + } + } + /// Shared access keys of the Topic + public partial interface ITopicSharedAccessKeys : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// Shared access key1 for the topic. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Shared access key1 for the topic.", + SerializedName = @"key1", + PossibleTypes = new [] { typeof(string) })] + string Key1 { get; set; } + /// Shared access key2 for the topic. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Shared access key2 for the topic.", + SerializedName = @"key2", + PossibleTypes = new [] { typeof(string) })] + string Key2 { get; set; } + + } + /// Shared access keys of the Topic + internal partial interface ITopicSharedAccessKeysInternal + + { + /// Shared access key1 for the topic. + string Key1 { get; set; } + /// Shared access key2 for the topic. + string Key2 { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicSharedAccessKeys.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicSharedAccessKeys.json.cs new file mode 100644 index 000000000000..5de921a74010 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicSharedAccessKeys.json.cs @@ -0,0 +1,108 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Shared access keys of the Topic + public partial class TopicSharedAccessKeys + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicSharedAccessKeys. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicSharedAccessKeys. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicSharedAccessKeys FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new TopicSharedAccessKeys(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._key1)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._key1.ToString()) : null, "key1" ,container.Add ); + AddIf( null != (((object)this._key2)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._key2.ToString()) : null, "key2" ,container.Add ); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal TopicSharedAccessKeys(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_key1 = If( json?.PropertyT("key1"), out var __jsonKey1) ? (string)__jsonKey1 : (string)Key1;} + {_key2 = If( json?.PropertyT("key2"), out var __jsonKey2) ? (string)__jsonKey2 : (string)Key2;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicTypeInfo.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicTypeInfo.PowerShell.cs new file mode 100644 index 000000000000..825de0a4b0fe --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicTypeInfo.PowerShell.cs @@ -0,0 +1,230 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Properties of a topic type info. + [System.ComponentModel.TypeConverter(typeof(TopicTypeInfoTypeConverter))] + public partial class TopicTypeInfo + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypeInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new TopicTypeInfo(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypeInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new TopicTypeInfo(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypeInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal TopicTypeInfo(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypeInfoInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypeProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypeInfoInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.TopicTypePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Provider")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypeInfoInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypeInfoInternal)this).Provider, global::System.Convert.ToString); + } + if (content.Contains("DisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypeInfoInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypeInfoInternal)this).DisplayName, global::System.Convert.ToString); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypeInfoInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypeInfoInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("ResourceRegionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypeInfoInternal)this).ResourceRegionType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceRegionType?) content.GetValueForProperty("ResourceRegionType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypeInfoInternal)this).ResourceRegionType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceRegionType.CreateFrom); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypeInfoInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.TopicTypeProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypeInfoInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.TopicTypeProvisioningState.CreateFrom); + } + if (content.Contains("SupportedLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypeInfoInternal)this).SupportedLocation = (string[]) content.GetValueForProperty("SupportedLocation",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypeInfoInternal)this).SupportedLocation, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("SourceResourceFormat")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypeInfoInternal)this).SourceResourceFormat = (string) content.GetValueForProperty("SourceResourceFormat",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypeInfoInternal)this).SourceResourceFormat, global::System.Convert.ToString); + } + if (content.Contains("SupportedScopesForSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypeInfoInternal)this).SupportedScopesForSource = (string[]) content.GetValueForProperty("SupportedScopesForSource",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypeInfoInternal)this).SupportedScopesForSource, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal TopicTypeInfo(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypeInfoInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypeProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypeInfoInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.TopicTypePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Provider")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypeInfoInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypeInfoInternal)this).Provider, global::System.Convert.ToString); + } + if (content.Contains("DisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypeInfoInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypeInfoInternal)this).DisplayName, global::System.Convert.ToString); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypeInfoInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypeInfoInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("ResourceRegionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypeInfoInternal)this).ResourceRegionType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceRegionType?) content.GetValueForProperty("ResourceRegionType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypeInfoInternal)this).ResourceRegionType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceRegionType.CreateFrom); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypeInfoInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.TopicTypeProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypeInfoInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.TopicTypeProvisioningState.CreateFrom); + } + if (content.Contains("SupportedLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypeInfoInternal)this).SupportedLocation = (string[]) content.GetValueForProperty("SupportedLocation",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypeInfoInternal)this).SupportedLocation, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("SourceResourceFormat")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypeInfoInternal)this).SourceResourceFormat = (string) content.GetValueForProperty("SourceResourceFormat",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypeInfoInternal)this).SourceResourceFormat, global::System.Convert.ToString); + } + if (content.Contains("SupportedScopesForSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypeInfoInternal)this).SupportedScopesForSource = (string[]) content.GetValueForProperty("SupportedScopesForSource",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypeInfoInternal)this).SupportedScopesForSource, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + AfterDeserializePSObject(content); + } + } + /// Properties of a topic type info. + [System.ComponentModel.TypeConverter(typeof(TopicTypeInfoTypeConverter))] + public partial interface ITopicTypeInfo + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicTypeInfo.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicTypeInfo.TypeConverter.cs new file mode 100644 index 000000000000..19b463061f69 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicTypeInfo.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class TopicTypeInfoTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypeInfo ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypeInfo).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return TopicTypeInfo.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return TopicTypeInfo.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return TopicTypeInfo.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicTypeInfo.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicTypeInfo.cs new file mode 100644 index 000000000000..483f0ec37457 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicTypeInfo.cs @@ -0,0 +1,198 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Properties of a topic type info. + public partial class TopicTypeInfo : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypeInfo, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypeInfoInternal, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.Resource(); + + /// Description of the topic type. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypePropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypePropertiesInternal)Property).Description = value ?? null; } + + /// Display Name for the topic type. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypePropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypePropertiesInternal)Property).DisplayName = value ?? null; } + + /// Fully qualified identifier of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Type = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypeProperties Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypeInfoInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.TopicTypeProperties()); set { {_property = value;} } } + + /// Name of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypeProperties _property; + + /// Properties of the topic type info + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypeProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.TopicTypeProperties()); set => this._property = value; } + + /// Namespace of the provider of the topic type. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string Provider { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypePropertiesInternal)Property).Provider; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypePropertiesInternal)Property).Provider = value ?? null; } + + /// Provisioning state of the topic type + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.TopicTypeProvisioningState? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypePropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypePropertiesInternal)Property).ProvisioningState = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.TopicTypeProvisioningState)""); } + + /// Region type of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceRegionType? ResourceRegionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypePropertiesInternal)Property).ResourceRegionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypePropertiesInternal)Property).ResourceRegionType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceRegionType)""); } + + /// Source resource format. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string SourceResourceFormat { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypePropertiesInternal)Property).SourceResourceFormat; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypePropertiesInternal)Property).SourceResourceFormat = value ?? null; } + + /// List of locations supported by this topic type. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string[] SupportedLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypePropertiesInternal)Property).SupportedLocation; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypePropertiesInternal)Property).SupportedLocation = value ?? null /* arrayOf */; } + + /// Supported source scopes. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string[] SupportedScopesForSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypePropertiesInternal)Property).SupportedScopesForSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypePropertiesInternal)Property).SupportedScopesForSource = value ?? null /* arrayOf */; } + + /// Type of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public TopicTypeInfo() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// Properties of a topic type info. + public partial interface ITopicTypeInfo : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResource + { + /// Description of the topic type. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Description of the topic type.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// Display Name for the topic type. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Display Name for the topic type.", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + string DisplayName { get; set; } + /// Namespace of the provider of the topic type. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Namespace of the provider of the topic type.", + SerializedName = @"provider", + PossibleTypes = new [] { typeof(string) })] + string Provider { get; set; } + /// Provisioning state of the topic type + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Provisioning state of the topic type", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.TopicTypeProvisioningState) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.TopicTypeProvisioningState? ProvisioningState { get; set; } + /// Region type of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Region type of the resource.", + SerializedName = @"resourceRegionType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceRegionType) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceRegionType? ResourceRegionType { get; set; } + /// Source resource format. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Source resource format.", + SerializedName = @"sourceResourceFormat", + PossibleTypes = new [] { typeof(string) })] + string SourceResourceFormat { get; set; } + /// List of locations supported by this topic type. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of locations supported by this topic type.", + SerializedName = @"supportedLocations", + PossibleTypes = new [] { typeof(string) })] + string[] SupportedLocation { get; set; } + /// Supported source scopes. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Supported source scopes.", + SerializedName = @"supportedScopesForSource", + PossibleTypes = new [] { typeof(string) })] + string[] SupportedScopesForSource { get; set; } + + } + /// Properties of a topic type info. + internal partial interface ITopicTypeInfoInternal : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal + { + /// Description of the topic type. + string Description { get; set; } + /// Display Name for the topic type. + string DisplayName { get; set; } + /// Properties of the topic type info + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypeProperties Property { get; set; } + /// Namespace of the provider of the topic type. + string Provider { get; set; } + /// Provisioning state of the topic type + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.TopicTypeProvisioningState? ProvisioningState { get; set; } + /// Region type of the resource. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceRegionType? ResourceRegionType { get; set; } + /// Source resource format. + string SourceResourceFormat { get; set; } + /// List of locations supported by this topic type. + string[] SupportedLocation { get; set; } + /// Supported source scopes. + string[] SupportedScopesForSource { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicTypeInfo.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicTypeInfo.json.cs new file mode 100644 index 000000000000..05734e54b194 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicTypeInfo.json.cs @@ -0,0 +1,108 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Properties of a topic type info. + public partial class TopicTypeInfo + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypeInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypeInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypeInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new TopicTypeInfo(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal TopicTypeInfo(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.TopicTypeProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicTypeProperties.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicTypeProperties.PowerShell.cs new file mode 100644 index 000000000000..a3399e21acd6 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicTypeProperties.PowerShell.cs @@ -0,0 +1,200 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Properties of a topic type. + [System.ComponentModel.TypeConverter(typeof(TopicTypePropertiesTypeConverter))] + public partial class TopicTypeProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypeProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new TopicTypeProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypeProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new TopicTypeProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypeProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal TopicTypeProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Provider")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypePropertiesInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypePropertiesInternal)this).Provider, global::System.Convert.ToString); + } + if (content.Contains("DisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypePropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypePropertiesInternal)this).DisplayName, global::System.Convert.ToString); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypePropertiesInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypePropertiesInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("ResourceRegionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypePropertiesInternal)this).ResourceRegionType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceRegionType?) content.GetValueForProperty("ResourceRegionType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypePropertiesInternal)this).ResourceRegionType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceRegionType.CreateFrom); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypePropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.TopicTypeProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypePropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.TopicTypeProvisioningState.CreateFrom); + } + if (content.Contains("SupportedLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypePropertiesInternal)this).SupportedLocation = (string[]) content.GetValueForProperty("SupportedLocation",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypePropertiesInternal)this).SupportedLocation, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("SourceResourceFormat")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypePropertiesInternal)this).SourceResourceFormat = (string) content.GetValueForProperty("SourceResourceFormat",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypePropertiesInternal)this).SourceResourceFormat, global::System.Convert.ToString); + } + if (content.Contains("SupportedScopesForSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypePropertiesInternal)this).SupportedScopesForSource = (string[]) content.GetValueForProperty("SupportedScopesForSource",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypePropertiesInternal)this).SupportedScopesForSource, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal TopicTypeProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Provider")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypePropertiesInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypePropertiesInternal)this).Provider, global::System.Convert.ToString); + } + if (content.Contains("DisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypePropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypePropertiesInternal)this).DisplayName, global::System.Convert.ToString); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypePropertiesInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypePropertiesInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("ResourceRegionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypePropertiesInternal)this).ResourceRegionType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceRegionType?) content.GetValueForProperty("ResourceRegionType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypePropertiesInternal)this).ResourceRegionType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceRegionType.CreateFrom); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypePropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.TopicTypeProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypePropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.TopicTypeProvisioningState.CreateFrom); + } + if (content.Contains("SupportedLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypePropertiesInternal)this).SupportedLocation = (string[]) content.GetValueForProperty("SupportedLocation",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypePropertiesInternal)this).SupportedLocation, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("SourceResourceFormat")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypePropertiesInternal)this).SourceResourceFormat = (string) content.GetValueForProperty("SourceResourceFormat",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypePropertiesInternal)this).SourceResourceFormat, global::System.Convert.ToString); + } + if (content.Contains("SupportedScopesForSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypePropertiesInternal)this).SupportedScopesForSource = (string[]) content.GetValueForProperty("SupportedScopesForSource",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypePropertiesInternal)this).SupportedScopesForSource, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + AfterDeserializePSObject(content); + } + } + /// Properties of a topic type. + [System.ComponentModel.TypeConverter(typeof(TopicTypePropertiesTypeConverter))] + public partial interface ITopicTypeProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicTypeProperties.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicTypeProperties.TypeConverter.cs new file mode 100644 index 000000000000..9536cd110154 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicTypeProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class TopicTypePropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypeProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypeProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return TopicTypeProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return TopicTypeProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return TopicTypeProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicTypeProperties.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicTypeProperties.cs new file mode 100644 index 000000000000..cf5c3d4757f1 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicTypeProperties.cs @@ -0,0 +1,170 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Properties of a topic type. + public partial class TopicTypeProperties : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypeProperties, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypePropertiesInternal + { + + /// Backing field for property. + private string _description; + + /// Description of the topic type. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string Description { get => this._description; set => this._description = value; } + + /// Backing field for property. + private string _displayName; + + /// Display Name for the topic type. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string DisplayName { get => this._displayName; set => this._displayName = value; } + + /// Backing field for property. + private string _provider; + + /// Namespace of the provider of the topic type. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string Provider { get => this._provider; set => this._provider = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.TopicTypeProvisioningState? _provisioningState; + + /// Provisioning state of the topic type + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.TopicTypeProvisioningState? ProvisioningState { get => this._provisioningState; set => this._provisioningState = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceRegionType? _resourceRegionType; + + /// Region type of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceRegionType? ResourceRegionType { get => this._resourceRegionType; set => this._resourceRegionType = value; } + + /// Backing field for property. + private string _sourceResourceFormat; + + /// Source resource format. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string SourceResourceFormat { get => this._sourceResourceFormat; set => this._sourceResourceFormat = value; } + + /// Backing field for property. + private string[] _supportedLocation; + + /// List of locations supported by this topic type. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string[] SupportedLocation { get => this._supportedLocation; set => this._supportedLocation = value; } + + /// Backing field for property. + private string[] _supportedScopesForSource; + + /// Supported source scopes. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string[] SupportedScopesForSource { get => this._supportedScopesForSource; set => this._supportedScopesForSource = value; } + + /// Creates an new instance. + public TopicTypeProperties() + { + + } + } + /// Properties of a topic type. + public partial interface ITopicTypeProperties : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// Description of the topic type. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Description of the topic type.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// Display Name for the topic type. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Display Name for the topic type.", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + string DisplayName { get; set; } + /// Namespace of the provider of the topic type. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Namespace of the provider of the topic type.", + SerializedName = @"provider", + PossibleTypes = new [] { typeof(string) })] + string Provider { get; set; } + /// Provisioning state of the topic type + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Provisioning state of the topic type", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.TopicTypeProvisioningState) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.TopicTypeProvisioningState? ProvisioningState { get; set; } + /// Region type of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Region type of the resource.", + SerializedName = @"resourceRegionType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceRegionType) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceRegionType? ResourceRegionType { get; set; } + /// Source resource format. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Source resource format.", + SerializedName = @"sourceResourceFormat", + PossibleTypes = new [] { typeof(string) })] + string SourceResourceFormat { get; set; } + /// List of locations supported by this topic type. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of locations supported by this topic type.", + SerializedName = @"supportedLocations", + PossibleTypes = new [] { typeof(string) })] + string[] SupportedLocation { get; set; } + /// Supported source scopes. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Supported source scopes.", + SerializedName = @"supportedScopesForSource", + PossibleTypes = new [] { typeof(string) })] + string[] SupportedScopesForSource { get; set; } + + } + /// Properties of a topic type. + internal partial interface ITopicTypePropertiesInternal + + { + /// Description of the topic type. + string Description { get; set; } + /// Display Name for the topic type. + string DisplayName { get; set; } + /// Namespace of the provider of the topic type. + string Provider { get; set; } + /// Provisioning state of the topic type + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.TopicTypeProvisioningState? ProvisioningState { get; set; } + /// Region type of the resource. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceRegionType? ResourceRegionType { get; set; } + /// Source resource format. + string SourceResourceFormat { get; set; } + /// List of locations supported by this topic type. + string[] SupportedLocation { get; set; } + /// Supported source scopes. + string[] SupportedScopesForSource { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicTypeProperties.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicTypeProperties.json.cs new file mode 100644 index 000000000000..41142ce06fbd --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicTypeProperties.json.cs @@ -0,0 +1,136 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Properties of a topic type. + public partial class TopicTypeProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypeProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypeProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypeProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new TopicTypeProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._provider)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._provider.ToString()) : null, "provider" ,container.Add ); + AddIf( null != (((object)this._displayName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._displayName.ToString()) : null, "displayName" ,container.Add ); + AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._description.ToString()) : null, "description" ,container.Add ); + AddIf( null != (((object)this._resourceRegionType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._resourceRegionType.ToString()) : null, "resourceRegionType" ,container.Add ); + AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); + if (null != this._supportedLocation) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.XNodeArray(); + foreach( var __x in this._supportedLocation ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("supportedLocations",__w); + } + AddIf( null != (((object)this._sourceResourceFormat)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._sourceResourceFormat.ToString()) : null, "sourceResourceFormat" ,container.Add ); + if (null != this._supportedScopesForSource) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.XNodeArray(); + foreach( var __s in this._supportedScopesForSource ) + { + AddIf(null != (((object)__s)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(__s.ToString()) : null ,__r.Add); + } + container.Add("supportedScopesForSource",__r); + } + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal TopicTypeProperties(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_provider = If( json?.PropertyT("provider"), out var __jsonProvider) ? (string)__jsonProvider : (string)Provider;} + {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)DisplayName;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} + {_resourceRegionType = If( json?.PropertyT("resourceRegionType"), out var __jsonResourceRegionType) ? (string)__jsonResourceRegionType : (string)ResourceRegionType;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} + {_supportedLocation = If( json?.PropertyT("supportedLocations"), out var __jsonSupportedLocations) ? If( __jsonSupportedLocations as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : SupportedLocation;} + {_sourceResourceFormat = If( json?.PropertyT("sourceResourceFormat"), out var __jsonSourceResourceFormat) ? (string)__jsonSourceResourceFormat : (string)SourceResourceFormat;} + {_supportedScopesForSource = If( json?.PropertyT("supportedScopesForSource"), out var __jsonSupportedScopesForSource) ? If( __jsonSupportedScopesForSource as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(string) (__p is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : SupportedScopesForSource;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicTypesListResult.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicTypesListResult.PowerShell.cs new file mode 100644 index 000000000000..c7e83eebddf6 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicTypesListResult.PowerShell.cs @@ -0,0 +1,144 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Result of the List Topic Types operation + [System.ComponentModel.TypeConverter(typeof(TopicTypesListResultTypeConverter))] + public partial class TopicTypesListResult + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypesListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new TopicTypesListResult(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypesListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new TopicTypesListResult(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypesListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal TopicTypesListResult(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypesListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypeInfo[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypesListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.TopicTypeInfoTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal TopicTypesListResult(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypesListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypeInfo[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypesListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.TopicTypeInfoTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + } + /// Result of the List Topic Types operation + [System.ComponentModel.TypeConverter(typeof(TopicTypesListResultTypeConverter))] + public partial interface ITopicTypesListResult + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicTypesListResult.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicTypesListResult.TypeConverter.cs new file mode 100644 index 000000000000..6f75d37ced4b --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicTypesListResult.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class TopicTypesListResultTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypesListResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypesListResult).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return TopicTypesListResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return TopicTypesListResult.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return TopicTypesListResult.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicTypesListResult.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicTypesListResult.cs new file mode 100644 index 000000000000..50ab59ef3305 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicTypesListResult.cs @@ -0,0 +1,51 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Result of the List Topic Types operation + public partial class TopicTypesListResult : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypesListResult, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypesListResultInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypeInfo[] _value; + + /// A collection of topic types + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypeInfo[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public TopicTypesListResult() + { + + } + } + /// Result of the List Topic Types operation + public partial interface ITopicTypesListResult : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// A collection of topic types + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A collection of topic types", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypeInfo) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypeInfo[] Value { get; set; } + + } + /// Result of the List Topic Types operation + internal partial interface ITopicTypesListResultInternal + + { + /// A collection of topic types + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypeInfo[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicTypesListResult.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicTypesListResult.json.cs new file mode 100644 index 000000000000..6682fea46bfb --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicTypesListResult.json.cs @@ -0,0 +1,114 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Result of the List Topic Types operation + public partial class TopicTypesListResult + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypesListResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypesListResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypesListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new TopicTypesListResult(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal TopicTypesListResult(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypeInfo) (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.TopicTypeInfo.FromJson(__u) )) ))() : null : Value;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicUpdateParameterProperties.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicUpdateParameterProperties.PowerShell.cs new file mode 100644 index 000000000000..c0601d241676 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicUpdateParameterProperties.PowerShell.cs @@ -0,0 +1,168 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Information of topic update parameter properties. + [System.ComponentModel.TypeConverter(typeof(TopicUpdateParameterPropertiesTypeConverter))] + public partial class TopicUpdateParameterProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParameterProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new TopicUpdateParameterProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParameterProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new TopicUpdateParameterProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParameterProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal TopicUpdateParameterProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("PublicNetworkAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParameterPropertiesInternal)this).PublicNetworkAccess = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess?) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParameterPropertiesInternal)this).PublicNetworkAccess, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess.CreateFrom); + } + if (content.Contains("InboundIPRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParameterPropertiesInternal)this).InboundIPRule = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[]) content.GetValueForProperty("InboundIPRule",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParameterPropertiesInternal)this).InboundIPRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.InboundIPRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("DisableLocalAuth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParameterPropertiesInternal)this).DisableLocalAuth = (bool?) content.GetValueForProperty("DisableLocalAuth",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParameterPropertiesInternal)this).DisableLocalAuth, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DataResidencyBoundary")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParameterPropertiesInternal)this).DataResidencyBoundary = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary?) content.GetValueForProperty("DataResidencyBoundary",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParameterPropertiesInternal)this).DataResidencyBoundary, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal TopicUpdateParameterProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("PublicNetworkAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParameterPropertiesInternal)this).PublicNetworkAccess = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess?) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParameterPropertiesInternal)this).PublicNetworkAccess, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess.CreateFrom); + } + if (content.Contains("InboundIPRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParameterPropertiesInternal)this).InboundIPRule = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[]) content.GetValueForProperty("InboundIPRule",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParameterPropertiesInternal)this).InboundIPRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.InboundIPRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("DisableLocalAuth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParameterPropertiesInternal)this).DisableLocalAuth = (bool?) content.GetValueForProperty("DisableLocalAuth",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParameterPropertiesInternal)this).DisableLocalAuth, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DataResidencyBoundary")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParameterPropertiesInternal)this).DataResidencyBoundary = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary?) content.GetValueForProperty("DataResidencyBoundary",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParameterPropertiesInternal)this).DataResidencyBoundary, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary.CreateFrom); + } + AfterDeserializePSObject(content); + } + } + /// Information of topic update parameter properties. + [System.ComponentModel.TypeConverter(typeof(TopicUpdateParameterPropertiesTypeConverter))] + public partial interface ITopicUpdateParameterProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicUpdateParameterProperties.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicUpdateParameterProperties.TypeConverter.cs new file mode 100644 index 000000000000..ffe2f1586336 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicUpdateParameterProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class TopicUpdateParameterPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParameterProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParameterProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return TopicUpdateParameterProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return TopicUpdateParameterProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return TopicUpdateParameterProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicUpdateParameterProperties.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicUpdateParameterProperties.cs new file mode 100644 index 000000000000..002318de3305 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicUpdateParameterProperties.cs @@ -0,0 +1,133 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Information of topic update parameter properties. + public partial class TopicUpdateParameterProperties : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParameterProperties, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParameterPropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary? _dataResidencyBoundary; + + /// The data residency boundary for the topic. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary? DataResidencyBoundary { get => this._dataResidencyBoundary; set => this._dataResidencyBoundary = value; } + + /// Backing field for property. + private bool? _disableLocalAuth; + + /// + /// This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD + /// token will be used to authenticate if user is allowed to publish to the topic. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public bool? DisableLocalAuth { get => this._disableLocalAuth; set => this._disableLocalAuth = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[] _inboundIPRule; + + /// + /// This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess + /// is enabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[] InboundIPRule { get => this._inboundIPRule; set => this._inboundIPRule = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess? _publicNetworkAccess; + + /// + /// This determines if traffic is allowed over public network. By default it is enabled. + /// You can further restrict to specific IPs by configuring + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess? PublicNetworkAccess { get => this._publicNetworkAccess; set => this._publicNetworkAccess = value; } + + /// Creates an new instance. + public TopicUpdateParameterProperties() + { + + } + } + /// Information of topic update parameter properties. + public partial interface ITopicUpdateParameterProperties : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// The data residency boundary for the topic. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The data residency boundary for the topic.", + SerializedName = @"dataResidencyBoundary", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary? DataResidencyBoundary { get; set; } + /// + /// This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD + /// token will be used to authenticate if user is allowed to publish to the topic. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD token will be used to authenticate if user is allowed to publish to the topic.", + SerializedName = @"disableLocalAuth", + PossibleTypes = new [] { typeof(bool) })] + bool? DisableLocalAuth { get; set; } + /// + /// This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess + /// is enabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess is enabled.", + SerializedName = @"inboundIpRules", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[] InboundIPRule { get; set; } + /// + /// This determines if traffic is allowed over public network. By default it is enabled. + /// You can further restrict to specific IPs by configuring + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This determines if traffic is allowed over public network. By default it is enabled. + You can further restrict to specific IPs by configuring ", + SerializedName = @"publicNetworkAccess", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess? PublicNetworkAccess { get; set; } + + } + /// Information of topic update parameter properties. + internal partial interface ITopicUpdateParameterPropertiesInternal + + { + /// The data residency boundary for the topic. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary? DataResidencyBoundary { get; set; } + /// + /// This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD + /// token will be used to authenticate if user is allowed to publish to the topic. + /// + bool? DisableLocalAuth { get; set; } + /// + /// This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess + /// is enabled. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[] InboundIPRule { get; set; } + /// + /// This determines if traffic is allowed over public network. By default it is enabled. + /// You can further restrict to specific IPs by configuring + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess? PublicNetworkAccess { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicUpdateParameterProperties.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicUpdateParameterProperties.json.cs new file mode 100644 index 000000000000..ea4b74c26572 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicUpdateParameterProperties.json.cs @@ -0,0 +1,120 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Information of topic update parameter properties. + public partial class TopicUpdateParameterProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParameterProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParameterProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParameterProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new TopicUpdateParameterProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._publicNetworkAccess)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._publicNetworkAccess.ToString()) : null, "publicNetworkAccess" ,container.Add ); + if (null != this._inboundIPRule) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.XNodeArray(); + foreach( var __x in this._inboundIPRule ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("inboundIpRules",__w); + } + AddIf( null != this._disableLocalAuth ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonBoolean((bool)this._disableLocalAuth) : null, "disableLocalAuth" ,container.Add ); + AddIf( null != (((object)this._dataResidencyBoundary)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._dataResidencyBoundary.ToString()) : null, "dataResidencyBoundary" ,container.Add ); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal TopicUpdateParameterProperties(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_publicNetworkAccess = If( json?.PropertyT("publicNetworkAccess"), out var __jsonPublicNetworkAccess) ? (string)__jsonPublicNetworkAccess : (string)PublicNetworkAccess;} + {_inboundIPRule = If( json?.PropertyT("inboundIpRules"), out var __jsonInboundIPRules) ? If( __jsonInboundIPRules as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule) (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.InboundIPRule.FromJson(__u) )) ))() : null : InboundIPRule;} + {_disableLocalAuth = If( json?.PropertyT("disableLocalAuth"), out var __jsonDisableLocalAuth) ? (bool?)__jsonDisableLocalAuth : DisableLocalAuth;} + {_dataResidencyBoundary = If( json?.PropertyT("dataResidencyBoundary"), out var __jsonDataResidencyBoundary) ? (string)__jsonDataResidencyBoundary : (string)DataResidencyBoundary;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicUpdateParameters.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicUpdateParameters.PowerShell.cs new file mode 100644 index 000000000000..5ff1b57ebdb6 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicUpdateParameters.PowerShell.cs @@ -0,0 +1,240 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Properties of the Topic update + [System.ComponentModel.TypeConverter(typeof(TopicUpdateParametersTypeConverter))] + public partial class TopicUpdateParameters + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new TopicUpdateParameters(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new TopicUpdateParameters(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal TopicUpdateParameters(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Identity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParametersInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfo) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParametersInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IdentityInfoTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParametersInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParameterProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParametersInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.TopicUpdateParameterPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Sku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParametersInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceSku) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParametersInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ResourceSkuTypeConverter.ConvertFrom); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.TopicUpdateParametersTagsTypeConverter.ConvertFrom); + } + if (content.Contains("IdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParametersInternal)this).IdentityType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType?) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParametersInternal)this).IdentityType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType.CreateFrom); + } + if (content.Contains("SkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParametersInternal)this).SkuName = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku?) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParametersInternal)this).SkuName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku.CreateFrom); + } + if (content.Contains("IdentityPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParametersInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParametersInternal)this).IdentityPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("IdentityTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParametersInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParametersInternal)this).IdentityTenantId, global::System.Convert.ToString); + } + if (content.Contains("IdentityUserAssignedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParametersInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParametersInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IdentityInfoUserAssignedIdentitiesTypeConverter.ConvertFrom); + } + if (content.Contains("PublicNetworkAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParametersInternal)this).PublicNetworkAccess = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess?) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParametersInternal)this).PublicNetworkAccess, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess.CreateFrom); + } + if (content.Contains("InboundIPRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParametersInternal)this).InboundIPRule = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[]) content.GetValueForProperty("InboundIPRule",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParametersInternal)this).InboundIPRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.InboundIPRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("DisableLocalAuth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParametersInternal)this).DisableLocalAuth = (bool?) content.GetValueForProperty("DisableLocalAuth",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParametersInternal)this).DisableLocalAuth, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DataResidencyBoundary")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParametersInternal)this).DataResidencyBoundary = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary?) content.GetValueForProperty("DataResidencyBoundary",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParametersInternal)this).DataResidencyBoundary, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal TopicUpdateParameters(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Identity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParametersInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfo) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParametersInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IdentityInfoTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParametersInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParameterProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParametersInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.TopicUpdateParameterPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Sku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParametersInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceSku) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParametersInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ResourceSkuTypeConverter.ConvertFrom); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.TopicUpdateParametersTagsTypeConverter.ConvertFrom); + } + if (content.Contains("IdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParametersInternal)this).IdentityType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType?) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParametersInternal)this).IdentityType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType.CreateFrom); + } + if (content.Contains("SkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParametersInternal)this).SkuName = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku?) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParametersInternal)this).SkuName, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku.CreateFrom); + } + if (content.Contains("IdentityPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParametersInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParametersInternal)this).IdentityPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("IdentityTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParametersInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParametersInternal)this).IdentityTenantId, global::System.Convert.ToString); + } + if (content.Contains("IdentityUserAssignedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParametersInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParametersInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IdentityInfoUserAssignedIdentitiesTypeConverter.ConvertFrom); + } + if (content.Contains("PublicNetworkAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParametersInternal)this).PublicNetworkAccess = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess?) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParametersInternal)this).PublicNetworkAccess, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess.CreateFrom); + } + if (content.Contains("InboundIPRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParametersInternal)this).InboundIPRule = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[]) content.GetValueForProperty("InboundIPRule",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParametersInternal)this).InboundIPRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.InboundIPRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("DisableLocalAuth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParametersInternal)this).DisableLocalAuth = (bool?) content.GetValueForProperty("DisableLocalAuth",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParametersInternal)this).DisableLocalAuth, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DataResidencyBoundary")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParametersInternal)this).DataResidencyBoundary = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary?) content.GetValueForProperty("DataResidencyBoundary",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParametersInternal)this).DataResidencyBoundary, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary.CreateFrom); + } + AfterDeserializePSObject(content); + } + } + /// Properties of the Topic update + [System.ComponentModel.TypeConverter(typeof(TopicUpdateParametersTypeConverter))] + public partial interface ITopicUpdateParameters + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicUpdateParameters.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicUpdateParameters.TypeConverter.cs new file mode 100644 index 000000000000..bb4048d689f0 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicUpdateParameters.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class TopicUpdateParametersTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParameters ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParameters).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return TopicUpdateParameters.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return TopicUpdateParameters.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return TopicUpdateParameters.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicUpdateParameters.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicUpdateParameters.cs new file mode 100644 index 000000000000..38cd713030d5 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicUpdateParameters.cs @@ -0,0 +1,270 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Properties of the Topic update + public partial class TopicUpdateParameters : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParameters, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParametersInternal + { + + /// The data residency boundary for the topic. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary? DataResidencyBoundary { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParameterPropertiesInternal)Property).DataResidencyBoundary; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParameterPropertiesInternal)Property).DataResidencyBoundary = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary)""); } + + /// + /// This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD + /// token will be used to authenticate if user is allowed to publish to the topic. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public bool? DisableLocalAuth { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParameterPropertiesInternal)Property).DisableLocalAuth; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParameterPropertiesInternal)Property).DisableLocalAuth = value ?? default(bool); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfo _identity; + + /// Topic resource identity information. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfo Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IdentityInfo()); set => this._identity = value; } + + /// The principal ID of resource identity. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoInternal)Identity).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoInternal)Identity).PrincipalId = value ?? null; } + + /// The tenant ID of resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoInternal)Identity).TenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoInternal)Identity).TenantId = value ?? null; } + + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType? IdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoInternal)Identity).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoInternal)Identity).Type = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType)""); } + + /// + /// The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource + /// ids in the form: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + /// This property is currently not used and reserved for future usage. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoInternal)Identity).UserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoInternal)Identity).UserAssignedIdentity = value ?? null /* model class */; } + + /// + /// This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess + /// is enabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[] InboundIPRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParameterPropertiesInternal)Property).InboundIPRule; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParameterPropertiesInternal)Property).InboundIPRule = value ?? null /* arrayOf */; } + + /// Internal Acessors for Identity + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfo Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParametersInternal.Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IdentityInfo()); set { {_identity = value;} } } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParameterProperties Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParametersInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.TopicUpdateParameterProperties()); set { {_property = value;} } } + + /// Internal Acessors for Sku + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceSku Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParametersInternal.Sku { get => (this._sku = this._sku ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ResourceSku()); set { {_sku = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParameterProperties _property; + + /// Properties of the Topic resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParameterProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.TopicUpdateParameterProperties()); set => this._property = value; } + + /// + /// This determines if traffic is allowed over public network. By default it is enabled. + /// You can further restrict to specific IPs by configuring + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess? PublicNetworkAccess { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParameterPropertiesInternal)Property).PublicNetworkAccess; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParameterPropertiesInternal)Property).PublicNetworkAccess = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess)""); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceSku _sku; + + /// The Sku pricing tier for the topic. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceSku Sku { get => (this._sku = this._sku ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ResourceSku()); set => this._sku = value; } + + /// The Sku name of the resource. The possible values are: Basic or Premium. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku? SkuName { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceSkuInternal)Sku).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceSkuInternal)Sku).Name = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku)""); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParametersTags _tag; + + /// Tags of the Topic resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParametersTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.TopicUpdateParametersTags()); set => this._tag = value; } + + /// Creates an new instance. + public TopicUpdateParameters() + { + + } + } + /// Properties of the Topic update + public partial interface ITopicUpdateParameters : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// The data residency boundary for the topic. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The data residency boundary for the topic.", + SerializedName = @"dataResidencyBoundary", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary? DataResidencyBoundary { get; set; } + /// + /// This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD + /// token will be used to authenticate if user is allowed to publish to the topic. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD token will be used to authenticate if user is allowed to publish to the topic.", + SerializedName = @"disableLocalAuth", + PossibleTypes = new [] { typeof(bool) })] + bool? DisableLocalAuth { get; set; } + /// The principal ID of resource identity. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The principal ID of resource identity.", + SerializedName = @"principalId", + PossibleTypes = new [] { typeof(string) })] + string IdentityPrincipalId { get; set; } + /// The tenant ID of resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The tenant ID of resource.", + SerializedName = @"tenantId", + PossibleTypes = new [] { typeof(string) })] + string IdentityTenantId { get; set; } + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType? IdentityType { get; set; } + /// + /// The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource + /// ids in the form: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + /// This property is currently not used and reserved for future usage. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + This property is currently not used and reserved for future usage.", + SerializedName = @"userAssignedIdentities", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } + /// + /// This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess + /// is enabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess is enabled.", + SerializedName = @"inboundIpRules", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[] InboundIPRule { get; set; } + /// + /// This determines if traffic is allowed over public network. By default it is enabled. + /// You can further restrict to specific IPs by configuring + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This determines if traffic is allowed over public network. By default it is enabled. + You can further restrict to specific IPs by configuring ", + SerializedName = @"publicNetworkAccess", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess? PublicNetworkAccess { get; set; } + /// The Sku name of the resource. The possible values are: Basic or Premium. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Sku name of the resource. The possible values are: Basic or Premium.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku? SkuName { get; set; } + /// Tags of the Topic resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Tags of the Topic resource.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParametersTags) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParametersTags Tag { get; set; } + + } + /// Properties of the Topic update + internal partial interface ITopicUpdateParametersInternal + + { + /// The data residency boundary for the topic. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary? DataResidencyBoundary { get; set; } + /// + /// This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD + /// token will be used to authenticate if user is allowed to publish to the topic. + /// + bool? DisableLocalAuth { get; set; } + /// Topic resource identity information. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfo Identity { get; set; } + /// The principal ID of resource identity. + string IdentityPrincipalId { get; set; } + /// The tenant ID of resource. + string IdentityTenantId { get; set; } + /// + /// 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. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType? IdentityType { get; set; } + /// + /// The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource + /// ids in the form: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + /// This property is currently not used and reserved for future usage. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } + /// + /// This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess + /// is enabled. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[] InboundIPRule { get; set; } + /// Properties of the Topic resource. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParameterProperties Property { get; set; } + /// + /// This determines if traffic is allowed over public network. By default it is enabled. + /// You can further restrict to specific IPs by configuring + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess? PublicNetworkAccess { get; set; } + /// The Sku pricing tier for the topic. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceSku Sku { get; set; } + /// The Sku name of the resource. The possible values are: Basic or Premium. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku? SkuName { get; set; } + /// Tags of the Topic resource. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParametersTags Tag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicUpdateParameters.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicUpdateParameters.json.cs new file mode 100644 index 000000000000..4f2fd05f23fc --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicUpdateParameters.json.cs @@ -0,0 +1,112 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Properties of the Topic update + public partial class TopicUpdateParameters + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParameters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParameters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new TopicUpdateParameters(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._identity ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._identity.ToJson(null,serializationMode) : null, "identity" ,container.Add ); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AddIf( null != this._sku ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._sku.ToJson(null,serializationMode) : null, "sku" ,container.Add ); + AddIf( null != this._tag ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._tag.ToJson(null,serializationMode) : null, "tags" ,container.Add ); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal TopicUpdateParameters(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_identity = If( json?.PropertyT("identity"), out var __jsonIdentity) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IdentityInfo.FromJson(__jsonIdentity) : Identity;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.TopicUpdateParameterProperties.FromJson(__jsonProperties) : Property;} + {_sku = If( json?.PropertyT("sku"), out var __jsonSku) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ResourceSku.FromJson(__jsonSku) : Sku;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.TopicUpdateParametersTags.FromJson(__jsonTags) : Tag;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicUpdateParametersTags.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicUpdateParametersTags.PowerShell.cs new file mode 100644 index 000000000000..e8fa4a27caac --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicUpdateParametersTags.PowerShell.cs @@ -0,0 +1,140 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Tags of the Topic resource. + [System.ComponentModel.TypeConverter(typeof(TopicUpdateParametersTagsTypeConverter))] + public partial class TopicUpdateParametersTags + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParametersTags DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new TopicUpdateParametersTags(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParametersTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new TopicUpdateParametersTags(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParametersTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal TopicUpdateParametersTags(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal TopicUpdateParametersTags(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + } + /// Tags of the Topic resource. + [System.ComponentModel.TypeConverter(typeof(TopicUpdateParametersTagsTypeConverter))] + public partial interface ITopicUpdateParametersTags + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicUpdateParametersTags.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicUpdateParametersTags.TypeConverter.cs new file mode 100644 index 000000000000..5e3c3dad78e6 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicUpdateParametersTags.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class TopicUpdateParametersTagsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParametersTags ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParametersTags).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return TopicUpdateParametersTags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return TopicUpdateParametersTags.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return TopicUpdateParametersTags.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicUpdateParametersTags.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicUpdateParametersTags.cs new file mode 100644 index 000000000000..2e34142a5de6 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicUpdateParametersTags.cs @@ -0,0 +1,35 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Tags of the Topic resource. + public partial class TopicUpdateParametersTags : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParametersTags, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParametersTagsInternal + { + + /// Creates an new instance. + public TopicUpdateParametersTags() + { + + } + } + /// Tags of the Topic resource. + public partial interface ITopicUpdateParametersTags : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray + { + + } + /// Tags of the Topic resource. + internal partial interface ITopicUpdateParametersTagsInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicUpdateParametersTags.dictionary.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicUpdateParametersTags.dictionary.cs new file mode 100644 index 000000000000..a2939707a5fb --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicUpdateParametersTags.dictionary.cs @@ -0,0 +1,75 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + public partial class TopicUpdateParametersTags : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.TopicUpdateParametersTags source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicUpdateParametersTags.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicUpdateParametersTags.json.cs new file mode 100644 index 000000000000..6ae42755468c --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicUpdateParametersTags.json.cs @@ -0,0 +1,107 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Tags of the Topic resource. + public partial class TopicUpdateParametersTags + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParametersTags. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParametersTags. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParametersTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new TopicUpdateParametersTags(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + /// + internal TopicUpdateParametersTags(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicsListResult.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicsListResult.PowerShell.cs new file mode 100644 index 000000000000..2c0836663f66 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicsListResult.PowerShell.cs @@ -0,0 +1,150 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Result of the List Topics operation + [System.ComponentModel.TypeConverter(typeof(TopicsListResultTypeConverter))] + public partial class TopicsListResult + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicsListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new TopicsListResult(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicsListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new TopicsListResult(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicsListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal TopicsListResult(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicsListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopic[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicsListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.TopicTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicsListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicsListResultInternal)this).NextLink, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal TopicsListResult(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicsListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopic[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicsListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.TopicTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicsListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicsListResultInternal)this).NextLink, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + } + /// Result of the List Topics operation + [System.ComponentModel.TypeConverter(typeof(TopicsListResultTypeConverter))] + public partial interface ITopicsListResult + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicsListResult.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicsListResult.TypeConverter.cs new file mode 100644 index 000000000000..2f0e8a94f1d2 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicsListResult.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class TopicsListResultTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicsListResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicsListResult).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return TopicsListResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return TopicsListResult.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return TopicsListResult.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicsListResult.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicsListResult.cs new file mode 100644 index 000000000000..d6b047a66a83 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicsListResult.cs @@ -0,0 +1,68 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Result of the List Topics operation + public partial class TopicsListResult : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicsListResult, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicsListResultInternal + { + + /// Backing field for property. + private string _nextLink; + + /// A link for the next page of topics + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopic[] _value; + + /// A collection of Topics + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopic[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public TopicsListResult() + { + + } + } + /// Result of the List Topics operation + public partial interface ITopicsListResult : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// A link for the next page of topics + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A link for the next page of topics", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// A collection of Topics + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A collection of Topics", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopic) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopic[] Value { get; set; } + + } + /// Result of the List Topics operation + internal partial interface ITopicsListResultInternal + + { + /// A link for the next page of topics + string NextLink { get; set; } + /// A collection of Topics + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopic[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicsListResult.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicsListResult.json.cs new file mode 100644 index 000000000000..e1341d3ad39f --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TopicsListResult.json.cs @@ -0,0 +1,116 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Result of the List Topics operation + public partial class TopicsListResult + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicsListResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicsListResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicsListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new TopicsListResult(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal TopicsListResult(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopic) (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.Topic.FromJson(__u) )) ))() : null : Value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TrackedResource.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TrackedResource.PowerShell.cs new file mode 100644 index 000000000000..64808bb7bb00 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TrackedResource.PowerShell.cs @@ -0,0 +1,174 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Definition of a Tracked Resource. + [System.ComponentModel.TypeConverter(typeof(TrackedResourceTypeConverter))] + public partial class TrackedResource + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new TrackedResource(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new TrackedResource(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal TrackedResource(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.TrackedResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Type, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal TrackedResource(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.TrackedResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Type, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + } + /// Definition of a Tracked Resource. + [System.ComponentModel.TypeConverter(typeof(TrackedResourceTypeConverter))] + public partial interface ITrackedResource + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TrackedResource.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TrackedResource.TypeConverter.cs new file mode 100644 index 000000000000..0b3e1631883a --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TrackedResource.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class TrackedResourceTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResource ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResource).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return TrackedResource.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return TrackedResource.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return TrackedResource.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TrackedResource.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TrackedResource.cs new file mode 100644 index 000000000000..ff59257eb868 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TrackedResource.cs @@ -0,0 +1,108 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Definition of a Tracked Resource. + public partial class TrackedResource : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResource, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceInternal, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.Resource(); + + /// Fully qualified identifier of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Id; } + + /// Backing field for property. + private string _location; + + /// Location of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string Location { get => this._location; set => this._location = value; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Type = value; } + + /// Name of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceTags _tag; + + /// Tags of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.TrackedResourceTags()); set => this._tag = value; } + + /// Type of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public TrackedResource() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// Definition of a Tracked Resource. + public partial interface ITrackedResource : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResource + { + /// Location of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Location of the resource.", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + string Location { get; set; } + /// Tags of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Tags of the resource.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceTags) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceTags Tag { get; set; } + + } + /// Definition of a Tracked Resource. + internal partial interface ITrackedResourceInternal : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal + { + /// Location of the resource. + string Location { get; set; } + /// Tags of the resource. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceTags Tag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TrackedResource.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TrackedResource.json.cs new file mode 100644 index 000000000000..d3132cc882ae --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TrackedResource.json.cs @@ -0,0 +1,110 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Definition of a Tracked Resource. + public partial class TrackedResource + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResource. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResource. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new TrackedResource(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != (((object)this._location)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._location.ToString()) : null, "location" ,container.Add ); + AddIf( null != this._tag ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._tag.ToJson(null,serializationMode) : null, "tags" ,container.Add ); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal TrackedResource(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.Resource(json); + {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)Location;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.TrackedResourceTags.FromJson(__jsonTags) : Tag;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TrackedResourceTags.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TrackedResourceTags.PowerShell.cs new file mode 100644 index 000000000000..e128f7ee6e34 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TrackedResourceTags.PowerShell.cs @@ -0,0 +1,140 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Tags of the resource. + [System.ComponentModel.TypeConverter(typeof(TrackedResourceTagsTypeConverter))] + public partial class TrackedResourceTags + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceTags DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new TrackedResourceTags(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new TrackedResourceTags(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal TrackedResourceTags(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal TrackedResourceTags(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + } + /// Tags of the resource. + [System.ComponentModel.TypeConverter(typeof(TrackedResourceTagsTypeConverter))] + public partial interface ITrackedResourceTags + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TrackedResourceTags.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TrackedResourceTags.TypeConverter.cs new file mode 100644 index 000000000000..ff2b2de73ae4 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TrackedResourceTags.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class TrackedResourceTagsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceTags ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceTags).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return TrackedResourceTags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return TrackedResourceTags.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return TrackedResourceTags.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TrackedResourceTags.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TrackedResourceTags.cs new file mode 100644 index 000000000000..6ae985ce490e --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TrackedResourceTags.cs @@ -0,0 +1,35 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Tags of the resource. + public partial class TrackedResourceTags : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceTags, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceTagsInternal + { + + /// Creates an new instance. + public TrackedResourceTags() + { + + } + } + /// Tags of the resource. + public partial interface ITrackedResourceTags : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray + { + + } + /// Tags of the resource. + internal partial interface ITrackedResourceTagsInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TrackedResourceTags.dictionary.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TrackedResourceTags.dictionary.cs new file mode 100644 index 000000000000..3310d6359e53 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TrackedResourceTags.dictionary.cs @@ -0,0 +1,75 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + public partial class TrackedResourceTags : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.TrackedResourceTags source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TrackedResourceTags.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TrackedResourceTags.json.cs new file mode 100644 index 000000000000..d5bcb5f09f7c --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/TrackedResourceTags.json.cs @@ -0,0 +1,107 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Tags of the resource. + public partial class TrackedResourceTags + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceTags. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceTags. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new TrackedResourceTags(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + /// + internal TrackedResourceTags(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/UserIdentityProperties.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/UserIdentityProperties.PowerShell.cs new file mode 100644 index 000000000000..17c64cdd8110 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/UserIdentityProperties.PowerShell.cs @@ -0,0 +1,152 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// The information about the user identity. + [System.ComponentModel.TypeConverter(typeof(UserIdentityPropertiesTypeConverter))] + public partial class UserIdentityProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IUserIdentityProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new UserIdentityProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IUserIdentityProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new UserIdentityProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IUserIdentityProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal UserIdentityProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("PrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IUserIdentityPropertiesInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IUserIdentityPropertiesInternal)this).PrincipalId, global::System.Convert.ToString); + } + if (content.Contains("ClientId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IUserIdentityPropertiesInternal)this).ClientId = (string) content.GetValueForProperty("ClientId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IUserIdentityPropertiesInternal)this).ClientId, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal UserIdentityProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("PrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IUserIdentityPropertiesInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IUserIdentityPropertiesInternal)this).PrincipalId, global::System.Convert.ToString); + } + if (content.Contains("ClientId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IUserIdentityPropertiesInternal)this).ClientId = (string) content.GetValueForProperty("ClientId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IUserIdentityPropertiesInternal)this).ClientId, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + } + /// The information about the user identity. + [System.ComponentModel.TypeConverter(typeof(UserIdentityPropertiesTypeConverter))] + public partial interface IUserIdentityProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/UserIdentityProperties.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/UserIdentityProperties.TypeConverter.cs new file mode 100644 index 000000000000..709273a6f9ce --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/UserIdentityProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class UserIdentityPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IUserIdentityProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IUserIdentityProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return UserIdentityProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return UserIdentityProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return UserIdentityProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/UserIdentityProperties.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/UserIdentityProperties.cs new file mode 100644 index 000000000000..97519d82c79b --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/UserIdentityProperties.cs @@ -0,0 +1,68 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// The information about the user identity. + public partial class UserIdentityProperties : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IUserIdentityProperties, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IUserIdentityPropertiesInternal + { + + /// Backing field for property. + private string _clientId; + + /// The client id of user assigned identity. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string ClientId { get => this._clientId; set => this._clientId = value; } + + /// Backing field for property. + private string _principalId; + + /// The principal id of user assigned identity. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string PrincipalId { get => this._principalId; set => this._principalId = value; } + + /// Creates an new instance. + public UserIdentityProperties() + { + + } + } + /// The information about the user identity. + public partial interface IUserIdentityProperties : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// The client id of user assigned identity. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The client id of user assigned identity.", + SerializedName = @"clientId", + PossibleTypes = new [] { typeof(string) })] + string ClientId { get; set; } + /// The principal id of user assigned identity. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The principal id of user assigned identity.", + SerializedName = @"principalId", + PossibleTypes = new [] { typeof(string) })] + string PrincipalId { get; set; } + + } + /// The information about the user identity. + internal partial interface IUserIdentityPropertiesInternal + + { + /// The client id of user assigned identity. + string ClientId { get; set; } + /// The principal id of user assigned identity. + string PrincipalId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/UserIdentityProperties.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/UserIdentityProperties.json.cs new file mode 100644 index 000000000000..4e8f4a783e15 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/UserIdentityProperties.json.cs @@ -0,0 +1,108 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// The information about the user identity. + public partial class UserIdentityProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IUserIdentityProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IUserIdentityProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IUserIdentityProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new UserIdentityProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._principalId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._principalId.ToString()) : null, "principalId" ,container.Add ); + AddIf( null != (((object)this._clientId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._clientId.ToString()) : null, "clientId" ,container.Add ); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal UserIdentityProperties(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)PrincipalId;} + {_clientId = If( json?.PropertyT("clientId"), out var __jsonClientId) ? (string)__jsonClientId : (string)ClientId;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/VerifiedPartner.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/VerifiedPartner.PowerShell.cs new file mode 100644 index 000000000000..1bc8ef1df502 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/VerifiedPartner.PowerShell.cs @@ -0,0 +1,318 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Verified partner information + [System.ComponentModel.TypeConverter(typeof(VerifiedPartnerTypeConverter))] + public partial class VerifiedPartner + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartner DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new VerifiedPartner(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartner DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new VerifiedPartner(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartner FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal VerifiedPartner(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.VerifiedPartnerPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("PartnerTopicDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerInternal)this).PartnerTopicDetail = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDetails) content.GetValueForProperty("PartnerTopicDetail",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerInternal)this).PartnerTopicDetail, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("PartnerDestinationDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerInternal)this).PartnerDestinationDetail = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDetails) content.GetValueForProperty("PartnerDestinationDetail",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerInternal)this).PartnerDestinationDetail, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("PartnerRegistrationImmutableId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerInternal)this).PartnerRegistrationImmutableId = (string) content.GetValueForProperty("PartnerRegistrationImmutableId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerInternal)this).PartnerRegistrationImmutableId, global::System.Convert.ToString); + } + if (content.Contains("OrganizationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerInternal)this).OrganizationName = (string) content.GetValueForProperty("OrganizationName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerInternal)this).OrganizationName, global::System.Convert.ToString); + } + if (content.Contains("PartnerDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerInternal)this).PartnerDisplayName = (string) content.GetValueForProperty("PartnerDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerInternal)this).PartnerDisplayName, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.VerifiedPartnerProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.VerifiedPartnerProvisioningState.CreateFrom); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("PartnerTopicDetailDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerInternal)this).PartnerTopicDetailDescription = (string) content.GetValueForProperty("PartnerTopicDetailDescription",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerInternal)this).PartnerTopicDetailDescription, global::System.Convert.ToString); + } + if (content.Contains("PartnerTopicDetailLongDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerInternal)this).PartnerTopicDetailLongDescription = (string) content.GetValueForProperty("PartnerTopicDetailLongDescription",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerInternal)this).PartnerTopicDetailLongDescription, global::System.Convert.ToString); + } + if (content.Contains("PartnerTopicDetailSetupUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerInternal)this).PartnerTopicDetailSetupUri = (string) content.GetValueForProperty("PartnerTopicDetailSetupUri",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerInternal)this).PartnerTopicDetailSetupUri, global::System.Convert.ToString); + } + if (content.Contains("PartnerDestinationDetailDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerInternal)this).PartnerDestinationDetailDescription = (string) content.GetValueForProperty("PartnerDestinationDetailDescription",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerInternal)this).PartnerDestinationDetailDescription, global::System.Convert.ToString); + } + if (content.Contains("PartnerDestinationDetailLongDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerInternal)this).PartnerDestinationDetailLongDescription = (string) content.GetValueForProperty("PartnerDestinationDetailLongDescription",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerInternal)this).PartnerDestinationDetailLongDescription, global::System.Convert.ToString); + } + if (content.Contains("PartnerDestinationDetailSetupUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerInternal)this).PartnerDestinationDetailSetupUri = (string) content.GetValueForProperty("PartnerDestinationDetailSetupUri",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerInternal)this).PartnerDestinationDetailSetupUri, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal VerifiedPartner(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.VerifiedPartnerPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("PartnerTopicDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerInternal)this).PartnerTopicDetail = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDetails) content.GetValueForProperty("PartnerTopicDetail",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerInternal)this).PartnerTopicDetail, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("PartnerDestinationDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerInternal)this).PartnerDestinationDetail = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDetails) content.GetValueForProperty("PartnerDestinationDetail",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerInternal)this).PartnerDestinationDetail, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("PartnerRegistrationImmutableId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerInternal)this).PartnerRegistrationImmutableId = (string) content.GetValueForProperty("PartnerRegistrationImmutableId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerInternal)this).PartnerRegistrationImmutableId, global::System.Convert.ToString); + } + if (content.Contains("OrganizationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerInternal)this).OrganizationName = (string) content.GetValueForProperty("OrganizationName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerInternal)this).OrganizationName, global::System.Convert.ToString); + } + if (content.Contains("PartnerDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerInternal)this).PartnerDisplayName = (string) content.GetValueForProperty("PartnerDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerInternal)this).PartnerDisplayName, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.VerifiedPartnerProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.VerifiedPartnerProvisioningState.CreateFrom); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("PartnerTopicDetailDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerInternal)this).PartnerTopicDetailDescription = (string) content.GetValueForProperty("PartnerTopicDetailDescription",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerInternal)this).PartnerTopicDetailDescription, global::System.Convert.ToString); + } + if (content.Contains("PartnerTopicDetailLongDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerInternal)this).PartnerTopicDetailLongDescription = (string) content.GetValueForProperty("PartnerTopicDetailLongDescription",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerInternal)this).PartnerTopicDetailLongDescription, global::System.Convert.ToString); + } + if (content.Contains("PartnerTopicDetailSetupUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerInternal)this).PartnerTopicDetailSetupUri = (string) content.GetValueForProperty("PartnerTopicDetailSetupUri",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerInternal)this).PartnerTopicDetailSetupUri, global::System.Convert.ToString); + } + if (content.Contains("PartnerDestinationDetailDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerInternal)this).PartnerDestinationDetailDescription = (string) content.GetValueForProperty("PartnerDestinationDetailDescription",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerInternal)this).PartnerDestinationDetailDescription, global::System.Convert.ToString); + } + if (content.Contains("PartnerDestinationDetailLongDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerInternal)this).PartnerDestinationDetailLongDescription = (string) content.GetValueForProperty("PartnerDestinationDetailLongDescription",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerInternal)this).PartnerDestinationDetailLongDescription, global::System.Convert.ToString); + } + if (content.Contains("PartnerDestinationDetailSetupUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerInternal)this).PartnerDestinationDetailSetupUri = (string) content.GetValueForProperty("PartnerDestinationDetailSetupUri",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerInternal)this).PartnerDestinationDetailSetupUri, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + } + /// Verified partner information + [System.ComponentModel.TypeConverter(typeof(VerifiedPartnerTypeConverter))] + public partial interface IVerifiedPartner + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/VerifiedPartner.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/VerifiedPartner.TypeConverter.cs new file mode 100644 index 000000000000..94e2fcdbcf84 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/VerifiedPartner.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class VerifiedPartnerTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartner ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartner).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return VerifiedPartner.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return VerifiedPartner.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return VerifiedPartner.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/VerifiedPartner.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/VerifiedPartner.cs new file mode 100644 index 000000000000..2fe1b7363d4f --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/VerifiedPartner.cs @@ -0,0 +1,376 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Verified partner information + public partial class VerifiedPartner : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartner, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerInternal, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.Resource(); + + /// Fully qualified identifier of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Type = value; } + + /// Internal Acessors for PartnerDestinationDetail + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDetails Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerInternal.PartnerDestinationDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerPropertiesInternal)Property).PartnerDestinationDetail; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerPropertiesInternal)Property).PartnerDestinationDetail = value; } + + /// Internal Acessors for PartnerTopicDetail + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDetails Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerInternal.PartnerTopicDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerPropertiesInternal)Property).PartnerTopicDetail; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerPropertiesInternal)Property).PartnerTopicDetail = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerProperties Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.VerifiedPartnerProperties()); set { {_property = value;} } } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.SystemData()); set { {_systemData = value;} } } + + /// Name of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Name; } + + /// Official name of the Partner. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string OrganizationName { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerPropertiesInternal)Property).OrganizationName; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerPropertiesInternal)Property).OrganizationName = value ?? null; } + + /// + /// This is short description about the partner. The length of this description should not exceed 256 characters. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string PartnerDestinationDetailDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerPropertiesInternal)Property).PartnerDestinationDetailDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerPropertiesInternal)Property).PartnerDestinationDetailDescription = value ?? null; } + + /// + /// Long description for the partner's scenarios and integration.Length of this description should not exceed 2048 characters. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string PartnerDestinationDetailLongDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerPropertiesInternal)Property).PartnerDestinationDetailLongDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerPropertiesInternal)Property).PartnerDestinationDetailLongDescription = value ?? null; } + + /// + /// URI of the partner website that can be used by Azure customers to setup Event Grid + /// integration on an event source. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string PartnerDestinationDetailSetupUri { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerPropertiesInternal)Property).PartnerDestinationDetailSetupUri; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerPropertiesInternal)Property).PartnerDestinationDetailSetupUri = value ?? null; } + + /// Display name of the verified partner. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string PartnerDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerPropertiesInternal)Property).PartnerDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerPropertiesInternal)Property).PartnerDisplayName = value ?? null; } + + /// ImmutableId of the corresponding partner registration. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string PartnerRegistrationImmutableId { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerPropertiesInternal)Property).PartnerRegistrationImmutableId; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerPropertiesInternal)Property).PartnerRegistrationImmutableId = value ?? null; } + + /// + /// This is short description about the partner. The length of this description should not exceed 256 characters. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string PartnerTopicDetailDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerPropertiesInternal)Property).PartnerTopicDetailDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerPropertiesInternal)Property).PartnerTopicDetailDescription = value ?? null; } + + /// + /// Long description for the partner's scenarios and integration.Length of this description should not exceed 2048 characters. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string PartnerTopicDetailLongDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerPropertiesInternal)Property).PartnerTopicDetailLongDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerPropertiesInternal)Property).PartnerTopicDetailLongDescription = value ?? null; } + + /// + /// URI of the partner website that can be used by Azure customers to setup Event Grid + /// integration on an event source. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string PartnerTopicDetailSetupUri { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerPropertiesInternal)Property).PartnerTopicDetailSetupUri; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerPropertiesInternal)Property).PartnerTopicDetailSetupUri = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerProperties _property; + + /// Properties of the verified partner. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.VerifiedPartnerProperties()); set => this._property = value; } + + /// Provisioning state of the verified partner. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.VerifiedPartnerProvisioningState? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerPropertiesInternal)Property).ProvisioningState = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.VerifiedPartnerProvisioningState)""); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData _systemData; + + /// The system metadata relating to Verified Partner resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.SystemData()); } + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).CreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType)""); } + + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType)""); } + + /// Type of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal)__resource).Type; } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + + /// Creates an new instance. + public VerifiedPartner() + { + + } + } + /// Verified partner information + public partial interface IVerifiedPartner : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResource + { + /// Official name of the Partner. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Official name of the Partner.", + SerializedName = @"organizationName", + PossibleTypes = new [] { typeof(string) })] + string OrganizationName { get; set; } + /// + /// This is short description about the partner. The length of this description should not exceed 256 characters. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This is short description about the partner. The length of this description should not exceed 256 characters.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string PartnerDestinationDetailDescription { get; set; } + /// + /// Long description for the partner's scenarios and integration.Length of this description should not exceed 2048 characters. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Long description for the partner's scenarios and integration.Length of this description should not exceed 2048 characters.", + SerializedName = @"longDescription", + PossibleTypes = new [] { typeof(string) })] + string PartnerDestinationDetailLongDescription { get; set; } + /// + /// URI of the partner website that can be used by Azure customers to setup Event Grid + /// integration on an event source. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"URI of the partner website that can be used by Azure customers to setup Event Grid + integration on an event source.", + SerializedName = @"setupUri", + PossibleTypes = new [] { typeof(string) })] + string PartnerDestinationDetailSetupUri { get; set; } + /// Display name of the verified partner. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Display name of the verified partner.", + SerializedName = @"partnerDisplayName", + PossibleTypes = new [] { typeof(string) })] + string PartnerDisplayName { get; set; } + /// ImmutableId of the corresponding partner registration. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ImmutableId of the corresponding partner registration.", + SerializedName = @"partnerRegistrationImmutableId", + PossibleTypes = new [] { typeof(string) })] + string PartnerRegistrationImmutableId { get; set; } + /// + /// This is short description about the partner. The length of this description should not exceed 256 characters. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This is short description about the partner. The length of this description should not exceed 256 characters.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string PartnerTopicDetailDescription { get; set; } + /// + /// Long description for the partner's scenarios and integration.Length of this description should not exceed 2048 characters. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Long description for the partner's scenarios and integration.Length of this description should not exceed 2048 characters.", + SerializedName = @"longDescription", + PossibleTypes = new [] { typeof(string) })] + string PartnerTopicDetailLongDescription { get; set; } + /// + /// URI of the partner website that can be used by Azure customers to setup Event Grid + /// integration on an event source. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"URI of the partner website that can be used by Azure customers to setup Event Grid + integration on an event source.", + SerializedName = @"setupUri", + PossibleTypes = new [] { typeof(string) })] + string PartnerTopicDetailSetupUri { get; set; } + /// Provisioning state of the verified partner. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Provisioning state of the verified partner.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.VerifiedPartnerProvisioningState) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.VerifiedPartnerProvisioningState? ProvisioningState { get; set; } + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timestamp of resource creation (UTC).", + SerializedName = @"createdAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SystemDataCreatedAt { get; set; } + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identity that created the resource.", + SerializedName = @"createdBy", + PossibleTypes = new [] { typeof(string) })] + string SystemDataCreatedBy { get; set; } + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of identity that created the resource.", + SerializedName = @"createdByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType? SystemDataCreatedByType { get; set; } + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timestamp of resource last modification (UTC)", + SerializedName = @"lastModifiedAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SystemDataLastModifiedAt { get; set; } + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identity that last modified the resource.", + SerializedName = @"lastModifiedBy", + PossibleTypes = new [] { typeof(string) })] + string SystemDataLastModifiedBy { get; set; } + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of identity that last modified the resource.", + SerializedName = @"lastModifiedByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + + } + /// Verified partner information + internal partial interface IVerifiedPartnerInternal : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceInternal + { + /// Official name of the Partner. + string OrganizationName { get; set; } + /// Details of the partner destination scenario. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDetails PartnerDestinationDetail { get; set; } + /// + /// This is short description about the partner. The length of this description should not exceed 256 characters. + /// + string PartnerDestinationDetailDescription { get; set; } + /// + /// Long description for the partner's scenarios and integration.Length of this description should not exceed 2048 characters. + /// + string PartnerDestinationDetailLongDescription { get; set; } + /// + /// URI of the partner website that can be used by Azure customers to setup Event Grid + /// integration on an event source. + /// + string PartnerDestinationDetailSetupUri { get; set; } + /// Display name of the verified partner. + string PartnerDisplayName { get; set; } + /// ImmutableId of the corresponding partner registration. + string PartnerRegistrationImmutableId { get; set; } + /// Details of the partner topic scenario. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDetails PartnerTopicDetail { get; set; } + /// + /// This is short description about the partner. The length of this description should not exceed 256 characters. + /// + string PartnerTopicDetailDescription { get; set; } + /// + /// Long description for the partner's scenarios and integration.Length of this description should not exceed 2048 characters. + /// + string PartnerTopicDetailLongDescription { get; set; } + /// + /// URI of the partner website that can be used by Azure customers to setup Event Grid + /// integration on an event source. + /// + string PartnerTopicDetailSetupUri { get; set; } + /// Properties of the verified partner. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerProperties Property { get; set; } + /// Provisioning state of the verified partner. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.VerifiedPartnerProvisioningState? ProvisioningState { get; set; } + /// The system metadata relating to Verified Partner resource. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.ISystemData SystemData { get; set; } + /// The timestamp of resource creation (UTC). + global::System.DateTime? SystemDataCreatedAt { get; set; } + /// The identity that created the resource. + string SystemDataCreatedBy { get; set; } + /// The type of identity that created the resource. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType? SystemDataCreatedByType { get; set; } + /// The timestamp of resource last modification (UTC) + global::System.DateTime? SystemDataLastModifiedAt { get; set; } + /// The identity that last modified the resource. + string SystemDataLastModifiedBy { get; set; } + /// The type of identity that last modified the resource. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/VerifiedPartner.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/VerifiedPartner.json.cs new file mode 100644 index 000000000000..32e8b1cc07a1 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/VerifiedPartner.json.cs @@ -0,0 +1,113 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Verified partner information + public partial class VerifiedPartner + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartner. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartner. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartner FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new VerifiedPartner(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._systemData ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._systemData.ToJson(null,serializationMode) : null, "systemData" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal VerifiedPartner(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.VerifiedPartnerProperties.FromJson(__jsonProperties) : Property;} + {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20.SystemData.FromJson(__jsonSystemData) : SystemData;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/VerifiedPartnerProperties.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/VerifiedPartnerProperties.PowerShell.cs new file mode 100644 index 000000000000..59ca2d3271fe --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/VerifiedPartnerProperties.PowerShell.cs @@ -0,0 +1,232 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Properties of the verified partner. + [System.ComponentModel.TypeConverter(typeof(VerifiedPartnerPropertiesTypeConverter))] + public partial class VerifiedPartnerProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new VerifiedPartnerProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new VerifiedPartnerProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal VerifiedPartnerProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("PartnerTopicDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerPropertiesInternal)this).PartnerTopicDetail = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDetails) content.GetValueForProperty("PartnerTopicDetail",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerPropertiesInternal)this).PartnerTopicDetail, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("PartnerDestinationDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerPropertiesInternal)this).PartnerDestinationDetail = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDetails) content.GetValueForProperty("PartnerDestinationDetail",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerPropertiesInternal)this).PartnerDestinationDetail, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("PartnerRegistrationImmutableId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerPropertiesInternal)this).PartnerRegistrationImmutableId = (string) content.GetValueForProperty("PartnerRegistrationImmutableId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerPropertiesInternal)this).PartnerRegistrationImmutableId, global::System.Convert.ToString); + } + if (content.Contains("OrganizationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerPropertiesInternal)this).OrganizationName = (string) content.GetValueForProperty("OrganizationName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerPropertiesInternal)this).OrganizationName, global::System.Convert.ToString); + } + if (content.Contains("PartnerDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerPropertiesInternal)this).PartnerDisplayName = (string) content.GetValueForProperty("PartnerDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerPropertiesInternal)this).PartnerDisplayName, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.VerifiedPartnerProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.VerifiedPartnerProvisioningState.CreateFrom); + } + if (content.Contains("PartnerTopicDetailDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerPropertiesInternal)this).PartnerTopicDetailDescription = (string) content.GetValueForProperty("PartnerTopicDetailDescription",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerPropertiesInternal)this).PartnerTopicDetailDescription, global::System.Convert.ToString); + } + if (content.Contains("PartnerTopicDetailLongDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerPropertiesInternal)this).PartnerTopicDetailLongDescription = (string) content.GetValueForProperty("PartnerTopicDetailLongDescription",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerPropertiesInternal)this).PartnerTopicDetailLongDescription, global::System.Convert.ToString); + } + if (content.Contains("PartnerTopicDetailSetupUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerPropertiesInternal)this).PartnerTopicDetailSetupUri = (string) content.GetValueForProperty("PartnerTopicDetailSetupUri",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerPropertiesInternal)this).PartnerTopicDetailSetupUri, global::System.Convert.ToString); + } + if (content.Contains("PartnerDestinationDetailDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerPropertiesInternal)this).PartnerDestinationDetailDescription = (string) content.GetValueForProperty("PartnerDestinationDetailDescription",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerPropertiesInternal)this).PartnerDestinationDetailDescription, global::System.Convert.ToString); + } + if (content.Contains("PartnerDestinationDetailLongDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerPropertiesInternal)this).PartnerDestinationDetailLongDescription = (string) content.GetValueForProperty("PartnerDestinationDetailLongDescription",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerPropertiesInternal)this).PartnerDestinationDetailLongDescription, global::System.Convert.ToString); + } + if (content.Contains("PartnerDestinationDetailSetupUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerPropertiesInternal)this).PartnerDestinationDetailSetupUri = (string) content.GetValueForProperty("PartnerDestinationDetailSetupUri",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerPropertiesInternal)this).PartnerDestinationDetailSetupUri, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal VerifiedPartnerProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("PartnerTopicDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerPropertiesInternal)this).PartnerTopicDetail = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDetails) content.GetValueForProperty("PartnerTopicDetail",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerPropertiesInternal)this).PartnerTopicDetail, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("PartnerDestinationDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerPropertiesInternal)this).PartnerDestinationDetail = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDetails) content.GetValueForProperty("PartnerDestinationDetail",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerPropertiesInternal)this).PartnerDestinationDetail, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("PartnerRegistrationImmutableId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerPropertiesInternal)this).PartnerRegistrationImmutableId = (string) content.GetValueForProperty("PartnerRegistrationImmutableId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerPropertiesInternal)this).PartnerRegistrationImmutableId, global::System.Convert.ToString); + } + if (content.Contains("OrganizationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerPropertiesInternal)this).OrganizationName = (string) content.GetValueForProperty("OrganizationName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerPropertiesInternal)this).OrganizationName, global::System.Convert.ToString); + } + if (content.Contains("PartnerDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerPropertiesInternal)this).PartnerDisplayName = (string) content.GetValueForProperty("PartnerDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerPropertiesInternal)this).PartnerDisplayName, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.VerifiedPartnerProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.VerifiedPartnerProvisioningState.CreateFrom); + } + if (content.Contains("PartnerTopicDetailDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerPropertiesInternal)this).PartnerTopicDetailDescription = (string) content.GetValueForProperty("PartnerTopicDetailDescription",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerPropertiesInternal)this).PartnerTopicDetailDescription, global::System.Convert.ToString); + } + if (content.Contains("PartnerTopicDetailLongDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerPropertiesInternal)this).PartnerTopicDetailLongDescription = (string) content.GetValueForProperty("PartnerTopicDetailLongDescription",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerPropertiesInternal)this).PartnerTopicDetailLongDescription, global::System.Convert.ToString); + } + if (content.Contains("PartnerTopicDetailSetupUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerPropertiesInternal)this).PartnerTopicDetailSetupUri = (string) content.GetValueForProperty("PartnerTopicDetailSetupUri",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerPropertiesInternal)this).PartnerTopicDetailSetupUri, global::System.Convert.ToString); + } + if (content.Contains("PartnerDestinationDetailDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerPropertiesInternal)this).PartnerDestinationDetailDescription = (string) content.GetValueForProperty("PartnerDestinationDetailDescription",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerPropertiesInternal)this).PartnerDestinationDetailDescription, global::System.Convert.ToString); + } + if (content.Contains("PartnerDestinationDetailLongDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerPropertiesInternal)this).PartnerDestinationDetailLongDescription = (string) content.GetValueForProperty("PartnerDestinationDetailLongDescription",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerPropertiesInternal)this).PartnerDestinationDetailLongDescription, global::System.Convert.ToString); + } + if (content.Contains("PartnerDestinationDetailSetupUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerPropertiesInternal)this).PartnerDestinationDetailSetupUri = (string) content.GetValueForProperty("PartnerDestinationDetailSetupUri",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerPropertiesInternal)this).PartnerDestinationDetailSetupUri, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + } + /// Properties of the verified partner. + [System.ComponentModel.TypeConverter(typeof(VerifiedPartnerPropertiesTypeConverter))] + public partial interface IVerifiedPartnerProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/VerifiedPartnerProperties.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/VerifiedPartnerProperties.TypeConverter.cs new file mode 100644 index 000000000000..5f8885dabb3f --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/VerifiedPartnerProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class VerifiedPartnerPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return VerifiedPartnerProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return VerifiedPartnerProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return VerifiedPartnerProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/VerifiedPartnerProperties.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/VerifiedPartnerProperties.cs new file mode 100644 index 000000000000..438e56acdd25 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/VerifiedPartnerProperties.cs @@ -0,0 +1,254 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Properties of the verified partner. + public partial class VerifiedPartnerProperties : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerProperties, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerPropertiesInternal + { + + /// Internal Acessors for PartnerDestinationDetail + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDetails Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerPropertiesInternal.PartnerDestinationDetail { get => (this._partnerDestinationDetail = this._partnerDestinationDetail ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerDetails()); set { {_partnerDestinationDetail = value;} } } + + /// Internal Acessors for PartnerTopicDetail + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDetails Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerPropertiesInternal.PartnerTopicDetail { get => (this._partnerTopicDetail = this._partnerTopicDetail ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerDetails()); set { {_partnerTopicDetail = value;} } } + + /// Backing field for property. + private string _organizationName; + + /// Official name of the Partner. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string OrganizationName { get => this._organizationName; set => this._organizationName = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDetails _partnerDestinationDetail; + + /// Details of the partner destination scenario. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDetails PartnerDestinationDetail { get => (this._partnerDestinationDetail = this._partnerDestinationDetail ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerDetails()); set => this._partnerDestinationDetail = value; } + + /// + /// This is short description about the partner. The length of this description should not exceed 256 characters. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string PartnerDestinationDetailDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDetailsInternal)PartnerDestinationDetail).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDetailsInternal)PartnerDestinationDetail).Description = value ?? null; } + + /// + /// Long description for the partner's scenarios and integration.Length of this description should not exceed 2048 characters. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string PartnerDestinationDetailLongDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDetailsInternal)PartnerDestinationDetail).LongDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDetailsInternal)PartnerDestinationDetail).LongDescription = value ?? null; } + + /// + /// URI of the partner website that can be used by Azure customers to setup Event Grid + /// integration on an event source. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string PartnerDestinationDetailSetupUri { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDetailsInternal)PartnerDestinationDetail).SetupUri; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDetailsInternal)PartnerDestinationDetail).SetupUri = value ?? null; } + + /// Backing field for property. + private string _partnerDisplayName; + + /// Display name of the verified partner. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string PartnerDisplayName { get => this._partnerDisplayName; set => this._partnerDisplayName = value; } + + /// Backing field for property. + private string _partnerRegistrationImmutableId; + + /// ImmutableId of the corresponding partner registration. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string PartnerRegistrationImmutableId { get => this._partnerRegistrationImmutableId; set => this._partnerRegistrationImmutableId = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDetails _partnerTopicDetail; + + /// Details of the partner topic scenario. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDetails PartnerTopicDetail { get => (this._partnerTopicDetail = this._partnerTopicDetail ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerDetails()); set => this._partnerTopicDetail = value; } + + /// + /// This is short description about the partner. The length of this description should not exceed 256 characters. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string PartnerTopicDetailDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDetailsInternal)PartnerTopicDetail).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDetailsInternal)PartnerTopicDetail).Description = value ?? null; } + + /// + /// Long description for the partner's scenarios and integration.Length of this description should not exceed 2048 characters. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string PartnerTopicDetailLongDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDetailsInternal)PartnerTopicDetail).LongDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDetailsInternal)PartnerTopicDetail).LongDescription = value ?? null; } + + /// + /// URI of the partner website that can be used by Azure customers to setup Event Grid + /// integration on an event source. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string PartnerTopicDetailSetupUri { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDetailsInternal)PartnerTopicDetail).SetupUri; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDetailsInternal)PartnerTopicDetail).SetupUri = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.VerifiedPartnerProvisioningState? _provisioningState; + + /// Provisioning state of the verified partner. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.VerifiedPartnerProvisioningState? ProvisioningState { get => this._provisioningState; set => this._provisioningState = value; } + + /// Creates an new instance. + public VerifiedPartnerProperties() + { + + } + } + /// Properties of the verified partner. + public partial interface IVerifiedPartnerProperties : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// Official name of the Partner. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Official name of the Partner.", + SerializedName = @"organizationName", + PossibleTypes = new [] { typeof(string) })] + string OrganizationName { get; set; } + /// + /// This is short description about the partner. The length of this description should not exceed 256 characters. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This is short description about the partner. The length of this description should not exceed 256 characters.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string PartnerDestinationDetailDescription { get; set; } + /// + /// Long description for the partner's scenarios and integration.Length of this description should not exceed 2048 characters. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Long description for the partner's scenarios and integration.Length of this description should not exceed 2048 characters.", + SerializedName = @"longDescription", + PossibleTypes = new [] { typeof(string) })] + string PartnerDestinationDetailLongDescription { get; set; } + /// + /// URI of the partner website that can be used by Azure customers to setup Event Grid + /// integration on an event source. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"URI of the partner website that can be used by Azure customers to setup Event Grid + integration on an event source.", + SerializedName = @"setupUri", + PossibleTypes = new [] { typeof(string) })] + string PartnerDestinationDetailSetupUri { get; set; } + /// Display name of the verified partner. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Display name of the verified partner.", + SerializedName = @"partnerDisplayName", + PossibleTypes = new [] { typeof(string) })] + string PartnerDisplayName { get; set; } + /// ImmutableId of the corresponding partner registration. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ImmutableId of the corresponding partner registration.", + SerializedName = @"partnerRegistrationImmutableId", + PossibleTypes = new [] { typeof(string) })] + string PartnerRegistrationImmutableId { get; set; } + /// + /// This is short description about the partner. The length of this description should not exceed 256 characters. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This is short description about the partner. The length of this description should not exceed 256 characters.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string PartnerTopicDetailDescription { get; set; } + /// + /// Long description for the partner's scenarios and integration.Length of this description should not exceed 2048 characters. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Long description for the partner's scenarios and integration.Length of this description should not exceed 2048 characters.", + SerializedName = @"longDescription", + PossibleTypes = new [] { typeof(string) })] + string PartnerTopicDetailLongDescription { get; set; } + /// + /// URI of the partner website that can be used by Azure customers to setup Event Grid + /// integration on an event source. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"URI of the partner website that can be used by Azure customers to setup Event Grid + integration on an event source.", + SerializedName = @"setupUri", + PossibleTypes = new [] { typeof(string) })] + string PartnerTopicDetailSetupUri { get; set; } + /// Provisioning state of the verified partner. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Provisioning state of the verified partner.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.VerifiedPartnerProvisioningState) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.VerifiedPartnerProvisioningState? ProvisioningState { get; set; } + + } + /// Properties of the verified partner. + internal partial interface IVerifiedPartnerPropertiesInternal + + { + /// Official name of the Partner. + string OrganizationName { get; set; } + /// Details of the partner destination scenario. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDetails PartnerDestinationDetail { get; set; } + /// + /// This is short description about the partner. The length of this description should not exceed 256 characters. + /// + string PartnerDestinationDetailDescription { get; set; } + /// + /// Long description for the partner's scenarios and integration.Length of this description should not exceed 2048 characters. + /// + string PartnerDestinationDetailLongDescription { get; set; } + /// + /// URI of the partner website that can be used by Azure customers to setup Event Grid + /// integration on an event source. + /// + string PartnerDestinationDetailSetupUri { get; set; } + /// Display name of the verified partner. + string PartnerDisplayName { get; set; } + /// ImmutableId of the corresponding partner registration. + string PartnerRegistrationImmutableId { get; set; } + /// Details of the partner topic scenario. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDetails PartnerTopicDetail { get; set; } + /// + /// This is short description about the partner. The length of this description should not exceed 256 characters. + /// + string PartnerTopicDetailDescription { get; set; } + /// + /// Long description for the partner's scenarios and integration.Length of this description should not exceed 2048 characters. + /// + string PartnerTopicDetailLongDescription { get; set; } + /// + /// URI of the partner website that can be used by Azure customers to setup Event Grid + /// integration on an event source. + /// + string PartnerTopicDetailSetupUri { get; set; } + /// Provisioning state of the verified partner. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.VerifiedPartnerProvisioningState? ProvisioningState { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/VerifiedPartnerProperties.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/VerifiedPartnerProperties.json.cs new file mode 100644 index 000000000000..3afe45cd6148 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/VerifiedPartnerProperties.json.cs @@ -0,0 +1,116 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Properties of the verified partner. + public partial class VerifiedPartnerProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnerProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new VerifiedPartnerProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._partnerTopicDetail ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._partnerTopicDetail.ToJson(null,serializationMode) : null, "partnerTopicDetails" ,container.Add ); + AddIf( null != this._partnerDestinationDetail ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._partnerDestinationDetail.ToJson(null,serializationMode) : null, "partnerDestinationDetails" ,container.Add ); + AddIf( null != (((object)this._partnerRegistrationImmutableId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._partnerRegistrationImmutableId.ToString()) : null, "partnerRegistrationImmutableId" ,container.Add ); + AddIf( null != (((object)this._organizationName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._organizationName.ToString()) : null, "organizationName" ,container.Add ); + AddIf( null != (((object)this._partnerDisplayName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._partnerDisplayName.ToString()) : null, "partnerDisplayName" ,container.Add ); + AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal VerifiedPartnerProperties(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_partnerTopicDetail = If( json?.PropertyT("partnerTopicDetails"), out var __jsonPartnerTopicDetails) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerDetails.FromJson(__jsonPartnerTopicDetails) : PartnerTopicDetail;} + {_partnerDestinationDetail = If( json?.PropertyT("partnerDestinationDetails"), out var __jsonPartnerDestinationDetails) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerDetails.FromJson(__jsonPartnerDestinationDetails) : PartnerDestinationDetail;} + {_partnerRegistrationImmutableId = If( json?.PropertyT("partnerRegistrationImmutableId"), out var __jsonPartnerRegistrationImmutableId) ? (string)__jsonPartnerRegistrationImmutableId : (string)PartnerRegistrationImmutableId;} + {_organizationName = If( json?.PropertyT("organizationName"), out var __jsonOrganizationName) ? (string)__jsonOrganizationName : (string)OrganizationName;} + {_partnerDisplayName = If( json?.PropertyT("partnerDisplayName"), out var __jsonPartnerDisplayName) ? (string)__jsonPartnerDisplayName : (string)PartnerDisplayName;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/VerifiedPartnersListResult.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/VerifiedPartnersListResult.PowerShell.cs new file mode 100644 index 000000000000..bdd28a38eb11 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/VerifiedPartnersListResult.PowerShell.cs @@ -0,0 +1,152 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Result of the List verified partners operation + [System.ComponentModel.TypeConverter(typeof(VerifiedPartnersListResultTypeConverter))] + public partial class VerifiedPartnersListResult + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnersListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new VerifiedPartnersListResult(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnersListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new VerifiedPartnersListResult(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnersListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal VerifiedPartnersListResult(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnersListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartner[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnersListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.VerifiedPartnerTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnersListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnersListResultInternal)this).NextLink, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal VerifiedPartnersListResult(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnersListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartner[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnersListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.VerifiedPartnerTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnersListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnersListResultInternal)this).NextLink, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + } + /// Result of the List verified partners operation + [System.ComponentModel.TypeConverter(typeof(VerifiedPartnersListResultTypeConverter))] + public partial interface IVerifiedPartnersListResult + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/VerifiedPartnersListResult.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/VerifiedPartnersListResult.TypeConverter.cs new file mode 100644 index 000000000000..6dd730fc2a91 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/VerifiedPartnersListResult.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class VerifiedPartnersListResultTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnersListResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnersListResult).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return VerifiedPartnersListResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return VerifiedPartnersListResult.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return VerifiedPartnersListResult.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/VerifiedPartnersListResult.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/VerifiedPartnersListResult.cs new file mode 100644 index 000000000000..f94e00ca872b --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/VerifiedPartnersListResult.cs @@ -0,0 +1,68 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Result of the List verified partners operation + public partial class VerifiedPartnersListResult : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnersListResult, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnersListResultInternal + { + + /// Backing field for property. + private string _nextLink; + + /// A link for the next page of verified partners if any. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartner[] _value; + + /// A collection of verified partners. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartner[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public VerifiedPartnersListResult() + { + + } + } + /// Result of the List verified partners operation + public partial interface IVerifiedPartnersListResult : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// A link for the next page of verified partners if any. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A link for the next page of verified partners if any.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// A collection of verified partners. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A collection of verified partners.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartner) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartner[] Value { get; set; } + + } + /// Result of the List verified partners operation + internal partial interface IVerifiedPartnersListResultInternal + + { + /// A link for the next page of verified partners if any. + string NextLink { get; set; } + /// A collection of verified partners. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartner[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/VerifiedPartnersListResult.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/VerifiedPartnersListResult.json.cs new file mode 100644 index 000000000000..9addf48640f2 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/VerifiedPartnersListResult.json.cs @@ -0,0 +1,116 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Result of the List verified partners operation + public partial class VerifiedPartnersListResult + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnersListResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnersListResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartnersListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new VerifiedPartnersListResult(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal VerifiedPartnersListResult(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartner) (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.VerifiedPartner.FromJson(__u) )) ))() : null : Value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/WebHookEventSubscriptionDestination.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/WebHookEventSubscriptionDestination.PowerShell.cs new file mode 100644 index 000000000000..30812cdfd66e --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/WebHookEventSubscriptionDestination.PowerShell.cs @@ -0,0 +1,208 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Information about the webhook destination for an event subscription. + [System.ComponentModel.TypeConverter(typeof(WebHookEventSubscriptionDestinationTypeConverter))] + public partial class WebHookEventSubscriptionDestination + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestination DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new WebHookEventSubscriptionDestination(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestination DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new WebHookEventSubscriptionDestination(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestination FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal WebHookEventSubscriptionDestination(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.WebHookEventSubscriptionDestinationPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("EndpointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestinationInternal)this).EndpointType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType) content.GetValueForProperty("EndpointType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestinationInternal)this).EndpointType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType.CreateFrom); + } + if (content.Contains("EndpointUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationInternal)this).EndpointUrl = (string) content.GetValueForProperty("EndpointUrl",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationInternal)this).EndpointUrl, global::System.Convert.ToString); + } + if (content.Contains("EndpointBaseUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationInternal)this).EndpointBaseUrl = (string) content.GetValueForProperty("EndpointBaseUrl",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationInternal)this).EndpointBaseUrl, global::System.Convert.ToString); + } + if (content.Contains("MaxEventsPerBatch")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationInternal)this).MaxEventsPerBatch = (int?) content.GetValueForProperty("MaxEventsPerBatch",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationInternal)this).MaxEventsPerBatch, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("PreferredBatchSizeInKilobyte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationInternal)this).PreferredBatchSizeInKilobyte = (int?) content.GetValueForProperty("PreferredBatchSizeInKilobyte",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationInternal)this).PreferredBatchSizeInKilobyte, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("AzureActiveDirectoryTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationInternal)this).AzureActiveDirectoryTenantId = (string) content.GetValueForProperty("AzureActiveDirectoryTenantId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationInternal)this).AzureActiveDirectoryTenantId, global::System.Convert.ToString); + } + if (content.Contains("AzureActiveDirectoryApplicationIdOrUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationInternal)this).AzureActiveDirectoryApplicationIdOrUri = (string) content.GetValueForProperty("AzureActiveDirectoryApplicationIdOrUri",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationInternal)this).AzureActiveDirectoryApplicationIdOrUri, global::System.Convert.ToString); + } + if (content.Contains("DeliveryAttributeMapping")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationInternal)this).DeliveryAttributeMapping = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping[]) content.GetValueForProperty("DeliveryAttributeMapping",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationInternal)this).DeliveryAttributeMapping, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeliveryAttributeMappingTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal WebHookEventSubscriptionDestination(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.WebHookEventSubscriptionDestinationPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("EndpointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestinationInternal)this).EndpointType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType) content.GetValueForProperty("EndpointType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestinationInternal)this).EndpointType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType.CreateFrom); + } + if (content.Contains("EndpointUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationInternal)this).EndpointUrl = (string) content.GetValueForProperty("EndpointUrl",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationInternal)this).EndpointUrl, global::System.Convert.ToString); + } + if (content.Contains("EndpointBaseUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationInternal)this).EndpointBaseUrl = (string) content.GetValueForProperty("EndpointBaseUrl",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationInternal)this).EndpointBaseUrl, global::System.Convert.ToString); + } + if (content.Contains("MaxEventsPerBatch")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationInternal)this).MaxEventsPerBatch = (int?) content.GetValueForProperty("MaxEventsPerBatch",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationInternal)this).MaxEventsPerBatch, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("PreferredBatchSizeInKilobyte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationInternal)this).PreferredBatchSizeInKilobyte = (int?) content.GetValueForProperty("PreferredBatchSizeInKilobyte",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationInternal)this).PreferredBatchSizeInKilobyte, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("AzureActiveDirectoryTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationInternal)this).AzureActiveDirectoryTenantId = (string) content.GetValueForProperty("AzureActiveDirectoryTenantId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationInternal)this).AzureActiveDirectoryTenantId, global::System.Convert.ToString); + } + if (content.Contains("AzureActiveDirectoryApplicationIdOrUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationInternal)this).AzureActiveDirectoryApplicationIdOrUri = (string) content.GetValueForProperty("AzureActiveDirectoryApplicationIdOrUri",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationInternal)this).AzureActiveDirectoryApplicationIdOrUri, global::System.Convert.ToString); + } + if (content.Contains("DeliveryAttributeMapping")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationInternal)this).DeliveryAttributeMapping = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping[]) content.GetValueForProperty("DeliveryAttributeMapping",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationInternal)this).DeliveryAttributeMapping, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeliveryAttributeMappingTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + } + /// Information about the webhook destination for an event subscription. + [System.ComponentModel.TypeConverter(typeof(WebHookEventSubscriptionDestinationTypeConverter))] + public partial interface IWebHookEventSubscriptionDestination + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/WebHookEventSubscriptionDestination.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/WebHookEventSubscriptionDestination.TypeConverter.cs new file mode 100644 index 000000000000..2f939bf82122 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/WebHookEventSubscriptionDestination.TypeConverter.cs @@ -0,0 +1,148 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class WebHookEventSubscriptionDestinationTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestination ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestination).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return WebHookEventSubscriptionDestination.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return WebHookEventSubscriptionDestination.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return WebHookEventSubscriptionDestination.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/WebHookEventSubscriptionDestination.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/WebHookEventSubscriptionDestination.cs new file mode 100644 index 000000000000..8d2a8e9d2a8d --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/WebHookEventSubscriptionDestination.cs @@ -0,0 +1,197 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Information about the webhook destination for an event subscription. + public partial class WebHookEventSubscriptionDestination : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestination, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationInternal, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestination __eventSubscriptionDestination = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionDestination(); + + /// + /// The Azure Active Directory Application ID or URI to get the access token that will be included as the bearer token in + /// delivery requests. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string AzureActiveDirectoryApplicationIdOrUri { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationPropertiesInternal)Property).AzureActiveDirectoryApplicationIdOrUri; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationPropertiesInternal)Property).AzureActiveDirectoryApplicationIdOrUri = value ?? null; } + + /// + /// The Azure Active Directory Tenant ID to get the access token that will be included as the bearer token in delivery requests. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string AzureActiveDirectoryTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationPropertiesInternal)Property).AzureActiveDirectoryTenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationPropertiesInternal)Property).AzureActiveDirectoryTenantId = value ?? null; } + + /// Delivery attribute details. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping[] DeliveryAttributeMapping { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationPropertiesInternal)Property).DeliveryAttributeMapping; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationPropertiesInternal)Property).DeliveryAttributeMapping = value ?? null /* arrayOf */; } + + /// + /// The base URL that represents the endpoint of the destination of an event subscription. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string EndpointBaseUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationPropertiesInternal)Property).EndpointBaseUrl; } + + /// Type of the endpoint for the event subscription destination. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType EndpointType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestinationInternal)__eventSubscriptionDestination).EndpointType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestinationInternal)__eventSubscriptionDestination).EndpointType = value ; } + + /// + /// The URL that represents the endpoint of the destination of an event subscription. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string EndpointUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationPropertiesInternal)Property).EndpointUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationPropertiesInternal)Property).EndpointUrl = value ?? null; } + + /// Maximum number of events per batch. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public int? MaxEventsPerBatch { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationPropertiesInternal)Property).MaxEventsPerBatch; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationPropertiesInternal)Property).MaxEventsPerBatch = value ?? default(int); } + + /// Internal Acessors for EndpointBaseUrl + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationInternal.EndpointBaseUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationPropertiesInternal)Property).EndpointBaseUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationPropertiesInternal)Property).EndpointBaseUrl = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationProperties Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.WebHookEventSubscriptionDestinationProperties()); set { {_property = value;} } } + + /// Preferred batch size in Kilobytes. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public int? PreferredBatchSizeInKilobyte { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationPropertiesInternal)Property).PreferredBatchSizeInKilobyte; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationPropertiesInternal)Property).PreferredBatchSizeInKilobyte = value ?? default(int); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationProperties _property; + + /// WebHook Properties of the event subscription destination. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.WebHookEventSubscriptionDestinationProperties()); set => this._property = value; } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__eventSubscriptionDestination), __eventSubscriptionDestination); + await eventListener.AssertObjectIsValid(nameof(__eventSubscriptionDestination), __eventSubscriptionDestination); + } + + /// Creates an new instance. + public WebHookEventSubscriptionDestination() + { + + } + } + /// Information about the webhook destination for an event subscription. + public partial interface IWebHookEventSubscriptionDestination : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestination + { + /// + /// The Azure Active Directory Application ID or URI to get the access token that will be included as the bearer token in + /// delivery requests. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Azure Active Directory Application ID or URI to get the access token that will be included as the bearer token in delivery requests.", + SerializedName = @"azureActiveDirectoryApplicationIdOrUri", + PossibleTypes = new [] { typeof(string) })] + string AzureActiveDirectoryApplicationIdOrUri { get; set; } + /// + /// The Azure Active Directory Tenant ID to get the access token that will be included as the bearer token in delivery requests. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Azure Active Directory Tenant ID to get the access token that will be included as the bearer token in delivery requests.", + SerializedName = @"azureActiveDirectoryTenantId", + PossibleTypes = new [] { typeof(string) })] + string AzureActiveDirectoryTenantId { get; set; } + /// Delivery attribute details. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Delivery attribute details.", + SerializedName = @"deliveryAttributeMappings", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping),typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IStaticDeliveryAttributeMapping),typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDynamicDeliveryAttributeMapping) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping[] DeliveryAttributeMapping { get; set; } + /// + /// The base URL that represents the endpoint of the destination of an event subscription. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The base URL that represents the endpoint of the destination of an event subscription.", + SerializedName = @"endpointBaseUrl", + PossibleTypes = new [] { typeof(string) })] + string EndpointBaseUrl { get; } + /// + /// The URL that represents the endpoint of the destination of an event subscription. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The URL that represents the endpoint of the destination of an event subscription.", + SerializedName = @"endpointUrl", + PossibleTypes = new [] { typeof(string) })] + string EndpointUrl { get; set; } + /// Maximum number of events per batch. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Maximum number of events per batch.", + SerializedName = @"maxEventsPerBatch", + PossibleTypes = new [] { typeof(int) })] + int? MaxEventsPerBatch { get; set; } + /// Preferred batch size in Kilobytes. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Preferred batch size in Kilobytes.", + SerializedName = @"preferredBatchSizeInKilobytes", + PossibleTypes = new [] { typeof(int) })] + int? PreferredBatchSizeInKilobyte { get; set; } + + } + /// Information about the webhook destination for an event subscription. + internal partial interface IWebHookEventSubscriptionDestinationInternal : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionDestinationInternal + { + /// + /// The Azure Active Directory Application ID or URI to get the access token that will be included as the bearer token in + /// delivery requests. + /// + string AzureActiveDirectoryApplicationIdOrUri { get; set; } + /// + /// The Azure Active Directory Tenant ID to get the access token that will be included as the bearer token in delivery requests. + /// + string AzureActiveDirectoryTenantId { get; set; } + /// Delivery attribute details. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping[] DeliveryAttributeMapping { get; set; } + /// + /// The base URL that represents the endpoint of the destination of an event subscription. + /// + string EndpointBaseUrl { get; set; } + /// + /// The URL that represents the endpoint of the destination of an event subscription. + /// + string EndpointUrl { get; set; } + /// Maximum number of events per batch. + int? MaxEventsPerBatch { get; set; } + /// Preferred batch size in Kilobytes. + int? PreferredBatchSizeInKilobyte { get; set; } + /// WebHook Properties of the event subscription destination. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationProperties Property { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/WebHookEventSubscriptionDestination.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/WebHookEventSubscriptionDestination.json.cs new file mode 100644 index 000000000000..049d1837571c --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/WebHookEventSubscriptionDestination.json.cs @@ -0,0 +1,109 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Information about the webhook destination for an event subscription. + public partial class WebHookEventSubscriptionDestination + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestination. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestination. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestination FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new WebHookEventSubscriptionDestination(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __eventSubscriptionDestination?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal WebHookEventSubscriptionDestination(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __eventSubscriptionDestination = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionDestination(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.WebHookEventSubscriptionDestinationProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/WebHookEventSubscriptionDestinationProperties.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/WebHookEventSubscriptionDestinationProperties.PowerShell.cs new file mode 100644 index 000000000000..2408b942ecee --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/WebHookEventSubscriptionDestinationProperties.PowerShell.cs @@ -0,0 +1,193 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Information about the webhook destination properties for an event subscription. + [System.ComponentModel.TypeConverter(typeof(WebHookEventSubscriptionDestinationPropertiesTypeConverter))] + public partial class WebHookEventSubscriptionDestinationProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new WebHookEventSubscriptionDestinationProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new WebHookEventSubscriptionDestinationProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from + /// a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal WebHookEventSubscriptionDestinationProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("EndpointUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationPropertiesInternal)this).EndpointUrl = (string) content.GetValueForProperty("EndpointUrl",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationPropertiesInternal)this).EndpointUrl, global::System.Convert.ToString); + } + if (content.Contains("EndpointBaseUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationPropertiesInternal)this).EndpointBaseUrl = (string) content.GetValueForProperty("EndpointBaseUrl",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationPropertiesInternal)this).EndpointBaseUrl, global::System.Convert.ToString); + } + if (content.Contains("MaxEventsPerBatch")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationPropertiesInternal)this).MaxEventsPerBatch = (int?) content.GetValueForProperty("MaxEventsPerBatch",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationPropertiesInternal)this).MaxEventsPerBatch, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("PreferredBatchSizeInKilobyte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationPropertiesInternal)this).PreferredBatchSizeInKilobyte = (int?) content.GetValueForProperty("PreferredBatchSizeInKilobyte",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationPropertiesInternal)this).PreferredBatchSizeInKilobyte, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("AzureActiveDirectoryTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationPropertiesInternal)this).AzureActiveDirectoryTenantId = (string) content.GetValueForProperty("AzureActiveDirectoryTenantId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationPropertiesInternal)this).AzureActiveDirectoryTenantId, global::System.Convert.ToString); + } + if (content.Contains("AzureActiveDirectoryApplicationIdOrUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationPropertiesInternal)this).AzureActiveDirectoryApplicationIdOrUri = (string) content.GetValueForProperty("AzureActiveDirectoryApplicationIdOrUri",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationPropertiesInternal)this).AzureActiveDirectoryApplicationIdOrUri, global::System.Convert.ToString); + } + if (content.Contains("DeliveryAttributeMapping")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationPropertiesInternal)this).DeliveryAttributeMapping = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping[]) content.GetValueForProperty("DeliveryAttributeMapping",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationPropertiesInternal)this).DeliveryAttributeMapping, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeliveryAttributeMappingTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal WebHookEventSubscriptionDestinationProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("EndpointUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationPropertiesInternal)this).EndpointUrl = (string) content.GetValueForProperty("EndpointUrl",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationPropertiesInternal)this).EndpointUrl, global::System.Convert.ToString); + } + if (content.Contains("EndpointBaseUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationPropertiesInternal)this).EndpointBaseUrl = (string) content.GetValueForProperty("EndpointBaseUrl",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationPropertiesInternal)this).EndpointBaseUrl, global::System.Convert.ToString); + } + if (content.Contains("MaxEventsPerBatch")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationPropertiesInternal)this).MaxEventsPerBatch = (int?) content.GetValueForProperty("MaxEventsPerBatch",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationPropertiesInternal)this).MaxEventsPerBatch, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("PreferredBatchSizeInKilobyte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationPropertiesInternal)this).PreferredBatchSizeInKilobyte = (int?) content.GetValueForProperty("PreferredBatchSizeInKilobyte",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationPropertiesInternal)this).PreferredBatchSizeInKilobyte, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("AzureActiveDirectoryTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationPropertiesInternal)this).AzureActiveDirectoryTenantId = (string) content.GetValueForProperty("AzureActiveDirectoryTenantId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationPropertiesInternal)this).AzureActiveDirectoryTenantId, global::System.Convert.ToString); + } + if (content.Contains("AzureActiveDirectoryApplicationIdOrUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationPropertiesInternal)this).AzureActiveDirectoryApplicationIdOrUri = (string) content.GetValueForProperty("AzureActiveDirectoryApplicationIdOrUri",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationPropertiesInternal)this).AzureActiveDirectoryApplicationIdOrUri, global::System.Convert.ToString); + } + if (content.Contains("DeliveryAttributeMapping")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationPropertiesInternal)this).DeliveryAttributeMapping = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping[]) content.GetValueForProperty("DeliveryAttributeMapping",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationPropertiesInternal)this).DeliveryAttributeMapping, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeliveryAttributeMappingTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + } + /// Information about the webhook destination properties for an event subscription. + [System.ComponentModel.TypeConverter(typeof(WebHookEventSubscriptionDestinationPropertiesTypeConverter))] + public partial interface IWebHookEventSubscriptionDestinationProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/WebHookEventSubscriptionDestinationProperties.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/WebHookEventSubscriptionDestinationProperties.TypeConverter.cs new file mode 100644 index 000000000000..984cf2b3b608 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/WebHookEventSubscriptionDestinationProperties.TypeConverter.cs @@ -0,0 +1,150 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class WebHookEventSubscriptionDestinationPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, + /// otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return WebHookEventSubscriptionDestinationProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return WebHookEventSubscriptionDestinationProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return WebHookEventSubscriptionDestinationProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/WebHookEventSubscriptionDestinationProperties.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/WebHookEventSubscriptionDestinationProperties.cs new file mode 100644 index 000000000000..f4f0ed4c89dc --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/WebHookEventSubscriptionDestinationProperties.cs @@ -0,0 +1,187 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Information about the webhook destination properties for an event subscription. + public partial class WebHookEventSubscriptionDestinationProperties : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationProperties, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationPropertiesInternal + { + + /// + /// Backing field for property. + /// + private string _azureActiveDirectoryApplicationIdOrUri; + + /// + /// The Azure Active Directory Application ID or URI to get the access token that will be included as the bearer token in + /// delivery requests. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string AzureActiveDirectoryApplicationIdOrUri { get => this._azureActiveDirectoryApplicationIdOrUri; set => this._azureActiveDirectoryApplicationIdOrUri = value; } + + /// Backing field for property. + private string _azureActiveDirectoryTenantId; + + /// + /// The Azure Active Directory Tenant ID to get the access token that will be included as the bearer token in delivery requests. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string AzureActiveDirectoryTenantId { get => this._azureActiveDirectoryTenantId; set => this._azureActiveDirectoryTenantId = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping[] _deliveryAttributeMapping; + + /// Delivery attribute details. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping[] DeliveryAttributeMapping { get => this._deliveryAttributeMapping; set => this._deliveryAttributeMapping = value; } + + /// Backing field for property. + private string _endpointBaseUrl; + + /// + /// The base URL that represents the endpoint of the destination of an event subscription. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string EndpointBaseUrl { get => this._endpointBaseUrl; } + + /// Backing field for property. + private string _endpointUrl; + + /// + /// The URL that represents the endpoint of the destination of an event subscription. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string EndpointUrl { get => this._endpointUrl; set => this._endpointUrl = value; } + + /// Backing field for property. + private int? _maxEventsPerBatch; + + /// Maximum number of events per batch. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public int? MaxEventsPerBatch { get => this._maxEventsPerBatch; set => this._maxEventsPerBatch = value; } + + /// Internal Acessors for EndpointBaseUrl + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationPropertiesInternal.EndpointBaseUrl { get => this._endpointBaseUrl; set { {_endpointBaseUrl = value;} } } + + /// Backing field for property. + private int? _preferredBatchSizeInKilobyte; + + /// Preferred batch size in Kilobytes. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public int? PreferredBatchSizeInKilobyte { get => this._preferredBatchSizeInKilobyte; set => this._preferredBatchSizeInKilobyte = value; } + + /// + /// Creates an new instance. + /// + public WebHookEventSubscriptionDestinationProperties() + { + + } + } + /// Information about the webhook destination properties for an event subscription. + public partial interface IWebHookEventSubscriptionDestinationProperties : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// + /// The Azure Active Directory Application ID or URI to get the access token that will be included as the bearer token in + /// delivery requests. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Azure Active Directory Application ID or URI to get the access token that will be included as the bearer token in delivery requests.", + SerializedName = @"azureActiveDirectoryApplicationIdOrUri", + PossibleTypes = new [] { typeof(string) })] + string AzureActiveDirectoryApplicationIdOrUri { get; set; } + /// + /// The Azure Active Directory Tenant ID to get the access token that will be included as the bearer token in delivery requests. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Azure Active Directory Tenant ID to get the access token that will be included as the bearer token in delivery requests.", + SerializedName = @"azureActiveDirectoryTenantId", + PossibleTypes = new [] { typeof(string) })] + string AzureActiveDirectoryTenantId { get; set; } + /// Delivery attribute details. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Delivery attribute details.", + SerializedName = @"deliveryAttributeMappings", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping[] DeliveryAttributeMapping { get; set; } + /// + /// The base URL that represents the endpoint of the destination of an event subscription. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The base URL that represents the endpoint of the destination of an event subscription.", + SerializedName = @"endpointBaseUrl", + PossibleTypes = new [] { typeof(string) })] + string EndpointBaseUrl { get; } + /// + /// The URL that represents the endpoint of the destination of an event subscription. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The URL that represents the endpoint of the destination of an event subscription.", + SerializedName = @"endpointUrl", + PossibleTypes = new [] { typeof(string) })] + string EndpointUrl { get; set; } + /// Maximum number of events per batch. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Maximum number of events per batch.", + SerializedName = @"maxEventsPerBatch", + PossibleTypes = new [] { typeof(int) })] + int? MaxEventsPerBatch { get; set; } + /// Preferred batch size in Kilobytes. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Preferred batch size in Kilobytes.", + SerializedName = @"preferredBatchSizeInKilobytes", + PossibleTypes = new [] { typeof(int) })] + int? PreferredBatchSizeInKilobyte { get; set; } + + } + /// Information about the webhook destination properties for an event subscription. + internal partial interface IWebHookEventSubscriptionDestinationPropertiesInternal + + { + /// + /// The Azure Active Directory Application ID or URI to get the access token that will be included as the bearer token in + /// delivery requests. + /// + string AzureActiveDirectoryApplicationIdOrUri { get; set; } + /// + /// The Azure Active Directory Tenant ID to get the access token that will be included as the bearer token in delivery requests. + /// + string AzureActiveDirectoryTenantId { get; set; } + /// Delivery attribute details. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping[] DeliveryAttributeMapping { get; set; } + /// + /// The base URL that represents the endpoint of the destination of an event subscription. + /// + string EndpointBaseUrl { get; set; } + /// + /// The URL that represents the endpoint of the destination of an event subscription. + /// + string EndpointUrl { get; set; } + /// Maximum number of events per batch. + int? MaxEventsPerBatch { get; set; } + /// Preferred batch size in Kilobytes. + int? PreferredBatchSizeInKilobyte { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/WebHookEventSubscriptionDestinationProperties.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/WebHookEventSubscriptionDestinationProperties.json.cs new file mode 100644 index 000000000000..20c3841bc89a --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/WebHookEventSubscriptionDestinationProperties.json.cs @@ -0,0 +1,132 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Information about the webhook destination properties for an event subscription. + public partial class WebHookEventSubscriptionDestinationProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebHookEventSubscriptionDestinationProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new WebHookEventSubscriptionDestinationProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._endpointUrl)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._endpointUrl.ToString()) : null, "endpointUrl" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._endpointBaseUrl)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._endpointBaseUrl.ToString()) : null, "endpointBaseUrl" ,container.Add ); + } + AddIf( null != this._maxEventsPerBatch ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNumber((int)this._maxEventsPerBatch) : null, "maxEventsPerBatch" ,container.Add ); + AddIf( null != this._preferredBatchSizeInKilobyte ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNumber((int)this._preferredBatchSizeInKilobyte) : null, "preferredBatchSizeInKilobytes" ,container.Add ); + AddIf( null != (((object)this._azureActiveDirectoryTenantId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._azureActiveDirectoryTenantId.ToString()) : null, "azureActiveDirectoryTenantId" ,container.Add ); + AddIf( null != (((object)this._azureActiveDirectoryApplicationIdOrUri)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._azureActiveDirectoryApplicationIdOrUri.ToString()) : null, "azureActiveDirectoryApplicationIdOrUri" ,container.Add ); + if (null != this._deliveryAttributeMapping) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.XNodeArray(); + foreach( var __x in this._deliveryAttributeMapping ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("deliveryAttributeMappings",__w); + } + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal WebHookEventSubscriptionDestinationProperties(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_endpointUrl = If( json?.PropertyT("endpointUrl"), out var __jsonEndpointUrl) ? (string)__jsonEndpointUrl : (string)EndpointUrl;} + {_endpointBaseUrl = If( json?.PropertyT("endpointBaseUrl"), out var __jsonEndpointBaseUrl) ? (string)__jsonEndpointBaseUrl : (string)EndpointBaseUrl;} + {_maxEventsPerBatch = If( json?.PropertyT("maxEventsPerBatch"), out var __jsonMaxEventsPerBatch) ? (int?)__jsonMaxEventsPerBatch : MaxEventsPerBatch;} + {_preferredBatchSizeInKilobyte = If( json?.PropertyT("preferredBatchSizeInKilobytes"), out var __jsonPreferredBatchSizeInKilobytes) ? (int?)__jsonPreferredBatchSizeInKilobytes : PreferredBatchSizeInKilobyte;} + {_azureActiveDirectoryTenantId = If( json?.PropertyT("azureActiveDirectoryTenantId"), out var __jsonAzureActiveDirectoryTenantId) ? (string)__jsonAzureActiveDirectoryTenantId : (string)AzureActiveDirectoryTenantId;} + {_azureActiveDirectoryApplicationIdOrUri = If( json?.PropertyT("azureActiveDirectoryApplicationIdOrUri"), out var __jsonAzureActiveDirectoryApplicationIdOrUri) ? (string)__jsonAzureActiveDirectoryApplicationIdOrUri : (string)AzureActiveDirectoryApplicationIdOrUri;} + {_deliveryAttributeMapping = If( json?.PropertyT("deliveryAttributeMappings"), out var __jsonDeliveryAttributeMappings) ? If( __jsonDeliveryAttributeMappings as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping) (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DeliveryAttributeMapping.FromJson(__u) )) ))() : null : DeliveryAttributeMapping;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/WebhookPartnerDestinationInfo.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/WebhookPartnerDestinationInfo.PowerShell.cs new file mode 100644 index 000000000000..71439a0f9f4d --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/WebhookPartnerDestinationInfo.PowerShell.cs @@ -0,0 +1,224 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Information about the WebHook of the partner destination. + [System.ComponentModel.TypeConverter(typeof(WebhookPartnerDestinationInfoTypeConverter))] + public partial class WebhookPartnerDestinationInfo + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookPartnerDestinationInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new WebhookPartnerDestinationInfo(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookPartnerDestinationInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new WebhookPartnerDestinationInfo(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookPartnerDestinationInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal WebhookPartnerDestinationInfo(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookPartnerDestinationInfoInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookPartnerDestinationProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookPartnerDestinationInfoInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.WebhookPartnerDestinationPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("AzureSubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfoInternal)this).AzureSubscriptionId = (string) content.GetValueForProperty("AzureSubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfoInternal)this).AzureSubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("ResourceGroupName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfoInternal)this).ResourceGroupName = (string) content.GetValueForProperty("ResourceGroupName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfoInternal)this).ResourceGroupName, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfoInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfoInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("EndpointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfoInternal)this).EndpointType = (string) content.GetValueForProperty("EndpointType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfoInternal)this).EndpointType, global::System.Convert.ToString); + } + if (content.Contains("EndpointServiceContext")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfoInternal)this).EndpointServiceContext = (string) content.GetValueForProperty("EndpointServiceContext",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfoInternal)this).EndpointServiceContext, global::System.Convert.ToString); + } + if (content.Contains("ResourceMoveChangeHistory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfoInternal)this).ResourceMoveChangeHistory = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceMoveChangeHistory[]) content.GetValueForProperty("ResourceMoveChangeHistory",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfoInternal)this).ResourceMoveChangeHistory, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ResourceMoveChangeHistoryTypeConverter.ConvertFrom)); + } + if (content.Contains("ClientAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookPartnerDestinationInfoInternal)this).ClientAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerClientAuthentication) content.GetValueForProperty("ClientAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookPartnerDestinationInfoInternal)this).ClientAuthentication, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerClientAuthenticationTypeConverter.ConvertFrom); + } + if (content.Contains("EndpointUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookPartnerDestinationInfoInternal)this).EndpointUrl = (string) content.GetValueForProperty("EndpointUrl",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookPartnerDestinationInfoInternal)this).EndpointUrl, global::System.Convert.ToString); + } + if (content.Contains("EndpointBaseUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookPartnerDestinationInfoInternal)this).EndpointBaseUrl = (string) content.GetValueForProperty("EndpointBaseUrl",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookPartnerDestinationInfoInternal)this).EndpointBaseUrl, global::System.Convert.ToString); + } + if (content.Contains("ClientAuthenticationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookPartnerDestinationInfoInternal)this).ClientAuthenticationType = (string) content.GetValueForProperty("ClientAuthenticationType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookPartnerDestinationInfoInternal)this).ClientAuthenticationType, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal WebhookPartnerDestinationInfo(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookPartnerDestinationInfoInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookPartnerDestinationProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookPartnerDestinationInfoInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.WebhookPartnerDestinationPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("AzureSubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfoInternal)this).AzureSubscriptionId = (string) content.GetValueForProperty("AzureSubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfoInternal)this).AzureSubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("ResourceGroupName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfoInternal)this).ResourceGroupName = (string) content.GetValueForProperty("ResourceGroupName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfoInternal)this).ResourceGroupName, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfoInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfoInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("EndpointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfoInternal)this).EndpointType = (string) content.GetValueForProperty("EndpointType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfoInternal)this).EndpointType, global::System.Convert.ToString); + } + if (content.Contains("EndpointServiceContext")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfoInternal)this).EndpointServiceContext = (string) content.GetValueForProperty("EndpointServiceContext",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfoInternal)this).EndpointServiceContext, global::System.Convert.ToString); + } + if (content.Contains("ResourceMoveChangeHistory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfoInternal)this).ResourceMoveChangeHistory = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceMoveChangeHistory[]) content.GetValueForProperty("ResourceMoveChangeHistory",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfoInternal)this).ResourceMoveChangeHistory, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ResourceMoveChangeHistoryTypeConverter.ConvertFrom)); + } + if (content.Contains("ClientAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookPartnerDestinationInfoInternal)this).ClientAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerClientAuthentication) content.GetValueForProperty("ClientAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookPartnerDestinationInfoInternal)this).ClientAuthentication, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerClientAuthenticationTypeConverter.ConvertFrom); + } + if (content.Contains("EndpointUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookPartnerDestinationInfoInternal)this).EndpointUrl = (string) content.GetValueForProperty("EndpointUrl",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookPartnerDestinationInfoInternal)this).EndpointUrl, global::System.Convert.ToString); + } + if (content.Contains("EndpointBaseUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookPartnerDestinationInfoInternal)this).EndpointBaseUrl = (string) content.GetValueForProperty("EndpointBaseUrl",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookPartnerDestinationInfoInternal)this).EndpointBaseUrl, global::System.Convert.ToString); + } + if (content.Contains("ClientAuthenticationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookPartnerDestinationInfoInternal)this).ClientAuthenticationType = (string) content.GetValueForProperty("ClientAuthenticationType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookPartnerDestinationInfoInternal)this).ClientAuthenticationType, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + } + /// Information about the WebHook of the partner destination. + [System.ComponentModel.TypeConverter(typeof(WebhookPartnerDestinationInfoTypeConverter))] + public partial interface IWebhookPartnerDestinationInfo + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/WebhookPartnerDestinationInfo.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/WebhookPartnerDestinationInfo.TypeConverter.cs new file mode 100644 index 000000000000..0f6295d3a8bf --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/WebhookPartnerDestinationInfo.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class WebhookPartnerDestinationInfoTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookPartnerDestinationInfo ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookPartnerDestinationInfo).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return WebhookPartnerDestinationInfo.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return WebhookPartnerDestinationInfo.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return WebhookPartnerDestinationInfo.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/WebhookPartnerDestinationInfo.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/WebhookPartnerDestinationInfo.cs new file mode 100644 index 000000000000..755c85e82dae --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/WebhookPartnerDestinationInfo.cs @@ -0,0 +1,148 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Information about the WebHook of the partner destination. + public partial class WebhookPartnerDestinationInfo : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookPartnerDestinationInfo, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookPartnerDestinationInfoInternal, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfo __partnerDestinationInfo = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerDestinationInfo(); + + /// + /// Azure subscription ID of the subscriber. The partner destination associated with the channel will be + /// created under this Azure subscription. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public string AzureSubscriptionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfoInternal)__partnerDestinationInfo).AzureSubscriptionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfoInternal)__partnerDestinationInfo).AzureSubscriptionId = value ?? null; } + + /// Type of client authentication + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string ClientAuthenticationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookPartnerDestinationPropertiesInternal)Property).ClientAuthenticationType; } + + /// The base URL that represents the endpoint of the partner destination. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string EndpointBaseUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookPartnerDestinationPropertiesInternal)Property).EndpointBaseUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookPartnerDestinationPropertiesInternal)Property).EndpointBaseUrl = value ?? null; } + + /// Additional context of the partner destination endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public string EndpointServiceContext { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfoInternal)__partnerDestinationInfo).EndpointServiceContext; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfoInternal)__partnerDestinationInfo).EndpointServiceContext = value ?? null; } + + /// Type of the endpoint for the partner destination + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public string EndpointType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfoInternal)__partnerDestinationInfo).EndpointType; } + + /// The URL that represents the endpoint of the partner destination. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string EndpointUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookPartnerDestinationPropertiesInternal)Property).EndpointUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookPartnerDestinationPropertiesInternal)Property).EndpointUrl = value ?? null; } + + /// Internal Acessors for EndpointType + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfoInternal.EndpointType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfoInternal)__partnerDestinationInfo).EndpointType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfoInternal)__partnerDestinationInfo).EndpointType = value; } + + /// Internal Acessors for ClientAuthentication + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerClientAuthentication Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookPartnerDestinationInfoInternal.ClientAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookPartnerDestinationPropertiesInternal)Property).ClientAuthentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookPartnerDestinationPropertiesInternal)Property).ClientAuthentication = value; } + + /// Internal Acessors for ClientAuthenticationType + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookPartnerDestinationInfoInternal.ClientAuthenticationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookPartnerDestinationPropertiesInternal)Property).ClientAuthenticationType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookPartnerDestinationPropertiesInternal)Property).ClientAuthenticationType = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookPartnerDestinationProperties Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookPartnerDestinationInfoInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.WebhookPartnerDestinationProperties()); set { {_property = value;} } } + + /// Name of the partner destination associated with the channel. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfoInternal)__partnerDestinationInfo).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfoInternal)__partnerDestinationInfo).Name = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookPartnerDestinationProperties _property; + + /// WebHook Properties of the partner destination. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookPartnerDestinationProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.WebhookPartnerDestinationProperties()); set => this._property = value; } + + /// + /// Azure Resource Group of the subscriber. The partner destination associated with the channel will be + /// created under this resource group. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public string ResourceGroupName { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfoInternal)__partnerDestinationInfo).ResourceGroupName; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfoInternal)__partnerDestinationInfo).ResourceGroupName = value ?? null; } + + /// Change history of the resource move. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceMoveChangeHistory[] ResourceMoveChangeHistory { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfoInternal)__partnerDestinationInfo).ResourceMoveChangeHistory; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfoInternal)__partnerDestinationInfo).ResourceMoveChangeHistory = value ?? null /* arrayOf */; } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__partnerDestinationInfo), __partnerDestinationInfo); + await eventListener.AssertObjectIsValid(nameof(__partnerDestinationInfo), __partnerDestinationInfo); + } + + /// Creates an new instance. + public WebhookPartnerDestinationInfo() + { + + } + } + /// Information about the WebHook of the partner destination. + public partial interface IWebhookPartnerDestinationInfo : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfo + { + /// Type of client authentication + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Type of client authentication", + SerializedName = @"clientAuthenticationType", + PossibleTypes = new [] { typeof(string) })] + string ClientAuthenticationType { get; } + /// The base URL that represents the endpoint of the partner destination. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The base URL that represents the endpoint of the partner destination.", + SerializedName = @"endpointBaseUrl", + PossibleTypes = new [] { typeof(string) })] + string EndpointBaseUrl { get; set; } + /// The URL that represents the endpoint of the partner destination. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The URL that represents the endpoint of the partner destination.", + SerializedName = @"endpointUrl", + PossibleTypes = new [] { typeof(string) })] + string EndpointUrl { get; set; } + + } + /// Information about the WebHook of the partner destination. + internal partial interface IWebhookPartnerDestinationInfoInternal : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationInfoInternal + { + /// Partner client authentication + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerClientAuthentication ClientAuthentication { get; set; } + /// Type of client authentication + string ClientAuthenticationType { get; set; } + /// The base URL that represents the endpoint of the partner destination. + string EndpointBaseUrl { get; set; } + /// The URL that represents the endpoint of the partner destination. + string EndpointUrl { get; set; } + /// WebHook Properties of the partner destination. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookPartnerDestinationProperties Property { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/WebhookPartnerDestinationInfo.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/WebhookPartnerDestinationInfo.json.cs new file mode 100644 index 000000000000..8bfce29dc679 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/WebhookPartnerDestinationInfo.json.cs @@ -0,0 +1,108 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Information about the WebHook of the partner destination. + public partial class WebhookPartnerDestinationInfo + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookPartnerDestinationInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookPartnerDestinationInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookPartnerDestinationInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new WebhookPartnerDestinationInfo(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __partnerDestinationInfo?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal WebhookPartnerDestinationInfo(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __partnerDestinationInfo = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerDestinationInfo(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.WebhookPartnerDestinationProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/WebhookPartnerDestinationProperties.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/WebhookPartnerDestinationProperties.PowerShell.cs new file mode 100644 index 000000000000..ed4709f63a4b --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/WebhookPartnerDestinationProperties.PowerShell.cs @@ -0,0 +1,168 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Properties of a partner destination webhook. + [System.ComponentModel.TypeConverter(typeof(WebhookPartnerDestinationPropertiesTypeConverter))] + public partial class WebhookPartnerDestinationProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookPartnerDestinationProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new WebhookPartnerDestinationProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookPartnerDestinationProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new WebhookPartnerDestinationProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookPartnerDestinationProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal WebhookPartnerDestinationProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ClientAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookPartnerDestinationPropertiesInternal)this).ClientAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerClientAuthentication) content.GetValueForProperty("ClientAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookPartnerDestinationPropertiesInternal)this).ClientAuthentication, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerClientAuthenticationTypeConverter.ConvertFrom); + } + if (content.Contains("EndpointUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookPartnerDestinationPropertiesInternal)this).EndpointUrl = (string) content.GetValueForProperty("EndpointUrl",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookPartnerDestinationPropertiesInternal)this).EndpointUrl, global::System.Convert.ToString); + } + if (content.Contains("EndpointBaseUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookPartnerDestinationPropertiesInternal)this).EndpointBaseUrl = (string) content.GetValueForProperty("EndpointBaseUrl",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookPartnerDestinationPropertiesInternal)this).EndpointBaseUrl, global::System.Convert.ToString); + } + if (content.Contains("ClientAuthenticationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookPartnerDestinationPropertiesInternal)this).ClientAuthenticationType = (string) content.GetValueForProperty("ClientAuthenticationType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookPartnerDestinationPropertiesInternal)this).ClientAuthenticationType, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal WebhookPartnerDestinationProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ClientAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookPartnerDestinationPropertiesInternal)this).ClientAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerClientAuthentication) content.GetValueForProperty("ClientAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookPartnerDestinationPropertiesInternal)this).ClientAuthentication, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerClientAuthenticationTypeConverter.ConvertFrom); + } + if (content.Contains("EndpointUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookPartnerDestinationPropertiesInternal)this).EndpointUrl = (string) content.GetValueForProperty("EndpointUrl",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookPartnerDestinationPropertiesInternal)this).EndpointUrl, global::System.Convert.ToString); + } + if (content.Contains("EndpointBaseUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookPartnerDestinationPropertiesInternal)this).EndpointBaseUrl = (string) content.GetValueForProperty("EndpointBaseUrl",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookPartnerDestinationPropertiesInternal)this).EndpointBaseUrl, global::System.Convert.ToString); + } + if (content.Contains("ClientAuthenticationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookPartnerDestinationPropertiesInternal)this).ClientAuthenticationType = (string) content.GetValueForProperty("ClientAuthenticationType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookPartnerDestinationPropertiesInternal)this).ClientAuthenticationType, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + } + /// Properties of a partner destination webhook. + [System.ComponentModel.TypeConverter(typeof(WebhookPartnerDestinationPropertiesTypeConverter))] + public partial interface IWebhookPartnerDestinationProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/WebhookPartnerDestinationProperties.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/WebhookPartnerDestinationProperties.TypeConverter.cs new file mode 100644 index 000000000000..178019b9820f --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/WebhookPartnerDestinationProperties.TypeConverter.cs @@ -0,0 +1,148 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class WebhookPartnerDestinationPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookPartnerDestinationProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookPartnerDestinationProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return WebhookPartnerDestinationProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return WebhookPartnerDestinationProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return WebhookPartnerDestinationProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/WebhookPartnerDestinationProperties.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/WebhookPartnerDestinationProperties.cs new file mode 100644 index 000000000000..ffe88316b573 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/WebhookPartnerDestinationProperties.cs @@ -0,0 +1,97 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Properties of a partner destination webhook. + public partial class WebhookPartnerDestinationProperties : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookPartnerDestinationProperties, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookPartnerDestinationPropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerClientAuthentication _clientAuthentication; + + /// Partner client authentication + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerClientAuthentication ClientAuthentication { get => (this._clientAuthentication = this._clientAuthentication ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerClientAuthentication()); set => this._clientAuthentication = value; } + + /// Type of client authentication + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string ClientAuthenticationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerClientAuthenticationInternal)ClientAuthentication).ClientAuthenticationType; } + + /// Backing field for property. + private string _endpointBaseUrl; + + /// The base URL that represents the endpoint of the partner destination. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string EndpointBaseUrl { get => this._endpointBaseUrl; set => this._endpointBaseUrl = value; } + + /// Backing field for property. + private string _endpointUrl; + + /// The URL that represents the endpoint of the partner destination. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string EndpointUrl { get => this._endpointUrl; set => this._endpointUrl = value; } + + /// Internal Acessors for ClientAuthentication + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerClientAuthentication Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookPartnerDestinationPropertiesInternal.ClientAuthentication { get => (this._clientAuthentication = this._clientAuthentication ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerClientAuthentication()); set { {_clientAuthentication = value;} } } + + /// Internal Acessors for ClientAuthenticationType + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookPartnerDestinationPropertiesInternal.ClientAuthenticationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerClientAuthenticationInternal)ClientAuthentication).ClientAuthenticationType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerClientAuthenticationInternal)ClientAuthentication).ClientAuthenticationType = value; } + + /// Creates an new instance. + public WebhookPartnerDestinationProperties() + { + + } + } + /// Properties of a partner destination webhook. + public partial interface IWebhookPartnerDestinationProperties : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// Type of client authentication + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Type of client authentication", + SerializedName = @"clientAuthenticationType", + PossibleTypes = new [] { typeof(string) })] + string ClientAuthenticationType { get; } + /// The base URL that represents the endpoint of the partner destination. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The base URL that represents the endpoint of the partner destination.", + SerializedName = @"endpointBaseUrl", + PossibleTypes = new [] { typeof(string) })] + string EndpointBaseUrl { get; set; } + /// The URL that represents the endpoint of the partner destination. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The URL that represents the endpoint of the partner destination.", + SerializedName = @"endpointUrl", + PossibleTypes = new [] { typeof(string) })] + string EndpointUrl { get; set; } + + } + /// Properties of a partner destination webhook. + internal partial interface IWebhookPartnerDestinationPropertiesInternal + + { + /// Partner client authentication + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerClientAuthentication ClientAuthentication { get; set; } + /// Type of client authentication + string ClientAuthenticationType { get; set; } + /// The base URL that represents the endpoint of the partner destination. + string EndpointBaseUrl { get; set; } + /// The URL that represents the endpoint of the partner destination. + string EndpointUrl { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/WebhookPartnerDestinationProperties.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/WebhookPartnerDestinationProperties.json.cs new file mode 100644 index 000000000000..628cebfcae63 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/WebhookPartnerDestinationProperties.json.cs @@ -0,0 +1,111 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Properties of a partner destination webhook. + public partial class WebhookPartnerDestinationProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookPartnerDestinationProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookPartnerDestinationProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookPartnerDestinationProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new WebhookPartnerDestinationProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._clientAuthentication ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._clientAuthentication.ToJson(null,serializationMode) : null, "clientAuthentication" ,container.Add ); + AddIf( null != (((object)this._endpointUrl)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._endpointUrl.ToString()) : null, "endpointUrl" ,container.Add ); + AddIf( null != (((object)this._endpointBaseUrl)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._endpointBaseUrl.ToString()) : null, "endpointBaseUrl" ,container.Add ); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal WebhookPartnerDestinationProperties(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_clientAuthentication = If( json?.PropertyT("clientAuthentication"), out var __jsonClientAuthentication) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerClientAuthentication.FromJson(__jsonClientAuthentication) : ClientAuthentication;} + {_endpointUrl = If( json?.PropertyT("endpointUrl"), out var __jsonEndpointUrl) ? (string)__jsonEndpointUrl : (string)EndpointUrl;} + {_endpointBaseUrl = If( json?.PropertyT("endpointBaseUrl"), out var __jsonEndpointBaseUrl) ? (string)__jsonEndpointBaseUrl : (string)EndpointBaseUrl;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/WebhookUpdatePartnerDestinationInfo.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/WebhookUpdatePartnerDestinationInfo.PowerShell.cs new file mode 100644 index 000000000000..3b87aa94c352 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/WebhookUpdatePartnerDestinationInfo.PowerShell.cs @@ -0,0 +1,184 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// Information about the update of the WebHook of the partner destination. + [System.ComponentModel.TypeConverter(typeof(WebhookUpdatePartnerDestinationInfoTypeConverter))] + public partial class WebhookUpdatePartnerDestinationInfo + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookUpdatePartnerDestinationInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new WebhookUpdatePartnerDestinationInfo(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookUpdatePartnerDestinationInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new WebhookUpdatePartnerDestinationInfo(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookUpdatePartnerDestinationInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal WebhookUpdatePartnerDestinationInfo(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookUpdatePartnerDestinationInfoInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookPartnerDestinationProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookUpdatePartnerDestinationInfoInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.WebhookPartnerDestinationPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("EndpointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerUpdateDestinationInfoInternal)this).EndpointType = (string) content.GetValueForProperty("EndpointType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerUpdateDestinationInfoInternal)this).EndpointType, global::System.Convert.ToString); + } + if (content.Contains("ClientAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookUpdatePartnerDestinationInfoInternal)this).ClientAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerClientAuthentication) content.GetValueForProperty("ClientAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookUpdatePartnerDestinationInfoInternal)this).ClientAuthentication, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerClientAuthenticationTypeConverter.ConvertFrom); + } + if (content.Contains("EndpointUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookUpdatePartnerDestinationInfoInternal)this).EndpointUrl = (string) content.GetValueForProperty("EndpointUrl",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookUpdatePartnerDestinationInfoInternal)this).EndpointUrl, global::System.Convert.ToString); + } + if (content.Contains("EndpointBaseUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookUpdatePartnerDestinationInfoInternal)this).EndpointBaseUrl = (string) content.GetValueForProperty("EndpointBaseUrl",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookUpdatePartnerDestinationInfoInternal)this).EndpointBaseUrl, global::System.Convert.ToString); + } + if (content.Contains("ClientAuthenticationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookUpdatePartnerDestinationInfoInternal)this).ClientAuthenticationType = (string) content.GetValueForProperty("ClientAuthenticationType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookUpdatePartnerDestinationInfoInternal)this).ClientAuthenticationType, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal WebhookUpdatePartnerDestinationInfo(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookUpdatePartnerDestinationInfoInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookPartnerDestinationProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookUpdatePartnerDestinationInfoInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.WebhookPartnerDestinationPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("EndpointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerUpdateDestinationInfoInternal)this).EndpointType = (string) content.GetValueForProperty("EndpointType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerUpdateDestinationInfoInternal)this).EndpointType, global::System.Convert.ToString); + } + if (content.Contains("ClientAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookUpdatePartnerDestinationInfoInternal)this).ClientAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerClientAuthentication) content.GetValueForProperty("ClientAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookUpdatePartnerDestinationInfoInternal)this).ClientAuthentication, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerClientAuthenticationTypeConverter.ConvertFrom); + } + if (content.Contains("EndpointUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookUpdatePartnerDestinationInfoInternal)this).EndpointUrl = (string) content.GetValueForProperty("EndpointUrl",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookUpdatePartnerDestinationInfoInternal)this).EndpointUrl, global::System.Convert.ToString); + } + if (content.Contains("EndpointBaseUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookUpdatePartnerDestinationInfoInternal)this).EndpointBaseUrl = (string) content.GetValueForProperty("EndpointBaseUrl",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookUpdatePartnerDestinationInfoInternal)this).EndpointBaseUrl, global::System.Convert.ToString); + } + if (content.Contains("ClientAuthenticationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookUpdatePartnerDestinationInfoInternal)this).ClientAuthenticationType = (string) content.GetValueForProperty("ClientAuthenticationType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookUpdatePartnerDestinationInfoInternal)this).ClientAuthenticationType, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + } + /// Information about the update of the WebHook of the partner destination. + [System.ComponentModel.TypeConverter(typeof(WebhookUpdatePartnerDestinationInfoTypeConverter))] + public partial interface IWebhookUpdatePartnerDestinationInfo + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/WebhookUpdatePartnerDestinationInfo.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/WebhookUpdatePartnerDestinationInfo.TypeConverter.cs new file mode 100644 index 000000000000..ec3d16df5790 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/WebhookUpdatePartnerDestinationInfo.TypeConverter.cs @@ -0,0 +1,148 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class WebhookUpdatePartnerDestinationInfoTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookUpdatePartnerDestinationInfo ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookUpdatePartnerDestinationInfo).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return WebhookUpdatePartnerDestinationInfo.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return WebhookUpdatePartnerDestinationInfo.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return WebhookUpdatePartnerDestinationInfo.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/WebhookUpdatePartnerDestinationInfo.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/WebhookUpdatePartnerDestinationInfo.cs new file mode 100644 index 000000000000..f21fc889cb9b --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/WebhookUpdatePartnerDestinationInfo.cs @@ -0,0 +1,122 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Information about the update of the WebHook of the partner destination. + public partial class WebhookUpdatePartnerDestinationInfo : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookUpdatePartnerDestinationInfo, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookUpdatePartnerDestinationInfoInternal, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerUpdateDestinationInfo __partnerUpdateDestinationInfo = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerUpdateDestinationInfo(); + + /// Type of client authentication + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string ClientAuthenticationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookPartnerDestinationPropertiesInternal)Property).ClientAuthenticationType; } + + /// The base URL that represents the endpoint of the partner destination. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string EndpointBaseUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookPartnerDestinationPropertiesInternal)Property).EndpointBaseUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookPartnerDestinationPropertiesInternal)Property).EndpointBaseUrl = value ?? null; } + + /// Type of the endpoint for the partner destination + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inherited)] + public string EndpointType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerUpdateDestinationInfoInternal)__partnerUpdateDestinationInfo).EndpointType; } + + /// The URL that represents the endpoint of the partner destination. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Inlined)] + public string EndpointUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookPartnerDestinationPropertiesInternal)Property).EndpointUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookPartnerDestinationPropertiesInternal)Property).EndpointUrl = value ?? null; } + + /// Internal Acessors for EndpointType + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerUpdateDestinationInfoInternal.EndpointType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerUpdateDestinationInfoInternal)__partnerUpdateDestinationInfo).EndpointType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerUpdateDestinationInfoInternal)__partnerUpdateDestinationInfo).EndpointType = value; } + + /// Internal Acessors for ClientAuthentication + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerClientAuthentication Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookUpdatePartnerDestinationInfoInternal.ClientAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookPartnerDestinationPropertiesInternal)Property).ClientAuthentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookPartnerDestinationPropertiesInternal)Property).ClientAuthentication = value; } + + /// Internal Acessors for ClientAuthenticationType + string Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookUpdatePartnerDestinationInfoInternal.ClientAuthenticationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookPartnerDestinationPropertiesInternal)Property).ClientAuthenticationType; set => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookPartnerDestinationPropertiesInternal)Property).ClientAuthenticationType = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookPartnerDestinationProperties Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookUpdatePartnerDestinationInfoInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.WebhookPartnerDestinationProperties()); set { {_property = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookPartnerDestinationProperties _property; + + /// WebHook Properties of the partner destination. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookPartnerDestinationProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.WebhookPartnerDestinationProperties()); set => this._property = value; } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__partnerUpdateDestinationInfo), __partnerUpdateDestinationInfo); + await eventListener.AssertObjectIsValid(nameof(__partnerUpdateDestinationInfo), __partnerUpdateDestinationInfo); + } + + /// Creates an new instance. + public WebhookUpdatePartnerDestinationInfo() + { + + } + } + /// Information about the update of the WebHook of the partner destination. + public partial interface IWebhookUpdatePartnerDestinationInfo : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerUpdateDestinationInfo + { + /// Type of client authentication + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Type of client authentication", + SerializedName = @"clientAuthenticationType", + PossibleTypes = new [] { typeof(string) })] + string ClientAuthenticationType { get; } + /// The base URL that represents the endpoint of the partner destination. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The base URL that represents the endpoint of the partner destination.", + SerializedName = @"endpointBaseUrl", + PossibleTypes = new [] { typeof(string) })] + string EndpointBaseUrl { get; set; } + /// The URL that represents the endpoint of the partner destination. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The URL that represents the endpoint of the partner destination.", + SerializedName = @"endpointUrl", + PossibleTypes = new [] { typeof(string) })] + string EndpointUrl { get; set; } + + } + /// Information about the update of the WebHook of the partner destination. + internal partial interface IWebhookUpdatePartnerDestinationInfoInternal : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerUpdateDestinationInfoInternal + { + /// Partner client authentication + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerClientAuthentication ClientAuthentication { get; set; } + /// Type of client authentication + string ClientAuthenticationType { get; set; } + /// The base URL that represents the endpoint of the partner destination. + string EndpointBaseUrl { get; set; } + /// The URL that represents the endpoint of the partner destination. + string EndpointUrl { get; set; } + /// WebHook Properties of the partner destination. + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookPartnerDestinationProperties Property { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/WebhookUpdatePartnerDestinationInfo.json.cs b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/WebhookUpdatePartnerDestinationInfo.json.cs new file mode 100644 index 000000000000..f851cb6419a2 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/Api20211015Preview/WebhookUpdatePartnerDestinationInfo.json.cs @@ -0,0 +1,109 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + /// Information about the update of the WebHook of the partner destination. + public partial class WebhookUpdatePartnerDestinationInfo + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookUpdatePartnerDestinationInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookUpdatePartnerDestinationInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IWebhookUpdatePartnerDestinationInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new WebhookUpdatePartnerDestinationInfo(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __partnerUpdateDestinationInfo?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal WebhookUpdatePartnerDestinationInfo(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __partnerUpdateDestinationInfo = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerUpdateDestinationInfo(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.WebhookPartnerDestinationProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/EventGridIdentity.PowerShell.cs b/swaggerci/eventgrid/generated/api/Models/EventGridIdentity.PowerShell.cs new file mode 100644 index 000000000000..72e7faaac84f --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/EventGridIdentity.PowerShell.cs @@ -0,0 +1,332 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(EventGridIdentityTypeConverter))] + public partial class EventGridIdentity + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new EventGridIdentity(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new EventGridIdentity(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal EventGridIdentity(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).SubscriptionId = (string) content.GetValueForProperty("SubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).SubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("ResourceGroupName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).ResourceGroupName = (string) content.GetValueForProperty("ResourceGroupName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).ResourceGroupName, global::System.Convert.ToString); + } + if (content.Contains("PartnerNamespaceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).PartnerNamespaceName = (string) content.GetValueForProperty("PartnerNamespaceName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).PartnerNamespaceName, global::System.Convert.ToString); + } + if (content.Contains("ChannelName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).ChannelName = (string) content.GetValueForProperty("ChannelName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).ChannelName, global::System.Convert.ToString); + } + if (content.Contains("DomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).DomainName = (string) content.GetValueForProperty("DomainName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).DomainName, global::System.Convert.ToString); + } + if (content.Contains("DomainTopicName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).DomainTopicName = (string) content.GetValueForProperty("DomainTopicName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).DomainTopicName, global::System.Convert.ToString); + } + if (content.Contains("EventChannelName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).EventChannelName = (string) content.GetValueForProperty("EventChannelName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).EventChannelName, global::System.Convert.ToString); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("EventSubscriptionName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).EventSubscriptionName = (string) content.GetValueForProperty("EventSubscriptionName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).EventSubscriptionName, global::System.Convert.ToString); + } + if (content.Contains("TopicTypeName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).TopicTypeName = (string) content.GetValueForProperty("TopicTypeName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).TopicTypeName, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("ProviderNamespace")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).ProviderNamespace = (string) content.GetValueForProperty("ProviderNamespace",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).ProviderNamespace, global::System.Convert.ToString); + } + if (content.Contains("ResourceTypeName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).ResourceTypeName = (string) content.GetValueForProperty("ResourceTypeName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).ResourceTypeName, global::System.Convert.ToString); + } + if (content.Contains("ResourceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).ResourceName = (string) content.GetValueForProperty("ResourceName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).ResourceName, global::System.Convert.ToString); + } + if (content.Contains("TopicName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).TopicName = (string) content.GetValueForProperty("TopicName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).TopicName, global::System.Convert.ToString); + } + if (content.Contains("SystemTopicName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).SystemTopicName = (string) content.GetValueForProperty("SystemTopicName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).SystemTopicName, global::System.Convert.ToString); + } + if (content.Contains("PartnerTopicName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).PartnerTopicName = (string) content.GetValueForProperty("PartnerTopicName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).PartnerTopicName, global::System.Convert.ToString); + } + if (content.Contains("PartnerDestinationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).PartnerDestinationName = (string) content.GetValueForProperty("PartnerDestinationName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).PartnerDestinationName, global::System.Convert.ToString); + } + if (content.Contains("PartnerRegistrationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).PartnerRegistrationName = (string) content.GetValueForProperty("PartnerRegistrationName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).PartnerRegistrationName, global::System.Convert.ToString); + } + if (content.Contains("ParentType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).ParentType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ParentType?) content.GetValueForProperty("ParentType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).ParentType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ParentType.CreateFrom); + } + if (content.Contains("ParentName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).ParentName = (string) content.GetValueForProperty("ParentName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).ParentName, global::System.Convert.ToString); + } + if (content.Contains("PrivateEndpointConnectionName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).PrivateEndpointConnectionName = (string) content.GetValueForProperty("PrivateEndpointConnectionName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).PrivateEndpointConnectionName, global::System.Convert.ToString); + } + if (content.Contains("PrivateLinkResourceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).PrivateLinkResourceName = (string) content.GetValueForProperty("PrivateLinkResourceName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).PrivateLinkResourceName, global::System.Convert.ToString); + } + if (content.Contains("VerifiedPartnerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).VerifiedPartnerName = (string) content.GetValueForProperty("VerifiedPartnerName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).VerifiedPartnerName, global::System.Convert.ToString); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).Id, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal EventGridIdentity(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).SubscriptionId = (string) content.GetValueForProperty("SubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).SubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("ResourceGroupName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).ResourceGroupName = (string) content.GetValueForProperty("ResourceGroupName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).ResourceGroupName, global::System.Convert.ToString); + } + if (content.Contains("PartnerNamespaceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).PartnerNamespaceName = (string) content.GetValueForProperty("PartnerNamespaceName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).PartnerNamespaceName, global::System.Convert.ToString); + } + if (content.Contains("ChannelName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).ChannelName = (string) content.GetValueForProperty("ChannelName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).ChannelName, global::System.Convert.ToString); + } + if (content.Contains("DomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).DomainName = (string) content.GetValueForProperty("DomainName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).DomainName, global::System.Convert.ToString); + } + if (content.Contains("DomainTopicName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).DomainTopicName = (string) content.GetValueForProperty("DomainTopicName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).DomainTopicName, global::System.Convert.ToString); + } + if (content.Contains("EventChannelName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).EventChannelName = (string) content.GetValueForProperty("EventChannelName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).EventChannelName, global::System.Convert.ToString); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("EventSubscriptionName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).EventSubscriptionName = (string) content.GetValueForProperty("EventSubscriptionName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).EventSubscriptionName, global::System.Convert.ToString); + } + if (content.Contains("TopicTypeName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).TopicTypeName = (string) content.GetValueForProperty("TopicTypeName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).TopicTypeName, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("ProviderNamespace")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).ProviderNamespace = (string) content.GetValueForProperty("ProviderNamespace",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).ProviderNamespace, global::System.Convert.ToString); + } + if (content.Contains("ResourceTypeName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).ResourceTypeName = (string) content.GetValueForProperty("ResourceTypeName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).ResourceTypeName, global::System.Convert.ToString); + } + if (content.Contains("ResourceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).ResourceName = (string) content.GetValueForProperty("ResourceName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).ResourceName, global::System.Convert.ToString); + } + if (content.Contains("TopicName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).TopicName = (string) content.GetValueForProperty("TopicName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).TopicName, global::System.Convert.ToString); + } + if (content.Contains("SystemTopicName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).SystemTopicName = (string) content.GetValueForProperty("SystemTopicName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).SystemTopicName, global::System.Convert.ToString); + } + if (content.Contains("PartnerTopicName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).PartnerTopicName = (string) content.GetValueForProperty("PartnerTopicName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).PartnerTopicName, global::System.Convert.ToString); + } + if (content.Contains("PartnerDestinationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).PartnerDestinationName = (string) content.GetValueForProperty("PartnerDestinationName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).PartnerDestinationName, global::System.Convert.ToString); + } + if (content.Contains("PartnerRegistrationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).PartnerRegistrationName = (string) content.GetValueForProperty("PartnerRegistrationName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).PartnerRegistrationName, global::System.Convert.ToString); + } + if (content.Contains("ParentType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).ParentType = (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ParentType?) content.GetValueForProperty("ParentType",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).ParentType, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ParentType.CreateFrom); + } + if (content.Contains("ParentName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).ParentName = (string) content.GetValueForProperty("ParentName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).ParentName, global::System.Convert.ToString); + } + if (content.Contains("PrivateEndpointConnectionName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).PrivateEndpointConnectionName = (string) content.GetValueForProperty("PrivateEndpointConnectionName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).PrivateEndpointConnectionName, global::System.Convert.ToString); + } + if (content.Contains("PrivateLinkResourceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).PrivateLinkResourceName = (string) content.GetValueForProperty("PrivateLinkResourceName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).PrivateLinkResourceName, global::System.Convert.ToString); + } + if (content.Contains("VerifiedPartnerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).VerifiedPartnerName = (string) content.GetValueForProperty("VerifiedPartnerName",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).VerifiedPartnerName, global::System.Convert.ToString); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal)this).Id, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(EventGridIdentityTypeConverter))] + public partial interface IEventGridIdentity + + { + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/EventGridIdentity.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Models/EventGridIdentity.TypeConverter.cs new file mode 100644 index 000000000000..c2ae2f4ca596 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/EventGridIdentity.TypeConverter.cs @@ -0,0 +1,157 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class EventGridIdentityTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + // we allow string conversion too. + if (type == typeof(global::System.String)) + { + return true; + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + // support direct string to id type conversion. + if (type == typeof(global::System.String)) + { + return new EventGridIdentity { Id = sourceValue }; + } + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return EventGridIdentity.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return EventGridIdentity.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return EventGridIdentity.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/EventGridIdentity.cs b/swaggerci/eventgrid/generated/api/Models/EventGridIdentity.cs new file mode 100644 index 000000000000..01b64895aebb --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/EventGridIdentity.cs @@ -0,0 +1,495 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + public partial class EventGridIdentity : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentityInternal + { + + /// Backing field for property. + private string _channelName; + + /// Name of the channel. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string ChannelName { get => this._channelName; set => this._channelName = value; } + + /// Backing field for property. + private string _domainName; + + /// Name of the domain. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string DomainName { get => this._domainName; set => this._domainName = value; } + + /// Backing field for property. + private string _domainTopicName; + + /// Name of the topic. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string DomainTopicName { get => this._domainTopicName; set => this._domainTopicName = value; } + + /// Backing field for property. + private string _eventChannelName; + + /// Name of the event channel. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string EventChannelName { get => this._eventChannelName; set => this._eventChannelName = value; } + + /// Backing field for property. + private string _eventSubscriptionName; + + /// Name of the event subscription. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string EventSubscriptionName { get => this._eventSubscriptionName; set => this._eventSubscriptionName = value; } + + /// Backing field for property. + private string _id; + + /// Resource identity path + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string Id { get => this._id; set => this._id = value; } + + /// Backing field for property. + private string _location; + + /// Name of the location. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string Location { get => this._location; set => this._location = value; } + + /// Backing field for property. + private string _parentName; + + /// + /// The name of the parent resource (namely, either, the topic name, domain name, or partner namespace name). + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string ParentName { get => this._parentName; set => this._parentName = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ParentType? _parentType; + + /// + /// The type of the parent resource. This can be either \'topics\', \'domains\', or \'partnerNamespaces\'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ParentType? ParentType { get => this._parentType; set => this._parentType = value; } + + /// Backing field for property. + private string _partnerDestinationName; + + /// Name of the partner destination. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string PartnerDestinationName { get => this._partnerDestinationName; set => this._partnerDestinationName = value; } + + /// Backing field for property. + private string _partnerNamespaceName; + + /// Name of the partner namespace. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string PartnerNamespaceName { get => this._partnerNamespaceName; set => this._partnerNamespaceName = value; } + + /// Backing field for property. + private string _partnerRegistrationName; + + /// Name of the partner registration. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string PartnerRegistrationName { get => this._partnerRegistrationName; set => this._partnerRegistrationName = value; } + + /// Backing field for property. + private string _partnerTopicName; + + /// Name of the partner topic. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string PartnerTopicName { get => this._partnerTopicName; set => this._partnerTopicName = value; } + + /// Backing field for property. + private string _privateEndpointConnectionName; + + /// The name of the private endpoint connection connection. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string PrivateEndpointConnectionName { get => this._privateEndpointConnectionName; set => this._privateEndpointConnectionName = value; } + + /// Backing field for property. + private string _privateLinkResourceName; + + /// The name of private link resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string PrivateLinkResourceName { get => this._privateLinkResourceName; set => this._privateLinkResourceName = value; } + + /// Backing field for property. + private string _providerNamespace; + + /// Namespace of the provider of the topic. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string ProviderNamespace { get => this._providerNamespace; set => this._providerNamespace = value; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the partners subscription. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _resourceName; + + /// Name of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string ResourceName { get => this._resourceName; set => this._resourceName = value; } + + /// Backing field for property. + private string _resourceTypeName; + + /// Name of the resource type. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string ResourceTypeName { get => this._resourceTypeName; set => this._resourceTypeName = value; } + + /// Backing field for property. + private string _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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' + /// for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' + /// for an EventGrid topic. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string Scope { get => this._scope; set => this._scope = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _systemTopicName; + + /// Name of the system topic. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string SystemTopicName { get => this._systemTopicName; set => this._systemTopicName = value; } + + /// Backing field for property. + private string _topicName; + + /// Name of the domain topic. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string TopicName { get => this._topicName; set => this._topicName = value; } + + /// Backing field for property. + private string _topicTypeName; + + /// Name of the topic type. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string TopicTypeName { get => this._topicTypeName; set => this._topicTypeName = value; } + + /// Backing field for property. + private string _verifiedPartnerName; + + /// Name of the verified partner. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Origin(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.PropertyOrigin.Owned)] + public string VerifiedPartnerName { get => this._verifiedPartnerName; set => this._verifiedPartnerName = value; } + + /// Creates an new instance. + public EventGridIdentity() + { + + } + } + public partial interface IEventGridIdentity : + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable + { + /// Name of the channel. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the channel.", + SerializedName = @"channelName", + PossibleTypes = new [] { typeof(string) })] + string ChannelName { get; set; } + /// Name of the domain. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the domain.", + SerializedName = @"domainName", + PossibleTypes = new [] { typeof(string) })] + string DomainName { get; set; } + /// Name of the topic. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the topic.", + SerializedName = @"domainTopicName", + PossibleTypes = new [] { typeof(string) })] + string DomainTopicName { get; set; } + /// Name of the event channel. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the event channel.", + SerializedName = @"eventChannelName", + PossibleTypes = new [] { typeof(string) })] + string EventChannelName { get; set; } + /// Name of the event subscription. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the event subscription.", + SerializedName = @"eventSubscriptionName", + PossibleTypes = new [] { typeof(string) })] + string EventSubscriptionName { get; set; } + /// Resource identity path + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource identity path", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; set; } + /// Name of the location. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the location.", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + string Location { get; set; } + /// + /// The name of the parent resource (namely, either, the topic name, domain name, or partner namespace name). + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the parent resource (namely, either, the topic name, domain name, or partner namespace name).", + SerializedName = @"parentName", + PossibleTypes = new [] { typeof(string) })] + string ParentName { get; set; } + /// + /// The type of the parent resource. This can be either \'topics\', \'domains\', or \'partnerNamespaces\'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of the parent resource. This can be either \'topics\', \'domains\', or \'partnerNamespaces\'.", + SerializedName = @"parentType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ParentType) })] + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ParentType? ParentType { get; set; } + /// Name of the partner destination. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the partner destination.", + SerializedName = @"partnerDestinationName", + PossibleTypes = new [] { typeof(string) })] + string PartnerDestinationName { get; set; } + /// Name of the partner namespace. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the partner namespace.", + SerializedName = @"partnerNamespaceName", + PossibleTypes = new [] { typeof(string) })] + string PartnerNamespaceName { get; set; } + /// Name of the partner registration. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the partner registration.", + SerializedName = @"partnerRegistrationName", + PossibleTypes = new [] { typeof(string) })] + string PartnerRegistrationName { get; set; } + /// Name of the partner topic. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the partner topic.", + SerializedName = @"partnerTopicName", + PossibleTypes = new [] { typeof(string) })] + string PartnerTopicName { get; set; } + /// The name of the private endpoint connection connection. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the private endpoint connection connection.", + SerializedName = @"privateEndpointConnectionName", + PossibleTypes = new [] { typeof(string) })] + string PrivateEndpointConnectionName { get; set; } + /// The name of private link resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of private link resource.", + SerializedName = @"privateLinkResourceName", + PossibleTypes = new [] { typeof(string) })] + string PrivateLinkResourceName { get; set; } + /// Namespace of the provider of the topic. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Namespace of the provider of the topic.", + SerializedName = @"providerNamespace", + PossibleTypes = new [] { typeof(string) })] + string ProviderNamespace { get; set; } + /// The name of the resource group within the partners subscription. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the resource group within the partners subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + string ResourceGroupName { get; set; } + /// Name of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + string ResourceName { get; set; } + /// Name of the resource type. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the resource type.", + SerializedName = @"resourceTypeName", + PossibleTypes = new [] { typeof(string) })] + string ResourceTypeName { get; set; } + /// + /// 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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' + /// for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' + /// for an EventGrid topic. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic.", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(string) })] + string Scope { get; set; } + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + string SubscriptionId { get; set; } + /// Name of the system topic. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the system topic.", + SerializedName = @"systemTopicName", + PossibleTypes = new [] { typeof(string) })] + string SystemTopicName { get; set; } + /// Name of the domain topic. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the domain topic.", + SerializedName = @"topicName", + PossibleTypes = new [] { typeof(string) })] + string TopicName { get; set; } + /// Name of the topic type. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the topic type.", + SerializedName = @"topicTypeName", + PossibleTypes = new [] { typeof(string) })] + string TopicTypeName { get; set; } + /// Name of the verified partner. + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the verified partner.", + SerializedName = @"verifiedPartnerName", + PossibleTypes = new [] { typeof(string) })] + string VerifiedPartnerName { get; set; } + + } + internal partial interface IEventGridIdentityInternal + + { + /// Name of the channel. + string ChannelName { get; set; } + /// Name of the domain. + string DomainName { get; set; } + /// Name of the topic. + string DomainTopicName { get; set; } + /// Name of the event channel. + string EventChannelName { get; set; } + /// Name of the event subscription. + string EventSubscriptionName { get; set; } + /// Resource identity path + string Id { get; set; } + /// Name of the location. + string Location { get; set; } + /// + /// The name of the parent resource (namely, either, the topic name, domain name, or partner namespace name). + /// + string ParentName { get; set; } + /// + /// The type of the parent resource. This can be either \'topics\', \'domains\', or \'partnerNamespaces\'. + /// + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ParentType? ParentType { get; set; } + /// Name of the partner destination. + string PartnerDestinationName { get; set; } + /// Name of the partner namespace. + string PartnerNamespaceName { get; set; } + /// Name of the partner registration. + string PartnerRegistrationName { get; set; } + /// Name of the partner topic. + string PartnerTopicName { get; set; } + /// The name of the private endpoint connection connection. + string PrivateEndpointConnectionName { get; set; } + /// The name of private link resource. + string PrivateLinkResourceName { get; set; } + /// Namespace of the provider of the topic. + string ProviderNamespace { get; set; } + /// The name of the resource group within the partners subscription. + string ResourceGroupName { get; set; } + /// Name of the resource. + string ResourceName { get; set; } + /// Name of the resource type. + string ResourceTypeName { get; set; } + /// + /// 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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' + /// for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' + /// for an EventGrid topic. + /// + string Scope { get; set; } + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + string SubscriptionId { get; set; } + /// Name of the system topic. + string SystemTopicName { get; set; } + /// Name of the domain topic. + string TopicName { get; set; } + /// Name of the topic type. + string TopicTypeName { get; set; } + /// Name of the verified partner. + string VerifiedPartnerName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Models/EventGridIdentity.json.cs b/swaggerci/eventgrid/generated/api/Models/EventGridIdentity.json.cs new file mode 100644 index 000000000000..c0ba58e7f3d4 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Models/EventGridIdentity.json.cs @@ -0,0 +1,153 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + public partial class EventGridIdentity + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject instance to deserialize from. + internal EventGridIdentity(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_subscriptionId = If( json?.PropertyT("subscriptionId"), out var __jsonSubscriptionId) ? (string)__jsonSubscriptionId : (string)SubscriptionId;} + {_resourceGroupName = If( json?.PropertyT("resourceGroupName"), out var __jsonResourceGroupName) ? (string)__jsonResourceGroupName : (string)ResourceGroupName;} + {_partnerNamespaceName = If( json?.PropertyT("partnerNamespaceName"), out var __jsonPartnerNamespaceName) ? (string)__jsonPartnerNamespaceName : (string)PartnerNamespaceName;} + {_channelName = If( json?.PropertyT("channelName"), out var __jsonChannelName) ? (string)__jsonChannelName : (string)ChannelName;} + {_domainName = If( json?.PropertyT("domainName"), out var __jsonDomainName) ? (string)__jsonDomainName : (string)DomainName;} + {_domainTopicName = If( json?.PropertyT("domainTopicName"), out var __jsonDomainTopicName) ? (string)__jsonDomainTopicName : (string)DomainTopicName;} + {_eventChannelName = If( json?.PropertyT("eventChannelName"), out var __jsonEventChannelName) ? (string)__jsonEventChannelName : (string)EventChannelName;} + {_scope = If( json?.PropertyT("scope"), out var __jsonScope) ? (string)__jsonScope : (string)Scope;} + {_eventSubscriptionName = If( json?.PropertyT("eventSubscriptionName"), out var __jsonEventSubscriptionName) ? (string)__jsonEventSubscriptionName : (string)EventSubscriptionName;} + {_topicTypeName = If( json?.PropertyT("topicTypeName"), out var __jsonTopicTypeName) ? (string)__jsonTopicTypeName : (string)TopicTypeName;} + {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)Location;} + {_providerNamespace = If( json?.PropertyT("providerNamespace"), out var __jsonProviderNamespace) ? (string)__jsonProviderNamespace : (string)ProviderNamespace;} + {_resourceTypeName = If( json?.PropertyT("resourceTypeName"), out var __jsonResourceTypeName) ? (string)__jsonResourceTypeName : (string)ResourceTypeName;} + {_resourceName = If( json?.PropertyT("resourceName"), out var __jsonResourceName) ? (string)__jsonResourceName : (string)ResourceName;} + {_topicName = If( json?.PropertyT("topicName"), out var __jsonTopicName) ? (string)__jsonTopicName : (string)TopicName;} + {_systemTopicName = If( json?.PropertyT("systemTopicName"), out var __jsonSystemTopicName) ? (string)__jsonSystemTopicName : (string)SystemTopicName;} + {_partnerTopicName = If( json?.PropertyT("partnerTopicName"), out var __jsonPartnerTopicName) ? (string)__jsonPartnerTopicName : (string)PartnerTopicName;} + {_partnerDestinationName = If( json?.PropertyT("partnerDestinationName"), out var __jsonPartnerDestinationName) ? (string)__jsonPartnerDestinationName : (string)PartnerDestinationName;} + {_partnerRegistrationName = If( json?.PropertyT("partnerRegistrationName"), out var __jsonPartnerRegistrationName) ? (string)__jsonPartnerRegistrationName : (string)PartnerRegistrationName;} + {_parentType = If( json?.PropertyT("parentType"), out var __jsonParentType) ? (string)__jsonParentType : (string)ParentType;} + {_parentName = If( json?.PropertyT("parentName"), out var __jsonParentName) ? (string)__jsonParentName : (string)ParentName;} + {_privateEndpointConnectionName = If( json?.PropertyT("privateEndpointConnectionName"), out var __jsonPrivateEndpointConnectionName) ? (string)__jsonPrivateEndpointConnectionName : (string)PrivateEndpointConnectionName;} + {_privateLinkResourceName = If( json?.PropertyT("privateLinkResourceName"), out var __jsonPrivateLinkResourceName) ? (string)__jsonPrivateLinkResourceName : (string)PrivateLinkResourceName;} + {_verifiedPartnerName = If( json?.PropertyT("verifiedPartnerName"), out var __jsonVerifiedPartnerName) ? (string)__jsonVerifiedPartnerName : (string)VerifiedPartnerName;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new EventGridIdentity(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._subscriptionId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._subscriptionId.ToString()) : null, "subscriptionId" ,container.Add ); + AddIf( null != (((object)this._resourceGroupName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._resourceGroupName.ToString()) : null, "resourceGroupName" ,container.Add ); + AddIf( null != (((object)this._partnerNamespaceName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._partnerNamespaceName.ToString()) : null, "partnerNamespaceName" ,container.Add ); + AddIf( null != (((object)this._channelName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._channelName.ToString()) : null, "channelName" ,container.Add ); + AddIf( null != (((object)this._domainName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._domainName.ToString()) : null, "domainName" ,container.Add ); + AddIf( null != (((object)this._domainTopicName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._domainTopicName.ToString()) : null, "domainTopicName" ,container.Add ); + AddIf( null != (((object)this._eventChannelName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._eventChannelName.ToString()) : null, "eventChannelName" ,container.Add ); + AddIf( null != (((object)this._scope)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._scope.ToString()) : null, "scope" ,container.Add ); + AddIf( null != (((object)this._eventSubscriptionName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._eventSubscriptionName.ToString()) : null, "eventSubscriptionName" ,container.Add ); + AddIf( null != (((object)this._topicTypeName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._topicTypeName.ToString()) : null, "topicTypeName" ,container.Add ); + AddIf( null != (((object)this._location)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._location.ToString()) : null, "location" ,container.Add ); + AddIf( null != (((object)this._providerNamespace)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._providerNamespace.ToString()) : null, "providerNamespace" ,container.Add ); + AddIf( null != (((object)this._resourceTypeName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._resourceTypeName.ToString()) : null, "resourceTypeName" ,container.Add ); + AddIf( null != (((object)this._resourceName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._resourceName.ToString()) : null, "resourceName" ,container.Add ); + AddIf( null != (((object)this._topicName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._topicName.ToString()) : null, "topicName" ,container.Add ); + AddIf( null != (((object)this._systemTopicName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._systemTopicName.ToString()) : null, "systemTopicName" ,container.Add ); + AddIf( null != (((object)this._partnerTopicName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._partnerTopicName.ToString()) : null, "partnerTopicName" ,container.Add ); + AddIf( null != (((object)this._partnerDestinationName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._partnerDestinationName.ToString()) : null, "partnerDestinationName" ,container.Add ); + AddIf( null != (((object)this._partnerRegistrationName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._partnerRegistrationName.ToString()) : null, "partnerRegistrationName" ,container.Add ); + AddIf( null != (((object)this._parentType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._parentType.ToString()) : null, "parentType" ,container.Add ); + AddIf( null != (((object)this._parentName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._parentName.ToString()) : null, "parentName" ,container.Add ); + AddIf( null != (((object)this._privateEndpointConnectionName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._privateEndpointConnectionName.ToString()) : null, "privateEndpointConnectionName" ,container.Add ); + AddIf( null != (((object)this._privateLinkResourceName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._privateLinkResourceName.ToString()) : null, "privateLinkResourceName" ,container.Add ); + AddIf( null != (((object)this._verifiedPartnerName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._verifiedPartnerName.ToString()) : null, "verifiedPartnerName" ,container.Add ); + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/AdvancedFilterOperatorType.Completer.cs b/swaggerci/eventgrid/generated/api/Support/AdvancedFilterOperatorType.Completer.cs new file mode 100644 index 000000000000..e5f5192c8442 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/AdvancedFilterOperatorType.Completer.cs @@ -0,0 +1,109 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// + /// The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. + /// + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorTypeTypeConverter))] + public partial struct AdvancedFilterOperatorType : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "NumberIn".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'NumberIn'", "NumberIn", global::System.Management.Automation.CompletionResultType.ParameterValue, "NumberIn"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "NumberNotIn".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'NumberNotIn'", "NumberNotIn", global::System.Management.Automation.CompletionResultType.ParameterValue, "NumberNotIn"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "NumberLessThan".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'NumberLessThan'", "NumberLessThan", global::System.Management.Automation.CompletionResultType.ParameterValue, "NumberLessThan"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "NumberGreaterThan".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'NumberGreaterThan'", "NumberGreaterThan", global::System.Management.Automation.CompletionResultType.ParameterValue, "NumberGreaterThan"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "NumberLessThanOrEquals".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'NumberLessThanOrEquals'", "NumberLessThanOrEquals", global::System.Management.Automation.CompletionResultType.ParameterValue, "NumberLessThanOrEquals"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "NumberGreaterThanOrEquals".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'NumberGreaterThanOrEquals'", "NumberGreaterThanOrEquals", global::System.Management.Automation.CompletionResultType.ParameterValue, "NumberGreaterThanOrEquals"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "BoolEquals".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'BoolEquals'", "BoolEquals", global::System.Management.Automation.CompletionResultType.ParameterValue, "BoolEquals"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "StringIn".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'StringIn'", "StringIn", global::System.Management.Automation.CompletionResultType.ParameterValue, "StringIn"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "StringNotIn".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'StringNotIn'", "StringNotIn", global::System.Management.Automation.CompletionResultType.ParameterValue, "StringNotIn"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "StringBeginsWith".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'StringBeginsWith'", "StringBeginsWith", global::System.Management.Automation.CompletionResultType.ParameterValue, "StringBeginsWith"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "StringEndsWith".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'StringEndsWith'", "StringEndsWith", global::System.Management.Automation.CompletionResultType.ParameterValue, "StringEndsWith"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "StringContains".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'StringContains'", "StringContains", global::System.Management.Automation.CompletionResultType.ParameterValue, "StringContains"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "NumberInRange".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'NumberInRange'", "NumberInRange", global::System.Management.Automation.CompletionResultType.ParameterValue, "NumberInRange"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "NumberNotInRange".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'NumberNotInRange'", "NumberNotInRange", global::System.Management.Automation.CompletionResultType.ParameterValue, "NumberNotInRange"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "StringNotBeginsWith".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'StringNotBeginsWith'", "StringNotBeginsWith", global::System.Management.Automation.CompletionResultType.ParameterValue, "StringNotBeginsWith"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "StringNotEndsWith".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'StringNotEndsWith'", "StringNotEndsWith", global::System.Management.Automation.CompletionResultType.ParameterValue, "StringNotEndsWith"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "StringNotContains".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'StringNotContains'", "StringNotContains", global::System.Management.Automation.CompletionResultType.ParameterValue, "StringNotContains"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "IsNullOrUndefined".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'IsNullOrUndefined'", "IsNullOrUndefined", global::System.Management.Automation.CompletionResultType.ParameterValue, "IsNullOrUndefined"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "IsNotNull".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'IsNotNull'", "IsNotNull", global::System.Management.Automation.CompletionResultType.ParameterValue, "IsNotNull"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/AdvancedFilterOperatorType.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Support/AdvancedFilterOperatorType.TypeConverter.cs new file mode 100644 index 000000000000..48002db2ed1f --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/AdvancedFilterOperatorType.TypeConverter.cs @@ -0,0 +1,61 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// + /// The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. + /// + public partial class AdvancedFilterOperatorTypeTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => AdvancedFilterOperatorType.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/AdvancedFilterOperatorType.cs b/swaggerci/eventgrid/generated/api/Support/AdvancedFilterOperatorType.cs new file mode 100644 index 000000000000..e64e3d5fff2c --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/AdvancedFilterOperatorType.cs @@ -0,0 +1,136 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// + /// The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. + /// + public partial struct AdvancedFilterOperatorType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType BoolEquals = @"BoolEquals"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType IsNotNull = @"IsNotNull"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType IsNullOrUndefined = @"IsNullOrUndefined"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType NumberGreaterThan = @"NumberGreaterThan"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType NumberGreaterThanOrEquals = @"NumberGreaterThanOrEquals"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType NumberIn = @"NumberIn"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType NumberInRange = @"NumberInRange"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType NumberLessThan = @"NumberLessThan"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType NumberLessThanOrEquals = @"NumberLessThanOrEquals"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType NumberNotIn = @"NumberNotIn"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType NumberNotInRange = @"NumberNotInRange"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType StringBeginsWith = @"StringBeginsWith"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType StringContains = @"StringContains"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType StringEndsWith = @"StringEndsWith"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType StringIn = @"StringIn"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType StringNotBeginsWith = @"StringNotBeginsWith"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType StringNotContains = @"StringNotContains"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType StringNotEndsWith = @"StringNotEndsWith"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType StringNotIn = @"StringNotIn"; + + /// + /// the value for an instance of the Enum. + /// + private string _value { get; set; } + + /// Creates an instance of the + /// the value to create an instance for. + private AdvancedFilterOperatorType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Conversion from arbitrary object to AdvancedFilterOperatorType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new AdvancedFilterOperatorType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type AdvancedFilterOperatorType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type AdvancedFilterOperatorType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is AdvancedFilterOperatorType && Equals((AdvancedFilterOperatorType)obj); + } + + /// Returns hashCode for enum AdvancedFilterOperatorType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for AdvancedFilterOperatorType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to AdvancedFilterOperatorType + /// the value to convert to an instance of . + + public static implicit operator AdvancedFilterOperatorType(string value) + { + return new AdvancedFilterOperatorType(value); + } + + /// Implicit operator to convert AdvancedFilterOperatorType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType e) + { + return e._value; + } + + /// Overriding != operator for enum AdvancedFilterOperatorType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType e1, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum AdvancedFilterOperatorType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType e1, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.AdvancedFilterOperatorType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/ChannelProvisioningState.Completer.cs b/swaggerci/eventgrid/generated/api/Support/ChannelProvisioningState.Completer.cs new file mode 100644 index 000000000000..3ede15875339 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/ChannelProvisioningState.Completer.cs @@ -0,0 +1,55 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// Provisioning state of the channel. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ChannelProvisioningStateTypeConverter))] + public partial struct ChannelProvisioningState : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Creating".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Creating'", "Creating", global::System.Management.Automation.CompletionResultType.ParameterValue, "Creating"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Updating".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Updating'", "Updating", global::System.Management.Automation.CompletionResultType.ParameterValue, "Updating"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Deleting".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Deleting'", "Deleting", global::System.Management.Automation.CompletionResultType.ParameterValue, "Deleting"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Succeeded".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Succeeded'", "Succeeded", global::System.Management.Automation.CompletionResultType.ParameterValue, "Succeeded"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Canceled".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Canceled'", "Canceled", global::System.Management.Automation.CompletionResultType.ParameterValue, "Canceled"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Failed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Failed'", "Failed", global::System.Management.Automation.CompletionResultType.ParameterValue, "Failed"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/ChannelProvisioningState.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Support/ChannelProvisioningState.TypeConverter.cs new file mode 100644 index 000000000000..bf6b528b758c --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/ChannelProvisioningState.TypeConverter.cs @@ -0,0 +1,59 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// Provisioning state of the channel. + public partial class ChannelProvisioningStateTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ChannelProvisioningState.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/ChannelProvisioningState.cs b/swaggerci/eventgrid/generated/api/Support/ChannelProvisioningState.cs new file mode 100644 index 000000000000..06f71455fbbc --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/ChannelProvisioningState.cs @@ -0,0 +1,106 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// Provisioning state of the channel. + public partial struct ChannelProvisioningState : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ChannelProvisioningState Canceled = @"Canceled"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ChannelProvisioningState Creating = @"Creating"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ChannelProvisioningState Deleting = @"Deleting"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ChannelProvisioningState Failed = @"Failed"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ChannelProvisioningState Succeeded = @"Succeeded"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ChannelProvisioningState Updating = @"Updating"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Creates an instance of the + /// the value to create an instance for. + private ChannelProvisioningState(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Conversion from arbitrary object to ChannelProvisioningState + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ChannelProvisioningState(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ChannelProvisioningState + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ChannelProvisioningState e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type ChannelProvisioningState (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is ChannelProvisioningState && Equals((ChannelProvisioningState)obj); + } + + /// Returns hashCode for enum ChannelProvisioningState + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for ChannelProvisioningState + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to ChannelProvisioningState + /// the value to convert to an instance of . + + public static implicit operator ChannelProvisioningState(string value) + { + return new ChannelProvisioningState(value); + } + + /// Implicit operator to convert ChannelProvisioningState to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ChannelProvisioningState e) + { + return e._value; + } + + /// Overriding != operator for enum ChannelProvisioningState + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ChannelProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ChannelProvisioningState e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ChannelProvisioningState + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ChannelProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ChannelProvisioningState e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/ChannelType.Completer.cs b/swaggerci/eventgrid/generated/api/Support/ChannelType.Completer.cs new file mode 100644 index 000000000000..3ab86130751a --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/ChannelType.Completer.cs @@ -0,0 +1,39 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// The type of the event channel which represents the direction flow of events. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ChannelTypeTypeConverter))] + public partial struct ChannelType : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "PartnerTopic".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'PartnerTopic'", "PartnerTopic", global::System.Management.Automation.CompletionResultType.ParameterValue, "PartnerTopic"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "PartnerDestination".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'PartnerDestination'", "PartnerDestination", global::System.Management.Automation.CompletionResultType.ParameterValue, "PartnerDestination"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/ChannelType.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Support/ChannelType.TypeConverter.cs new file mode 100644 index 000000000000..c3668dec1314 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/ChannelType.TypeConverter.cs @@ -0,0 +1,59 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// The type of the event channel which represents the direction flow of events. + public partial class ChannelTypeTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ChannelType.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/ChannelType.cs b/swaggerci/eventgrid/generated/api/Support/ChannelType.cs new file mode 100644 index 000000000000..9573465bd31f --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/ChannelType.cs @@ -0,0 +1,98 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// The type of the event channel which represents the direction flow of events. + public partial struct ChannelType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ChannelType PartnerDestination = @"PartnerDestination"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ChannelType PartnerTopic = @"PartnerTopic"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Creates an instance of the + /// the value to create an instance for. + private ChannelType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Conversion from arbitrary object to ChannelType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ChannelType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ChannelType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ChannelType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type ChannelType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is ChannelType && Equals((ChannelType)obj); + } + + /// Returns hashCode for enum ChannelType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for ChannelType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to ChannelType + /// the value to convert to an instance of . + + public static implicit operator ChannelType(string value) + { + return new ChannelType(value); + } + + /// Implicit operator to convert ChannelType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ChannelType e) + { + return e._value; + } + + /// Overriding != operator for enum ChannelType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ChannelType e1, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ChannelType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ChannelType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ChannelType e1, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ChannelType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/CreatedByType.Completer.cs b/swaggerci/eventgrid/generated/api/Support/CreatedByType.Completer.cs new file mode 100644 index 000000000000..d896c8999a96 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/CreatedByType.Completer.cs @@ -0,0 +1,47 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// The type of identity that created the resource. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByTypeTypeConverter))] + public partial struct CreatedByType : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "User".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'User'", "User", global::System.Management.Automation.CompletionResultType.ParameterValue, "User"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Application".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Application'", "Application", global::System.Management.Automation.CompletionResultType.ParameterValue, "Application"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "ManagedIdentity".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'ManagedIdentity'", "ManagedIdentity", global::System.Management.Automation.CompletionResultType.ParameterValue, "ManagedIdentity"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Key".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Key'", "Key", global::System.Management.Automation.CompletionResultType.ParameterValue, "Key"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/CreatedByType.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Support/CreatedByType.TypeConverter.cs new file mode 100644 index 000000000000..fd0ca2ff450a --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/CreatedByType.TypeConverter.cs @@ -0,0 +1,59 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// The type of identity that created the resource. + public partial class CreatedByTypeTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => CreatedByType.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/CreatedByType.cs b/swaggerci/eventgrid/generated/api/Support/CreatedByType.cs new file mode 100644 index 000000000000..5b8394c653f0 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/CreatedByType.cs @@ -0,0 +1,102 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// The type of identity that created the resource. + public partial struct CreatedByType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType Application = @"Application"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType Key = @"Key"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType ManagedIdentity = @"ManagedIdentity"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType User = @"User"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to CreatedByType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new CreatedByType(global::System.Convert.ToString(value)); + } + + /// Creates an instance of the + /// the value to create an instance for. + private CreatedByType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Compares values of enum type CreatedByType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type CreatedByType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is CreatedByType && Equals((CreatedByType)obj); + } + + /// Returns hashCode for enum CreatedByType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for CreatedByType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to CreatedByType + /// the value to convert to an instance of . + + public static implicit operator CreatedByType(string value) + { + return new CreatedByType(value); + } + + /// Implicit operator to convert CreatedByType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType e) + { + return e._value; + } + + /// Overriding != operator for enum CreatedByType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType e1, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum CreatedByType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType e1, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.CreatedByType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/DataResidencyBoundary.Completer.cs b/swaggerci/eventgrid/generated/api/Support/DataResidencyBoundary.Completer.cs new file mode 100644 index 000000000000..b9c56ac57721 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/DataResidencyBoundary.Completer.cs @@ -0,0 +1,39 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// Data Residency Boundary of the resource. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundaryTypeConverter))] + public partial struct DataResidencyBoundary : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "WithinGeopair".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'WithinGeopair'", "WithinGeopair", global::System.Management.Automation.CompletionResultType.ParameterValue, "WithinGeopair"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "WithinRegion".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'WithinRegion'", "WithinRegion", global::System.Management.Automation.CompletionResultType.ParameterValue, "WithinRegion"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/DataResidencyBoundary.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Support/DataResidencyBoundary.TypeConverter.cs new file mode 100644 index 000000000000..81318217c5fb --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/DataResidencyBoundary.TypeConverter.cs @@ -0,0 +1,59 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// Data Residency Boundary of the resource. + public partial class DataResidencyBoundaryTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => DataResidencyBoundary.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/DataResidencyBoundary.cs b/swaggerci/eventgrid/generated/api/Support/DataResidencyBoundary.cs new file mode 100644 index 000000000000..b16fcf2aad79 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/DataResidencyBoundary.cs @@ -0,0 +1,98 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// Data Residency Boundary of the resource. + public partial struct DataResidencyBoundary : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary WithinGeopair = @"WithinGeopair"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary WithinRegion = @"WithinRegion"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to DataResidencyBoundary + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new DataResidencyBoundary(global::System.Convert.ToString(value)); + } + + /// Creates an instance of the + /// the value to create an instance for. + private DataResidencyBoundary(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Compares values of enum type DataResidencyBoundary + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type DataResidencyBoundary (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is DataResidencyBoundary && Equals((DataResidencyBoundary)obj); + } + + /// Returns hashCode for enum DataResidencyBoundary + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for DataResidencyBoundary + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to DataResidencyBoundary + /// the value to convert to an instance of . + + public static implicit operator DataResidencyBoundary(string value) + { + return new DataResidencyBoundary(value); + } + + /// Implicit operator to convert DataResidencyBoundary to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary e) + { + return e._value; + } + + /// Overriding != operator for enum DataResidencyBoundary + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary e1, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum DataResidencyBoundary + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary e1, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/DeliveryAttributeMappingType.Completer.cs b/swaggerci/eventgrid/generated/api/Support/DeliveryAttributeMappingType.Completer.cs new file mode 100644 index 000000000000..f5220601609a --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/DeliveryAttributeMappingType.Completer.cs @@ -0,0 +1,39 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// Type of the delivery attribute or header name. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DeliveryAttributeMappingTypeTypeConverter))] + public partial struct DeliveryAttributeMappingType : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Static".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Static'", "Static", global::System.Management.Automation.CompletionResultType.ParameterValue, "Static"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Dynamic".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Dynamic'", "Dynamic", global::System.Management.Automation.CompletionResultType.ParameterValue, "Dynamic"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/DeliveryAttributeMappingType.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Support/DeliveryAttributeMappingType.TypeConverter.cs new file mode 100644 index 000000000000..c7f3098c67be --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/DeliveryAttributeMappingType.TypeConverter.cs @@ -0,0 +1,59 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// Type of the delivery attribute or header name. + public partial class DeliveryAttributeMappingTypeTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => DeliveryAttributeMappingType.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/DeliveryAttributeMappingType.cs b/swaggerci/eventgrid/generated/api/Support/DeliveryAttributeMappingType.cs new file mode 100644 index 000000000000..1713107f1812 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/DeliveryAttributeMappingType.cs @@ -0,0 +1,102 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// Type of the delivery attribute or header name. + public partial struct DeliveryAttributeMappingType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DeliveryAttributeMappingType Dynamic = @"Dynamic"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DeliveryAttributeMappingType Static = @"Static"; + + /// + /// the value for an instance of the Enum. + /// + private string _value { get; set; } + + /// Conversion from arbitrary object to DeliveryAttributeMappingType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new DeliveryAttributeMappingType(global::System.Convert.ToString(value)); + } + + /// + /// Creates an instance of the + /// + /// the value to create an instance for. + private DeliveryAttributeMappingType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Compares values of enum type DeliveryAttributeMappingType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DeliveryAttributeMappingType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type DeliveryAttributeMappingType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is DeliveryAttributeMappingType && Equals((DeliveryAttributeMappingType)obj); + } + + /// Returns hashCode for enum DeliveryAttributeMappingType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for DeliveryAttributeMappingType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to DeliveryAttributeMappingType + /// the value to convert to an instance of . + + public static implicit operator DeliveryAttributeMappingType(string value) + { + return new DeliveryAttributeMappingType(value); + } + + /// Implicit operator to convert DeliveryAttributeMappingType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DeliveryAttributeMappingType e) + { + return e._value; + } + + /// Overriding != operator for enum DeliveryAttributeMappingType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DeliveryAttributeMappingType e1, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DeliveryAttributeMappingType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum DeliveryAttributeMappingType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DeliveryAttributeMappingType e1, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DeliveryAttributeMappingType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/DomainProvisioningState.Completer.cs b/swaggerci/eventgrid/generated/api/Support/DomainProvisioningState.Completer.cs new file mode 100644 index 000000000000..af5f154ff100 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/DomainProvisioningState.Completer.cs @@ -0,0 +1,55 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// Provisioning state of the Event Grid Domain Resource. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DomainProvisioningStateTypeConverter))] + public partial struct DomainProvisioningState : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Creating".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Creating'", "Creating", global::System.Management.Automation.CompletionResultType.ParameterValue, "Creating"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Updating".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Updating'", "Updating", global::System.Management.Automation.CompletionResultType.ParameterValue, "Updating"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Deleting".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Deleting'", "Deleting", global::System.Management.Automation.CompletionResultType.ParameterValue, "Deleting"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Succeeded".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Succeeded'", "Succeeded", global::System.Management.Automation.CompletionResultType.ParameterValue, "Succeeded"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Canceled".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Canceled'", "Canceled", global::System.Management.Automation.CompletionResultType.ParameterValue, "Canceled"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Failed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Failed'", "Failed", global::System.Management.Automation.CompletionResultType.ParameterValue, "Failed"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/DomainProvisioningState.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Support/DomainProvisioningState.TypeConverter.cs new file mode 100644 index 000000000000..41a3a6969f23 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/DomainProvisioningState.TypeConverter.cs @@ -0,0 +1,59 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// Provisioning state of the Event Grid Domain Resource. + public partial class DomainProvisioningStateTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => DomainProvisioningState.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/DomainProvisioningState.cs b/swaggerci/eventgrid/generated/api/Support/DomainProvisioningState.cs new file mode 100644 index 000000000000..946706461a0d --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/DomainProvisioningState.cs @@ -0,0 +1,106 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// Provisioning state of the Event Grid Domain Resource. + public partial struct DomainProvisioningState : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DomainProvisioningState Canceled = @"Canceled"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DomainProvisioningState Creating = @"Creating"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DomainProvisioningState Deleting = @"Deleting"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DomainProvisioningState Failed = @"Failed"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DomainProvisioningState Succeeded = @"Succeeded"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DomainProvisioningState Updating = @"Updating"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to DomainProvisioningState + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new DomainProvisioningState(global::System.Convert.ToString(value)); + } + + /// Creates an instance of the + /// the value to create an instance for. + private DomainProvisioningState(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Compares values of enum type DomainProvisioningState + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DomainProvisioningState e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type DomainProvisioningState (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is DomainProvisioningState && Equals((DomainProvisioningState)obj); + } + + /// Returns hashCode for enum DomainProvisioningState + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for DomainProvisioningState + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to DomainProvisioningState + /// the value to convert to an instance of . + + public static implicit operator DomainProvisioningState(string value) + { + return new DomainProvisioningState(value); + } + + /// Implicit operator to convert DomainProvisioningState to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DomainProvisioningState e) + { + return e._value; + } + + /// Overriding != operator for enum DomainProvisioningState + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DomainProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DomainProvisioningState e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum DomainProvisioningState + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DomainProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DomainProvisioningState e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/DomainTopicProvisioningState.Completer.cs b/swaggerci/eventgrid/generated/api/Support/DomainTopicProvisioningState.Completer.cs new file mode 100644 index 000000000000..649ee581b495 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/DomainTopicProvisioningState.Completer.cs @@ -0,0 +1,55 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// Provisioning state of the domain topic. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DomainTopicProvisioningStateTypeConverter))] + public partial struct DomainTopicProvisioningState : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Creating".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Creating'", "Creating", global::System.Management.Automation.CompletionResultType.ParameterValue, "Creating"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Updating".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Updating'", "Updating", global::System.Management.Automation.CompletionResultType.ParameterValue, "Updating"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Deleting".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Deleting'", "Deleting", global::System.Management.Automation.CompletionResultType.ParameterValue, "Deleting"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Succeeded".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Succeeded'", "Succeeded", global::System.Management.Automation.CompletionResultType.ParameterValue, "Succeeded"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Canceled".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Canceled'", "Canceled", global::System.Management.Automation.CompletionResultType.ParameterValue, "Canceled"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Failed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Failed'", "Failed", global::System.Management.Automation.CompletionResultType.ParameterValue, "Failed"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/DomainTopicProvisioningState.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Support/DomainTopicProvisioningState.TypeConverter.cs new file mode 100644 index 000000000000..e6883de240b9 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/DomainTopicProvisioningState.TypeConverter.cs @@ -0,0 +1,59 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// Provisioning state of the domain topic. + public partial class DomainTopicProvisioningStateTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => DomainTopicProvisioningState.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/DomainTopicProvisioningState.cs b/swaggerci/eventgrid/generated/api/Support/DomainTopicProvisioningState.cs new file mode 100644 index 000000000000..236dfd309fa4 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/DomainTopicProvisioningState.cs @@ -0,0 +1,110 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// Provisioning state of the domain topic. + public partial struct DomainTopicProvisioningState : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DomainTopicProvisioningState Canceled = @"Canceled"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DomainTopicProvisioningState Creating = @"Creating"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DomainTopicProvisioningState Deleting = @"Deleting"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DomainTopicProvisioningState Failed = @"Failed"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DomainTopicProvisioningState Succeeded = @"Succeeded"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DomainTopicProvisioningState Updating = @"Updating"; + + /// + /// the value for an instance of the Enum. + /// + private string _value { get; set; } + + /// Conversion from arbitrary object to DomainTopicProvisioningState + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new DomainTopicProvisioningState(global::System.Convert.ToString(value)); + } + + /// + /// Creates an instance of the + /// + /// the value to create an instance for. + private DomainTopicProvisioningState(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Compares values of enum type DomainTopicProvisioningState + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DomainTopicProvisioningState e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type DomainTopicProvisioningState (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is DomainTopicProvisioningState && Equals((DomainTopicProvisioningState)obj); + } + + /// Returns hashCode for enum DomainTopicProvisioningState + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for DomainTopicProvisioningState + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to DomainTopicProvisioningState + /// the value to convert to an instance of . + + public static implicit operator DomainTopicProvisioningState(string value) + { + return new DomainTopicProvisioningState(value); + } + + /// Implicit operator to convert DomainTopicProvisioningState to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DomainTopicProvisioningState e) + { + return e._value; + } + + /// Overriding != operator for enum DomainTopicProvisioningState + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DomainTopicProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DomainTopicProvisioningState e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum DomainTopicProvisioningState + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DomainTopicProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DomainTopicProvisioningState e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/EndpointType.Completer.cs b/swaggerci/eventgrid/generated/api/Support/EndpointType.Completer.cs new file mode 100644 index 000000000000..6aa9f7794977 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/EndpointType.Completer.cs @@ -0,0 +1,63 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// Type of the endpoint for the event subscription destination. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointTypeTypeConverter))] + public partial struct EndpointType : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "WebHook".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'WebHook'", "WebHook", global::System.Management.Automation.CompletionResultType.ParameterValue, "WebHook"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "EventHub".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'EventHub'", "EventHub", global::System.Management.Automation.CompletionResultType.ParameterValue, "EventHub"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "StorageQueue".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'StorageQueue'", "StorageQueue", global::System.Management.Automation.CompletionResultType.ParameterValue, "StorageQueue"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "HybridConnection".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'HybridConnection'", "HybridConnection", global::System.Management.Automation.CompletionResultType.ParameterValue, "HybridConnection"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "ServiceBusQueue".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'ServiceBusQueue'", "ServiceBusQueue", global::System.Management.Automation.CompletionResultType.ParameterValue, "ServiceBusQueue"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "ServiceBusTopic".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'ServiceBusTopic'", "ServiceBusTopic", global::System.Management.Automation.CompletionResultType.ParameterValue, "ServiceBusTopic"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "AzureFunction".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'AzureFunction'", "AzureFunction", global::System.Management.Automation.CompletionResultType.ParameterValue, "AzureFunction"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "PartnerDestination".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'PartnerDestination'", "PartnerDestination", global::System.Management.Automation.CompletionResultType.ParameterValue, "PartnerDestination"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/EndpointType.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Support/EndpointType.TypeConverter.cs new file mode 100644 index 000000000000..9c91cee6fca5 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/EndpointType.TypeConverter.cs @@ -0,0 +1,59 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// Type of the endpoint for the event subscription destination. + public partial class EndpointTypeTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => EndpointType.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/EndpointType.cs b/swaggerci/eventgrid/generated/api/Support/EndpointType.cs new file mode 100644 index 000000000000..fe555021c525 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/EndpointType.cs @@ -0,0 +1,110 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// Type of the endpoint for the event subscription destination. + public partial struct EndpointType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType AzureFunction = @"AzureFunction"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType EventHub = @"EventHub"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType HybridConnection = @"HybridConnection"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType PartnerDestination = @"PartnerDestination"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType ServiceBusQueue = @"ServiceBusQueue"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType ServiceBusTopic = @"ServiceBusTopic"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType StorageQueue = @"StorageQueue"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType WebHook = @"WebHook"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to EndpointType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new EndpointType(global::System.Convert.ToString(value)); + } + + /// Creates an instance of the + /// the value to create an instance for. + private EndpointType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Compares values of enum type EndpointType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type EndpointType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is EndpointType && Equals((EndpointType)obj); + } + + /// Returns hashCode for enum EndpointType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for EndpointType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to EndpointType + /// the value to convert to an instance of . + + public static implicit operator EndpointType(string value) + { + return new EndpointType(value); + } + + /// Implicit operator to convert EndpointType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType e) + { + return e._value; + } + + /// Overriding != operator for enum EndpointType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType e1, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum EndpointType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType e1, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/EventChannelProvisioningState.Completer.cs b/swaggerci/eventgrid/generated/api/Support/EventChannelProvisioningState.Completer.cs new file mode 100644 index 000000000000..bdbe967ca9f3 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/EventChannelProvisioningState.Completer.cs @@ -0,0 +1,55 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// Provisioning state of the event channel. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventChannelProvisioningStateTypeConverter))] + public partial struct EventChannelProvisioningState : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Creating".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Creating'", "Creating", global::System.Management.Automation.CompletionResultType.ParameterValue, "Creating"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Updating".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Updating'", "Updating", global::System.Management.Automation.CompletionResultType.ParameterValue, "Updating"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Deleting".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Deleting'", "Deleting", global::System.Management.Automation.CompletionResultType.ParameterValue, "Deleting"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Succeeded".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Succeeded'", "Succeeded", global::System.Management.Automation.CompletionResultType.ParameterValue, "Succeeded"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Canceled".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Canceled'", "Canceled", global::System.Management.Automation.CompletionResultType.ParameterValue, "Canceled"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Failed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Failed'", "Failed", global::System.Management.Automation.CompletionResultType.ParameterValue, "Failed"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/EventChannelProvisioningState.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Support/EventChannelProvisioningState.TypeConverter.cs new file mode 100644 index 000000000000..496737e69be1 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/EventChannelProvisioningState.TypeConverter.cs @@ -0,0 +1,59 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// Provisioning state of the event channel. + public partial class EventChannelProvisioningStateTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => EventChannelProvisioningState.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/EventChannelProvisioningState.cs b/swaggerci/eventgrid/generated/api/Support/EventChannelProvisioningState.cs new file mode 100644 index 000000000000..5b78029d400d --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/EventChannelProvisioningState.cs @@ -0,0 +1,112 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// Provisioning state of the event channel. + public partial struct EventChannelProvisioningState : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventChannelProvisioningState Canceled = @"Canceled"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventChannelProvisioningState Creating = @"Creating"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventChannelProvisioningState Deleting = @"Deleting"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventChannelProvisioningState Failed = @"Failed"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventChannelProvisioningState Succeeded = @"Succeeded"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventChannelProvisioningState Updating = @"Updating"; + + /// + /// the value for an instance of the Enum. + /// + private string _value { get; set; } + + /// Conversion from arbitrary object to EventChannelProvisioningState + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new EventChannelProvisioningState(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type EventChannelProvisioningState + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventChannelProvisioningState e) + { + return _value.Equals(e._value); + } + + /// + /// Compares values of enum type EventChannelProvisioningState (override for Object) + /// + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is EventChannelProvisioningState && Equals((EventChannelProvisioningState)obj); + } + + /// + /// Creates an instance of the + /// + /// the value to create an instance for. + private EventChannelProvisioningState(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns hashCode for enum EventChannelProvisioningState + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for EventChannelProvisioningState + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to EventChannelProvisioningState + /// the value to convert to an instance of . + + public static implicit operator EventChannelProvisioningState(string value) + { + return new EventChannelProvisioningState(value); + } + + /// Implicit operator to convert EventChannelProvisioningState to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventChannelProvisioningState e) + { + return e._value; + } + + /// Overriding != operator for enum EventChannelProvisioningState + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventChannelProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventChannelProvisioningState e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum EventChannelProvisioningState + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventChannelProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventChannelProvisioningState e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/EventDefinitionKind.Completer.cs b/swaggerci/eventgrid/generated/api/Support/EventDefinitionKind.Completer.cs new file mode 100644 index 000000000000..14d24e6f3f5e --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/EventDefinitionKind.Completer.cs @@ -0,0 +1,35 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// The kind of event type used. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKindTypeConverter))] + public partial struct EventDefinitionKind : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Inline".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Inline'", "Inline", global::System.Management.Automation.CompletionResultType.ParameterValue, "Inline"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/EventDefinitionKind.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Support/EventDefinitionKind.TypeConverter.cs new file mode 100644 index 000000000000..a3d6fdbb3ce4 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/EventDefinitionKind.TypeConverter.cs @@ -0,0 +1,59 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// The kind of event type used. + public partial class EventDefinitionKindTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => EventDefinitionKind.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/EventDefinitionKind.cs b/swaggerci/eventgrid/generated/api/Support/EventDefinitionKind.cs new file mode 100644 index 000000000000..f2b5c266393f --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/EventDefinitionKind.cs @@ -0,0 +1,96 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// The kind of event type used. + public partial struct EventDefinitionKind : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind Inline = @"Inline"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to EventDefinitionKind + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new EventDefinitionKind(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type EventDefinitionKind + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type EventDefinitionKind (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is EventDefinitionKind && Equals((EventDefinitionKind)obj); + } + + /// Creates an instance of the + /// the value to create an instance for. + private EventDefinitionKind(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns hashCode for enum EventDefinitionKind + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for EventDefinitionKind + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to EventDefinitionKind + /// the value to convert to an instance of . + + public static implicit operator EventDefinitionKind(string value) + { + return new EventDefinitionKind(value); + } + + /// Implicit operator to convert EventDefinitionKind to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind e) + { + return e._value; + } + + /// Overriding != operator for enum EventDefinitionKind + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind e1, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum EventDefinitionKind + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind e1, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/EventDeliverySchema.Completer.cs b/swaggerci/eventgrid/generated/api/Support/EventDeliverySchema.Completer.cs new file mode 100644 index 000000000000..de78ab5524c5 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/EventDeliverySchema.Completer.cs @@ -0,0 +1,43 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// The event delivery schema for the event subscription. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchemaTypeConverter))] + public partial struct EventDeliverySchema : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "EventGridSchema".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'EventGridSchema'", "EventGridSchema", global::System.Management.Automation.CompletionResultType.ParameterValue, "EventGridSchema"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "CustomInputSchema".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'CustomInputSchema'", "CustomInputSchema", global::System.Management.Automation.CompletionResultType.ParameterValue, "CustomInputSchema"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "CloudEventSchemaV1_0".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'CloudEventSchemaV1_0'", "CloudEventSchemaV1_0", global::System.Management.Automation.CompletionResultType.ParameterValue, "CloudEventSchemaV1_0"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/EventDeliverySchema.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Support/EventDeliverySchema.TypeConverter.cs new file mode 100644 index 000000000000..ceee85541f4c --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/EventDeliverySchema.TypeConverter.cs @@ -0,0 +1,59 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// The event delivery schema for the event subscription. + public partial class EventDeliverySchemaTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => EventDeliverySchema.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/EventDeliverySchema.cs b/swaggerci/eventgrid/generated/api/Support/EventDeliverySchema.cs new file mode 100644 index 000000000000..fb3925bad63e --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/EventDeliverySchema.cs @@ -0,0 +1,100 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// The event delivery schema for the event subscription. + public partial struct EventDeliverySchema : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema CloudEventSchemaV10 = @"CloudEventSchemaV1_0"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema CustomInputSchema = @"CustomInputSchema"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema EventGridSchema = @"EventGridSchema"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to EventDeliverySchema + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new EventDeliverySchema(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type EventDeliverySchema + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type EventDeliverySchema (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is EventDeliverySchema && Equals((EventDeliverySchema)obj); + } + + /// Creates an instance of the + /// the value to create an instance for. + private EventDeliverySchema(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns hashCode for enum EventDeliverySchema + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for EventDeliverySchema + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to EventDeliverySchema + /// the value to convert to an instance of . + + public static implicit operator EventDeliverySchema(string value) + { + return new EventDeliverySchema(value); + } + + /// Implicit operator to convert EventDeliverySchema to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema e) + { + return e._value; + } + + /// Overriding != operator for enum EventDeliverySchema + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema e1, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum EventDeliverySchema + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema e1, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/EventSubscriptionIdentityType.Completer.cs b/swaggerci/eventgrid/generated/api/Support/EventSubscriptionIdentityType.Completer.cs new file mode 100644 index 000000000000..2f7f47a655d9 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/EventSubscriptionIdentityType.Completer.cs @@ -0,0 +1,42 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// + /// 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. + /// + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityTypeTypeConverter))] + public partial struct EventSubscriptionIdentityType : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "SystemAssigned".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'SystemAssigned'", "SystemAssigned", global::System.Management.Automation.CompletionResultType.ParameterValue, "SystemAssigned"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "UserAssigned".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'UserAssigned'", "UserAssigned", global::System.Management.Automation.CompletionResultType.ParameterValue, "UserAssigned"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/EventSubscriptionIdentityType.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Support/EventSubscriptionIdentityType.TypeConverter.cs new file mode 100644 index 000000000000..f3accd7a63e0 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/EventSubscriptionIdentityType.TypeConverter.cs @@ -0,0 +1,62 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// + /// 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. + /// + public partial class EventSubscriptionIdentityTypeTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => EventSubscriptionIdentityType.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/EventSubscriptionIdentityType.cs b/swaggerci/eventgrid/generated/api/Support/EventSubscriptionIdentityType.cs new file mode 100644 index 000000000000..af2096542d48 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/EventSubscriptionIdentityType.cs @@ -0,0 +1,107 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// + /// 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. + /// + public partial struct EventSubscriptionIdentityType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType SystemAssigned = @"SystemAssigned"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType UserAssigned = @"UserAssigned"; + + /// + /// the value for an instance of the Enum. + /// + private string _value { get; set; } + + /// Conversion from arbitrary object to EventSubscriptionIdentityType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new EventSubscriptionIdentityType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type EventSubscriptionIdentityType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType e) + { + return _value.Equals(e._value); + } + + /// + /// Compares values of enum type EventSubscriptionIdentityType (override for Object) + /// + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is EventSubscriptionIdentityType && Equals((EventSubscriptionIdentityType)obj); + } + + /// + /// Creates an instance of the + /// + /// the value to create an instance for. + private EventSubscriptionIdentityType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns hashCode for enum EventSubscriptionIdentityType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for EventSubscriptionIdentityType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to EventSubscriptionIdentityType + /// the value to convert to an instance of . + + public static implicit operator EventSubscriptionIdentityType(string value) + { + return new EventSubscriptionIdentityType(value); + } + + /// Implicit operator to convert EventSubscriptionIdentityType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType e) + { + return e._value; + } + + /// Overriding != operator for enum EventSubscriptionIdentityType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType e1, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum EventSubscriptionIdentityType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType e1, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/EventSubscriptionProvisioningState.Completer.cs b/swaggerci/eventgrid/generated/api/Support/EventSubscriptionProvisioningState.Completer.cs new file mode 100644 index 000000000000..e1b5d5ec5219 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/EventSubscriptionProvisioningState.Completer.cs @@ -0,0 +1,59 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// Provisioning state of the event subscription. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionProvisioningStateTypeConverter))] + public partial struct EventSubscriptionProvisioningState : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Creating".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Creating'", "Creating", global::System.Management.Automation.CompletionResultType.ParameterValue, "Creating"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Updating".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Updating'", "Updating", global::System.Management.Automation.CompletionResultType.ParameterValue, "Updating"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Deleting".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Deleting'", "Deleting", global::System.Management.Automation.CompletionResultType.ParameterValue, "Deleting"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Succeeded".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Succeeded'", "Succeeded", global::System.Management.Automation.CompletionResultType.ParameterValue, "Succeeded"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Canceled".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Canceled'", "Canceled", global::System.Management.Automation.CompletionResultType.ParameterValue, "Canceled"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Failed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Failed'", "Failed", global::System.Management.Automation.CompletionResultType.ParameterValue, "Failed"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "AwaitingManualAction".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'AwaitingManualAction'", "AwaitingManualAction", global::System.Management.Automation.CompletionResultType.ParameterValue, "AwaitingManualAction"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/EventSubscriptionProvisioningState.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Support/EventSubscriptionProvisioningState.TypeConverter.cs new file mode 100644 index 000000000000..4afde87481f4 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/EventSubscriptionProvisioningState.TypeConverter.cs @@ -0,0 +1,59 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// Provisioning state of the event subscription. + public partial class EventSubscriptionProvisioningStateTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => EventSubscriptionProvisioningState.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/EventSubscriptionProvisioningState.cs b/swaggerci/eventgrid/generated/api/Support/EventSubscriptionProvisioningState.cs new file mode 100644 index 000000000000..1abbb9da8d1a --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/EventSubscriptionProvisioningState.cs @@ -0,0 +1,114 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// Provisioning state of the event subscription. + public partial struct EventSubscriptionProvisioningState : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionProvisioningState AwaitingManualAction = @"AwaitingManualAction"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionProvisioningState Canceled = @"Canceled"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionProvisioningState Creating = @"Creating"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionProvisioningState Deleting = @"Deleting"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionProvisioningState Failed = @"Failed"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionProvisioningState Succeeded = @"Succeeded"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionProvisioningState Updating = @"Updating"; + + /// + /// the value for an instance of the Enum. + /// + private string _value { get; set; } + + /// Conversion from arbitrary object to EventSubscriptionProvisioningState + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new EventSubscriptionProvisioningState(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type EventSubscriptionProvisioningState + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionProvisioningState e) + { + return _value.Equals(e._value); + } + + /// + /// Compares values of enum type EventSubscriptionProvisioningState (override for Object) + /// + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is EventSubscriptionProvisioningState && Equals((EventSubscriptionProvisioningState)obj); + } + + /// + /// Creates an instance of the + /// + /// the value to create an instance for. + private EventSubscriptionProvisioningState(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns hashCode for enum EventSubscriptionProvisioningState + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for EventSubscriptionProvisioningState + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to EventSubscriptionProvisioningState + /// the value to convert to an instance of . + + public static implicit operator EventSubscriptionProvisioningState(string value) + { + return new EventSubscriptionProvisioningState(value); + } + + /// Implicit operator to convert EventSubscriptionProvisioningState to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionProvisioningState e) + { + return e._value; + } + + /// Overriding != operator for enum EventSubscriptionProvisioningState + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionProvisioningState e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum EventSubscriptionProvisioningState + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionProvisioningState e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/IPActionType.Completer.cs b/swaggerci/eventgrid/generated/api/Support/IPActionType.Completer.cs new file mode 100644 index 000000000000..001031916710 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/IPActionType.Completer.cs @@ -0,0 +1,35 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// Action to perform based on the match or no match of the IpMask. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IPActionTypeTypeConverter))] + public partial struct IPActionType : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Allow".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Allow'", "Allow", global::System.Management.Automation.CompletionResultType.ParameterValue, "Allow"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/IPActionType.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Support/IPActionType.TypeConverter.cs new file mode 100644 index 000000000000..35defb92a815 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/IPActionType.TypeConverter.cs @@ -0,0 +1,59 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// Action to perform based on the match or no match of the IpMask. + public partial class IPActionTypeTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => IPActionType.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/IPActionType.cs b/swaggerci/eventgrid/generated/api/Support/IPActionType.cs new file mode 100644 index 000000000000..b7724b5b96c7 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/IPActionType.cs @@ -0,0 +1,96 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// Action to perform based on the match or no match of the IpMask. + public partial struct IPActionType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IPActionType Allow = @"Allow"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to IPActionType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new IPActionType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type IPActionType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IPActionType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type IPActionType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is IPActionType && Equals((IPActionType)obj); + } + + /// Returns hashCode for enum IPActionType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private IPActionType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for IPActionType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to IPActionType + /// the value to convert to an instance of . + + public static implicit operator IPActionType(string value) + { + return new IPActionType(value); + } + + /// Implicit operator to convert IPActionType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IPActionType e) + { + return e._value; + } + + /// Overriding != operator for enum IPActionType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IPActionType e1, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IPActionType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum IPActionType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IPActionType e1, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IPActionType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/IdentityType.Completer.cs b/swaggerci/eventgrid/generated/api/Support/IdentityType.Completer.cs new file mode 100644 index 000000000000..f6dd5546fd86 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/IdentityType.Completer.cs @@ -0,0 +1,50 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// + /// 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. + /// + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityTypeTypeConverter))] + public partial struct IdentityType : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "None".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'None'", "None", global::System.Management.Automation.CompletionResultType.ParameterValue, "None"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "SystemAssigned".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'SystemAssigned'", "SystemAssigned", global::System.Management.Automation.CompletionResultType.ParameterValue, "SystemAssigned"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "UserAssigned".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'UserAssigned'", "UserAssigned", global::System.Management.Automation.CompletionResultType.ParameterValue, "UserAssigned"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "SystemAssigned, UserAssigned".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'SystemAssigned, UserAssigned'", "SystemAssigned, UserAssigned", global::System.Management.Automation.CompletionResultType.ParameterValue, "SystemAssigned, UserAssigned"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/IdentityType.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Support/IdentityType.TypeConverter.cs new file mode 100644 index 000000000000..66833add55ce --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/IdentityType.TypeConverter.cs @@ -0,0 +1,62 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// + /// 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. + /// + public partial class IdentityTypeTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => IdentityType.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/IdentityType.cs b/swaggerci/eventgrid/generated/api/Support/IdentityType.cs new file mode 100644 index 000000000000..387d43eb574d --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/IdentityType.cs @@ -0,0 +1,105 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// + /// 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. + /// + public partial struct IdentityType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType None = @"None"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType SystemAssigned = @"SystemAssigned"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType SystemAssignedUserAssigned = @"SystemAssigned, UserAssigned"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType UserAssigned = @"UserAssigned"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to IdentityType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new IdentityType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type IdentityType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type IdentityType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is IdentityType && Equals((IdentityType)obj); + } + + /// Returns hashCode for enum IdentityType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private IdentityType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for IdentityType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to IdentityType + /// the value to convert to an instance of . + + public static implicit operator IdentityType(string value) + { + return new IdentityType(value); + } + + /// Implicit operator to convert IdentityType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType e) + { + return e._value; + } + + /// Overriding != operator for enum IdentityType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType e1, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum IdentityType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType e1, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/InputSchema.Completer.cs b/swaggerci/eventgrid/generated/api/Support/InputSchema.Completer.cs new file mode 100644 index 000000000000..f1fde5fecb03 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/InputSchema.Completer.cs @@ -0,0 +1,45 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// + /// This determines the format that Event Grid should expect for incoming events published to the Event Grid Domain Resource. + /// + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.InputSchemaTypeConverter))] + public partial struct InputSchema : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "EventGridSchema".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'EventGridSchema'", "EventGridSchema", global::System.Management.Automation.CompletionResultType.ParameterValue, "EventGridSchema"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "CustomEventSchema".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'CustomEventSchema'", "CustomEventSchema", global::System.Management.Automation.CompletionResultType.ParameterValue, "CustomEventSchema"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "CloudEventSchemaV1_0".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'CloudEventSchemaV1_0'", "CloudEventSchemaV1_0", global::System.Management.Automation.CompletionResultType.ParameterValue, "CloudEventSchemaV1_0"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/InputSchema.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Support/InputSchema.TypeConverter.cs new file mode 100644 index 000000000000..f22f07abcb25 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/InputSchema.TypeConverter.cs @@ -0,0 +1,61 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// + /// This determines the format that Event Grid should expect for incoming events published to the Event Grid Domain Resource. + /// + public partial class InputSchemaTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => InputSchema.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/InputSchema.cs b/swaggerci/eventgrid/generated/api/Support/InputSchema.cs new file mode 100644 index 000000000000..2d7ef91ec794 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/InputSchema.cs @@ -0,0 +1,102 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// + /// This determines the format that Event Grid should expect for incoming events published to the Event Grid Domain Resource. + /// + public partial struct InputSchema : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.InputSchema CloudEventSchemaV10 = @"CloudEventSchemaV1_0"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.InputSchema CustomEventSchema = @"CustomEventSchema"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.InputSchema EventGridSchema = @"EventGridSchema"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to InputSchema + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new InputSchema(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type InputSchema + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.InputSchema e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type InputSchema (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is InputSchema && Equals((InputSchema)obj); + } + + /// Returns hashCode for enum InputSchema + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private InputSchema(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for InputSchema + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to InputSchema + /// the value to convert to an instance of . + + public static implicit operator InputSchema(string value) + { + return new InputSchema(value); + } + + /// Implicit operator to convert InputSchema to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.InputSchema e) + { + return e._value; + } + + /// Overriding != operator for enum InputSchema + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.InputSchema e1, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.InputSchema e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum InputSchema + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.InputSchema e1, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.InputSchema e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/ParentType.Completer.cs b/swaggerci/eventgrid/generated/api/Support/ParentType.Completer.cs new file mode 100644 index 000000000000..aa67b93cda42 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/ParentType.Completer.cs @@ -0,0 +1,43 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// Argument completer implementation for ParentType. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ParentTypeTypeConverter))] + public partial struct ParentType : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "topics".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'topics'", "topics", global::System.Management.Automation.CompletionResultType.ParameterValue, "topics"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "domains".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'domains'", "domains", global::System.Management.Automation.CompletionResultType.ParameterValue, "domains"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "partnerNamespaces".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'partnerNamespaces'", "partnerNamespaces", global::System.Management.Automation.CompletionResultType.ParameterValue, "partnerNamespaces"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/ParentType.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Support/ParentType.TypeConverter.cs new file mode 100644 index 000000000000..a5b1532198b6 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/ParentType.TypeConverter.cs @@ -0,0 +1,59 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// TypeConverter implementation for ParentType. + public partial class ParentTypeTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ParentType.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/ParentType.cs b/swaggerci/eventgrid/generated/api/Support/ParentType.cs new file mode 100644 index 000000000000..1e6cde7ff22d --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/ParentType.cs @@ -0,0 +1,99 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + public partial struct ParentType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ParentType Domains = @"domains"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ParentType PartnerNamespaces = @"partnerNamespaces"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ParentType Topics = @"topics"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to ParentType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ParentType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ParentType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ParentType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type ParentType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is ParentType && Equals((ParentType)obj); + } + + /// Returns hashCode for enum ParentType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private ParentType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for ParentType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to ParentType + /// the value to convert to an instance of . + + public static implicit operator ParentType(string value) + { + return new ParentType(value); + } + + /// Implicit operator to convert ParentType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ParentType e) + { + return e._value; + } + + /// Overriding != operator for enum ParentType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ParentType e1, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ParentType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ParentType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ParentType e1, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ParentType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/PartnerConfigurationProvisioningState.Completer.cs b/swaggerci/eventgrid/generated/api/Support/PartnerConfigurationProvisioningState.Completer.cs new file mode 100644 index 000000000000..e478ed25f6af --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/PartnerConfigurationProvisioningState.Completer.cs @@ -0,0 +1,55 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// Provisioning state of the partner configuration. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerConfigurationProvisioningStateTypeConverter))] + public partial struct PartnerConfigurationProvisioningState : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Creating".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Creating'", "Creating", global::System.Management.Automation.CompletionResultType.ParameterValue, "Creating"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Updating".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Updating'", "Updating", global::System.Management.Automation.CompletionResultType.ParameterValue, "Updating"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Deleting".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Deleting'", "Deleting", global::System.Management.Automation.CompletionResultType.ParameterValue, "Deleting"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Succeeded".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Succeeded'", "Succeeded", global::System.Management.Automation.CompletionResultType.ParameterValue, "Succeeded"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Canceled".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Canceled'", "Canceled", global::System.Management.Automation.CompletionResultType.ParameterValue, "Canceled"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Failed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Failed'", "Failed", global::System.Management.Automation.CompletionResultType.ParameterValue, "Failed"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/PartnerConfigurationProvisioningState.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Support/PartnerConfigurationProvisioningState.TypeConverter.cs new file mode 100644 index 000000000000..080f3600a22e --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/PartnerConfigurationProvisioningState.TypeConverter.cs @@ -0,0 +1,59 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// Provisioning state of the partner configuration. + public partial class PartnerConfigurationProvisioningStateTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => PartnerConfigurationProvisioningState.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/PartnerConfigurationProvisioningState.cs b/swaggerci/eventgrid/generated/api/Support/PartnerConfigurationProvisioningState.cs new file mode 100644 index 000000000000..c1ae6bec080f --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/PartnerConfigurationProvisioningState.cs @@ -0,0 +1,112 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// Provisioning state of the partner configuration. + public partial struct PartnerConfigurationProvisioningState : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerConfigurationProvisioningState Canceled = @"Canceled"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerConfigurationProvisioningState Creating = @"Creating"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerConfigurationProvisioningState Deleting = @"Deleting"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerConfigurationProvisioningState Failed = @"Failed"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerConfigurationProvisioningState Succeeded = @"Succeeded"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerConfigurationProvisioningState Updating = @"Updating"; + + /// + /// the value for an instance of the Enum. + /// + private string _value { get; set; } + + /// Conversion from arbitrary object to PartnerConfigurationProvisioningState + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new PartnerConfigurationProvisioningState(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type PartnerConfigurationProvisioningState + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerConfigurationProvisioningState e) + { + return _value.Equals(e._value); + } + + /// + /// Compares values of enum type PartnerConfigurationProvisioningState (override for Object) + /// + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is PartnerConfigurationProvisioningState && Equals((PartnerConfigurationProvisioningState)obj); + } + + /// Returns hashCode for enum PartnerConfigurationProvisioningState + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// + /// Creates an instance of the + /// + /// the value to create an instance for. + private PartnerConfigurationProvisioningState(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for PartnerConfigurationProvisioningState + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to PartnerConfigurationProvisioningState + /// the value to convert to an instance of . + + public static implicit operator PartnerConfigurationProvisioningState(string value) + { + return new PartnerConfigurationProvisioningState(value); + } + + /// Implicit operator to convert PartnerConfigurationProvisioningState to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerConfigurationProvisioningState e) + { + return e._value; + } + + /// Overriding != operator for enum PartnerConfigurationProvisioningState + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerConfigurationProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerConfigurationProvisioningState e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum PartnerConfigurationProvisioningState + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerConfigurationProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerConfigurationProvisioningState e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/PartnerDestinationActivationState.Completer.cs b/swaggerci/eventgrid/generated/api/Support/PartnerDestinationActivationState.Completer.cs new file mode 100644 index 000000000000..d3a9657afa00 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/PartnerDestinationActivationState.Completer.cs @@ -0,0 +1,39 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// Activation state of the partner destination. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerDestinationActivationStateTypeConverter))] + public partial struct PartnerDestinationActivationState : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "NeverActivated".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'NeverActivated'", "NeverActivated", global::System.Management.Automation.CompletionResultType.ParameterValue, "NeverActivated"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Activated".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Activated'", "Activated", global::System.Management.Automation.CompletionResultType.ParameterValue, "Activated"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/PartnerDestinationActivationState.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Support/PartnerDestinationActivationState.TypeConverter.cs new file mode 100644 index 000000000000..ebc8fa7e0df3 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/PartnerDestinationActivationState.TypeConverter.cs @@ -0,0 +1,59 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// Activation state of the partner destination. + public partial class PartnerDestinationActivationStateTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => PartnerDestinationActivationState.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/PartnerDestinationActivationState.cs b/swaggerci/eventgrid/generated/api/Support/PartnerDestinationActivationState.cs new file mode 100644 index 000000000000..d3e87cc12985 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/PartnerDestinationActivationState.cs @@ -0,0 +1,104 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// Activation state of the partner destination. + public partial struct PartnerDestinationActivationState : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerDestinationActivationState Activated = @"Activated"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerDestinationActivationState NeverActivated = @"NeverActivated"; + + /// + /// the value for an instance of the Enum. + /// + private string _value { get; set; } + + /// Conversion from arbitrary object to PartnerDestinationActivationState + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new PartnerDestinationActivationState(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type PartnerDestinationActivationState + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerDestinationActivationState e) + { + return _value.Equals(e._value); + } + + /// + /// Compares values of enum type PartnerDestinationActivationState (override for Object) + /// + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is PartnerDestinationActivationState && Equals((PartnerDestinationActivationState)obj); + } + + /// Returns hashCode for enum PartnerDestinationActivationState + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// + /// Creates an instance of the + /// + /// the value to create an instance for. + private PartnerDestinationActivationState(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for PartnerDestinationActivationState + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to PartnerDestinationActivationState + /// the value to convert to an instance of . + + public static implicit operator PartnerDestinationActivationState(string value) + { + return new PartnerDestinationActivationState(value); + } + + /// Implicit operator to convert PartnerDestinationActivationState to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerDestinationActivationState e) + { + return e._value; + } + + /// Overriding != operator for enum PartnerDestinationActivationState + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerDestinationActivationState e1, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerDestinationActivationState e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum PartnerDestinationActivationState + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerDestinationActivationState e1, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerDestinationActivationState e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/PartnerDestinationProvisioningState.Completer.cs b/swaggerci/eventgrid/generated/api/Support/PartnerDestinationProvisioningState.Completer.cs new file mode 100644 index 000000000000..87259cbbb549 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/PartnerDestinationProvisioningState.Completer.cs @@ -0,0 +1,55 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// Provisioning state of the partner destination. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerDestinationProvisioningStateTypeConverter))] + public partial struct PartnerDestinationProvisioningState : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Creating".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Creating'", "Creating", global::System.Management.Automation.CompletionResultType.ParameterValue, "Creating"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Updating".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Updating'", "Updating", global::System.Management.Automation.CompletionResultType.ParameterValue, "Updating"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Deleting".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Deleting'", "Deleting", global::System.Management.Automation.CompletionResultType.ParameterValue, "Deleting"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Succeeded".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Succeeded'", "Succeeded", global::System.Management.Automation.CompletionResultType.ParameterValue, "Succeeded"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Canceled".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Canceled'", "Canceled", global::System.Management.Automation.CompletionResultType.ParameterValue, "Canceled"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Failed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Failed'", "Failed", global::System.Management.Automation.CompletionResultType.ParameterValue, "Failed"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/PartnerDestinationProvisioningState.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Support/PartnerDestinationProvisioningState.TypeConverter.cs new file mode 100644 index 000000000000..3fd4bb061a1e --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/PartnerDestinationProvisioningState.TypeConverter.cs @@ -0,0 +1,59 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// Provisioning state of the partner destination. + public partial class PartnerDestinationProvisioningStateTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => PartnerDestinationProvisioningState.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/PartnerDestinationProvisioningState.cs b/swaggerci/eventgrid/generated/api/Support/PartnerDestinationProvisioningState.cs new file mode 100644 index 000000000000..ecfdd1c77fbf --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/PartnerDestinationProvisioningState.cs @@ -0,0 +1,112 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// Provisioning state of the partner destination. + public partial struct PartnerDestinationProvisioningState : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerDestinationProvisioningState Canceled = @"Canceled"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerDestinationProvisioningState Creating = @"Creating"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerDestinationProvisioningState Deleting = @"Deleting"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerDestinationProvisioningState Failed = @"Failed"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerDestinationProvisioningState Succeeded = @"Succeeded"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerDestinationProvisioningState Updating = @"Updating"; + + /// + /// the value for an instance of the Enum. + /// + private string _value { get; set; } + + /// Conversion from arbitrary object to PartnerDestinationProvisioningState + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new PartnerDestinationProvisioningState(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type PartnerDestinationProvisioningState + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerDestinationProvisioningState e) + { + return _value.Equals(e._value); + } + + /// + /// Compares values of enum type PartnerDestinationProvisioningState (override for Object) + /// + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is PartnerDestinationProvisioningState && Equals((PartnerDestinationProvisioningState)obj); + } + + /// Returns hashCode for enum PartnerDestinationProvisioningState + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// + /// Creates an instance of the + /// + /// the value to create an instance for. + private PartnerDestinationProvisioningState(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for PartnerDestinationProvisioningState + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to PartnerDestinationProvisioningState + /// the value to convert to an instance of . + + public static implicit operator PartnerDestinationProvisioningState(string value) + { + return new PartnerDestinationProvisioningState(value); + } + + /// Implicit operator to convert PartnerDestinationProvisioningState to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerDestinationProvisioningState e) + { + return e._value; + } + + /// Overriding != operator for enum PartnerDestinationProvisioningState + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerDestinationProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerDestinationProvisioningState e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum PartnerDestinationProvisioningState + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerDestinationProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerDestinationProvisioningState e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/PartnerNamespaceProvisioningState.Completer.cs b/swaggerci/eventgrid/generated/api/Support/PartnerNamespaceProvisioningState.Completer.cs new file mode 100644 index 000000000000..3766c20c0e8e --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/PartnerNamespaceProvisioningState.Completer.cs @@ -0,0 +1,55 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// Provisioning state of the partner namespace. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerNamespaceProvisioningStateTypeConverter))] + public partial struct PartnerNamespaceProvisioningState : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Creating".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Creating'", "Creating", global::System.Management.Automation.CompletionResultType.ParameterValue, "Creating"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Updating".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Updating'", "Updating", global::System.Management.Automation.CompletionResultType.ParameterValue, "Updating"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Deleting".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Deleting'", "Deleting", global::System.Management.Automation.CompletionResultType.ParameterValue, "Deleting"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Succeeded".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Succeeded'", "Succeeded", global::System.Management.Automation.CompletionResultType.ParameterValue, "Succeeded"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Canceled".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Canceled'", "Canceled", global::System.Management.Automation.CompletionResultType.ParameterValue, "Canceled"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Failed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Failed'", "Failed", global::System.Management.Automation.CompletionResultType.ParameterValue, "Failed"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/PartnerNamespaceProvisioningState.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Support/PartnerNamespaceProvisioningState.TypeConverter.cs new file mode 100644 index 000000000000..a633c4963ba9 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/PartnerNamespaceProvisioningState.TypeConverter.cs @@ -0,0 +1,59 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// Provisioning state of the partner namespace. + public partial class PartnerNamespaceProvisioningStateTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => PartnerNamespaceProvisioningState.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/PartnerNamespaceProvisioningState.cs b/swaggerci/eventgrid/generated/api/Support/PartnerNamespaceProvisioningState.cs new file mode 100644 index 000000000000..77de8cdecd1e --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/PartnerNamespaceProvisioningState.cs @@ -0,0 +1,112 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// Provisioning state of the partner namespace. + public partial struct PartnerNamespaceProvisioningState : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerNamespaceProvisioningState Canceled = @"Canceled"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerNamespaceProvisioningState Creating = @"Creating"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerNamespaceProvisioningState Deleting = @"Deleting"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerNamespaceProvisioningState Failed = @"Failed"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerNamespaceProvisioningState Succeeded = @"Succeeded"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerNamespaceProvisioningState Updating = @"Updating"; + + /// + /// the value for an instance of the Enum. + /// + private string _value { get; set; } + + /// Conversion from arbitrary object to PartnerNamespaceProvisioningState + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new PartnerNamespaceProvisioningState(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type PartnerNamespaceProvisioningState + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerNamespaceProvisioningState e) + { + return _value.Equals(e._value); + } + + /// + /// Compares values of enum type PartnerNamespaceProvisioningState (override for Object) + /// + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is PartnerNamespaceProvisioningState && Equals((PartnerNamespaceProvisioningState)obj); + } + + /// Returns hashCode for enum PartnerNamespaceProvisioningState + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// + /// Creates an instance of the + /// + /// the value to create an instance for. + private PartnerNamespaceProvisioningState(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for PartnerNamespaceProvisioningState + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to PartnerNamespaceProvisioningState + /// the value to convert to an instance of . + + public static implicit operator PartnerNamespaceProvisioningState(string value) + { + return new PartnerNamespaceProvisioningState(value); + } + + /// Implicit operator to convert PartnerNamespaceProvisioningState to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerNamespaceProvisioningState e) + { + return e._value; + } + + /// Overriding != operator for enum PartnerNamespaceProvisioningState + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerNamespaceProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerNamespaceProvisioningState e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum PartnerNamespaceProvisioningState + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerNamespaceProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerNamespaceProvisioningState e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/PartnerRegistrationProvisioningState.Completer.cs b/swaggerci/eventgrid/generated/api/Support/PartnerRegistrationProvisioningState.Completer.cs new file mode 100644 index 000000000000..a131a1f98669 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/PartnerRegistrationProvisioningState.Completer.cs @@ -0,0 +1,55 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// Provisioning state of the partner registration. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerRegistrationProvisioningStateTypeConverter))] + public partial struct PartnerRegistrationProvisioningState : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Creating".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Creating'", "Creating", global::System.Management.Automation.CompletionResultType.ParameterValue, "Creating"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Updating".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Updating'", "Updating", global::System.Management.Automation.CompletionResultType.ParameterValue, "Updating"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Deleting".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Deleting'", "Deleting", global::System.Management.Automation.CompletionResultType.ParameterValue, "Deleting"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Succeeded".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Succeeded'", "Succeeded", global::System.Management.Automation.CompletionResultType.ParameterValue, "Succeeded"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Canceled".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Canceled'", "Canceled", global::System.Management.Automation.CompletionResultType.ParameterValue, "Canceled"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Failed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Failed'", "Failed", global::System.Management.Automation.CompletionResultType.ParameterValue, "Failed"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/PartnerRegistrationProvisioningState.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Support/PartnerRegistrationProvisioningState.TypeConverter.cs new file mode 100644 index 000000000000..d55aae19c928 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/PartnerRegistrationProvisioningState.TypeConverter.cs @@ -0,0 +1,59 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// Provisioning state of the partner registration. + public partial class PartnerRegistrationProvisioningStateTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => PartnerRegistrationProvisioningState.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/PartnerRegistrationProvisioningState.cs b/swaggerci/eventgrid/generated/api/Support/PartnerRegistrationProvisioningState.cs new file mode 100644 index 000000000000..ac9e01163458 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/PartnerRegistrationProvisioningState.cs @@ -0,0 +1,112 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// Provisioning state of the partner registration. + public partial struct PartnerRegistrationProvisioningState : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerRegistrationProvisioningState Canceled = @"Canceled"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerRegistrationProvisioningState Creating = @"Creating"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerRegistrationProvisioningState Deleting = @"Deleting"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerRegistrationProvisioningState Failed = @"Failed"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerRegistrationProvisioningState Succeeded = @"Succeeded"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerRegistrationProvisioningState Updating = @"Updating"; + + /// + /// the value for an instance of the Enum. + /// + private string _value { get; set; } + + /// Conversion from arbitrary object to PartnerRegistrationProvisioningState + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new PartnerRegistrationProvisioningState(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type PartnerRegistrationProvisioningState + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerRegistrationProvisioningState e) + { + return _value.Equals(e._value); + } + + /// + /// Compares values of enum type PartnerRegistrationProvisioningState (override for Object) + /// + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is PartnerRegistrationProvisioningState && Equals((PartnerRegistrationProvisioningState)obj); + } + + /// Returns hashCode for enum PartnerRegistrationProvisioningState + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// + /// Creates an instance of the + /// + /// the value to create an instance for. + private PartnerRegistrationProvisioningState(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for PartnerRegistrationProvisioningState + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to PartnerRegistrationProvisioningState + /// the value to convert to an instance of . + + public static implicit operator PartnerRegistrationProvisioningState(string value) + { + return new PartnerRegistrationProvisioningState(value); + } + + /// Implicit operator to convert PartnerRegistrationProvisioningState to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerRegistrationProvisioningState e) + { + return e._value; + } + + /// Overriding != operator for enum PartnerRegistrationProvisioningState + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerRegistrationProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerRegistrationProvisioningState e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum PartnerRegistrationProvisioningState + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerRegistrationProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerRegistrationProvisioningState e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/PartnerRegistrationVisibilityState.Completer.cs b/swaggerci/eventgrid/generated/api/Support/PartnerRegistrationVisibilityState.Completer.cs new file mode 100644 index 000000000000..b0ae78f4fb19 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/PartnerRegistrationVisibilityState.Completer.cs @@ -0,0 +1,43 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// Visibility state of the partner registration. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerRegistrationVisibilityStateTypeConverter))] + public partial struct PartnerRegistrationVisibilityState : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Hidden".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Hidden'", "Hidden", global::System.Management.Automation.CompletionResultType.ParameterValue, "Hidden"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "PublicPreview".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'PublicPreview'", "PublicPreview", global::System.Management.Automation.CompletionResultType.ParameterValue, "PublicPreview"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "GenerallyAvailable".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'GenerallyAvailable'", "GenerallyAvailable", global::System.Management.Automation.CompletionResultType.ParameterValue, "GenerallyAvailable"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/PartnerRegistrationVisibilityState.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Support/PartnerRegistrationVisibilityState.TypeConverter.cs new file mode 100644 index 000000000000..a9789076a0e6 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/PartnerRegistrationVisibilityState.TypeConverter.cs @@ -0,0 +1,59 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// Visibility state of the partner registration. + public partial class PartnerRegistrationVisibilityStateTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => PartnerRegistrationVisibilityState.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/PartnerRegistrationVisibilityState.cs b/swaggerci/eventgrid/generated/api/Support/PartnerRegistrationVisibilityState.cs new file mode 100644 index 000000000000..05ac85ea950d --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/PartnerRegistrationVisibilityState.cs @@ -0,0 +1,106 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// Visibility state of the partner registration. + public partial struct PartnerRegistrationVisibilityState : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerRegistrationVisibilityState GenerallyAvailable = @"GenerallyAvailable"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerRegistrationVisibilityState Hidden = @"Hidden"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerRegistrationVisibilityState PublicPreview = @"PublicPreview"; + + /// + /// the value for an instance of the Enum. + /// + private string _value { get; set; } + + /// Conversion from arbitrary object to PartnerRegistrationVisibilityState + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new PartnerRegistrationVisibilityState(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type PartnerRegistrationVisibilityState + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerRegistrationVisibilityState e) + { + return _value.Equals(e._value); + } + + /// + /// Compares values of enum type PartnerRegistrationVisibilityState (override for Object) + /// + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is PartnerRegistrationVisibilityState && Equals((PartnerRegistrationVisibilityState)obj); + } + + /// Returns hashCode for enum PartnerRegistrationVisibilityState + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// + /// Creates an instance of the + /// + /// the value to create an instance for. + private PartnerRegistrationVisibilityState(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for PartnerRegistrationVisibilityState + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to PartnerRegistrationVisibilityState + /// the value to convert to an instance of . + + public static implicit operator PartnerRegistrationVisibilityState(string value) + { + return new PartnerRegistrationVisibilityState(value); + } + + /// Implicit operator to convert PartnerRegistrationVisibilityState to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerRegistrationVisibilityState e) + { + return e._value; + } + + /// Overriding != operator for enum PartnerRegistrationVisibilityState + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerRegistrationVisibilityState e1, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerRegistrationVisibilityState e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum PartnerRegistrationVisibilityState + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerRegistrationVisibilityState e1, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerRegistrationVisibilityState e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/PartnerTopicActivationState.Completer.cs b/swaggerci/eventgrid/generated/api/Support/PartnerTopicActivationState.Completer.cs new file mode 100644 index 000000000000..489041d74cfc --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/PartnerTopicActivationState.Completer.cs @@ -0,0 +1,43 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// Activation state of the partner topic. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicActivationStateTypeConverter))] + public partial struct PartnerTopicActivationState : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "NeverActivated".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'NeverActivated'", "NeverActivated", global::System.Management.Automation.CompletionResultType.ParameterValue, "NeverActivated"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Activated".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Activated'", "Activated", global::System.Management.Automation.CompletionResultType.ParameterValue, "Activated"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Deactivated".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Deactivated'", "Deactivated", global::System.Management.Automation.CompletionResultType.ParameterValue, "Deactivated"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/PartnerTopicActivationState.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Support/PartnerTopicActivationState.TypeConverter.cs new file mode 100644 index 000000000000..7c044b8685d0 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/PartnerTopicActivationState.TypeConverter.cs @@ -0,0 +1,59 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// Activation state of the partner topic. + public partial class PartnerTopicActivationStateTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => PartnerTopicActivationState.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/PartnerTopicActivationState.cs b/swaggerci/eventgrid/generated/api/Support/PartnerTopicActivationState.cs new file mode 100644 index 000000000000..b525e0f3ae51 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/PartnerTopicActivationState.cs @@ -0,0 +1,104 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// Activation state of the partner topic. + public partial struct PartnerTopicActivationState : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicActivationState Activated = @"Activated"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicActivationState Deactivated = @"Deactivated"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicActivationState NeverActivated = @"NeverActivated"; + + /// + /// the value for an instance of the Enum. + /// + private string _value { get; set; } + + /// Conversion from arbitrary object to PartnerTopicActivationState + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new PartnerTopicActivationState(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type PartnerTopicActivationState + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicActivationState e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type PartnerTopicActivationState (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is PartnerTopicActivationState && Equals((PartnerTopicActivationState)obj); + } + + /// Returns hashCode for enum PartnerTopicActivationState + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// + /// Creates an instance of the + /// + /// the value to create an instance for. + private PartnerTopicActivationState(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for PartnerTopicActivationState + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to PartnerTopicActivationState + /// the value to convert to an instance of . + + public static implicit operator PartnerTopicActivationState(string value) + { + return new PartnerTopicActivationState(value); + } + + /// Implicit operator to convert PartnerTopicActivationState to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicActivationState e) + { + return e._value; + } + + /// Overriding != operator for enum PartnerTopicActivationState + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicActivationState e1, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicActivationState e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum PartnerTopicActivationState + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicActivationState e1, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicActivationState e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/PartnerTopicProvisioningState.Completer.cs b/swaggerci/eventgrid/generated/api/Support/PartnerTopicProvisioningState.Completer.cs new file mode 100644 index 000000000000..60c28a14e30d --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/PartnerTopicProvisioningState.Completer.cs @@ -0,0 +1,55 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// Provisioning state of the partner topic. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicProvisioningStateTypeConverter))] + public partial struct PartnerTopicProvisioningState : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Creating".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Creating'", "Creating", global::System.Management.Automation.CompletionResultType.ParameterValue, "Creating"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Updating".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Updating'", "Updating", global::System.Management.Automation.CompletionResultType.ParameterValue, "Updating"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Deleting".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Deleting'", "Deleting", global::System.Management.Automation.CompletionResultType.ParameterValue, "Deleting"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Succeeded".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Succeeded'", "Succeeded", global::System.Management.Automation.CompletionResultType.ParameterValue, "Succeeded"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Canceled".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Canceled'", "Canceled", global::System.Management.Automation.CompletionResultType.ParameterValue, "Canceled"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Failed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Failed'", "Failed", global::System.Management.Automation.CompletionResultType.ParameterValue, "Failed"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/PartnerTopicProvisioningState.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Support/PartnerTopicProvisioningState.TypeConverter.cs new file mode 100644 index 000000000000..11323dcad7d1 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/PartnerTopicProvisioningState.TypeConverter.cs @@ -0,0 +1,59 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// Provisioning state of the partner topic. + public partial class PartnerTopicProvisioningStateTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => PartnerTopicProvisioningState.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/PartnerTopicProvisioningState.cs b/swaggerci/eventgrid/generated/api/Support/PartnerTopicProvisioningState.cs new file mode 100644 index 000000000000..6f3e947d954c --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/PartnerTopicProvisioningState.cs @@ -0,0 +1,112 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// Provisioning state of the partner topic. + public partial struct PartnerTopicProvisioningState : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicProvisioningState Canceled = @"Canceled"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicProvisioningState Creating = @"Creating"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicProvisioningState Deleting = @"Deleting"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicProvisioningState Failed = @"Failed"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicProvisioningState Succeeded = @"Succeeded"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicProvisioningState Updating = @"Updating"; + + /// + /// the value for an instance of the Enum. + /// + private string _value { get; set; } + + /// Conversion from arbitrary object to PartnerTopicProvisioningState + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new PartnerTopicProvisioningState(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type PartnerTopicProvisioningState + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicProvisioningState e) + { + return _value.Equals(e._value); + } + + /// + /// Compares values of enum type PartnerTopicProvisioningState (override for Object) + /// + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is PartnerTopicProvisioningState && Equals((PartnerTopicProvisioningState)obj); + } + + /// Returns hashCode for enum PartnerTopicProvisioningState + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// + /// Creates an instance of the + /// + /// the value to create an instance for. + private PartnerTopicProvisioningState(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for PartnerTopicProvisioningState + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to PartnerTopicProvisioningState + /// the value to convert to an instance of . + + public static implicit operator PartnerTopicProvisioningState(string value) + { + return new PartnerTopicProvisioningState(value); + } + + /// Implicit operator to convert PartnerTopicProvisioningState to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicProvisioningState e) + { + return e._value; + } + + /// Overriding != operator for enum PartnerTopicProvisioningState + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicProvisioningState e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum PartnerTopicProvisioningState + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicProvisioningState e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/PartnerTopicReadinessState.Completer.cs b/swaggerci/eventgrid/generated/api/Support/PartnerTopicReadinessState.Completer.cs new file mode 100644 index 000000000000..34f108eb4598 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/PartnerTopicReadinessState.Completer.cs @@ -0,0 +1,47 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// The readiness state of the corresponding partner topic. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicReadinessStateTypeConverter))] + public partial struct PartnerTopicReadinessState : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "NotActivatedByUserYet".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'NotActivatedByUserYet'", "NotActivatedByUserYet", global::System.Management.Automation.CompletionResultType.ParameterValue, "NotActivatedByUserYet"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "ActivatedByUser".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'ActivatedByUser'", "ActivatedByUser", global::System.Management.Automation.CompletionResultType.ParameterValue, "ActivatedByUser"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "DeactivatedByUser".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'DeactivatedByUser'", "DeactivatedByUser", global::System.Management.Automation.CompletionResultType.ParameterValue, "DeactivatedByUser"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "DeletedByUser".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'DeletedByUser'", "DeletedByUser", global::System.Management.Automation.CompletionResultType.ParameterValue, "DeletedByUser"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/PartnerTopicReadinessState.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Support/PartnerTopicReadinessState.TypeConverter.cs new file mode 100644 index 000000000000..9eb604174879 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/PartnerTopicReadinessState.TypeConverter.cs @@ -0,0 +1,59 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// The readiness state of the corresponding partner topic. + public partial class PartnerTopicReadinessStateTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => PartnerTopicReadinessState.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/PartnerTopicReadinessState.cs b/swaggerci/eventgrid/generated/api/Support/PartnerTopicReadinessState.cs new file mode 100644 index 000000000000..91c5eb41e209 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/PartnerTopicReadinessState.cs @@ -0,0 +1,104 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// The readiness state of the corresponding partner topic. + public partial struct PartnerTopicReadinessState : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicReadinessState ActivatedByUser = @"ActivatedByUser"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicReadinessState DeactivatedByUser = @"DeactivatedByUser"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicReadinessState DeletedByUser = @"DeletedByUser"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicReadinessState NotActivatedByUserYet = @"NotActivatedByUserYet"; + + /// + /// the value for an instance of the Enum. + /// + private string _value { get; set; } + + /// Conversion from arbitrary object to PartnerTopicReadinessState + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new PartnerTopicReadinessState(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type PartnerTopicReadinessState + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicReadinessState e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type PartnerTopicReadinessState (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is PartnerTopicReadinessState && Equals((PartnerTopicReadinessState)obj); + } + + /// Returns hashCode for enum PartnerTopicReadinessState + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private PartnerTopicReadinessState(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for PartnerTopicReadinessState + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to PartnerTopicReadinessState + /// the value to convert to an instance of . + + public static implicit operator PartnerTopicReadinessState(string value) + { + return new PartnerTopicReadinessState(value); + } + + /// Implicit operator to convert PartnerTopicReadinessState to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicReadinessState e) + { + return e._value; + } + + /// Overriding != operator for enum PartnerTopicReadinessState + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicReadinessState e1, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicReadinessState e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum PartnerTopicReadinessState + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicReadinessState e1, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicReadinessState e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/PartnerTopicRoutingMode.Completer.cs b/swaggerci/eventgrid/generated/api/Support/PartnerTopicRoutingMode.Completer.cs new file mode 100644 index 000000000000..399011d51479 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/PartnerTopicRoutingMode.Completer.cs @@ -0,0 +1,43 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// + /// This determines if events published to this partner namespace should use the source attribute in the event payload + /// or use the channel name in the header when matching to the partner topic. If none is specified, source attribute routing + /// will be used to match the partner topic. + /// + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicRoutingModeTypeConverter))] + public partial struct PartnerTopicRoutingMode : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "SourceEventAttribute".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'SourceEventAttribute'", "SourceEventAttribute", global::System.Management.Automation.CompletionResultType.ParameterValue, "SourceEventAttribute"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "ChannelNameHeader".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'ChannelNameHeader'", "ChannelNameHeader", global::System.Management.Automation.CompletionResultType.ParameterValue, "ChannelNameHeader"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/PartnerTopicRoutingMode.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Support/PartnerTopicRoutingMode.TypeConverter.cs new file mode 100644 index 000000000000..780b1f1f639b --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/PartnerTopicRoutingMode.TypeConverter.cs @@ -0,0 +1,63 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// + /// This determines if events published to this partner namespace should use the source attribute in the event payload + /// or use the channel name in the header when matching to the partner topic. If none is specified, source attribute routing + /// will be used to match the partner topic. + /// + public partial class PartnerTopicRoutingModeTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => PartnerTopicRoutingMode.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/PartnerTopicRoutingMode.cs b/swaggerci/eventgrid/generated/api/Support/PartnerTopicRoutingMode.cs new file mode 100644 index 000000000000..5c6dade6254a --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/PartnerTopicRoutingMode.cs @@ -0,0 +1,102 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// + /// This determines if events published to this partner namespace should use the source attribute in the event payload + /// or use the channel name in the header when matching to the partner topic. If none is specified, source attribute routing + /// will be used to match the partner topic. + /// + public partial struct PartnerTopicRoutingMode : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicRoutingMode ChannelNameHeader = @"ChannelNameHeader"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicRoutingMode SourceEventAttribute = @"SourceEventAttribute"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to PartnerTopicRoutingMode + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new PartnerTopicRoutingMode(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type PartnerTopicRoutingMode + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicRoutingMode e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type PartnerTopicRoutingMode (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is PartnerTopicRoutingMode && Equals((PartnerTopicRoutingMode)obj); + } + + /// Returns hashCode for enum PartnerTopicRoutingMode + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private PartnerTopicRoutingMode(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for PartnerTopicRoutingMode + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to PartnerTopicRoutingMode + /// the value to convert to an instance of . + + public static implicit operator PartnerTopicRoutingMode(string value) + { + return new PartnerTopicRoutingMode(value); + } + + /// Implicit operator to convert PartnerTopicRoutingMode to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicRoutingMode e) + { + return e._value; + } + + /// Overriding != operator for enum PartnerTopicRoutingMode + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicRoutingMode e1, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicRoutingMode e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum PartnerTopicRoutingMode + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicRoutingMode e1, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicRoutingMode e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/PersistedConnectionStatus.Completer.cs b/swaggerci/eventgrid/generated/api/Support/PersistedConnectionStatus.Completer.cs new file mode 100644 index 000000000000..37b5b87426e2 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/PersistedConnectionStatus.Completer.cs @@ -0,0 +1,47 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// Status of the connection. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PersistedConnectionStatusTypeConverter))] + public partial struct PersistedConnectionStatus : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Pending".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Pending'", "Pending", global::System.Management.Automation.CompletionResultType.ParameterValue, "Pending"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Approved".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Approved'", "Approved", global::System.Management.Automation.CompletionResultType.ParameterValue, "Approved"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Rejected".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Rejected'", "Rejected", global::System.Management.Automation.CompletionResultType.ParameterValue, "Rejected"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Disconnected".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Disconnected'", "Disconnected", global::System.Management.Automation.CompletionResultType.ParameterValue, "Disconnected"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/PersistedConnectionStatus.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Support/PersistedConnectionStatus.TypeConverter.cs new file mode 100644 index 000000000000..4f1997172bd4 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/PersistedConnectionStatus.TypeConverter.cs @@ -0,0 +1,59 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// Status of the connection. + public partial class PersistedConnectionStatusTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => PersistedConnectionStatus.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/PersistedConnectionStatus.cs b/swaggerci/eventgrid/generated/api/Support/PersistedConnectionStatus.cs new file mode 100644 index 000000000000..239bc6b9e150 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/PersistedConnectionStatus.cs @@ -0,0 +1,102 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// Status of the connection. + public partial struct PersistedConnectionStatus : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PersistedConnectionStatus Approved = @"Approved"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PersistedConnectionStatus Disconnected = @"Disconnected"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PersistedConnectionStatus Pending = @"Pending"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PersistedConnectionStatus Rejected = @"Rejected"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to PersistedConnectionStatus + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new PersistedConnectionStatus(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type PersistedConnectionStatus + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PersistedConnectionStatus e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type PersistedConnectionStatus (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is PersistedConnectionStatus && Equals((PersistedConnectionStatus)obj); + } + + /// Returns hashCode for enum PersistedConnectionStatus + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private PersistedConnectionStatus(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for PersistedConnectionStatus + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to PersistedConnectionStatus + /// the value to convert to an instance of . + + public static implicit operator PersistedConnectionStatus(string value) + { + return new PersistedConnectionStatus(value); + } + + /// Implicit operator to convert PersistedConnectionStatus to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PersistedConnectionStatus e) + { + return e._value; + } + + /// Overriding != operator for enum PersistedConnectionStatus + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PersistedConnectionStatus e1, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PersistedConnectionStatus e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum PersistedConnectionStatus + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PersistedConnectionStatus e1, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PersistedConnectionStatus e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/PublicNetworkAccess.Completer.cs b/swaggerci/eventgrid/generated/api/Support/PublicNetworkAccess.Completer.cs new file mode 100644 index 000000000000..00279bb41414 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/PublicNetworkAccess.Completer.cs @@ -0,0 +1,43 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// + /// This determines if traffic is allowed over public network. By default it is enabled. + /// You can further restrict to specific IPs by configuring + /// + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccessTypeConverter))] + public partial struct PublicNetworkAccess : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Enabled".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Enabled'", "Enabled", global::System.Management.Automation.CompletionResultType.ParameterValue, "Enabled"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Disabled".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Disabled'", "Disabled", global::System.Management.Automation.CompletionResultType.ParameterValue, "Disabled"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/PublicNetworkAccess.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Support/PublicNetworkAccess.TypeConverter.cs new file mode 100644 index 000000000000..6c0d25c82391 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/PublicNetworkAccess.TypeConverter.cs @@ -0,0 +1,63 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// + /// This determines if traffic is allowed over public network. By default it is enabled. + /// You can further restrict to specific IPs by configuring + /// + public partial class PublicNetworkAccessTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => PublicNetworkAccess.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/PublicNetworkAccess.cs b/swaggerci/eventgrid/generated/api/Support/PublicNetworkAccess.cs new file mode 100644 index 000000000000..c05b9bc26ed0 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/PublicNetworkAccess.cs @@ -0,0 +1,102 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// + /// This determines if traffic is allowed over public network. By default it is enabled. + /// You can further restrict to specific IPs by configuring + /// + public partial struct PublicNetworkAccess : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess Disabled = @"Disabled"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess Enabled = @"Enabled"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to PublicNetworkAccess + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new PublicNetworkAccess(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type PublicNetworkAccess + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type PublicNetworkAccess (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is PublicNetworkAccess && Equals((PublicNetworkAccess)obj); + } + + /// Returns hashCode for enum PublicNetworkAccess + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private PublicNetworkAccess(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for PublicNetworkAccess + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to PublicNetworkAccess + /// the value to convert to an instance of . + + public static implicit operator PublicNetworkAccess(string value) + { + return new PublicNetworkAccess(value); + } + + /// Implicit operator to convert PublicNetworkAccess to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess e) + { + return e._value; + } + + /// Overriding != operator for enum PublicNetworkAccess + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess e1, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum PublicNetworkAccess + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess e1, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/ReadinessState.Completer.cs b/swaggerci/eventgrid/generated/api/Support/ReadinessState.Completer.cs new file mode 100644 index 000000000000..99bafa071983 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/ReadinessState.Completer.cs @@ -0,0 +1,39 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// The readiness state of the corresponding partner topic. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ReadinessStateTypeConverter))] + public partial struct ReadinessState : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "NeverActivated".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'NeverActivated'", "NeverActivated", global::System.Management.Automation.CompletionResultType.ParameterValue, "NeverActivated"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Activated".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Activated'", "Activated", global::System.Management.Automation.CompletionResultType.ParameterValue, "Activated"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/ReadinessState.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Support/ReadinessState.TypeConverter.cs new file mode 100644 index 000000000000..fb1be0e93e26 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/ReadinessState.TypeConverter.cs @@ -0,0 +1,59 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// The readiness state of the corresponding partner topic. + public partial class ReadinessStateTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ReadinessState.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/ReadinessState.cs b/swaggerci/eventgrid/generated/api/Support/ReadinessState.cs new file mode 100644 index 000000000000..296cd6ecd897 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/ReadinessState.cs @@ -0,0 +1,98 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// The readiness state of the corresponding partner topic. + public partial struct ReadinessState : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ReadinessState Activated = @"Activated"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ReadinessState NeverActivated = @"NeverActivated"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to ReadinessState + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ReadinessState(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ReadinessState + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ReadinessState e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type ReadinessState (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is ReadinessState && Equals((ReadinessState)obj); + } + + /// Returns hashCode for enum ReadinessState + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private ReadinessState(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for ReadinessState + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to ReadinessState + /// the value to convert to an instance of . + + public static implicit operator ReadinessState(string value) + { + return new ReadinessState(value); + } + + /// Implicit operator to convert ReadinessState to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ReadinessState e) + { + return e._value; + } + + /// Overriding != operator for enum ReadinessState + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ReadinessState e1, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ReadinessState e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ReadinessState + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ReadinessState e1, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ReadinessState e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/ResourceKind.Completer.cs b/swaggerci/eventgrid/generated/api/Support/ResourceKind.Completer.cs new file mode 100644 index 000000000000..c4f1984b4a28 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/ResourceKind.Completer.cs @@ -0,0 +1,39 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// Kind of the resource. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceKindTypeConverter))] + public partial struct ResourceKind : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Azure".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Azure'", "Azure", global::System.Management.Automation.CompletionResultType.ParameterValue, "Azure"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "AzureArc".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'AzureArc'", "AzureArc", global::System.Management.Automation.CompletionResultType.ParameterValue, "AzureArc"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/ResourceKind.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Support/ResourceKind.TypeConverter.cs new file mode 100644 index 000000000000..940bd3e29e59 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/ResourceKind.TypeConverter.cs @@ -0,0 +1,59 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// Kind of the resource. + public partial class ResourceKindTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ResourceKind.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/ResourceKind.cs b/swaggerci/eventgrid/generated/api/Support/ResourceKind.cs new file mode 100644 index 000000000000..5fc6cd4ca20a --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/ResourceKind.cs @@ -0,0 +1,98 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// Kind of the resource. + public partial struct ResourceKind : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceKind Azure = @"Azure"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceKind AzureArc = @"AzureArc"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to ResourceKind + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ResourceKind(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ResourceKind + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceKind e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type ResourceKind (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is ResourceKind && Equals((ResourceKind)obj); + } + + /// Returns hashCode for enum ResourceKind + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private ResourceKind(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for ResourceKind + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to ResourceKind + /// the value to convert to an instance of . + + public static implicit operator ResourceKind(string value) + { + return new ResourceKind(value); + } + + /// Implicit operator to convert ResourceKind to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceKind e) + { + return e._value; + } + + /// Overriding != operator for enum ResourceKind + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceKind e1, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceKind e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ResourceKind + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceKind e1, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceKind e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/ResourceProvisioningState.Completer.cs b/swaggerci/eventgrid/generated/api/Support/ResourceProvisioningState.Completer.cs new file mode 100644 index 000000000000..2972e1a34adf --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/ResourceProvisioningState.Completer.cs @@ -0,0 +1,55 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// Provisioning state of the Private Endpoint Connection. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceProvisioningStateTypeConverter))] + public partial struct ResourceProvisioningState : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Creating".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Creating'", "Creating", global::System.Management.Automation.CompletionResultType.ParameterValue, "Creating"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Updating".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Updating'", "Updating", global::System.Management.Automation.CompletionResultType.ParameterValue, "Updating"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Deleting".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Deleting'", "Deleting", global::System.Management.Automation.CompletionResultType.ParameterValue, "Deleting"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Succeeded".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Succeeded'", "Succeeded", global::System.Management.Automation.CompletionResultType.ParameterValue, "Succeeded"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Canceled".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Canceled'", "Canceled", global::System.Management.Automation.CompletionResultType.ParameterValue, "Canceled"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Failed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Failed'", "Failed", global::System.Management.Automation.CompletionResultType.ParameterValue, "Failed"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/ResourceProvisioningState.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Support/ResourceProvisioningState.TypeConverter.cs new file mode 100644 index 000000000000..cb90edc910c0 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/ResourceProvisioningState.TypeConverter.cs @@ -0,0 +1,59 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// Provisioning state of the Private Endpoint Connection. + public partial class ResourceProvisioningStateTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ResourceProvisioningState.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/ResourceProvisioningState.cs b/swaggerci/eventgrid/generated/api/Support/ResourceProvisioningState.cs new file mode 100644 index 000000000000..e1e0da8c2727 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/ResourceProvisioningState.cs @@ -0,0 +1,106 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// Provisioning state of the Private Endpoint Connection. + public partial struct ResourceProvisioningState : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceProvisioningState Canceled = @"Canceled"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceProvisioningState Creating = @"Creating"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceProvisioningState Deleting = @"Deleting"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceProvisioningState Failed = @"Failed"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceProvisioningState Succeeded = @"Succeeded"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceProvisioningState Updating = @"Updating"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to ResourceProvisioningState + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ResourceProvisioningState(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ResourceProvisioningState + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceProvisioningState e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type ResourceProvisioningState (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is ResourceProvisioningState && Equals((ResourceProvisioningState)obj); + } + + /// Returns hashCode for enum ResourceProvisioningState + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private ResourceProvisioningState(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for ResourceProvisioningState + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to ResourceProvisioningState + /// the value to convert to an instance of . + + public static implicit operator ResourceProvisioningState(string value) + { + return new ResourceProvisioningState(value); + } + + /// Implicit operator to convert ResourceProvisioningState to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceProvisioningState e) + { + return e._value; + } + + /// Overriding != operator for enum ResourceProvisioningState + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceProvisioningState e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ResourceProvisioningState + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceProvisioningState e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/ResourceRegionType.Completer.cs b/swaggerci/eventgrid/generated/api/Support/ResourceRegionType.Completer.cs new file mode 100644 index 000000000000..36470640c59c --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/ResourceRegionType.Completer.cs @@ -0,0 +1,39 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// Region type of the resource. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceRegionTypeTypeConverter))] + public partial struct ResourceRegionType : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "RegionalResource".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'RegionalResource'", "RegionalResource", global::System.Management.Automation.CompletionResultType.ParameterValue, "RegionalResource"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "GlobalResource".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'GlobalResource'", "GlobalResource", global::System.Management.Automation.CompletionResultType.ParameterValue, "GlobalResource"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/ResourceRegionType.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Support/ResourceRegionType.TypeConverter.cs new file mode 100644 index 000000000000..5fc805511e9b --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/ResourceRegionType.TypeConverter.cs @@ -0,0 +1,59 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// Region type of the resource. + public partial class ResourceRegionTypeTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ResourceRegionType.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/ResourceRegionType.cs b/swaggerci/eventgrid/generated/api/Support/ResourceRegionType.cs new file mode 100644 index 000000000000..93cd87173ccc --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/ResourceRegionType.cs @@ -0,0 +1,98 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// Region type of the resource. + public partial struct ResourceRegionType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceRegionType GlobalResource = @"GlobalResource"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceRegionType RegionalResource = @"RegionalResource"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to ResourceRegionType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ResourceRegionType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ResourceRegionType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceRegionType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type ResourceRegionType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is ResourceRegionType && Equals((ResourceRegionType)obj); + } + + /// Returns hashCode for enum ResourceRegionType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private ResourceRegionType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for ResourceRegionType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to ResourceRegionType + /// the value to convert to an instance of . + + public static implicit operator ResourceRegionType(string value) + { + return new ResourceRegionType(value); + } + + /// Implicit operator to convert ResourceRegionType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceRegionType e) + { + return e._value; + } + + /// Overriding != operator for enum ResourceRegionType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceRegionType e1, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceRegionType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ResourceRegionType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceRegionType e1, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceRegionType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/Sku.Completer.cs b/swaggerci/eventgrid/generated/api/Support/Sku.Completer.cs new file mode 100644 index 000000000000..dcf969acc806 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/Sku.Completer.cs @@ -0,0 +1,39 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// The Sku name of the resource. The possible values are: Basic or Premium. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.SkuTypeConverter))] + public partial struct Sku : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Basic".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Basic'", "Basic", global::System.Management.Automation.CompletionResultType.ParameterValue, "Basic"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Premium".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Premium'", "Premium", global::System.Management.Automation.CompletionResultType.ParameterValue, "Premium"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/Sku.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Support/Sku.TypeConverter.cs new file mode 100644 index 000000000000..f171574c7d8b --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/Sku.TypeConverter.cs @@ -0,0 +1,59 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// The Sku name of the resource. The possible values are: Basic or Premium. + public partial class SkuTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => Sku.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/Sku.cs b/swaggerci/eventgrid/generated/api/Support/Sku.cs new file mode 100644 index 000000000000..f5815ea8ee2b --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/Sku.cs @@ -0,0 +1,98 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// The Sku name of the resource. The possible values are: Basic or Premium. + public partial struct Sku : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku Basic = @"Basic"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku Premium = @"Premium"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to Sku + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new Sku(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type Sku + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type Sku (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is Sku && Equals((Sku)obj); + } + + /// Returns hashCode for enum Sku + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private Sku(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for Sku + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to Sku + /// the value to convert to an instance of . + + public static implicit operator Sku(string value) + { + return new Sku(value); + } + + /// Implicit operator to convert Sku to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku e) + { + return e._value; + } + + /// Overriding != operator for enum Sku + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku e1, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum Sku + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku e1, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/TopicProvisioningState.Completer.cs b/swaggerci/eventgrid/generated/api/Support/TopicProvisioningState.Completer.cs new file mode 100644 index 000000000000..829441ef2dc0 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/TopicProvisioningState.Completer.cs @@ -0,0 +1,55 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// Provisioning state of the topic. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.TopicProvisioningStateTypeConverter))] + public partial struct TopicProvisioningState : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Creating".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Creating'", "Creating", global::System.Management.Automation.CompletionResultType.ParameterValue, "Creating"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Updating".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Updating'", "Updating", global::System.Management.Automation.CompletionResultType.ParameterValue, "Updating"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Deleting".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Deleting'", "Deleting", global::System.Management.Automation.CompletionResultType.ParameterValue, "Deleting"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Succeeded".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Succeeded'", "Succeeded", global::System.Management.Automation.CompletionResultType.ParameterValue, "Succeeded"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Canceled".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Canceled'", "Canceled", global::System.Management.Automation.CompletionResultType.ParameterValue, "Canceled"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Failed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Failed'", "Failed", global::System.Management.Automation.CompletionResultType.ParameterValue, "Failed"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/TopicProvisioningState.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Support/TopicProvisioningState.TypeConverter.cs new file mode 100644 index 000000000000..dc583c472858 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/TopicProvisioningState.TypeConverter.cs @@ -0,0 +1,59 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// Provisioning state of the topic. + public partial class TopicProvisioningStateTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => TopicProvisioningState.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/TopicProvisioningState.cs b/swaggerci/eventgrid/generated/api/Support/TopicProvisioningState.cs new file mode 100644 index 000000000000..0fb9b0fc0af0 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/TopicProvisioningState.cs @@ -0,0 +1,106 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// Provisioning state of the topic. + public partial struct TopicProvisioningState : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.TopicProvisioningState Canceled = @"Canceled"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.TopicProvisioningState Creating = @"Creating"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.TopicProvisioningState Deleting = @"Deleting"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.TopicProvisioningState Failed = @"Failed"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.TopicProvisioningState Succeeded = @"Succeeded"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.TopicProvisioningState Updating = @"Updating"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to TopicProvisioningState + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new TopicProvisioningState(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type TopicProvisioningState + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.TopicProvisioningState e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type TopicProvisioningState (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is TopicProvisioningState && Equals((TopicProvisioningState)obj); + } + + /// Returns hashCode for enum TopicProvisioningState + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for TopicProvisioningState + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Creates an instance of the + /// the value to create an instance for. + private TopicProvisioningState(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Implicit operator to convert string to TopicProvisioningState + /// the value to convert to an instance of . + + public static implicit operator TopicProvisioningState(string value) + { + return new TopicProvisioningState(value); + } + + /// Implicit operator to convert TopicProvisioningState to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.TopicProvisioningState e) + { + return e._value; + } + + /// Overriding != operator for enum TopicProvisioningState + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.TopicProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.TopicProvisioningState e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum TopicProvisioningState + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.TopicProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.TopicProvisioningState e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/TopicTypeProvisioningState.Completer.cs b/swaggerci/eventgrid/generated/api/Support/TopicTypeProvisioningState.Completer.cs new file mode 100644 index 000000000000..32ffb8831403 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/TopicTypeProvisioningState.Completer.cs @@ -0,0 +1,55 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// Provisioning state of the topic type + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.TopicTypeProvisioningStateTypeConverter))] + public partial struct TopicTypeProvisioningState : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Creating".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Creating'", "Creating", global::System.Management.Automation.CompletionResultType.ParameterValue, "Creating"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Updating".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Updating'", "Updating", global::System.Management.Automation.CompletionResultType.ParameterValue, "Updating"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Deleting".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Deleting'", "Deleting", global::System.Management.Automation.CompletionResultType.ParameterValue, "Deleting"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Succeeded".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Succeeded'", "Succeeded", global::System.Management.Automation.CompletionResultType.ParameterValue, "Succeeded"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Canceled".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Canceled'", "Canceled", global::System.Management.Automation.CompletionResultType.ParameterValue, "Canceled"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Failed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Failed'", "Failed", global::System.Management.Automation.CompletionResultType.ParameterValue, "Failed"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/TopicTypeProvisioningState.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Support/TopicTypeProvisioningState.TypeConverter.cs new file mode 100644 index 000000000000..f9afaff3aeca --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/TopicTypeProvisioningState.TypeConverter.cs @@ -0,0 +1,59 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// Provisioning state of the topic type + public partial class TopicTypeProvisioningStateTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => TopicTypeProvisioningState.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/TopicTypeProvisioningState.cs b/swaggerci/eventgrid/generated/api/Support/TopicTypeProvisioningState.cs new file mode 100644 index 000000000000..d64b789d41e8 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/TopicTypeProvisioningState.cs @@ -0,0 +1,108 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// Provisioning state of the topic type + public partial struct TopicTypeProvisioningState : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.TopicTypeProvisioningState Canceled = @"Canceled"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.TopicTypeProvisioningState Creating = @"Creating"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.TopicTypeProvisioningState Deleting = @"Deleting"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.TopicTypeProvisioningState Failed = @"Failed"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.TopicTypeProvisioningState Succeeded = @"Succeeded"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.TopicTypeProvisioningState Updating = @"Updating"; + + /// + /// the value for an instance of the Enum. + /// + private string _value { get; set; } + + /// Conversion from arbitrary object to TopicTypeProvisioningState + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new TopicTypeProvisioningState(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type TopicTypeProvisioningState + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.TopicTypeProvisioningState e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type TopicTypeProvisioningState (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is TopicTypeProvisioningState && Equals((TopicTypeProvisioningState)obj); + } + + /// Returns hashCode for enum TopicTypeProvisioningState + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for TopicTypeProvisioningState + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Creates an instance of the + /// the value to create an instance for. + private TopicTypeProvisioningState(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Implicit operator to convert string to TopicTypeProvisioningState + /// the value to convert to an instance of . + + public static implicit operator TopicTypeProvisioningState(string value) + { + return new TopicTypeProvisioningState(value); + } + + /// Implicit operator to convert TopicTypeProvisioningState to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.TopicTypeProvisioningState e) + { + return e._value; + } + + /// Overriding != operator for enum TopicTypeProvisioningState + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.TopicTypeProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.TopicTypeProvisioningState e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum TopicTypeProvisioningState + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.TopicTypeProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.TopicTypeProvisioningState e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/VerifiedPartnerProvisioningState.Completer.cs b/swaggerci/eventgrid/generated/api/Support/VerifiedPartnerProvisioningState.Completer.cs new file mode 100644 index 000000000000..7568dcc221e8 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/VerifiedPartnerProvisioningState.Completer.cs @@ -0,0 +1,55 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// Provisioning state of the verified partner. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.VerifiedPartnerProvisioningStateTypeConverter))] + public partial struct VerifiedPartnerProvisioningState : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Creating".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Creating'", "Creating", global::System.Management.Automation.CompletionResultType.ParameterValue, "Creating"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Updating".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Updating'", "Updating", global::System.Management.Automation.CompletionResultType.ParameterValue, "Updating"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Deleting".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Deleting'", "Deleting", global::System.Management.Automation.CompletionResultType.ParameterValue, "Deleting"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Succeeded".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Succeeded'", "Succeeded", global::System.Management.Automation.CompletionResultType.ParameterValue, "Succeeded"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Canceled".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Canceled'", "Canceled", global::System.Management.Automation.CompletionResultType.ParameterValue, "Canceled"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Failed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Failed'", "Failed", global::System.Management.Automation.CompletionResultType.ParameterValue, "Failed"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/VerifiedPartnerProvisioningState.TypeConverter.cs b/swaggerci/eventgrid/generated/api/Support/VerifiedPartnerProvisioningState.TypeConverter.cs new file mode 100644 index 000000000000..5c6ca78c8490 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/VerifiedPartnerProvisioningState.TypeConverter.cs @@ -0,0 +1,59 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// Provisioning state of the verified partner. + public partial class VerifiedPartnerProvisioningStateTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => VerifiedPartnerProvisioningState.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/api/Support/VerifiedPartnerProvisioningState.cs b/swaggerci/eventgrid/generated/api/Support/VerifiedPartnerProvisioningState.cs new file mode 100644 index 000000000000..97c6a5a675a6 --- /dev/null +++ b/swaggerci/eventgrid/generated/api/Support/VerifiedPartnerProvisioningState.cs @@ -0,0 +1,112 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support +{ + + /// Provisioning state of the verified partner. + public partial struct VerifiedPartnerProvisioningState : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.VerifiedPartnerProvisioningState Canceled = @"Canceled"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.VerifiedPartnerProvisioningState Creating = @"Creating"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.VerifiedPartnerProvisioningState Deleting = @"Deleting"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.VerifiedPartnerProvisioningState Failed = @"Failed"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.VerifiedPartnerProvisioningState Succeeded = @"Succeeded"; + + public static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.VerifiedPartnerProvisioningState Updating = @"Updating"; + + /// + /// the value for an instance of the Enum. + /// + private string _value { get; set; } + + /// Conversion from arbitrary object to VerifiedPartnerProvisioningState + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new VerifiedPartnerProvisioningState(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type VerifiedPartnerProvisioningState + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.VerifiedPartnerProvisioningState e) + { + return _value.Equals(e._value); + } + + /// + /// Compares values of enum type VerifiedPartnerProvisioningState (override for Object) + /// + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is VerifiedPartnerProvisioningState && Equals((VerifiedPartnerProvisioningState)obj); + } + + /// Returns hashCode for enum VerifiedPartnerProvisioningState + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for VerifiedPartnerProvisioningState + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// + /// Creates an instance of the + /// + /// the value to create an instance for. + private VerifiedPartnerProvisioningState(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Implicit operator to convert string to VerifiedPartnerProvisioningState + /// the value to convert to an instance of . + + public static implicit operator VerifiedPartnerProvisioningState(string value) + { + return new VerifiedPartnerProvisioningState(value); + } + + /// Implicit operator to convert VerifiedPartnerProvisioningState to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.VerifiedPartnerProvisioningState e) + { + return e._value; + } + + /// Overriding != operator for enum VerifiedPartnerProvisioningState + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.VerifiedPartnerProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.VerifiedPartnerProvisioningState e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum VerifiedPartnerProvisioningState + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.VerifiedPartnerProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.VerifiedPartnerProvisioningState e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridChannelFullUrl_Get.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridChannelFullUrl_Get.cs new file mode 100644 index 000000000000..a51fe0fd352a --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridChannelFullUrl_Get.cs @@ -0,0 +1,414 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Get the full endpoint URL of a partner destination channel. + /// + /// [OpenAPI] GetFullUrl=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerNamespaces/{partnerNamespaceName}/channels/{channelName}/getFullUrl" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridChannelFullUrl_Get", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(string))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Get the full endpoint URL of a partner destination channel.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridChannelFullUrl_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Backing field for property. + private string _channelName; + + /// Name of the Channel. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the Channel.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the Channel.", + SerializedName = @"channelName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ChannelName { get => this._channelName; set => this._channelName = value; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _partnerNamespaceName; + + /// Name of the partner namespace. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the partner namespace.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the partner namespace.", + SerializedName = @"partnerNamespaceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string PartnerNamespaceName { get => this._partnerNamespaceName; set => this._partnerNamespaceName = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the partners subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the partners subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the partners subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridChannelFullUrl_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ChannelsGetFullUrl' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ChannelsGetFullUrl(SubscriptionId, ResourceGroupName, PartnerNamespaceName, ChannelName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PartnerNamespaceName=PartnerNamespaceName,ChannelName=ChannelName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PartnerNamespaceName=PartnerNamespaceName, ChannelName=ChannelName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFullUrl + WriteObject((await response).EndpointUrl); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridChannelFullUrl_GetViaIdentity.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridChannelFullUrl_GetViaIdentity.cs new file mode 100644 index 000000000000..2416b53a31de --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridChannelFullUrl_GetViaIdentity.cs @@ -0,0 +1,380 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Get the full endpoint URL of a partner destination channel. + /// + /// [OpenAPI] GetFullUrl=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerNamespaces/{partnerNamespaceName}/channels/{channelName}/getFullUrl" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridChannelFullUrl_GetViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(string))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Get the full endpoint URL of a partner destination channel.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridChannelFullUrl_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridChannelFullUrl_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ChannelsGetFullUrl' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ChannelsGetFullUrlViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.PartnerNamespaceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.PartnerNamespaceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ChannelName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ChannelName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.ChannelsGetFullUrl(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.PartnerNamespaceName ?? null, InputObject.ChannelName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFullUrl + WriteObject((await response).EndpointUrl); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridChannel_Get.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridChannel_Get.cs new file mode 100644 index 000000000000..22daf2e89ab9 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridChannel_Get.cs @@ -0,0 +1,412 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Get properties of a channel. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerNamespaces/{partnerNamespaceName}/channels/{channelName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridChannel_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannel))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Get properties of a channel.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridChannel_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the channel. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the channel.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the channel.", + SerializedName = @"channelName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ChannelName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private string _partnerNamespaceName; + + /// Name of the partner namespace. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the partner namespace.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the partner namespace.", + SerializedName = @"partnerNamespaceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string PartnerNamespaceName { get => this._partnerNamespaceName; set => this._partnerNamespaceName = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the partners subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the partners subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the partners subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridChannel_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ChannelsGet(SubscriptionId, ResourceGroupName, PartnerNamespaceName, Name, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PartnerNamespaceName=PartnerNamespaceName,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PartnerNamespaceName=PartnerNamespaceName, Name=Name }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannel + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridChannel_GetViaIdentity.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridChannel_GetViaIdentity.cs new file mode 100644 index 000000000000..2cee6951f812 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridChannel_GetViaIdentity.cs @@ -0,0 +1,377 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Get properties of a channel. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerNamespaces/{partnerNamespaceName}/channels/{channelName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridChannel_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannel))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Get properties of a channel.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridChannel_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridChannel_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ChannelsGetViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.PartnerNamespaceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.PartnerNamespaceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ChannelName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ChannelName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.ChannelsGet(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.PartnerNamespaceName ?? null, InputObject.ChannelName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannel + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridChannel_List.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridChannel_List.cs new file mode 100644 index 000000000000..1fa71a43bfb0 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridChannel_List.cs @@ -0,0 +1,456 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// List all the channels in a partner namespace. + /// + /// [OpenAPI] ListByPartnerNamespace=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerNamespaces/{partnerNamespaceName}/channels" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridChannel_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannel))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"List all the channels in a partner namespace.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridChannel_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A flag to tell whether it is the first onOK call. + private bool _isFirst = true; + + /// Link to retrieve next page. + private string _nextLink; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _filter; + + /// + /// 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'. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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'.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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'.", + SerializedName = @"$filter", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Query)] + public string Filter { get => this._filter; set => this._filter = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _partnerNamespaceName; + + /// Name of the partner namespace. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the partner namespace.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the partner namespace.", + SerializedName = @"partnerNamespaceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string PartnerNamespaceName { get => this._partnerNamespaceName; set => this._partnerNamespaceName = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the partners subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the partners subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the partners subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private int _top; + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"$top", + PossibleTypes = new [] { typeof(int) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Query)] + public int Top { get => this._top; set => this._top = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridChannel_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ChannelsListByPartnerNamespace(SubscriptionId, ResourceGroupName, PartnerNamespaceName, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?), onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PartnerNamespaceName=PartnerNamespaceName,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null,Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?)}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PartnerNamespaceName=PartnerNamespaceName, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?) }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / nextLink + var result = await response; + WriteObject(result.Value,true); + _nextLink = result.NextLink; + if (_isFirst) + { + _isFirst = false; + while (_nextLink != null) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ChannelsListByPartnerNamespace_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridDomainEventSubscriptionDeliveryAttribute_Get.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridDomainEventSubscriptionDeliveryAttribute_Get.cs new file mode 100644 index 000000000000..5f82818cfc38 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridDomainEventSubscriptionDeliveryAttribute_Get.cs @@ -0,0 +1,415 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Get all delivery attributes for an event subscription for domain. + /// + /// [OpenAPI] GetDeliveryAttributes=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/eventSubscriptions/{eventSubscriptionName}/getDeliveryAttributes" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridDomainEventSubscriptionDeliveryAttribute_Get", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Get all delivery attributes for an event subscription for domain.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridDomainEventSubscriptionDeliveryAttribute_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _domainName; + + /// Name of the domain topic. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the domain topic.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the domain topic.", + SerializedName = @"domainName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string DomainName { get => this._domainName; set => this._domainName = value; } + + /// Backing field for property. + private string _eventSubscriptionName; + + /// Name of the event subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the event subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the event subscription.", + SerializedName = @"eventSubscriptionName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string EventSubscriptionName { get => this._eventSubscriptionName; set => this._eventSubscriptionName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridDomainEventSubscriptionDeliveryAttribute_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DomainEventSubscriptionsGetDeliveryAttributes' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DomainEventSubscriptionsGetDeliveryAttributes(SubscriptionId, ResourceGroupName, DomainName, EventSubscriptionName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,DomainName=DomainName,EventSubscriptionName=EventSubscriptionName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, DomainName=DomainName, EventSubscriptionName=EventSubscriptionName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // nested-array / value / + WriteObject((await response).Value, true); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridDomainEventSubscriptionDeliveryAttribute_GetViaIdentity.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridDomainEventSubscriptionDeliveryAttribute_GetViaIdentity.cs new file mode 100644 index 000000000000..d1ebda90e4df --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridDomainEventSubscriptionDeliveryAttribute_GetViaIdentity.cs @@ -0,0 +1,382 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Get all delivery attributes for an event subscription for domain. + /// + /// [OpenAPI] GetDeliveryAttributes=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/eventSubscriptions/{eventSubscriptionName}/getDeliveryAttributes" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridDomainEventSubscriptionDeliveryAttribute_GetViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Get all delivery attributes for an event subscription for domain.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridDomainEventSubscriptionDeliveryAttribute_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the + /// cmdlet class. + /// + public GetAzEventGridDomainEventSubscriptionDeliveryAttribute_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DomainEventSubscriptionsGetDeliveryAttributes' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.DomainEventSubscriptionsGetDeliveryAttributesViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.DomainName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.DomainName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.EventSubscriptionName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.EventSubscriptionName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.DomainEventSubscriptionsGetDeliveryAttributes(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.DomainName ?? null, InputObject.EventSubscriptionName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // nested-array / value / + WriteObject((await response).Value, true); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridDomainEventSubscriptionFullUrl_Get.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridDomainEventSubscriptionFullUrl_Get.cs new file mode 100644 index 000000000000..498429745c2b --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridDomainEventSubscriptionFullUrl_Get.cs @@ -0,0 +1,414 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Get the full endpoint URL for an event subscription for domain. + /// + /// [OpenAPI] GetFullUrl=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/eventSubscriptions/{eventSubscriptionName}/getFullUrl" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridDomainEventSubscriptionFullUrl_Get", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(string))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Get the full endpoint URL for an event subscription for domain.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridDomainEventSubscriptionFullUrl_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _domainName; + + /// Name of the domain topic. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the domain topic.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the domain topic.", + SerializedName = @"domainName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string DomainName { get => this._domainName; set => this._domainName = value; } + + /// Backing field for property. + private string _eventSubscriptionName; + + /// Name of the event subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the event subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the event subscription.", + SerializedName = @"eventSubscriptionName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string EventSubscriptionName { get => this._eventSubscriptionName; set => this._eventSubscriptionName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridDomainEventSubscriptionFullUrl_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DomainEventSubscriptionsGetFullUrl' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DomainEventSubscriptionsGetFullUrl(SubscriptionId, ResourceGroupName, DomainName, EventSubscriptionName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,DomainName=DomainName,EventSubscriptionName=EventSubscriptionName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, DomainName=DomainName, EventSubscriptionName=EventSubscriptionName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFullUrl + WriteObject((await response).EndpointUrl); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridDomainEventSubscriptionFullUrl_GetViaIdentity.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridDomainEventSubscriptionFullUrl_GetViaIdentity.cs new file mode 100644 index 000000000000..9c6ed62497a8 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridDomainEventSubscriptionFullUrl_GetViaIdentity.cs @@ -0,0 +1,380 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Get the full endpoint URL for an event subscription for domain. + /// + /// [OpenAPI] GetFullUrl=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/eventSubscriptions/{eventSubscriptionName}/getFullUrl" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridDomainEventSubscriptionFullUrl_GetViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(string))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Get the full endpoint URL for an event subscription for domain.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridDomainEventSubscriptionFullUrl_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridDomainEventSubscriptionFullUrl_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DomainEventSubscriptionsGetFullUrl' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.DomainEventSubscriptionsGetFullUrlViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.DomainName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.DomainName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.EventSubscriptionName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.EventSubscriptionName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.DomainEventSubscriptionsGetFullUrl(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.DomainName ?? null, InputObject.EventSubscriptionName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFullUrl + WriteObject((await response).EndpointUrl); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridDomainEventSubscription_Get.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridDomainEventSubscription_Get.cs new file mode 100644 index 000000000000..a736168b5f17 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridDomainEventSubscription_Get.cs @@ -0,0 +1,414 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Get properties of an event subscription of a domain. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/eventSubscriptions/{eventSubscriptionName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridDomainEventSubscription_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Get properties of an event subscription of a domain.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridDomainEventSubscription_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _domainName; + + /// Name of the partner topic. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the partner topic.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the partner topic.", + SerializedName = @"domainName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string DomainName { get => this._domainName; set => this._domainName = value; } + + /// Backing field for property. + private string _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. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "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.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"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.", + SerializedName = @"eventSubscriptionName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string EventSubscriptionName { get => this._eventSubscriptionName; set => this._eventSubscriptionName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridDomainEventSubscription_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DomainEventSubscriptionsGet(SubscriptionId, ResourceGroupName, DomainName, EventSubscriptionName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,DomainName=DomainName,EventSubscriptionName=EventSubscriptionName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, DomainName=DomainName, EventSubscriptionName=EventSubscriptionName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridDomainEventSubscription_GetViaIdentity.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridDomainEventSubscription_GetViaIdentity.cs new file mode 100644 index 000000000000..6efaea7280ef --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridDomainEventSubscription_GetViaIdentity.cs @@ -0,0 +1,377 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Get properties of an event subscription of a domain. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/eventSubscriptions/{eventSubscriptionName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridDomainEventSubscription_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Get properties of an event subscription of a domain.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridDomainEventSubscription_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridDomainEventSubscription_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.DomainEventSubscriptionsGetViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.DomainName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.DomainName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.EventSubscriptionName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.EventSubscriptionName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.DomainEventSubscriptionsGet(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.DomainName ?? null, InputObject.EventSubscriptionName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridDomainEventSubscription_List.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridDomainEventSubscription_List.cs new file mode 100644 index 000000000000..32c4bcfe1deb --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridDomainEventSubscription_List.cs @@ -0,0 +1,456 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// List all event subscriptions that have been created for a specific topic. + /// + /// [OpenAPI] List=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/eventSubscriptions" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridDomainEventSubscription_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"List all event subscriptions that have been created for a specific topic.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridDomainEventSubscription_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A flag to tell whether it is the first onOK call. + private bool _isFirst = true; + + /// Link to retrieve next page. + private string _nextLink; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _domainName; + + /// Name of the domain. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the domain.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the domain.", + SerializedName = @"domainName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string DomainName { get => this._domainName; set => this._domainName = value; } + + /// Backing field for property. + private string _filter; + + /// + /// 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'. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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'.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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'.", + SerializedName = @"$filter", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Query)] + public string Filter { get => this._filter; set => this._filter = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private int _top; + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"$top", + PossibleTypes = new [] { typeof(int) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Query)] + public int Top { get => this._top; set => this._top = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridDomainEventSubscription_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DomainEventSubscriptionsList(SubscriptionId, ResourceGroupName, DomainName, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?), onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,DomainName=DomainName,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null,Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?)}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, DomainName=DomainName, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?) }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / nextLink + var result = await response; + WriteObject(result.Value,true); + _nextLink = result.NextLink; + if (_isFirst) + { + _isFirst = false; + while (_nextLink != null) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DomainEventSubscriptionsList_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridDomainSharedAccessKey_List.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridDomainSharedAccessKey_List.cs new file mode 100644 index 000000000000..8a6ceb5f662e --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridDomainSharedAccessKey_List.cs @@ -0,0 +1,400 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// List the two keys used to publish to a domain. + /// + /// [OpenAPI] ListSharedAccessKeys=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/listKeys" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridDomainSharedAccessKey_List", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainSharedAccessKeys))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"List the two keys used to publish to a domain.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridDomainSharedAccessKey_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _domainName; + + /// Name of the domain. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the domain.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the domain.", + SerializedName = @"domainName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string DomainName { get => this._domainName; set => this._domainName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridDomainSharedAccessKey_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DomainsListSharedAccessKeys' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DomainsListSharedAccessKeys(SubscriptionId, ResourceGroupName, DomainName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,DomainName=DomainName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, DomainName=DomainName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainSharedAccessKeys + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridDomainTopicEventSubscriptionDeliveryAttribute_Get.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridDomainTopicEventSubscriptionDeliveryAttribute_Get.cs new file mode 100644 index 000000000000..b6813ab32d1b --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridDomainTopicEventSubscriptionDeliveryAttribute_Get.cs @@ -0,0 +1,430 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Get all delivery attributes for an event subscription for domain topic. + /// + /// [OpenAPI] GetDeliveryAttributes=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/topics/{topicName}/eventSubscriptions/{eventSubscriptionName}/getDeliveryAttributes" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridDomainTopicEventSubscriptionDeliveryAttribute_Get", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Get all delivery attributes for an event subscription for domain topic.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridDomainTopicEventSubscriptionDeliveryAttribute_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _domainName; + + /// Name of the top level domain. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the top level domain.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the top level domain.", + SerializedName = @"domainName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string DomainName { get => this._domainName; set => this._domainName = value; } + + /// Backing field for property. + private string _eventSubscriptionName; + + /// Name of the event subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the event subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the event subscription.", + SerializedName = @"eventSubscriptionName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string EventSubscriptionName { get => this._eventSubscriptionName; set => this._eventSubscriptionName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _topicName; + + /// Name of the domain topic. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the domain topic.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the domain topic.", + SerializedName = @"topicName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string TopicName { get => this._topicName; set => this._topicName = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet + /// class. + /// + public GetAzEventGridDomainTopicEventSubscriptionDeliveryAttribute_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DomainTopicEventSubscriptionsGetDeliveryAttributes' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DomainTopicEventSubscriptionsGetDeliveryAttributes(SubscriptionId, ResourceGroupName, DomainName, TopicName, EventSubscriptionName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,DomainName=DomainName,TopicName=TopicName,EventSubscriptionName=EventSubscriptionName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, DomainName=DomainName, TopicName=TopicName, EventSubscriptionName=EventSubscriptionName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // nested-array / value / + WriteObject((await response).Value, true); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridDomainTopicEventSubscriptionDeliveryAttribute_GetViaIdentity.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridDomainTopicEventSubscriptionDeliveryAttribute_GetViaIdentity.cs new file mode 100644 index 000000000000..6cbed5af3015 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridDomainTopicEventSubscriptionDeliveryAttribute_GetViaIdentity.cs @@ -0,0 +1,386 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Get all delivery attributes for an event subscription for domain topic. + /// + /// [OpenAPI] GetDeliveryAttributes=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/topics/{topicName}/eventSubscriptions/{eventSubscriptionName}/getDeliveryAttributes" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridDomainTopicEventSubscriptionDeliveryAttribute_GetViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Get all delivery attributes for an event subscription for domain topic.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridDomainTopicEventSubscriptionDeliveryAttribute_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridDomainTopicEventSubscriptionDeliveryAttribute_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DomainTopicEventSubscriptionsGetDeliveryAttributes' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.DomainTopicEventSubscriptionsGetDeliveryAttributesViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.DomainName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.DomainName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.TopicName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.TopicName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.EventSubscriptionName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.EventSubscriptionName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.DomainTopicEventSubscriptionsGetDeliveryAttributes(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.DomainName ?? null, InputObject.TopicName ?? null, InputObject.EventSubscriptionName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // nested-array / value / + WriteObject((await response).Value, true); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridDomainTopicEventSubscriptionFullUrl_Get.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridDomainTopicEventSubscriptionFullUrl_Get.cs new file mode 100644 index 000000000000..635cb030ae69 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridDomainTopicEventSubscriptionFullUrl_Get.cs @@ -0,0 +1,428 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Get the full endpoint URL for a nested event subscription for domain topic. + /// + /// [OpenAPI] GetFullUrl=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/topics/{topicName}/eventSubscriptions/{eventSubscriptionName}/getFullUrl" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridDomainTopicEventSubscriptionFullUrl_Get", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(string))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Get the full endpoint URL for a nested event subscription for domain topic.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridDomainTopicEventSubscriptionFullUrl_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _domainName; + + /// Name of the top level domain. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the top level domain.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the top level domain.", + SerializedName = @"domainName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string DomainName { get => this._domainName; set => this._domainName = value; } + + /// Backing field for property. + private string _eventSubscriptionName; + + /// Name of the event subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the event subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the event subscription.", + SerializedName = @"eventSubscriptionName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string EventSubscriptionName { get => this._eventSubscriptionName; set => this._eventSubscriptionName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _topicName; + + /// Name of the domain topic. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the domain topic.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the domain topic.", + SerializedName = @"topicName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string TopicName { get => this._topicName; set => this._topicName = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridDomainTopicEventSubscriptionFullUrl_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DomainTopicEventSubscriptionsGetFullUrl' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DomainTopicEventSubscriptionsGetFullUrl(SubscriptionId, ResourceGroupName, DomainName, TopicName, EventSubscriptionName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,DomainName=DomainName,TopicName=TopicName,EventSubscriptionName=EventSubscriptionName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, DomainName=DomainName, TopicName=TopicName, EventSubscriptionName=EventSubscriptionName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFullUrl + WriteObject((await response).EndpointUrl); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridDomainTopicEventSubscriptionFullUrl_GetViaIdentity.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridDomainTopicEventSubscriptionFullUrl_GetViaIdentity.cs new file mode 100644 index 000000000000..d1660fe563ac --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridDomainTopicEventSubscriptionFullUrl_GetViaIdentity.cs @@ -0,0 +1,385 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Get the full endpoint URL for a nested event subscription for domain topic. + /// + /// [OpenAPI] GetFullUrl=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/topics/{topicName}/eventSubscriptions/{eventSubscriptionName}/getFullUrl" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridDomainTopicEventSubscriptionFullUrl_GetViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(string))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Get the full endpoint URL for a nested event subscription for domain topic.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridDomainTopicEventSubscriptionFullUrl_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet + /// class. + /// + public GetAzEventGridDomainTopicEventSubscriptionFullUrl_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DomainTopicEventSubscriptionsGetFullUrl' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.DomainTopicEventSubscriptionsGetFullUrlViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.DomainName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.DomainName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.TopicName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.TopicName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.EventSubscriptionName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.EventSubscriptionName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.DomainTopicEventSubscriptionsGetFullUrl(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.DomainName ?? null, InputObject.TopicName ?? null, InputObject.EventSubscriptionName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFullUrl + WriteObject((await response).EndpointUrl); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridDomainTopicEventSubscription_Get.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridDomainTopicEventSubscription_Get.cs new file mode 100644 index 000000000000..a318a59c8852 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridDomainTopicEventSubscription_Get.cs @@ -0,0 +1,425 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Get properties of a nested event subscription for a domain topic. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/topics/{topicName}/eventSubscriptions/{eventSubscriptionName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridDomainTopicEventSubscription_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Get properties of a nested event subscription for a domain topic.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridDomainTopicEventSubscription_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _domainName; + + /// Name of the top level domain. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the top level domain.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the top level domain.", + SerializedName = @"domainName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string DomainName { get => this._domainName; set => this._domainName = value; } + + /// Backing field for property. + private string _eventSubscriptionName; + + /// Name of the event subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the event subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the event subscription.", + SerializedName = @"eventSubscriptionName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string EventSubscriptionName { get => this._eventSubscriptionName; set => this._eventSubscriptionName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _topicName; + + /// Name of the domain topic. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the domain topic.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the domain topic.", + SerializedName = @"topicName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string TopicName { get => this._topicName; set => this._topicName = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridDomainTopicEventSubscription_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DomainTopicEventSubscriptionsGet(SubscriptionId, ResourceGroupName, DomainName, TopicName, EventSubscriptionName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,DomainName=DomainName,TopicName=TopicName,EventSubscriptionName=EventSubscriptionName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, DomainName=DomainName, TopicName=TopicName, EventSubscriptionName=EventSubscriptionName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridDomainTopicEventSubscription_GetViaIdentity.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridDomainTopicEventSubscription_GetViaIdentity.cs new file mode 100644 index 000000000000..880eb6c70f02 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridDomainTopicEventSubscription_GetViaIdentity.cs @@ -0,0 +1,381 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Get properties of a nested event subscription for a domain topic. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/topics/{topicName}/eventSubscriptions/{eventSubscriptionName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridDomainTopicEventSubscription_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Get properties of a nested event subscription for a domain topic.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridDomainTopicEventSubscription_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridDomainTopicEventSubscription_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.DomainTopicEventSubscriptionsGetViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.DomainName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.DomainName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.TopicName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.TopicName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.EventSubscriptionName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.EventSubscriptionName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.DomainTopicEventSubscriptionsGet(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.DomainName ?? null, InputObject.TopicName ?? null, InputObject.EventSubscriptionName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridDomainTopicEventSubscription_List.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridDomainTopicEventSubscription_List.cs new file mode 100644 index 000000000000..564c6ed2bee5 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridDomainTopicEventSubscription_List.cs @@ -0,0 +1,472 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// + /// List all event subscriptions that have been created for a specific domain topic. + /// + /// + /// [OpenAPI] List=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/topics/{topicName}/eventSubscriptions" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridDomainTopicEventSubscription_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"List all event subscriptions that have been created for a specific domain topic.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridDomainTopicEventSubscription_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A flag to tell whether it is the first onOK call. + private bool _isFirst = true; + + /// Link to retrieve next page. + private string _nextLink; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _domainName; + + /// Name of the top level domain. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the top level domain.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the top level domain.", + SerializedName = @"domainName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string DomainName { get => this._domainName; set => this._domainName = value; } + + /// Backing field for property. + private string _filter; + + /// + /// 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'. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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'.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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'.", + SerializedName = @"$filter", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Query)] + public string Filter { get => this._filter; set => this._filter = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private int _top; + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"$top", + PossibleTypes = new [] { typeof(int) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Query)] + public int Top { get => this._top; set => this._top = value; } + + /// Backing field for property. + private string _topicName; + + /// Name of the domain topic. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the domain topic.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the domain topic.", + SerializedName = @"topicName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string TopicName { get => this._topicName; set => this._topicName = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridDomainTopicEventSubscription_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DomainTopicEventSubscriptionsList(SubscriptionId, ResourceGroupName, DomainName, TopicName, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?), onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,DomainName=DomainName,TopicName=TopicName,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null,Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?)}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, DomainName=DomainName, TopicName=TopicName, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?) }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / nextLink + var result = await response; + WriteObject(result.Value,true); + _nextLink = result.NextLink; + if (_isFirst) + { + _isFirst = false; + while (_nextLink != null) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DomainTopicEventSubscriptionsList_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridDomainTopic_Get.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridDomainTopic_Get.cs new file mode 100644 index 000000000000..1af5805d7851 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridDomainTopic_Get.cs @@ -0,0 +1,412 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Get properties of a domain topic. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/topics/{domainTopicName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridDomainTopic_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopic))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Get properties of a domain topic.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridDomainTopic_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _domainName; + + /// Name of the domain. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the domain.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the domain.", + SerializedName = @"domainName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string DomainName { get => this._domainName; set => this._domainName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the topic. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the topic.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the topic.", + SerializedName = @"domainTopicName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("DomainTopicName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridDomainTopic_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DomainTopicsGet(SubscriptionId, ResourceGroupName, DomainName, Name, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,DomainName=DomainName,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, DomainName=DomainName, Name=Name }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopic + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridDomainTopic_GetViaIdentity.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridDomainTopic_GetViaIdentity.cs new file mode 100644 index 000000000000..b7dd409f6274 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridDomainTopic_GetViaIdentity.cs @@ -0,0 +1,377 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Get properties of a domain topic. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/topics/{domainTopicName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridDomainTopic_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopic))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Get properties of a domain topic.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridDomainTopic_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridDomainTopic_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.DomainTopicsGetViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.DomainName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.DomainName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.DomainTopicName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.DomainTopicName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.DomainTopicsGet(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.DomainName ?? null, InputObject.DomainTopicName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopic + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridDomainTopic_List.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridDomainTopic_List.cs new file mode 100644 index 000000000000..67c81e13cc9a --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridDomainTopic_List.cs @@ -0,0 +1,456 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// List all the topics in a domain. + /// + /// [OpenAPI] ListByDomain=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/topics" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridDomainTopic_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainTopic))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"List all the topics in a domain.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridDomainTopic_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A flag to tell whether it is the first onOK call. + private bool _isFirst = true; + + /// Link to retrieve next page. + private string _nextLink; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _domainName; + + /// Domain name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Domain name.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Domain name.", + SerializedName = @"domainName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string DomainName { get => this._domainName; set => this._domainName = value; } + + /// Backing field for property. + private string _filter; + + /// + /// 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'. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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'.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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'.", + SerializedName = @"$filter", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Query)] + public string Filter { get => this._filter; set => this._filter = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private int _top; + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"$top", + PossibleTypes = new [] { typeof(int) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Query)] + public int Top { get => this._top; set => this._top = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridDomainTopic_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DomainTopicsListByDomain(SubscriptionId, ResourceGroupName, DomainName, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?), onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,DomainName=DomainName,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null,Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?)}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, DomainName=DomainName, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?) }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / nextLink + var result = await response; + WriteObject(result.Value,true); + _nextLink = result.NextLink; + if (_isFirst) + { + _isFirst = false; + while (_nextLink != null) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DomainTopicsListByDomain_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridDomain_Get.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridDomain_Get.cs new file mode 100644 index 000000000000..4accd764e67f --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridDomain_Get.cs @@ -0,0 +1,398 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Get properties of a domain. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridDomain_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomain))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Get properties of a domain.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridDomain_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the domain. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the domain.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the domain.", + SerializedName = @"domainName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("DomainName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridDomain_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DomainsGet(SubscriptionId, ResourceGroupName, Name, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomain + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridDomain_GetViaIdentity.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridDomain_GetViaIdentity.cs new file mode 100644 index 000000000000..bfb9b401431a --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridDomain_GetViaIdentity.cs @@ -0,0 +1,373 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Get properties of a domain. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridDomain_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomain))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Get properties of a domain.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridDomain_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridDomain_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.DomainsGetViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.DomainName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.DomainName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.DomainsGet(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.DomainName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomain + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridDomain_List.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridDomain_List.cs new file mode 100644 index 000000000000..00349a90fd4a --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridDomain_List.cs @@ -0,0 +1,428 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// List all the domains under an Azure subscription. + /// + /// [OpenAPI] ListBySubscription=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/domains" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridDomain_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomain))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"List all the domains under an Azure subscription.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridDomain_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A flag to tell whether it is the first onOK call. + private bool _isFirst = true; + + /// Link to retrieve next page. + private string _nextLink; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _filter; + + /// + /// 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'. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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'.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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'.", + SerializedName = @"$filter", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Query)] + public string Filter { get => this._filter; set => this._filter = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private int _top; + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"$top", + PossibleTypes = new [] { typeof(int) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Query)] + public int Top { get => this._top; set => this._top = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridDomain_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DomainsListBySubscription(SubscriptionId, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?), onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null,Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?)}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?) }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / nextLink + var result = await response; + WriteObject(result.Value,true); + _nextLink = result.NextLink; + if (_isFirst) + { + _isFirst = false; + while (_nextLink != null) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DomainsListBySubscription_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridDomain_List1.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridDomain_List1.cs new file mode 100644 index 000000000000..e64d19d3e27b --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridDomain_List1.cs @@ -0,0 +1,442 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// List all the domains under a resource group. + /// + /// [OpenAPI] ListByResourceGroup=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridDomain_List1")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomain))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"List all the domains under a resource group.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridDomain_List1 : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A flag to tell whether it is the first onOK call. + private bool _isFirst = true; + + /// Link to retrieve next page. + private string _nextLink; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _filter; + + /// + /// 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'. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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'.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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'.", + SerializedName = @"$filter", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Query)] + public string Filter { get => this._filter; set => this._filter = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private int _top; + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"$top", + PossibleTypes = new [] { typeof(int) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Query)] + public int Top { get => this._top; set => this._top = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridDomain_List1() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DomainsListByResourceGroup(SubscriptionId, ResourceGroupName, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?), onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null,Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?)}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?) }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / nextLink + var result = await response; + WriteObject(result.Value,true); + _nextLink = result.NextLink; + if (_isFirst) + { + _isFirst = false; + while (_nextLink != null) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DomainsListByResourceGroup_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridEventChannel_Get.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridEventChannel_Get.cs new file mode 100644 index 000000000000..09e46510e607 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridEventChannel_Get.cs @@ -0,0 +1,412 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Get properties of an event channel. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerNamespaces/{partnerNamespaceName}/eventChannels/{eventChannelName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridEventChannel_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannel))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Get properties of an event channel.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridEventChannel_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the event channel. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the event channel.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the event channel.", + SerializedName = @"eventChannelName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("EventChannelName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private string _partnerNamespaceName; + + /// Name of the partner namespace. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the partner namespace.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the partner namespace.", + SerializedName = @"partnerNamespaceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string PartnerNamespaceName { get => this._partnerNamespaceName; set => this._partnerNamespaceName = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridEventChannel_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.EventChannelsGet(SubscriptionId, ResourceGroupName, PartnerNamespaceName, Name, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PartnerNamespaceName=PartnerNamespaceName,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PartnerNamespaceName=PartnerNamespaceName, Name=Name }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannel + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridEventChannel_GetViaIdentity.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridEventChannel_GetViaIdentity.cs new file mode 100644 index 000000000000..e45c98337843 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridEventChannel_GetViaIdentity.cs @@ -0,0 +1,377 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Get properties of an event channel. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerNamespaces/{partnerNamespaceName}/eventChannels/{eventChannelName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridEventChannel_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannel))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Get properties of an event channel.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridEventChannel_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridEventChannel_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.EventChannelsGetViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.PartnerNamespaceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.PartnerNamespaceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.EventChannelName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.EventChannelName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.EventChannelsGet(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.PartnerNamespaceName ?? null, InputObject.EventChannelName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannel + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridEventChannel_List.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridEventChannel_List.cs new file mode 100644 index 000000000000..1e1a024e92d3 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridEventChannel_List.cs @@ -0,0 +1,456 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// List all the event channels in a partner namespace. + /// + /// [OpenAPI] ListByPartnerNamespace=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerNamespaces/{partnerNamespaceName}/eventChannels" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridEventChannel_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannel))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"List all the event channels in a partner namespace.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridEventChannel_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A flag to tell whether it is the first onOK call. + private bool _isFirst = true; + + /// Link to retrieve next page. + private string _nextLink; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _filter; + + /// + /// 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'. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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'.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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'.", + SerializedName = @"$filter", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Query)] + public string Filter { get => this._filter; set => this._filter = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _partnerNamespaceName; + + /// Name of the partner namespace. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the partner namespace.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the partner namespace.", + SerializedName = @"partnerNamespaceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string PartnerNamespaceName { get => this._partnerNamespaceName; set => this._partnerNamespaceName = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private int _top; + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"$top", + PossibleTypes = new [] { typeof(int) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Query)] + public int Top { get => this._top; set => this._top = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridEventChannel_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.EventChannelsListByPartnerNamespace(SubscriptionId, ResourceGroupName, PartnerNamespaceName, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?), onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PartnerNamespaceName=PartnerNamespaceName,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null,Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?)}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PartnerNamespaceName=PartnerNamespaceName, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?) }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / nextLink + var result = await response; + WriteObject(result.Value,true); + _nextLink = result.NextLink; + if (_isFirst) + { + _isFirst = false; + while (_nextLink != null) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.EventChannelsListByPartnerNamespace_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridEventSubscriptionDeliveryAttribute_Get.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridEventSubscriptionDeliveryAttribute_Get.cs new file mode 100644 index 000000000000..d862540124e4 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridEventSubscriptionDeliveryAttribute_Get.cs @@ -0,0 +1,383 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Get all delivery attributes for an event subscription. + /// + /// [OpenAPI] GetDeliveryAttributes=>POST:"/{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}/getDeliveryAttributes" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridEventSubscriptionDeliveryAttribute_Get", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Get all delivery attributes for an event subscription.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridEventSubscriptionDeliveryAttribute_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _eventSubscriptionName; + + /// Name of the event subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the event subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the event subscription.", + SerializedName = @"eventSubscriptionName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string EventSubscriptionName { get => this._eventSubscriptionName; set => this._eventSubscriptionName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' + /// for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' + /// for an EventGrid topic. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic.", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string Scope { get => this._scope; set => this._scope = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridEventSubscriptionDeliveryAttribute_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'EventSubscriptionsGetDeliveryAttributes' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.EventSubscriptionsGetDeliveryAttributes(Scope, EventSubscriptionName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,EventSubscriptionName=EventSubscriptionName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope, EventSubscriptionName=EventSubscriptionName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // nested-array / value / + WriteObject((await response).Value, true); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridEventSubscriptionDeliveryAttribute_GetViaIdentity.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridEventSubscriptionDeliveryAttribute_GetViaIdentity.cs new file mode 100644 index 000000000000..b1c48691cfc4 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridEventSubscriptionDeliveryAttribute_GetViaIdentity.cs @@ -0,0 +1,374 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Get all delivery attributes for an event subscription. + /// + /// [OpenAPI] GetDeliveryAttributes=>POST:"/{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}/getDeliveryAttributes" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridEventSubscriptionDeliveryAttribute_GetViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Get all delivery attributes for an event subscription.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridEventSubscriptionDeliveryAttribute_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet + /// class. + /// + public GetAzEventGridEventSubscriptionDeliveryAttribute_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'EventSubscriptionsGetDeliveryAttributes' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.EventSubscriptionsGetDeliveryAttributesViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.Scope) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.Scope"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.EventSubscriptionName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.EventSubscriptionName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.EventSubscriptionsGetDeliveryAttributes(InputObject.Scope ?? null, InputObject.EventSubscriptionName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // nested-array / value / + WriteObject((await response).Value, true); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridEventSubscriptionFullUrl_Get.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridEventSubscriptionFullUrl_Get.cs new file mode 100644 index 000000000000..07d5e1a96c7e --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridEventSubscriptionFullUrl_Get.cs @@ -0,0 +1,382 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Get the full endpoint URL for an event subscription. + /// + /// [OpenAPI] GetFullUrl=>POST:"/{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}/getFullUrl" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridEventSubscriptionFullUrl_Get", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(string))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Get the full endpoint URL for an event subscription.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridEventSubscriptionFullUrl_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _eventSubscriptionName; + + /// Name of the event subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the event subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the event subscription.", + SerializedName = @"eventSubscriptionName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string EventSubscriptionName { get => this._eventSubscriptionName; set => this._eventSubscriptionName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' + /// for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' + /// for an EventGrid topic. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic.", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string Scope { get => this._scope; set => this._scope = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridEventSubscriptionFullUrl_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'EventSubscriptionsGetFullUrl' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.EventSubscriptionsGetFullUrl(Scope, EventSubscriptionName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,EventSubscriptionName=EventSubscriptionName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope, EventSubscriptionName=EventSubscriptionName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFullUrl + WriteObject((await response).EndpointUrl); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridEventSubscriptionFullUrl_GetViaIdentity.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridEventSubscriptionFullUrl_GetViaIdentity.cs new file mode 100644 index 000000000000..c4ee1a8da968 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridEventSubscriptionFullUrl_GetViaIdentity.cs @@ -0,0 +1,372 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Get the full endpoint URL for an event subscription. + /// + /// [OpenAPI] GetFullUrl=>POST:"/{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}/getFullUrl" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridEventSubscriptionFullUrl_GetViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(string))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Get the full endpoint URL for an event subscription.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridEventSubscriptionFullUrl_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridEventSubscriptionFullUrl_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'EventSubscriptionsGetFullUrl' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.EventSubscriptionsGetFullUrlViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.Scope) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.Scope"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.EventSubscriptionName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.EventSubscriptionName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.EventSubscriptionsGetFullUrl(InputObject.Scope ?? null, InputObject.EventSubscriptionName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFullUrl + WriteObject((await response).EndpointUrl); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridEventSubscriptionGlobal_List.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridEventSubscriptionGlobal_List.cs new file mode 100644 index 000000000000..bbbeca651468 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridEventSubscriptionGlobal_List.cs @@ -0,0 +1,430 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// + /// List all aggregated global event subscriptions under a specific Azure subscription. + /// + /// + /// [OpenAPI] ListGlobalBySubscription=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/eventSubscriptions" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridEventSubscriptionGlobal_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"List all aggregated global event subscriptions under a specific Azure subscription.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridEventSubscriptionGlobal_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A flag to tell whether it is the first onOK call. + private bool _isFirst = true; + + /// Link to retrieve next page. + private string _nextLink; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _filter; + + /// + /// 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'. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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'.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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'.", + SerializedName = @"$filter", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Query)] + public string Filter { get => this._filter; set => this._filter = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private int _top; + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"$top", + PossibleTypes = new [] { typeof(int) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Query)] + public int Top { get => this._top; set => this._top = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridEventSubscriptionGlobal_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.EventSubscriptionsListGlobalBySubscription(SubscriptionId, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?), onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null,Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?)}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?) }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / nextLink + var result = await response; + WriteObject(result.Value,true); + _nextLink = result.NextLink; + if (_isFirst) + { + _isFirst = false; + while (_nextLink != null) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.EventSubscriptionsListGlobalBySubscription_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridEventSubscriptionGlobal_List1.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridEventSubscriptionGlobal_List1.cs new file mode 100644 index 000000000000..6ab363ac8d53 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridEventSubscriptionGlobal_List1.cs @@ -0,0 +1,444 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// + /// List all global event subscriptions under an Azure subscription for a topic type. + /// + /// + /// [OpenAPI] ListGlobalBySubscriptionForTopicType=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/topicTypes/{topicTypeName}/eventSubscriptions" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridEventSubscriptionGlobal_List1")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"List all global event subscriptions under an Azure subscription for a topic type.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridEventSubscriptionGlobal_List1 : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A flag to tell whether it is the first onOK call. + private bool _isFirst = true; + + /// Link to retrieve next page. + private string _nextLink; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _filter; + + /// + /// 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'. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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'.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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'.", + SerializedName = @"$filter", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Query)] + public string Filter { get => this._filter; set => this._filter = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private int _top; + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"$top", + PossibleTypes = new [] { typeof(int) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Query)] + public int Top { get => this._top; set => this._top = value; } + + /// Backing field for property. + private string _topicTypeName; + + /// Name of the topic type. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the topic type.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the topic type.", + SerializedName = @"topicTypeName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string TopicTypeName { get => this._topicTypeName; set => this._topicTypeName = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridEventSubscriptionGlobal_List1() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.EventSubscriptionsListGlobalBySubscriptionForTopicType(SubscriptionId, TopicTypeName, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?), onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,TopicTypeName=TopicTypeName,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null,Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?)}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, TopicTypeName=TopicTypeName, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?) }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / nextLink + var result = await response; + WriteObject(result.Value,true); + _nextLink = result.NextLink; + if (_isFirst) + { + _isFirst = false; + while (_nextLink != null) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.EventSubscriptionsListGlobalBySubscriptionForTopicType_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridEventSubscriptionGlobal_List2.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridEventSubscriptionGlobal_List2.cs new file mode 100644 index 000000000000..21d48fe509ff --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridEventSubscriptionGlobal_List2.cs @@ -0,0 +1,444 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// + /// List all global event subscriptions under a specific Azure subscription and resource group. + /// + /// + /// [OpenAPI] ListGlobalByResourceGroup=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/eventSubscriptions" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridEventSubscriptionGlobal_List2")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"List all global event subscriptions under a specific Azure subscription and resource group.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridEventSubscriptionGlobal_List2 : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A flag to tell whether it is the first onOK call. + private bool _isFirst = true; + + /// Link to retrieve next page. + private string _nextLink; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _filter; + + /// + /// 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'. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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'.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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'.", + SerializedName = @"$filter", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Query)] + public string Filter { get => this._filter; set => this._filter = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private int _top; + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"$top", + PossibleTypes = new [] { typeof(int) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Query)] + public int Top { get => this._top; set => this._top = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridEventSubscriptionGlobal_List2() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.EventSubscriptionsListGlobalByResourceGroup(SubscriptionId, ResourceGroupName, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?), onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null,Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?)}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?) }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / nextLink + var result = await response; + WriteObject(result.Value,true); + _nextLink = result.NextLink; + if (_isFirst) + { + _isFirst = false; + while (_nextLink != null) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.EventSubscriptionsListGlobalByResourceGroup_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridEventSubscriptionGlobal_List3.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridEventSubscriptionGlobal_List3.cs new file mode 100644 index 000000000000..29a16db1bbf6 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridEventSubscriptionGlobal_List3.cs @@ -0,0 +1,458 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// + /// List all global event subscriptions under a resource group for a specific topic type. + /// + /// + /// [OpenAPI] ListGlobalByResourceGroupForTopicType=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topicTypes/{topicTypeName}/eventSubscriptions" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridEventSubscriptionGlobal_List3")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"List all global event subscriptions under a resource group for a specific topic type.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridEventSubscriptionGlobal_List3 : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A flag to tell whether it is the first onOK call. + private bool _isFirst = true; + + /// Link to retrieve next page. + private string _nextLink; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _filter; + + /// + /// 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'. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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'.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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'.", + SerializedName = @"$filter", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Query)] + public string Filter { get => this._filter; set => this._filter = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private int _top; + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"$top", + PossibleTypes = new [] { typeof(int) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Query)] + public int Top { get => this._top; set => this._top = value; } + + /// Backing field for property. + private string _topicTypeName; + + /// Name of the topic type. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the topic type.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the topic type.", + SerializedName = @"topicTypeName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string TopicTypeName { get => this._topicTypeName; set => this._topicTypeName = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridEventSubscriptionGlobal_List3() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.EventSubscriptionsListGlobalByResourceGroupForTopicType(SubscriptionId, ResourceGroupName, TopicTypeName, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?), onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,TopicTypeName=TopicTypeName,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null,Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?)}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, TopicTypeName=TopicTypeName, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?) }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / nextLink + var result = await response; + WriteObject(result.Value,true); + _nextLink = result.NextLink; + if (_isFirst) + { + _isFirst = false; + while (_nextLink != null) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.EventSubscriptionsListGlobalByResourceGroupForTopicType_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridEventSubscriptionRegional_List.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridEventSubscriptionRegional_List.cs new file mode 100644 index 000000000000..37567c92f57d --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridEventSubscriptionRegional_List.cs @@ -0,0 +1,444 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// + /// List all event subscriptions from the given location under a specific Azure subscription. + /// + /// + /// [OpenAPI] ListRegionalBySubscription=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/locations/{location}/eventSubscriptions" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridEventSubscriptionRegional_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"List all event subscriptions from the given location under a specific Azure subscription.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridEventSubscriptionRegional_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A flag to tell whether it is the first onOK call. + private bool _isFirst = true; + + /// Link to retrieve next page. + private string _nextLink; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _filter; + + /// + /// 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'. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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'.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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'.", + SerializedName = @"$filter", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Query)] + public string Filter { get => this._filter; set => this._filter = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _location; + + /// Name of the location. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the location.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the location.", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string Location { get => this._location; set => this._location = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private int _top; + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"$top", + PossibleTypes = new [] { typeof(int) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Query)] + public int Top { get => this._top; set => this._top = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridEventSubscriptionRegional_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.EventSubscriptionsListRegionalBySubscription(SubscriptionId, Location, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?), onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,Location=Location,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null,Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?)}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, Location=Location, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?) }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / nextLink + var result = await response; + WriteObject(result.Value,true); + _nextLink = result.NextLink; + if (_isFirst) + { + _isFirst = false; + while (_nextLink != null) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.EventSubscriptionsListRegionalBySubscription_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridEventSubscriptionRegional_List1.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridEventSubscriptionRegional_List1.cs new file mode 100644 index 000000000000..678397c95616 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridEventSubscriptionRegional_List1.cs @@ -0,0 +1,458 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// + /// List all event subscriptions from the given location under a specific Azure subscription and resource group. + /// + /// + /// [OpenAPI] ListRegionalByResourceGroup=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/locations/{location}/eventSubscriptions" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridEventSubscriptionRegional_List1")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"List all event subscriptions from the given location under a specific Azure subscription and resource group.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridEventSubscriptionRegional_List1 : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A flag to tell whether it is the first onOK call. + private bool _isFirst = true; + + /// Link to retrieve next page. + private string _nextLink; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _filter; + + /// + /// 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'. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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'.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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'.", + SerializedName = @"$filter", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Query)] + public string Filter { get => this._filter; set => this._filter = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _location; + + /// Name of the location. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the location.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the location.", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string Location { get => this._location; set => this._location = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private int _top; + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"$top", + PossibleTypes = new [] { typeof(int) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Query)] + public int Top { get => this._top; set => this._top = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridEventSubscriptionRegional_List1() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.EventSubscriptionsListRegionalByResourceGroup(SubscriptionId, ResourceGroupName, Location, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?), onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Location=Location,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null,Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?)}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Location=Location, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?) }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / nextLink + var result = await response; + WriteObject(result.Value,true); + _nextLink = result.NextLink; + if (_isFirst) + { + _isFirst = false; + while (_nextLink != null) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.EventSubscriptionsListRegionalByResourceGroup_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridEventSubscriptionRegional_List2.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridEventSubscriptionRegional_List2.cs new file mode 100644 index 000000000000..cde3d4a94966 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridEventSubscriptionRegional_List2.cs @@ -0,0 +1,458 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// + /// List all event subscriptions from the given location under a specific Azure subscription and topic type. + /// + /// + /// [OpenAPI] ListRegionalBySubscriptionForTopicType=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/locations/{location}/topicTypes/{topicTypeName}/eventSubscriptions" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridEventSubscriptionRegional_List2")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"List all event subscriptions from the given location under a specific Azure subscription and topic type.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridEventSubscriptionRegional_List2 : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A flag to tell whether it is the first onOK call. + private bool _isFirst = true; + + /// Link to retrieve next page. + private string _nextLink; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _filter; + + /// + /// 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'. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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'.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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'.", + SerializedName = @"$filter", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Query)] + public string Filter { get => this._filter; set => this._filter = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _location; + + /// Name of the location. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the location.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the location.", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string Location { get => this._location; set => this._location = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private int _top; + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"$top", + PossibleTypes = new [] { typeof(int) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Query)] + public int Top { get => this._top; set => this._top = value; } + + /// Backing field for property. + private string _topicTypeName; + + /// Name of the topic type. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the topic type.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the topic type.", + SerializedName = @"topicTypeName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string TopicTypeName { get => this._topicTypeName; set => this._topicTypeName = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridEventSubscriptionRegional_List2() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.EventSubscriptionsListRegionalBySubscriptionForTopicType(SubscriptionId, Location, TopicTypeName, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?), onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,Location=Location,TopicTypeName=TopicTypeName,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null,Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?)}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, Location=Location, TopicTypeName=TopicTypeName, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?) }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / nextLink + var result = await response; + WriteObject(result.Value,true); + _nextLink = result.NextLink; + if (_isFirst) + { + _isFirst = false; + while (_nextLink != null) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.EventSubscriptionsListRegionalBySubscriptionForTopicType_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridEventSubscriptionRegional_List3.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridEventSubscriptionRegional_List3.cs new file mode 100644 index 000000000000..1b442e614b41 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridEventSubscriptionRegional_List3.cs @@ -0,0 +1,473 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// + /// List all event subscriptions from the given location under a specific Azure subscription and resource group and topic + /// type. + /// + /// + /// [OpenAPI] ListRegionalByResourceGroupForTopicType=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/locations/{location}/topicTypes/{topicTypeName}/eventSubscriptions" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridEventSubscriptionRegional_List3")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"List all event subscriptions from the given location under a specific Azure subscription and resource group and topic type.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridEventSubscriptionRegional_List3 : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A flag to tell whether it is the first onOK call. + private bool _isFirst = true; + + /// Link to retrieve next page. + private string _nextLink; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _filter; + + /// + /// 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'. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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'.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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'.", + SerializedName = @"$filter", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Query)] + public string Filter { get => this._filter; set => this._filter = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _location; + + /// Name of the location. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the location.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the location.", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string Location { get => this._location; set => this._location = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private int _top; + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"$top", + PossibleTypes = new [] { typeof(int) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Query)] + public int Top { get => this._top; set => this._top = value; } + + /// Backing field for property. + private string _topicTypeName; + + /// Name of the topic type. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the topic type.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the topic type.", + SerializedName = @"topicTypeName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string TopicTypeName { get => this._topicTypeName; set => this._topicTypeName = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridEventSubscriptionRegional_List3() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.EventSubscriptionsListRegionalByResourceGroupForTopicType(SubscriptionId, ResourceGroupName, Location, TopicTypeName, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?), onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Location=Location,TopicTypeName=TopicTypeName,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null,Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?)}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Location=Location, TopicTypeName=TopicTypeName, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?) }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / nextLink + var result = await response; + WriteObject(result.Value,true); + _nextLink = result.NextLink; + if (_isFirst) + { + _isFirst = false; + while (_nextLink != null) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.EventSubscriptionsListRegionalByResourceGroupForTopicType_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridEventSubscription_Get.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridEventSubscription_Get.cs new file mode 100644 index 000000000000..17d8b2c1ab3a --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridEventSubscription_Get.cs @@ -0,0 +1,380 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Get properties of an event subscription. + /// + /// [OpenAPI] Get=>GET:"/{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridEventSubscription_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Get properties of an event subscription.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridEventSubscription_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the event subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the event subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the event subscription.", + SerializedName = @"eventSubscriptionName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("EventSubscriptionName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' + /// for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' + /// for an EventGrid topic. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic.", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string Scope { get => this._scope; set => this._scope = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridEventSubscription_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.EventSubscriptionsGet(Scope, Name, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope, Name=Name }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridEventSubscription_GetViaIdentity.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridEventSubscription_GetViaIdentity.cs new file mode 100644 index 000000000000..0e04813c5ed1 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridEventSubscription_GetViaIdentity.cs @@ -0,0 +1,369 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Get properties of an event subscription. + /// + /// [OpenAPI] Get=>GET:"/{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridEventSubscription_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Get properties of an event subscription.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridEventSubscription_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridEventSubscription_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.EventSubscriptionsGetViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.Scope) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.Scope"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.EventSubscriptionName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.EventSubscriptionName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.EventSubscriptionsGet(InputObject.Scope ?? null, InputObject.EventSubscriptionName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridEventSubscription_List.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridEventSubscription_List.cs new file mode 100644 index 000000000000..97301ecd7ac8 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridEventSubscription_List.cs @@ -0,0 +1,484 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// List all event subscriptions that have been created for a specific resource. + /// + /// [OpenAPI] ListByResource=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{providerNamespace}/{resourceTypeName}/{resourceName}/providers/Microsoft.EventGrid/eventSubscriptions" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridEventSubscription_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"List all event subscriptions that have been created for a specific resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridEventSubscription_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A flag to tell whether it is the first onOK call. + private bool _isFirst = true; + + /// Link to retrieve next page. + private string _nextLink; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _filter; + + /// + /// 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'. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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'.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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'.", + SerializedName = @"$filter", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Query)] + public string Filter { get => this._filter; set => this._filter = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private string _providerNamespace; + + /// Namespace of the provider of the topic. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Namespace of the provider of the topic.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Namespace of the provider of the topic.", + SerializedName = @"providerNamespace", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ProviderNamespace { get => this._providerNamespace; set => this._providerNamespace = value; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _resourceName; + + /// Name of the resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceName { get => this._resourceName; set => this._resourceName = value; } + + /// Backing field for property. + private string _resourceTypeName; + + /// Name of the resource type. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the resource type.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the resource type.", + SerializedName = @"resourceTypeName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceTypeName { get => this._resourceTypeName; set => this._resourceTypeName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private int _top; + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"$top", + PossibleTypes = new [] { typeof(int) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Query)] + public int Top { get => this._top; set => this._top = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridEventSubscription_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.EventSubscriptionsListByResource(SubscriptionId, ResourceGroupName, ProviderNamespace, ResourceTypeName, ResourceName, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?), onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ProviderNamespace=ProviderNamespace,ResourceTypeName=ResourceTypeName,ResourceName=ResourceName,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null,Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?)}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ProviderNamespace=ProviderNamespace, ResourceTypeName=ResourceTypeName, ResourceName=ResourceName, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?) }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / nextLink + var result = await response; + WriteObject(result.Value,true); + _nextLink = result.NextLink; + if (_isFirst) + { + _isFirst = false; + while (_nextLink != null) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.EventSubscriptionsListByResource_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridEventSubscription_List1.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridEventSubscription_List1.cs new file mode 100644 index 000000000000..ea12486db0b3 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridEventSubscription_List1.cs @@ -0,0 +1,472 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// + /// List all event subscriptions that have been created for a specific domain topic. + /// + /// + /// [OpenAPI] ListByDomainTopic=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/topics/{topicName}/providers/Microsoft.EventGrid/eventSubscriptions" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridEventSubscription_List1")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"List all event subscriptions that have been created for a specific domain topic.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridEventSubscription_List1 : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A flag to tell whether it is the first onOK call. + private bool _isFirst = true; + + /// Link to retrieve next page. + private string _nextLink; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _domainName; + + /// Name of the top level domain. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the top level domain.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the top level domain.", + SerializedName = @"domainName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string DomainName { get => this._domainName; set => this._domainName = value; } + + /// Backing field for property. + private string _filter; + + /// + /// 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'. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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'.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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'.", + SerializedName = @"$filter", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Query)] + public string Filter { get => this._filter; set => this._filter = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private int _top; + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"$top", + PossibleTypes = new [] { typeof(int) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Query)] + public int Top { get => this._top; set => this._top = value; } + + /// Backing field for property. + private string _topicName; + + /// Name of the domain topic. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the domain topic.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the domain topic.", + SerializedName = @"topicName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string TopicName { get => this._topicName; set => this._topicName = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridEventSubscription_List1() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.EventSubscriptionsListByDomainTopic(SubscriptionId, ResourceGroupName, DomainName, TopicName, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?), onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,DomainName=DomainName,TopicName=TopicName,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null,Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?)}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, DomainName=DomainName, TopicName=TopicName, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?) }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / nextLink + var result = await response; + WriteObject(result.Value,true); + _nextLink = result.NextLink; + if (_isFirst) + { + _isFirst = false; + while (_nextLink != null) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.EventSubscriptionsListByDomainTopic_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridExtensionTopic_Get.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridExtensionTopic_Get.cs new file mode 100644 index 000000000000..133e799897c7 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridExtensionTopic_Get.cs @@ -0,0 +1,364 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Get the properties of an extension topic. + /// + /// [OpenAPI] Get=>GET:"/{scope}/providers/Microsoft.EventGrid/extensionTopics/default" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridExtensionTopic_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtensionTopic))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Get the properties of an extension topic.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridExtensionTopic_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' + /// for Azure resource. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for Azure resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for Azure resource.", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string Scope { get => this._scope; set => this._scope = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridExtensionTopic_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ExtensionTopicsGet(Scope, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtensionTopic + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridExtensionTopic_GetViaIdentity.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridExtensionTopic_GetViaIdentity.cs new file mode 100644 index 000000000000..7df1684b2247 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridExtensionTopic_GetViaIdentity.cs @@ -0,0 +1,365 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Get the properties of an extension topic. + /// + /// [OpenAPI] Get=>GET:"/{scope}/providers/Microsoft.EventGrid/extensionTopics/default" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridExtensionTopic_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtensionTopic))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Get the properties of an extension topic.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridExtensionTopic_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridExtensionTopic_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ExtensionTopicsGetViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.Scope) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.Scope"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.ExtensionTopicsGet(InputObject.Scope ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IExtensionTopic + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridOperation_List.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridOperation_List.cs new file mode 100644 index 000000000000..d941874137fa --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridOperation_List.cs @@ -0,0 +1,349 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// + /// List the available operations supported by the Microsoft.EventGrid resource provider. + /// + /// + /// [OpenAPI] List=>GET:"/providers/Microsoft.EventGrid/operations" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridOperation_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperation))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"List the available operations supported by the Microsoft.EventGrid resource provider.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridOperation_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridOperation_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.OperationsList(onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / + WriteObject((await response).Value, true); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPartnerConfiguration_Get.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPartnerConfiguration_Get.cs new file mode 100644 index 000000000000..006cfdf00425 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPartnerConfiguration_Get.cs @@ -0,0 +1,383 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Get properties of a partner configuration. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerConfigurations/default" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridPartnerConfiguration_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfiguration))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Get properties of a partner configuration.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridPartnerConfiguration_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridPartnerConfiguration_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.PartnerConfigurationsGet(SubscriptionId, ResourceGroupName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfiguration + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPartnerConfiguration_GetViaIdentity.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPartnerConfiguration_GetViaIdentity.cs new file mode 100644 index 000000000000..9b10f8296a5e --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPartnerConfiguration_GetViaIdentity.cs @@ -0,0 +1,369 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Get properties of a partner configuration. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerConfigurations/default" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridPartnerConfiguration_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfiguration))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Get properties of a partner configuration.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridPartnerConfiguration_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridPartnerConfiguration_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.PartnerConfigurationsGetViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.PartnerConfigurationsGet(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfiguration + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPartnerConfiguration_List.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPartnerConfiguration_List.cs new file mode 100644 index 000000000000..22dce753f185 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPartnerConfiguration_List.cs @@ -0,0 +1,384 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// List all the partner configurations under a resource group. + /// + /// [OpenAPI] ListByResourceGroup=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerConfigurations" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridPartnerConfiguration_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfiguration))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"List all the partner configurations under a resource group.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridPartnerConfiguration_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridPartnerConfiguration_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.PartnerConfigurationsListByResourceGroup(SubscriptionId, ResourceGroupName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / + WriteObject((await response).Value, true); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPartnerConfiguration_List1.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPartnerConfiguration_List1.cs new file mode 100644 index 000000000000..89a80f1d4dbe --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPartnerConfiguration_List1.cs @@ -0,0 +1,428 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// List all the partner configurations under an Azure subscription. + /// + /// [OpenAPI] ListBySubscription=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/partnerConfigurations" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridPartnerConfiguration_List1")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfiguration))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"List all the partner configurations under an Azure subscription.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridPartnerConfiguration_List1 : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A flag to tell whether it is the first onOK call. + private bool _isFirst = true; + + /// Link to retrieve next page. + private string _nextLink; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _filter; + + /// + /// 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'. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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'.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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'.", + SerializedName = @"$filter", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Query)] + public string Filter { get => this._filter; set => this._filter = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private int _top; + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"$top", + PossibleTypes = new [] { typeof(int) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Query)] + public int Top { get => this._top; set => this._top = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridPartnerConfiguration_List1() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.PartnerConfigurationsListBySubscription(SubscriptionId, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?), onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null,Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?)}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?) }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / nextLink + var result = await response; + WriteObject(result.Value,true); + _nextLink = result.NextLink; + if (_isFirst) + { + _isFirst = false; + while (_nextLink != null) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.PartnerConfigurationsListBySubscription_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPartnerDestination_Get.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPartnerDestination_Get.cs new file mode 100644 index 000000000000..39ee17ee9ab4 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPartnerDestination_Get.cs @@ -0,0 +1,398 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Get properties of a partner destination. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerDestinations/{partnerDestinationName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridPartnerDestination_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestination))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Get properties of a partner destination.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridPartnerDestination_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the partner destination. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the partner destination.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the partner destination.", + SerializedName = @"partnerDestinationName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("PartnerDestinationName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridPartnerDestination_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.PartnerDestinationsGet(SubscriptionId, ResourceGroupName, Name, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestination + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPartnerDestination_GetViaIdentity.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPartnerDestination_GetViaIdentity.cs new file mode 100644 index 000000000000..026efcf00c6e --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPartnerDestination_GetViaIdentity.cs @@ -0,0 +1,373 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Get properties of a partner destination. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerDestinations/{partnerDestinationName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridPartnerDestination_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestination))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Get properties of a partner destination.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridPartnerDestination_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridPartnerDestination_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.PartnerDestinationsGetViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.PartnerDestinationName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.PartnerDestinationName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.PartnerDestinationsGet(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.PartnerDestinationName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestination + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPartnerDestination_List.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPartnerDestination_List.cs new file mode 100644 index 000000000000..a2e694f25c9f --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPartnerDestination_List.cs @@ -0,0 +1,428 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// List all the partner destinations under an Azure subscription. + /// + /// [OpenAPI] ListBySubscription=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/partnerDestinations" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridPartnerDestination_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestination))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"List all the partner destinations under an Azure subscription.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridPartnerDestination_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A flag to tell whether it is the first onOK call. + private bool _isFirst = true; + + /// Link to retrieve next page. + private string _nextLink; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _filter; + + /// + /// 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'. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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'.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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'.", + SerializedName = @"$filter", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Query)] + public string Filter { get => this._filter; set => this._filter = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private int _top; + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"$top", + PossibleTypes = new [] { typeof(int) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Query)] + public int Top { get => this._top; set => this._top = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridPartnerDestination_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.PartnerDestinationsListBySubscription(SubscriptionId, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?), onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null,Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?)}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?) }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / nextLink + var result = await response; + WriteObject(result.Value,true); + _nextLink = result.NextLink; + if (_isFirst) + { + _isFirst = false; + while (_nextLink != null) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.PartnerDestinationsListBySubscription_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPartnerDestination_List1.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPartnerDestination_List1.cs new file mode 100644 index 000000000000..370429f03c30 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPartnerDestination_List1.cs @@ -0,0 +1,442 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// List all the partner destinations under a resource group. + /// + /// [OpenAPI] ListByResourceGroup=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerDestinations" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridPartnerDestination_List1")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestination))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"List all the partner destinations under a resource group.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridPartnerDestination_List1 : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A flag to tell whether it is the first onOK call. + private bool _isFirst = true; + + /// Link to retrieve next page. + private string _nextLink; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _filter; + + /// + /// 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'. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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'.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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'.", + SerializedName = @"$filter", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Query)] + public string Filter { get => this._filter; set => this._filter = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private int _top; + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"$top", + PossibleTypes = new [] { typeof(int) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Query)] + public int Top { get => this._top; set => this._top = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridPartnerDestination_List1() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.PartnerDestinationsListByResourceGroup(SubscriptionId, ResourceGroupName, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?), onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null,Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?)}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?) }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / nextLink + var result = await response; + WriteObject(result.Value,true); + _nextLink = result.NextLink; + if (_isFirst) + { + _isFirst = false; + while (_nextLink != null) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.PartnerDestinationsListByResourceGroup_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPartnerNamespaceSharedAccessKey_List.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPartnerNamespaceSharedAccessKey_List.cs new file mode 100644 index 000000000000..727fb68cac41 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPartnerNamespaceSharedAccessKey_List.cs @@ -0,0 +1,400 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// List the two keys used to publish to a partner namespace. + /// + /// [OpenAPI] ListSharedAccessKeys=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerNamespaces/{partnerNamespaceName}/listKeys" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridPartnerNamespaceSharedAccessKey_List", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceSharedAccessKeys))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"List the two keys used to publish to a partner namespace.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridPartnerNamespaceSharedAccessKey_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _partnerNamespaceName; + + /// Name of the partner namespace. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the partner namespace.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the partner namespace.", + SerializedName = @"partnerNamespaceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string PartnerNamespaceName { get => this._partnerNamespaceName; set => this._partnerNamespaceName = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridPartnerNamespaceSharedAccessKey_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'PartnerNamespacesListSharedAccessKeys' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.PartnerNamespacesListSharedAccessKeys(SubscriptionId, ResourceGroupName, PartnerNamespaceName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PartnerNamespaceName=PartnerNamespaceName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PartnerNamespaceName=PartnerNamespaceName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceSharedAccessKeys + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPartnerNamespace_Get.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPartnerNamespace_Get.cs new file mode 100644 index 000000000000..e17eb846fefb --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPartnerNamespace_Get.cs @@ -0,0 +1,398 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Get properties of a partner namespace. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerNamespaces/{partnerNamespaceName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridPartnerNamespace_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespace))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Get properties of a partner namespace.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridPartnerNamespace_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the partner namespace. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the partner namespace.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the partner namespace.", + SerializedName = @"partnerNamespaceName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("PartnerNamespaceName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridPartnerNamespace_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.PartnerNamespacesGet(SubscriptionId, ResourceGroupName, Name, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespace + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPartnerNamespace_GetViaIdentity.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPartnerNamespace_GetViaIdentity.cs new file mode 100644 index 000000000000..3adebe11e3ad --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPartnerNamespace_GetViaIdentity.cs @@ -0,0 +1,373 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Get properties of a partner namespace. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerNamespaces/{partnerNamespaceName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridPartnerNamespace_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespace))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Get properties of a partner namespace.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridPartnerNamespace_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridPartnerNamespace_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.PartnerNamespacesGetViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.PartnerNamespaceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.PartnerNamespaceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.PartnerNamespacesGet(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.PartnerNamespaceName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespace + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPartnerNamespace_List.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPartnerNamespace_List.cs new file mode 100644 index 000000000000..5aefbe6c9d3c --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPartnerNamespace_List.cs @@ -0,0 +1,428 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// List all the partner namespaces under an Azure subscription. + /// + /// [OpenAPI] ListBySubscription=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/partnerNamespaces" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridPartnerNamespace_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespace))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"List all the partner namespaces under an Azure subscription.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridPartnerNamespace_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A flag to tell whether it is the first onOK call. + private bool _isFirst = true; + + /// Link to retrieve next page. + private string _nextLink; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _filter; + + /// + /// 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'. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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'.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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'.", + SerializedName = @"$filter", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Query)] + public string Filter { get => this._filter; set => this._filter = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private int _top; + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"$top", + PossibleTypes = new [] { typeof(int) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Query)] + public int Top { get => this._top; set => this._top = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridPartnerNamespace_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.PartnerNamespacesListBySubscription(SubscriptionId, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?), onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null,Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?)}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?) }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / nextLink + var result = await response; + WriteObject(result.Value,true); + _nextLink = result.NextLink; + if (_isFirst) + { + _isFirst = false; + while (_nextLink != null) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.PartnerNamespacesListBySubscription_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPartnerNamespace_List1.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPartnerNamespace_List1.cs new file mode 100644 index 000000000000..dec3cab8266d --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPartnerNamespace_List1.cs @@ -0,0 +1,442 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// List all the partner namespaces under a resource group. + /// + /// [OpenAPI] ListByResourceGroup=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerNamespaces" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridPartnerNamespace_List1")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespace))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"List all the partner namespaces under a resource group.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridPartnerNamespace_List1 : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A flag to tell whether it is the first onOK call. + private bool _isFirst = true; + + /// Link to retrieve next page. + private string _nextLink; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _filter; + + /// + /// 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'. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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'.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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'.", + SerializedName = @"$filter", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Query)] + public string Filter { get => this._filter; set => this._filter = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private int _top; + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"$top", + PossibleTypes = new [] { typeof(int) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Query)] + public int Top { get => this._top; set => this._top = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridPartnerNamespace_List1() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.PartnerNamespacesListByResourceGroup(SubscriptionId, ResourceGroupName, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?), onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null,Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?)}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?) }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / nextLink + var result = await response; + WriteObject(result.Value,true); + _nextLink = result.NextLink; + if (_isFirst) + { + _isFirst = false; + while (_nextLink != null) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.PartnerNamespacesListByResourceGroup_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPartnerRegistration_Get.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPartnerRegistration_Get.cs new file mode 100644 index 000000000000..f5b93e31ed92 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPartnerRegistration_Get.cs @@ -0,0 +1,398 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Gets a partner registration with the specified parameters. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerRegistrations/{partnerRegistrationName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridPartnerRegistration_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistration))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Gets a partner registration with the specified parameters.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridPartnerRegistration_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the partner registration. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the partner registration.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the partner registration.", + SerializedName = @"partnerRegistrationName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("PartnerRegistrationName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridPartnerRegistration_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.PartnerRegistrationsGet(SubscriptionId, ResourceGroupName, Name, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistration + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPartnerRegistration_GetViaIdentity.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPartnerRegistration_GetViaIdentity.cs new file mode 100644 index 000000000000..d325e13679d2 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPartnerRegistration_GetViaIdentity.cs @@ -0,0 +1,373 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Gets a partner registration with the specified parameters. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerRegistrations/{partnerRegistrationName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridPartnerRegistration_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistration))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Gets a partner registration with the specified parameters.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridPartnerRegistration_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridPartnerRegistration_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.PartnerRegistrationsGetViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.PartnerRegistrationName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.PartnerRegistrationName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.PartnerRegistrationsGet(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.PartnerRegistrationName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistration + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPartnerRegistration_List.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPartnerRegistration_List.cs new file mode 100644 index 000000000000..856fc859ebca --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPartnerRegistration_List.cs @@ -0,0 +1,428 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// List all the partner registrations under an Azure subscription. + /// + /// [OpenAPI] ListBySubscription=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/partnerRegistrations" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridPartnerRegistration_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistration))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"List all the partner registrations under an Azure subscription.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridPartnerRegistration_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A flag to tell whether it is the first onOK call. + private bool _isFirst = true; + + /// Link to retrieve next page. + private string _nextLink; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _filter; + + /// + /// 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'. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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'.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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'.", + SerializedName = @"$filter", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Query)] + public string Filter { get => this._filter; set => this._filter = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private int _top; + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"$top", + PossibleTypes = new [] { typeof(int) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Query)] + public int Top { get => this._top; set => this._top = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridPartnerRegistration_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.PartnerRegistrationsListBySubscription(SubscriptionId, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?), onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null,Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?)}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?) }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / nextLink + var result = await response; + WriteObject(result.Value,true); + _nextLink = result.NextLink; + if (_isFirst) + { + _isFirst = false; + while (_nextLink != null) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.PartnerRegistrationsListBySubscription_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPartnerRegistration_List1.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPartnerRegistration_List1.cs new file mode 100644 index 000000000000..959db543ca25 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPartnerRegistration_List1.cs @@ -0,0 +1,442 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// List all the partner registrations under a resource group. + /// + /// [OpenAPI] ListByResourceGroup=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerRegistrations" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridPartnerRegistration_List1")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistration))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"List all the partner registrations under a resource group.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridPartnerRegistration_List1 : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A flag to tell whether it is the first onOK call. + private bool _isFirst = true; + + /// Link to retrieve next page. + private string _nextLink; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _filter; + + /// + /// 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'. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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'.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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'.", + SerializedName = @"$filter", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Query)] + public string Filter { get => this._filter; set => this._filter = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private int _top; + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"$top", + PossibleTypes = new [] { typeof(int) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Query)] + public int Top { get => this._top; set => this._top = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridPartnerRegistration_List1() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.PartnerRegistrationsListByResourceGroup(SubscriptionId, ResourceGroupName, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?), onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null,Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?)}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?) }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / nextLink + var result = await response; + WriteObject(result.Value,true); + _nextLink = result.NextLink; + if (_isFirst) + { + _isFirst = false; + while (_nextLink != null) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.PartnerRegistrationsListByResourceGroup_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPartnerTopicEventSubscriptionDeliveryAttribute_Get.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPartnerTopicEventSubscriptionDeliveryAttribute_Get.cs new file mode 100644 index 000000000000..0a6a1bde36ba --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPartnerTopicEventSubscriptionDeliveryAttribute_Get.cs @@ -0,0 +1,419 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Get all delivery attributes for an event subscription of a partner topic. + /// + /// [OpenAPI] GetDeliveryAttributes=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerTopics/{partnerTopicName}/eventSubscriptions/{eventSubscriptionName}/getDeliveryAttributes" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridPartnerTopicEventSubscriptionDeliveryAttribute_Get", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Get all delivery attributes for an event subscription of a partner topic.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridPartnerTopicEventSubscriptionDeliveryAttribute_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _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. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "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.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"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.", + SerializedName = @"eventSubscriptionName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string EventSubscriptionName { get => this._eventSubscriptionName; set => this._eventSubscriptionName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _partnerTopicName; + + /// Name of the partner topic. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the partner topic.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the partner topic.", + SerializedName = @"partnerTopicName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string PartnerTopicName { get => this._partnerTopicName; set => this._partnerTopicName = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet + /// class. + /// + public GetAzEventGridPartnerTopicEventSubscriptionDeliveryAttribute_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'PartnerTopicEventSubscriptionsGetDeliveryAttributes' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.PartnerTopicEventSubscriptionsGetDeliveryAttributes(SubscriptionId, ResourceGroupName, PartnerTopicName, EventSubscriptionName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PartnerTopicName=PartnerTopicName,EventSubscriptionName=EventSubscriptionName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PartnerTopicName=PartnerTopicName, EventSubscriptionName=EventSubscriptionName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // nested-array / value / + WriteObject((await response).Value, true); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPartnerTopicEventSubscriptionDeliveryAttribute_GetViaIdentity.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPartnerTopicEventSubscriptionDeliveryAttribute_GetViaIdentity.cs new file mode 100644 index 000000000000..e431036456a5 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPartnerTopicEventSubscriptionDeliveryAttribute_GetViaIdentity.cs @@ -0,0 +1,382 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Get all delivery attributes for an event subscription of a partner topic. + /// + /// [OpenAPI] GetDeliveryAttributes=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerTopics/{partnerTopicName}/eventSubscriptions/{eventSubscriptionName}/getDeliveryAttributes" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridPartnerTopicEventSubscriptionDeliveryAttribute_GetViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Get all delivery attributes for an event subscription of a partner topic.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridPartnerTopicEventSubscriptionDeliveryAttribute_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridPartnerTopicEventSubscriptionDeliveryAttribute_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'PartnerTopicEventSubscriptionsGetDeliveryAttributes' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.PartnerTopicEventSubscriptionsGetDeliveryAttributesViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.PartnerTopicName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.PartnerTopicName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.EventSubscriptionName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.EventSubscriptionName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.PartnerTopicEventSubscriptionsGetDeliveryAttributes(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.PartnerTopicName ?? null, InputObject.EventSubscriptionName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // nested-array / value / + WriteObject((await response).Value, true); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPartnerTopicEventSubscriptionFullUrl_Get.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPartnerTopicEventSubscriptionFullUrl_Get.cs new file mode 100644 index 000000000000..1547255d481e --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPartnerTopicEventSubscriptionFullUrl_Get.cs @@ -0,0 +1,417 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Get the full endpoint URL for an event subscription of a partner topic. + /// + /// [OpenAPI] GetFullUrl=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerTopics/{partnerTopicName}/eventSubscriptions/{eventSubscriptionName}/getFullUrl" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridPartnerTopicEventSubscriptionFullUrl_Get", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(string))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Get the full endpoint URL for an event subscription of a partner topic.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridPartnerTopicEventSubscriptionFullUrl_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _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. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "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.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"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.", + SerializedName = @"eventSubscriptionName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string EventSubscriptionName { get => this._eventSubscriptionName; set => this._eventSubscriptionName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _partnerTopicName; + + /// Name of the partner topic. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the partner topic.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the partner topic.", + SerializedName = @"partnerTopicName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string PartnerTopicName { get => this._partnerTopicName; set => this._partnerTopicName = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridPartnerTopicEventSubscriptionFullUrl_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'PartnerTopicEventSubscriptionsGetFullUrl' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.PartnerTopicEventSubscriptionsGetFullUrl(SubscriptionId, ResourceGroupName, PartnerTopicName, EventSubscriptionName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PartnerTopicName=PartnerTopicName,EventSubscriptionName=EventSubscriptionName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PartnerTopicName=PartnerTopicName, EventSubscriptionName=EventSubscriptionName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFullUrl + WriteObject((await response).EndpointUrl); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPartnerTopicEventSubscriptionFullUrl_GetViaIdentity.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPartnerTopicEventSubscriptionFullUrl_GetViaIdentity.cs new file mode 100644 index 000000000000..27f53cd12b31 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPartnerTopicEventSubscriptionFullUrl_GetViaIdentity.cs @@ -0,0 +1,381 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Get the full endpoint URL for an event subscription of a partner topic. + /// + /// [OpenAPI] GetFullUrl=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerTopics/{partnerTopicName}/eventSubscriptions/{eventSubscriptionName}/getFullUrl" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridPartnerTopicEventSubscriptionFullUrl_GetViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(string))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Get the full endpoint URL for an event subscription of a partner topic.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridPartnerTopicEventSubscriptionFullUrl_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet + /// class. + /// + public GetAzEventGridPartnerTopicEventSubscriptionFullUrl_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'PartnerTopicEventSubscriptionsGetFullUrl' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.PartnerTopicEventSubscriptionsGetFullUrlViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.PartnerTopicName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.PartnerTopicName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.EventSubscriptionName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.EventSubscriptionName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.PartnerTopicEventSubscriptionsGetFullUrl(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.PartnerTopicName ?? null, InputObject.EventSubscriptionName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFullUrl + WriteObject((await response).EndpointUrl); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPartnerTopicEventSubscription_Get.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPartnerTopicEventSubscription_Get.cs new file mode 100644 index 000000000000..fc6ad3261844 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPartnerTopicEventSubscription_Get.cs @@ -0,0 +1,414 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Get properties of an event subscription of a partner topic. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerTopics/{partnerTopicName}/eventSubscriptions/{eventSubscriptionName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridPartnerTopicEventSubscription_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Get properties of an event subscription of a partner topic.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridPartnerTopicEventSubscription_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _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. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "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.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"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.", + SerializedName = @"eventSubscriptionName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string EventSubscriptionName { get => this._eventSubscriptionName; set => this._eventSubscriptionName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _partnerTopicName; + + /// Name of the partner topic. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the partner topic.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the partner topic.", + SerializedName = @"partnerTopicName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string PartnerTopicName { get => this._partnerTopicName; set => this._partnerTopicName = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridPartnerTopicEventSubscription_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.PartnerTopicEventSubscriptionsGet(SubscriptionId, ResourceGroupName, PartnerTopicName, EventSubscriptionName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PartnerTopicName=PartnerTopicName,EventSubscriptionName=EventSubscriptionName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PartnerTopicName=PartnerTopicName, EventSubscriptionName=EventSubscriptionName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPartnerTopicEventSubscription_GetViaIdentity.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPartnerTopicEventSubscription_GetViaIdentity.cs new file mode 100644 index 000000000000..f79059c68e82 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPartnerTopicEventSubscription_GetViaIdentity.cs @@ -0,0 +1,377 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Get properties of an event subscription of a partner topic. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerTopics/{partnerTopicName}/eventSubscriptions/{eventSubscriptionName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridPartnerTopicEventSubscription_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Get properties of an event subscription of a partner topic.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridPartnerTopicEventSubscription_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridPartnerTopicEventSubscription_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.PartnerTopicEventSubscriptionsGetViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.PartnerTopicName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.PartnerTopicName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.EventSubscriptionName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.EventSubscriptionName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.PartnerTopicEventSubscriptionsGet(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.PartnerTopicName ?? null, InputObject.EventSubscriptionName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPartnerTopicEventSubscription_List.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPartnerTopicEventSubscription_List.cs new file mode 100644 index 000000000000..7ea2535f0566 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPartnerTopicEventSubscription_List.cs @@ -0,0 +1,456 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// List event subscriptions that belong to a specific partner topic. + /// + /// [OpenAPI] ListByPartnerTopic=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerTopics/{partnerTopicName}/eventSubscriptions" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridPartnerTopicEventSubscription_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"List event subscriptions that belong to a specific partner topic.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridPartnerTopicEventSubscription_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A flag to tell whether it is the first onOK call. + private bool _isFirst = true; + + /// Link to retrieve next page. + private string _nextLink; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _filter; + + /// + /// 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'. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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'.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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'.", + SerializedName = @"$filter", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Query)] + public string Filter { get => this._filter; set => this._filter = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _partnerTopicName; + + /// Name of the partner topic. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the partner topic.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the partner topic.", + SerializedName = @"partnerTopicName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string PartnerTopicName { get => this._partnerTopicName; set => this._partnerTopicName = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private int _top; + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"$top", + PossibleTypes = new [] { typeof(int) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Query)] + public int Top { get => this._top; set => this._top = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridPartnerTopicEventSubscription_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.PartnerTopicEventSubscriptionsListByPartnerTopic(SubscriptionId, ResourceGroupName, PartnerTopicName, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?), onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PartnerTopicName=PartnerTopicName,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null,Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?)}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PartnerTopicName=PartnerTopicName, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?) }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / nextLink + var result = await response; + WriteObject(result.Value,true); + _nextLink = result.NextLink; + if (_isFirst) + { + _isFirst = false; + while (_nextLink != null) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.PartnerTopicEventSubscriptionsListByPartnerTopic_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPartnerTopic_Get.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPartnerTopic_Get.cs new file mode 100644 index 000000000000..cb8f3f7ad56b --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPartnerTopic_Get.cs @@ -0,0 +1,398 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Get properties of a partner topic. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerTopics/{partnerTopicName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridPartnerTopic_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopic))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Get properties of a partner topic.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridPartnerTopic_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the partner topic. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the partner topic.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the partner topic.", + SerializedName = @"partnerTopicName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("PartnerTopicName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridPartnerTopic_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.PartnerTopicsGet(SubscriptionId, ResourceGroupName, Name, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopic + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPartnerTopic_GetViaIdentity.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPartnerTopic_GetViaIdentity.cs new file mode 100644 index 000000000000..c07f1aec6a88 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPartnerTopic_GetViaIdentity.cs @@ -0,0 +1,373 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Get properties of a partner topic. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerTopics/{partnerTopicName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridPartnerTopic_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopic))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Get properties of a partner topic.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridPartnerTopic_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridPartnerTopic_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.PartnerTopicsGetViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.PartnerTopicName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.PartnerTopicName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.PartnerTopicsGet(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.PartnerTopicName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopic + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPartnerTopic_List.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPartnerTopic_List.cs new file mode 100644 index 000000000000..143965668999 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPartnerTopic_List.cs @@ -0,0 +1,428 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// List all the partner topics under an Azure subscription. + /// + /// [OpenAPI] ListBySubscription=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/partnerTopics" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridPartnerTopic_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopic))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"List all the partner topics under an Azure subscription.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridPartnerTopic_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A flag to tell whether it is the first onOK call. + private bool _isFirst = true; + + /// Link to retrieve next page. + private string _nextLink; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _filter; + + /// + /// 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'. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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'.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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'.", + SerializedName = @"$filter", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Query)] + public string Filter { get => this._filter; set => this._filter = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private int _top; + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"$top", + PossibleTypes = new [] { typeof(int) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Query)] + public int Top { get => this._top; set => this._top = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridPartnerTopic_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.PartnerTopicsListBySubscription(SubscriptionId, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?), onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null,Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?)}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?) }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / nextLink + var result = await response; + WriteObject(result.Value,true); + _nextLink = result.NextLink; + if (_isFirst) + { + _isFirst = false; + while (_nextLink != null) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.PartnerTopicsListBySubscription_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPartnerTopic_List1.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPartnerTopic_List1.cs new file mode 100644 index 000000000000..abfa97e55c94 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPartnerTopic_List1.cs @@ -0,0 +1,442 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// List all the partner topics under a resource group. + /// + /// [OpenAPI] ListByResourceGroup=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerTopics" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridPartnerTopic_List1")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopic))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"List all the partner topics under a resource group.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridPartnerTopic_List1 : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A flag to tell whether it is the first onOK call. + private bool _isFirst = true; + + /// Link to retrieve next page. + private string _nextLink; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _filter; + + /// + /// 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'. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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'.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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'.", + SerializedName = @"$filter", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Query)] + public string Filter { get => this._filter; set => this._filter = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private int _top; + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"$top", + PossibleTypes = new [] { typeof(int) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Query)] + public int Top { get => this._top; set => this._top = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridPartnerTopic_List1() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.PartnerTopicsListByResourceGroup(SubscriptionId, ResourceGroupName, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?), onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null,Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?)}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?) }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / nextLink + var result = await response; + WriteObject(result.Value,true); + _nextLink = result.NextLink; + if (_isFirst) + { + _isFirst = false; + while (_nextLink != null) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.PartnerTopicsListByResourceGroup_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPrivateEndpointConnection_Get.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPrivateEndpointConnection_Get.cs new file mode 100644 index 000000000000..a149dee6d08d --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPrivateEndpointConnection_Get.cs @@ -0,0 +1,433 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// + /// Get a specific private endpoint connection under a topic, domain, or partner namespace. + /// + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/{parentType}/{parentName}/privateEndpointConnections/{privateEndpointConnectionName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridPrivateEndpointConnection_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnection))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Get a specific private endpoint connection under a topic, domain, or partner namespace.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridPrivateEndpointConnection_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the private endpoint connection connection. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the private endpoint connection connection.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the private endpoint connection connection.", + SerializedName = @"privateEndpointConnectionName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("PrivateEndpointConnectionName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private string _parentName; + + /// + /// The name of the parent resource (namely, either, the topic name, domain name, or partner namespace name). + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the parent resource (namely, either, the topic name, domain name, or partner namespace name).")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the parent resource (namely, either, the topic name, domain name, or partner namespace name).", + SerializedName = @"parentName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ParentName { get => this._parentName; set => this._parentName = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ParentType _parentType; + + /// + /// The type of the parent resource. This can be either \'topics\', \'domains\', or \'partnerNamespaces\'. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The type of the parent resource. This can be either \\'topics\\', \\'domains\\', or \\'partnerNamespaces\\'.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The type of the parent resource. This can be either \'topics\', \'domains\', or \'partnerNamespaces\'.", + SerializedName = @"parentType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ParentType) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ParentType))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ParentType ParentType { get => this._parentType; set => this._parentType = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridPrivateEndpointConnection_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.PrivateEndpointConnectionsGet(SubscriptionId, ResourceGroupName, ParentType, ParentName, Name, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ParentType=ParentType,ParentName=ParentName,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ParentType=ParentType, ParentName=ParentName, Name=Name }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnection + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPrivateEndpointConnection_GetViaIdentity.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPrivateEndpointConnection_GetViaIdentity.cs new file mode 100644 index 000000000000..d820ead6c5e1 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPrivateEndpointConnection_GetViaIdentity.cs @@ -0,0 +1,383 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// + /// Get a specific private endpoint connection under a topic, domain, or partner namespace. + /// + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/{parentType}/{parentName}/privateEndpointConnections/{privateEndpointConnectionName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridPrivateEndpointConnection_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnection))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Get a specific private endpoint connection under a topic, domain, or partner namespace.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridPrivateEndpointConnection_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridPrivateEndpointConnection_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.PrivateEndpointConnectionsGetViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ParentType) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ParentType"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ParentName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ParentName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.PrivateEndpointConnectionName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.PrivateEndpointConnectionName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.PrivateEndpointConnectionsGet(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ParentType ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ParentType)""), InputObject.ParentName ?? null, InputObject.PrivateEndpointConnectionName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnection + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPrivateEndpointConnection_List.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPrivateEndpointConnection_List.cs new file mode 100644 index 000000000000..1d4c1dff52ea --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPrivateEndpointConnection_List.cs @@ -0,0 +1,477 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// + /// Get all private endpoint connections under a topic, domain, or partner namespace. + /// + /// + /// [OpenAPI] ListByResource=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/{parentType}/{parentName}/privateEndpointConnections" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridPrivateEndpointConnection_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateEndpointConnection))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Get all private endpoint connections under a topic, domain, or partner namespace.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridPrivateEndpointConnection_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A flag to tell whether it is the first onOK call. + private bool _isFirst = true; + + /// Link to retrieve next page. + private string _nextLink; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _filter; + + /// + /// 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'. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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'.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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'.", + SerializedName = @"$filter", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Query)] + public string Filter { get => this._filter; set => this._filter = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _parentName; + + /// + /// The name of the parent resource (namely, either, the topic name, domain name, or partner namespace name). + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the parent resource (namely, either, the topic name, domain name, or partner namespace name).")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the parent resource (namely, either, the topic name, domain name, or partner namespace name).", + SerializedName = @"parentName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ParentName { get => this._parentName; set => this._parentName = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ParentType _parentType; + + /// + /// The type of the parent resource. This can be either \'topics\', \'domains\', or \'partnerNamespaces\'. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The type of the parent resource. This can be either \\'topics\\', \\'domains\\', or \\'partnerNamespaces\\'.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The type of the parent resource. This can be either \'topics\', \'domains\', or \'partnerNamespaces\'.", + SerializedName = @"parentType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ParentType) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ParentType))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ParentType ParentType { get => this._parentType; set => this._parentType = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private int _top; + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"$top", + PossibleTypes = new [] { typeof(int) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Query)] + public int Top { get => this._top; set => this._top = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridPrivateEndpointConnection_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.PrivateEndpointConnectionsListByResource(SubscriptionId, ResourceGroupName, ParentType, ParentName, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?), onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ParentType=ParentType,ParentName=ParentName,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null,Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?)}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ParentType=ParentType, ParentName=ParentName, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?) }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / nextLink + var result = await response; + WriteObject(result.Value,true); + _nextLink = result.NextLink; + if (_isFirst) + { + _isFirst = false; + while (_nextLink != null) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.PrivateEndpointConnectionsListByResource_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPrivateLinkResource_Get.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPrivateLinkResource_Get.cs new file mode 100644 index 000000000000..a1440db19b13 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPrivateLinkResource_Get.cs @@ -0,0 +1,430 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Get properties of a private link resource. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/{parentType}/{parentName}/privateLinkResources/{privateLinkResourceName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridPrivateLinkResource_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Get properties of a private link resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridPrivateLinkResource_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of private link resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of private link resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of private link resource.", + SerializedName = @"privateLinkResourceName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("PrivateLinkResourceName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private string _parentName; + + /// + /// The name of the parent resource (namely, either, the topic name, domain name, or partner namespace name). + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the parent resource (namely, either, the topic name, domain name, or partner namespace name).")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the parent resource (namely, either, the topic name, domain name, or partner namespace name).", + SerializedName = @"parentName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ParentName { get => this._parentName; set => this._parentName = value; } + + /// Backing field for property. + private string _parentType; + + /// + /// The type of the parent resource. This can be either \'topics\', \'domains\', or \'partnerNamespaces\'. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The type of the parent resource. This can be either \\'topics\\', \\'domains\\', or \\'partnerNamespaces\\'.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The type of the parent resource. This can be either \'topics\', \'domains\', or \'partnerNamespaces\'.", + SerializedName = @"parentType", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ParentType { get => this._parentType; set => this._parentType = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridPrivateLinkResource_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.PrivateLinkResourcesGet(SubscriptionId, ResourceGroupName, ParentType, ParentName, Name, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ParentType=ParentType,ParentName=ParentName,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ParentType=ParentType, ParentName=ParentName, Name=Name }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResource + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPrivateLinkResource_GetViaIdentity.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPrivateLinkResource_GetViaIdentity.cs new file mode 100644 index 000000000000..864a3e9869dc --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPrivateLinkResource_GetViaIdentity.cs @@ -0,0 +1,381 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Get properties of a private link resource. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/{parentType}/{parentName}/privateLinkResources/{privateLinkResourceName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridPrivateLinkResource_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Get properties of a private link resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridPrivateLinkResource_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridPrivateLinkResource_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.PrivateLinkResourcesGetViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ParentType) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ParentType"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ParentName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ParentName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.PrivateLinkResourceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.PrivateLinkResourceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.PrivateLinkResourcesGet(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ParentType ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ParentType)""), InputObject.ParentName ?? null, InputObject.PrivateLinkResourceName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResource + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPrivateLinkResource_List.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPrivateLinkResource_List.cs new file mode 100644 index 000000000000..b6379d70d98c --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridPrivateLinkResource_List.cs @@ -0,0 +1,476 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// + /// List all the private link resources under a topic, domain, or partner namespace. + /// + /// + /// [OpenAPI] ListByResource=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/{parentType}/{parentName}/privateLinkResources" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridPrivateLinkResource_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPrivateLinkResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"List all the private link resources under a topic, domain, or partner namespace.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridPrivateLinkResource_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A flag to tell whether it is the first onOK call. + private bool _isFirst = true; + + /// Link to retrieve next page. + private string _nextLink; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _filter; + + /// + /// 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'. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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'.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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'.", + SerializedName = @"$filter", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Query)] + public string Filter { get => this._filter; set => this._filter = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _parentName; + + /// + /// The name of the parent resource (namely, either, the topic name, domain name, or partner namespace name). + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the parent resource (namely, either, the topic name, domain name, or partner namespace name).")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the parent resource (namely, either, the topic name, domain name, or partner namespace name).", + SerializedName = @"parentName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ParentName { get => this._parentName; set => this._parentName = value; } + + /// Backing field for property. + private string _parentType; + + /// + /// The type of the parent resource. This can be either \'topics\', \'domains\', or \'partnerNamespaces\'. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The type of the parent resource. This can be either \\'topics\\', \\'domains\\', or \\'partnerNamespaces\\'.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The type of the parent resource. This can be either \'topics\', \'domains\', or \'partnerNamespaces\'.", + SerializedName = @"parentType", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ParentType { get => this._parentType; set => this._parentType = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private int _top; + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"$top", + PossibleTypes = new [] { typeof(int) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Query)] + public int Top { get => this._top; set => this._top = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridPrivateLinkResource_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.PrivateLinkResourcesListByResource(SubscriptionId, ResourceGroupName, ParentType, ParentName, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?), onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ParentType=ParentType,ParentName=ParentName,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null,Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?)}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ParentType=ParentType, ParentName=ParentName, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?) }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / nextLink + var result = await response; + WriteObject(result.Value,true); + _nextLink = result.NextLink; + if (_isFirst) + { + _isFirst = false; + while (_nextLink != null) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.PrivateLinkResourcesListByResource_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridSystemTopicEventSubscriptionDeliveryAttribute_Get.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridSystemTopicEventSubscriptionDeliveryAttribute_Get.cs new file mode 100644 index 000000000000..ec7894a6d0ca --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridSystemTopicEventSubscriptionDeliveryAttribute_Get.cs @@ -0,0 +1,419 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Get all delivery attributes for an event subscription. + /// + /// [OpenAPI] GetDeliveryAttributes=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/systemTopics/{systemTopicName}/eventSubscriptions/{eventSubscriptionName}/getDeliveryAttributes" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridSystemTopicEventSubscriptionDeliveryAttribute_Get", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Get all delivery attributes for an event subscription.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridSystemTopicEventSubscriptionDeliveryAttribute_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _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. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "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.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"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.", + SerializedName = @"eventSubscriptionName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string EventSubscriptionName { get => this._eventSubscriptionName; set => this._eventSubscriptionName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _systemTopicName; + + /// Name of the system topic. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the system topic.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the system topic.", + SerializedName = @"systemTopicName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string SystemTopicName { get => this._systemTopicName; set => this._systemTopicName = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet + /// class. + /// + public GetAzEventGridSystemTopicEventSubscriptionDeliveryAttribute_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'SystemTopicEventSubscriptionsGetDeliveryAttributes' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.SystemTopicEventSubscriptionsGetDeliveryAttributes(SubscriptionId, ResourceGroupName, SystemTopicName, EventSubscriptionName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,SystemTopicName=SystemTopicName,EventSubscriptionName=EventSubscriptionName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, SystemTopicName=SystemTopicName, EventSubscriptionName=EventSubscriptionName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // nested-array / value / + WriteObject((await response).Value, true); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridSystemTopicEventSubscriptionDeliveryAttribute_GetViaIdentity.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridSystemTopicEventSubscriptionDeliveryAttribute_GetViaIdentity.cs new file mode 100644 index 000000000000..ad66bc2b1fbd --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridSystemTopicEventSubscriptionDeliveryAttribute_GetViaIdentity.cs @@ -0,0 +1,382 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Get all delivery attributes for an event subscription. + /// + /// [OpenAPI] GetDeliveryAttributes=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/systemTopics/{systemTopicName}/eventSubscriptions/{eventSubscriptionName}/getDeliveryAttributes" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridSystemTopicEventSubscriptionDeliveryAttribute_GetViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Get all delivery attributes for an event subscription.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridSystemTopicEventSubscriptionDeliveryAttribute_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridSystemTopicEventSubscriptionDeliveryAttribute_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'SystemTopicEventSubscriptionsGetDeliveryAttributes' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.SystemTopicEventSubscriptionsGetDeliveryAttributesViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SystemTopicName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SystemTopicName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.EventSubscriptionName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.EventSubscriptionName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.SystemTopicEventSubscriptionsGetDeliveryAttributes(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.SystemTopicName ?? null, InputObject.EventSubscriptionName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // nested-array / value / + WriteObject((await response).Value, true); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridSystemTopicEventSubscriptionFullUrl_Get.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridSystemTopicEventSubscriptionFullUrl_Get.cs new file mode 100644 index 000000000000..9ff4842b4c11 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridSystemTopicEventSubscriptionFullUrl_Get.cs @@ -0,0 +1,417 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Get the full endpoint URL for an event subscription of a system topic. + /// + /// [OpenAPI] GetFullUrl=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/systemTopics/{systemTopicName}/eventSubscriptions/{eventSubscriptionName}/getFullUrl" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridSystemTopicEventSubscriptionFullUrl_Get", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(string))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Get the full endpoint URL for an event subscription of a system topic.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridSystemTopicEventSubscriptionFullUrl_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _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. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "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.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"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.", + SerializedName = @"eventSubscriptionName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string EventSubscriptionName { get => this._eventSubscriptionName; set => this._eventSubscriptionName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _systemTopicName; + + /// Name of the system topic. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the system topic.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the system topic.", + SerializedName = @"systemTopicName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string SystemTopicName { get => this._systemTopicName; set => this._systemTopicName = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridSystemTopicEventSubscriptionFullUrl_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'SystemTopicEventSubscriptionsGetFullUrl' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.SystemTopicEventSubscriptionsGetFullUrl(SubscriptionId, ResourceGroupName, SystemTopicName, EventSubscriptionName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,SystemTopicName=SystemTopicName,EventSubscriptionName=EventSubscriptionName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, SystemTopicName=SystemTopicName, EventSubscriptionName=EventSubscriptionName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFullUrl + WriteObject((await response).EndpointUrl); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridSystemTopicEventSubscriptionFullUrl_GetViaIdentity.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridSystemTopicEventSubscriptionFullUrl_GetViaIdentity.cs new file mode 100644 index 000000000000..4a85e0ea5ecb --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridSystemTopicEventSubscriptionFullUrl_GetViaIdentity.cs @@ -0,0 +1,381 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Get the full endpoint URL for an event subscription of a system topic. + /// + /// [OpenAPI] GetFullUrl=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/systemTopics/{systemTopicName}/eventSubscriptions/{eventSubscriptionName}/getFullUrl" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridSystemTopicEventSubscriptionFullUrl_GetViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(string))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Get the full endpoint URL for an event subscription of a system topic.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridSystemTopicEventSubscriptionFullUrl_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet + /// class. + /// + public GetAzEventGridSystemTopicEventSubscriptionFullUrl_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'SystemTopicEventSubscriptionsGetFullUrl' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.SystemTopicEventSubscriptionsGetFullUrlViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SystemTopicName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SystemTopicName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.EventSubscriptionName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.EventSubscriptionName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.SystemTopicEventSubscriptionsGetFullUrl(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.SystemTopicName ?? null, InputObject.EventSubscriptionName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFullUrl + WriteObject((await response).EndpointUrl); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridSystemTopicEventSubscription_Get.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridSystemTopicEventSubscription_Get.cs new file mode 100644 index 000000000000..92ed181a0a8d --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridSystemTopicEventSubscription_Get.cs @@ -0,0 +1,414 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Get an event subscription. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/systemTopics/{systemTopicName}/eventSubscriptions/{eventSubscriptionName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridSystemTopicEventSubscription_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Get an event subscription.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridSystemTopicEventSubscription_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _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. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "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.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"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.", + SerializedName = @"eventSubscriptionName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string EventSubscriptionName { get => this._eventSubscriptionName; set => this._eventSubscriptionName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _systemTopicName; + + /// Name of the system topic. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the system topic.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the system topic.", + SerializedName = @"systemTopicName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string SystemTopicName { get => this._systemTopicName; set => this._systemTopicName = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridSystemTopicEventSubscription_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.SystemTopicEventSubscriptionsGet(SubscriptionId, ResourceGroupName, SystemTopicName, EventSubscriptionName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,SystemTopicName=SystemTopicName,EventSubscriptionName=EventSubscriptionName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, SystemTopicName=SystemTopicName, EventSubscriptionName=EventSubscriptionName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridSystemTopicEventSubscription_GetViaIdentity.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridSystemTopicEventSubscription_GetViaIdentity.cs new file mode 100644 index 000000000000..ce62252a8137 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridSystemTopicEventSubscription_GetViaIdentity.cs @@ -0,0 +1,377 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Get an event subscription. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/systemTopics/{systemTopicName}/eventSubscriptions/{eventSubscriptionName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridSystemTopicEventSubscription_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Get an event subscription.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridSystemTopicEventSubscription_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridSystemTopicEventSubscription_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.SystemTopicEventSubscriptionsGetViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SystemTopicName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SystemTopicName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.EventSubscriptionName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.EventSubscriptionName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.SystemTopicEventSubscriptionsGet(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.SystemTopicName ?? null, InputObject.EventSubscriptionName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridSystemTopicEventSubscription_List.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridSystemTopicEventSubscription_List.cs new file mode 100644 index 000000000000..2b8a90564a84 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridSystemTopicEventSubscription_List.cs @@ -0,0 +1,456 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// List event subscriptions that belong to a specific system topic. + /// + /// [OpenAPI] ListBySystemTopic=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/systemTopics/{systemTopicName}/eventSubscriptions" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridSystemTopicEventSubscription_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"List event subscriptions that belong to a specific system topic.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridSystemTopicEventSubscription_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A flag to tell whether it is the first onOK call. + private bool _isFirst = true; + + /// Link to retrieve next page. + private string _nextLink; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _filter; + + /// + /// 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'. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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'.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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'.", + SerializedName = @"$filter", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Query)] + public string Filter { get => this._filter; set => this._filter = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _systemTopicName; + + /// Name of the system topic. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the system topic.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the system topic.", + SerializedName = @"systemTopicName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string SystemTopicName { get => this._systemTopicName; set => this._systemTopicName = value; } + + /// Backing field for property. + private int _top; + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"$top", + PossibleTypes = new [] { typeof(int) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Query)] + public int Top { get => this._top; set => this._top = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridSystemTopicEventSubscription_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.SystemTopicEventSubscriptionsListBySystemTopic(SubscriptionId, ResourceGroupName, SystemTopicName, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?), onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,SystemTopicName=SystemTopicName,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null,Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?)}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, SystemTopicName=SystemTopicName, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?) }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / nextLink + var result = await response; + WriteObject(result.Value,true); + _nextLink = result.NextLink; + if (_isFirst) + { + _isFirst = false; + while (_nextLink != null) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.SystemTopicEventSubscriptionsListBySystemTopic_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridSystemTopic_Get.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridSystemTopic_Get.cs new file mode 100644 index 000000000000..318bbae3e3f6 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridSystemTopic_Get.cs @@ -0,0 +1,398 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Get properties of a system topic. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/systemTopics/{systemTopicName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridSystemTopic_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopic))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Get properties of a system topic.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridSystemTopic_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the system topic. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the system topic.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the system topic.", + SerializedName = @"systemTopicName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("SystemTopicName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridSystemTopic_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.SystemTopicsGet(SubscriptionId, ResourceGroupName, Name, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopic + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridSystemTopic_GetViaIdentity.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridSystemTopic_GetViaIdentity.cs new file mode 100644 index 000000000000..fb798d793f23 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridSystemTopic_GetViaIdentity.cs @@ -0,0 +1,373 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Get properties of a system topic. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/systemTopics/{systemTopicName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridSystemTopic_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopic))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Get properties of a system topic.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridSystemTopic_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridSystemTopic_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.SystemTopicsGetViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SystemTopicName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SystemTopicName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.SystemTopicsGet(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.SystemTopicName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopic + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridSystemTopic_List.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridSystemTopic_List.cs new file mode 100644 index 000000000000..0a70e662037b --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridSystemTopic_List.cs @@ -0,0 +1,428 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// List all the system topics under an Azure subscription. + /// + /// [OpenAPI] ListBySubscription=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/systemTopics" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridSystemTopic_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopic))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"List all the system topics under an Azure subscription.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridSystemTopic_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A flag to tell whether it is the first onOK call. + private bool _isFirst = true; + + /// Link to retrieve next page. + private string _nextLink; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _filter; + + /// + /// 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'. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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'.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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'.", + SerializedName = @"$filter", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Query)] + public string Filter { get => this._filter; set => this._filter = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private int _top; + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"$top", + PossibleTypes = new [] { typeof(int) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Query)] + public int Top { get => this._top; set => this._top = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridSystemTopic_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.SystemTopicsListBySubscription(SubscriptionId, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?), onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null,Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?)}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?) }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / nextLink + var result = await response; + WriteObject(result.Value,true); + _nextLink = result.NextLink; + if (_isFirst) + { + _isFirst = false; + while (_nextLink != null) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.SystemTopicsListBySubscription_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridSystemTopic_List1.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridSystemTopic_List1.cs new file mode 100644 index 000000000000..0ce86230a1be --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridSystemTopic_List1.cs @@ -0,0 +1,442 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// List all the system topics under a resource group. + /// + /// [OpenAPI] ListByResourceGroup=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/systemTopics" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridSystemTopic_List1")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopic))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"List all the system topics under a resource group.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridSystemTopic_List1 : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A flag to tell whether it is the first onOK call. + private bool _isFirst = true; + + /// Link to retrieve next page. + private string _nextLink; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _filter; + + /// + /// 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'. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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'.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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'.", + SerializedName = @"$filter", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Query)] + public string Filter { get => this._filter; set => this._filter = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private int _top; + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"$top", + PossibleTypes = new [] { typeof(int) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Query)] + public int Top { get => this._top; set => this._top = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridSystemTopic_List1() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.SystemTopicsListByResourceGroup(SubscriptionId, ResourceGroupName, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?), onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null,Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?)}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?) }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / nextLink + var result = await response; + WriteObject(result.Value,true); + _nextLink = result.NextLink; + if (_isFirst) + { + _isFirst = false; + while (_nextLink != null) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.SystemTopicsListByResourceGroup_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridTopicEventSubscriptionDeliveryAttribute_Get.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridTopicEventSubscriptionDeliveryAttribute_Get.cs new file mode 100644 index 000000000000..d18c09a3f22a --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridTopicEventSubscriptionDeliveryAttribute_Get.cs @@ -0,0 +1,415 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Get all delivery attributes for an event subscription for topic. + /// + /// [OpenAPI] GetDeliveryAttributes=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}/eventSubscriptions/{eventSubscriptionName}/getDeliveryAttributes" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridTopicEventSubscriptionDeliveryAttribute_Get", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Get all delivery attributes for an event subscription for topic.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridTopicEventSubscriptionDeliveryAttribute_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _eventSubscriptionName; + + /// Name of the event subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the event subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the event subscription.", + SerializedName = @"eventSubscriptionName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string EventSubscriptionName { get => this._eventSubscriptionName; set => this._eventSubscriptionName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _topicName; + + /// Name of the domain topic. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the domain topic.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the domain topic.", + SerializedName = @"topicName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string TopicName { get => this._topicName; set => this._topicName = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridTopicEventSubscriptionDeliveryAttribute_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'TopicEventSubscriptionsGetDeliveryAttributes' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.TopicEventSubscriptionsGetDeliveryAttributes(SubscriptionId, ResourceGroupName, TopicName, EventSubscriptionName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,TopicName=TopicName,EventSubscriptionName=EventSubscriptionName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, TopicName=TopicName, EventSubscriptionName=EventSubscriptionName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // nested-array / value / + WriteObject((await response).Value, true); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridTopicEventSubscriptionDeliveryAttribute_GetViaIdentity.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridTopicEventSubscriptionDeliveryAttribute_GetViaIdentity.cs new file mode 100644 index 000000000000..e04b95def747 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridTopicEventSubscriptionDeliveryAttribute_GetViaIdentity.cs @@ -0,0 +1,382 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Get all delivery attributes for an event subscription for topic. + /// + /// [OpenAPI] GetDeliveryAttributes=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}/eventSubscriptions/{eventSubscriptionName}/getDeliveryAttributes" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridTopicEventSubscriptionDeliveryAttribute_GetViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDeliveryAttributeMapping))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Get all delivery attributes for an event subscription for topic.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridTopicEventSubscriptionDeliveryAttribute_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet + /// class. + /// + public GetAzEventGridTopicEventSubscriptionDeliveryAttribute_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'TopicEventSubscriptionsGetDeliveryAttributes' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.TopicEventSubscriptionsGetDeliveryAttributesViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.TopicName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.TopicName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.EventSubscriptionName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.EventSubscriptionName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.TopicEventSubscriptionsGetDeliveryAttributes(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.TopicName ?? null, InputObject.EventSubscriptionName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // nested-array / value / + WriteObject((await response).Value, true); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridTopicEventSubscriptionFullUrl_Get.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridTopicEventSubscriptionFullUrl_Get.cs new file mode 100644 index 000000000000..519f19e3c05d --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridTopicEventSubscriptionFullUrl_Get.cs @@ -0,0 +1,414 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Get the full endpoint URL for an event subscription for topic. + /// + /// [OpenAPI] GetFullUrl=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}/eventSubscriptions/{eventSubscriptionName}/getFullUrl" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridTopicEventSubscriptionFullUrl_Get", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(string))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Get the full endpoint URL for an event subscription for topic.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridTopicEventSubscriptionFullUrl_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _eventSubscriptionName; + + /// Name of the event subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the event subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the event subscription.", + SerializedName = @"eventSubscriptionName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string EventSubscriptionName { get => this._eventSubscriptionName; set => this._eventSubscriptionName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _topicName; + + /// Name of the domain topic. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the domain topic.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the domain topic.", + SerializedName = @"topicName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string TopicName { get => this._topicName; set => this._topicName = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridTopicEventSubscriptionFullUrl_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'TopicEventSubscriptionsGetFullUrl' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.TopicEventSubscriptionsGetFullUrl(SubscriptionId, ResourceGroupName, TopicName, EventSubscriptionName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,TopicName=TopicName,EventSubscriptionName=EventSubscriptionName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, TopicName=TopicName, EventSubscriptionName=EventSubscriptionName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFullUrl + WriteObject((await response).EndpointUrl); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridTopicEventSubscriptionFullUrl_GetViaIdentity.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridTopicEventSubscriptionFullUrl_GetViaIdentity.cs new file mode 100644 index 000000000000..4299dbd76452 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridTopicEventSubscriptionFullUrl_GetViaIdentity.cs @@ -0,0 +1,380 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Get the full endpoint URL for an event subscription for topic. + /// + /// [OpenAPI] GetFullUrl=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}/eventSubscriptions/{eventSubscriptionName}/getFullUrl" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridTopicEventSubscriptionFullUrl_GetViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(string))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Get the full endpoint URL for an event subscription for topic.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridTopicEventSubscriptionFullUrl_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridTopicEventSubscriptionFullUrl_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'TopicEventSubscriptionsGetFullUrl' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.TopicEventSubscriptionsGetFullUrlViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.TopicName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.TopicName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.EventSubscriptionName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.EventSubscriptionName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.TopicEventSubscriptionsGetFullUrl(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.TopicName ?? null, InputObject.EventSubscriptionName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionFullUrl + WriteObject((await response).EndpointUrl); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridTopicEventSubscription_Get.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridTopicEventSubscription_Get.cs new file mode 100644 index 000000000000..f5e35c207102 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridTopicEventSubscription_Get.cs @@ -0,0 +1,414 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Get properties of an event subscription of a topic. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}/eventSubscriptions/{eventSubscriptionName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridTopicEventSubscription_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Get properties of an event subscription of a topic.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridTopicEventSubscription_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _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. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "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.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"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.", + SerializedName = @"eventSubscriptionName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string EventSubscriptionName { get => this._eventSubscriptionName; set => this._eventSubscriptionName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _topicName; + + /// Name of the partner topic. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the partner topic.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the partner topic.", + SerializedName = @"topicName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string TopicName { get => this._topicName; set => this._topicName = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridTopicEventSubscription_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.TopicEventSubscriptionsGet(SubscriptionId, ResourceGroupName, TopicName, EventSubscriptionName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,TopicName=TopicName,EventSubscriptionName=EventSubscriptionName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, TopicName=TopicName, EventSubscriptionName=EventSubscriptionName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridTopicEventSubscription_GetViaIdentity.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridTopicEventSubscription_GetViaIdentity.cs new file mode 100644 index 000000000000..9101bacd86f8 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridTopicEventSubscription_GetViaIdentity.cs @@ -0,0 +1,377 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Get properties of an event subscription of a topic. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}/eventSubscriptions/{eventSubscriptionName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridTopicEventSubscription_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Get properties of an event subscription of a topic.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridTopicEventSubscription_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridTopicEventSubscription_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.TopicEventSubscriptionsGetViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.TopicName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.TopicName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.EventSubscriptionName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.EventSubscriptionName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.TopicEventSubscriptionsGet(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.TopicName ?? null, InputObject.EventSubscriptionName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridTopicEventSubscription_List.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridTopicEventSubscription_List.cs new file mode 100644 index 000000000000..604e03f31e31 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridTopicEventSubscription_List.cs @@ -0,0 +1,456 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// List all event subscriptions that have been created for a specific topic. + /// + /// [OpenAPI] List=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}/eventSubscriptions" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridTopicEventSubscription_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"List all event subscriptions that have been created for a specific topic.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridTopicEventSubscription_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A flag to tell whether it is the first onOK call. + private bool _isFirst = true; + + /// Link to retrieve next page. + private string _nextLink; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _filter; + + /// + /// 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'. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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'.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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'.", + SerializedName = @"$filter", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Query)] + public string Filter { get => this._filter; set => this._filter = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private int _top; + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"$top", + PossibleTypes = new [] { typeof(int) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Query)] + public int Top { get => this._top; set => this._top = value; } + + /// Backing field for property. + private string _topicName; + + /// Name of the topic. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the topic.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the topic.", + SerializedName = @"topicName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string TopicName { get => this._topicName; set => this._topicName = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridTopicEventSubscription_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.TopicEventSubscriptionsList(SubscriptionId, ResourceGroupName, TopicName, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?), onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,TopicName=TopicName,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null,Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?)}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, TopicName=TopicName, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?) }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / nextLink + var result = await response; + WriteObject(result.Value,true); + _nextLink = result.NextLink; + if (_isFirst) + { + _isFirst = false; + while (_nextLink != null) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.TopicEventSubscriptionsList_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridTopicEventType_List.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridTopicEventType_List.cs new file mode 100644 index 000000000000..6d08aa2fecd2 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridTopicEventType_List.cs @@ -0,0 +1,426 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// List event types for a topic. + /// + /// [OpenAPI] ListEventTypes=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{providerNamespace}/{resourceTypeName}/{resourceName}/providers/Microsoft.EventGrid/eventTypes" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridTopicEventType_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventType))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"List event types for a topic.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridTopicEventType_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private string _providerNamespace; + + /// Namespace of the provider of the topic. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Namespace of the provider of the topic.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Namespace of the provider of the topic.", + SerializedName = @"providerNamespace", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ProviderNamespace { get => this._providerNamespace; set => this._providerNamespace = value; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _resourceName; + + /// Name of the topic. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the topic.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the topic.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceName { get => this._resourceName; set => this._resourceName = value; } + + /// Backing field for property. + private string _resourceTypeName; + + /// Name of the topic type. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the topic type.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the topic type.", + SerializedName = @"resourceTypeName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceTypeName { get => this._resourceTypeName; set => this._resourceTypeName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridTopicEventType_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.TopicsListEventTypes(SubscriptionId, ResourceGroupName, ProviderNamespace, ResourceTypeName, ResourceName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ProviderNamespace=ProviderNamespace,ResourceTypeName=ResourceTypeName,ResourceName=ResourceName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ProviderNamespace=ProviderNamespace, ResourceTypeName=ResourceTypeName, ResourceName=ResourceName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / + WriteObject((await response).Value, true); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridTopicSharedAccessKey_List.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridTopicSharedAccessKey_List.cs new file mode 100644 index 000000000000..b4ecde847a37 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridTopicSharedAccessKey_List.cs @@ -0,0 +1,400 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// List the two keys used to publish to a topic. + /// + /// [OpenAPI] ListSharedAccessKeys=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}/listKeys" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridTopicSharedAccessKey_List", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicSharedAccessKeys))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"List the two keys used to publish to a topic.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridTopicSharedAccessKey_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _topicName; + + /// Name of the topic. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the topic.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the topic.", + SerializedName = @"topicName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string TopicName { get => this._topicName; set => this._topicName = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridTopicSharedAccessKey_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'TopicsListSharedAccessKeys' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.TopicsListSharedAccessKeys(SubscriptionId, ResourceGroupName, TopicName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,TopicName=TopicName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, TopicName=TopicName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicSharedAccessKeys + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridTopicTypeEventType_List.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridTopicTypeEventType_List.cs new file mode 100644 index 000000000000..ff423e5a0345 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridTopicTypeEventType_List.cs @@ -0,0 +1,360 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// List event types for a topic type. + /// + /// [OpenAPI] ListEventTypes=>GET:"/providers/Microsoft.EventGrid/topicTypes/{topicTypeName}/eventTypes" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridTopicTypeEventType_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventType))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"List event types for a topic type.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridTopicTypeEventType_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _topicTypeName; + + /// Name of the topic type. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the topic type.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the topic type.", + SerializedName = @"topicTypeName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string TopicTypeName { get => this._topicTypeName; set => this._topicTypeName = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridTopicTypeEventType_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.TopicTypesListEventTypes(TopicTypeName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { TopicTypeName=TopicTypeName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { TopicTypeName=TopicTypeName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / + WriteObject((await response).Value, true); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridTopicType_Get.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridTopicType_Get.cs new file mode 100644 index 000000000000..e1b8daea20de --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridTopicType_Get.cs @@ -0,0 +1,360 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Get information about a topic type. + /// + /// [OpenAPI] Get=>GET:"/providers/Microsoft.EventGrid/topicTypes/{topicTypeName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridTopicType_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypeInfo))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Get information about a topic type.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridTopicType_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the topic type. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the topic type.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the topic type.", + SerializedName = @"topicTypeName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("TopicTypeName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridTopicType_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.TopicTypesGet(Name, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypeInfo + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridTopicType_GetViaIdentity.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridTopicType_GetViaIdentity.cs new file mode 100644 index 000000000000..8abf9072a662 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridTopicType_GetViaIdentity.cs @@ -0,0 +1,365 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Get information about a topic type. + /// + /// [OpenAPI] Get=>GET:"/providers/Microsoft.EventGrid/topicTypes/{topicTypeName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridTopicType_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypeInfo))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Get information about a topic type.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridTopicType_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridTopicType_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.TopicTypesGetViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.TopicTypeName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.TopicTypeName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.TopicTypesGet(InputObject.TopicTypeName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypeInfo + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridTopicType_List.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridTopicType_List.cs new file mode 100644 index 000000000000..7bf673be9f11 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridTopicType_List.cs @@ -0,0 +1,346 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// List all registered topic types. + /// + /// [OpenAPI] List=>GET:"/providers/Microsoft.EventGrid/topicTypes" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridTopicType_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicTypeInfo))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"List all registered topic types.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridTopicType_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridTopicType_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.TopicTypesList(onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / + WriteObject((await response).Value, true); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridTopic_Get.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridTopic_Get.cs new file mode 100644 index 000000000000..c3ff2fbb665d --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridTopic_Get.cs @@ -0,0 +1,398 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Get properties of a topic. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridTopic_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopic))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Get properties of a topic.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridTopic_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the topic. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the topic.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the topic.", + SerializedName = @"topicName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("TopicName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridTopic_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.TopicsGet(SubscriptionId, ResourceGroupName, Name, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopic + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridTopic_GetViaIdentity.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridTopic_GetViaIdentity.cs new file mode 100644 index 000000000000..5f2e803da1e1 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridTopic_GetViaIdentity.cs @@ -0,0 +1,373 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Get properties of a topic. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridTopic_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopic))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Get properties of a topic.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridTopic_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridTopic_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.TopicsGetViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.TopicName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.TopicName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.TopicsGet(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.TopicName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopic + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridTopic_List.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridTopic_List.cs new file mode 100644 index 000000000000..f47b23fba388 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridTopic_List.cs @@ -0,0 +1,428 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// List all the topics under an Azure subscription. + /// + /// [OpenAPI] ListBySubscription=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/topics" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridTopic_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopic))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"List all the topics under an Azure subscription.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridTopic_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A flag to tell whether it is the first onOK call. + private bool _isFirst = true; + + /// Link to retrieve next page. + private string _nextLink; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _filter; + + /// + /// 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'. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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'.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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'.", + SerializedName = @"$filter", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Query)] + public string Filter { get => this._filter; set => this._filter = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private int _top; + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"$top", + PossibleTypes = new [] { typeof(int) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Query)] + public int Top { get => this._top; set => this._top = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridTopic_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.TopicsListBySubscription(SubscriptionId, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?), onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null,Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?)}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?) }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / nextLink + var result = await response; + WriteObject(result.Value,true); + _nextLink = result.NextLink; + if (_isFirst) + { + _isFirst = false; + while (_nextLink != null) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.TopicsListBySubscription_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridTopic_List1.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridTopic_List1.cs new file mode 100644 index 000000000000..15e5efb288f4 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridTopic_List1.cs @@ -0,0 +1,442 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// List all the topics under a resource group. + /// + /// [OpenAPI] ListByResourceGroup=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridTopic_List1")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopic))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"List all the topics under a resource group.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridTopic_List1 : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A flag to tell whether it is the first onOK call. + private bool _isFirst = true; + + /// Link to retrieve next page. + private string _nextLink; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _filter; + + /// + /// 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'. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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'.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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'.", + SerializedName = @"$filter", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Query)] + public string Filter { get => this._filter; set => this._filter = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private int _top; + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"$top", + PossibleTypes = new [] { typeof(int) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Query)] + public int Top { get => this._top; set => this._top = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridTopic_List1() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.TopicsListByResourceGroup(SubscriptionId, ResourceGroupName, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?), onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null,Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?)}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?) }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / nextLink + var result = await response; + WriteObject(result.Value,true); + _nextLink = result.NextLink; + if (_isFirst) + { + _isFirst = false; + while (_nextLink != null) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.TopicsListByResourceGroup_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridVerifiedPartner_Get.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridVerifiedPartner_Get.cs new file mode 100644 index 000000000000..473a04712b30 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridVerifiedPartner_Get.cs @@ -0,0 +1,360 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Get properties of a verified partner. + /// + /// [OpenAPI] Get=>GET:"/providers/Microsoft.EventGrid/verifiedPartners/{verifiedPartnerName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridVerifiedPartner_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartner))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Get properties of a verified partner.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridVerifiedPartner_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the verified partner. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the verified partner.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the verified partner.", + SerializedName = @"verifiedPartnerName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("VerifiedPartnerName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridVerifiedPartner_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.VerifiedPartnersGet(Name, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartner + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridVerifiedPartner_GetViaIdentity.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridVerifiedPartner_GetViaIdentity.cs new file mode 100644 index 000000000000..73a6dd6229a5 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridVerifiedPartner_GetViaIdentity.cs @@ -0,0 +1,365 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Get properties of a verified partner. + /// + /// [OpenAPI] Get=>GET:"/providers/Microsoft.EventGrid/verifiedPartners/{verifiedPartnerName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridVerifiedPartner_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartner))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Get properties of a verified partner.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridVerifiedPartner_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridVerifiedPartner_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.VerifiedPartnersGetViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.VerifiedPartnerName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.VerifiedPartnerName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.VerifiedPartnersGet(InputObject.VerifiedPartnerName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartner + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridVerifiedPartner_List.cs b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridVerifiedPartner_List.cs new file mode 100644 index 000000000000..f441a1151722 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GetAzEventGridVerifiedPartner_List.cs @@ -0,0 +1,404 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Get a list of all verified partners. + /// + /// [OpenAPI] List=>GET:"/providers/Microsoft.EventGrid/verifiedPartners" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventGridVerifiedPartner_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IVerifiedPartner))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Get a list of all verified partners.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GetAzEventGridVerifiedPartner_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A flag to tell whether it is the first onOK call. + private bool _isFirst = true; + + /// Link to retrieve next page. + private string _nextLink; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _filter; + + /// + /// 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'. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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'.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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'.", + SerializedName = @"$filter", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Query)] + public string Filter { get => this._filter; set => this._filter = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private int _top; + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"$top", + PossibleTypes = new [] { typeof(int) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Query)] + public int Top { get => this._top; set => this._top = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzEventGridVerifiedPartner_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.VerifiedPartnersList(this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?), onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null,Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?)}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?) }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / nextLink + var result = await response; + WriteObject(result.Value,true); + _nextLink = result.NextLink; + if (_isFirst) + { + _isFirst = false; + while (_nextLink != null) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.VerifiedPartnersList_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GrantAzEventGridPartnerConfigurationPartner_Authorize.cs b/swaggerci/eventgrid/generated/cmdlets/GrantAzEventGridPartnerConfigurationPartner_Authorize.cs new file mode 100644 index 000000000000..5feab42b38f0 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GrantAzEventGridPartnerConfigurationPartner_Authorize.cs @@ -0,0 +1,398 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// + /// Authorize a single partner either by partner registration immutable Id or by partner name. + /// + /// + /// [OpenAPI] AuthorizePartner=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerConfigurations/default/authorizePartner" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsSecurity.Grant, @"AzEventGridPartnerConfigurationPartner_Authorize", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfiguration))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Authorize a single partner either by partner registration immutable Id or by partner name.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GrantAzEventGridPartnerConfigurationPartner_Authorize : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartner _partnerInfo; + + /// Information about the partner. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Information about the partner.", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Information about the partner.", + SerializedName = @"partnerInfo", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartner) })] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartner PartnerInfo { get => this._partnerInfo; set => this._partnerInfo = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GrantAzEventGridPartnerConfigurationPartner_Authorize() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'PartnerConfigurationsAuthorizePartner' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.PartnerConfigurationsAuthorizePartner(SubscriptionId, ResourceGroupName, PartnerInfo, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,body=PartnerInfo}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, body=PartnerInfo }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfiguration + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GrantAzEventGridPartnerConfigurationPartner_AuthorizeExpanded.cs b/swaggerci/eventgrid/generated/cmdlets/GrantAzEventGridPartnerConfigurationPartner_AuthorizeExpanded.cs new file mode 100644 index 000000000000..8029be3a723b --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GrantAzEventGridPartnerConfigurationPartner_AuthorizeExpanded.cs @@ -0,0 +1,429 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// + /// Authorize a single partner either by partner registration immutable Id or by partner name. + /// + /// + /// [OpenAPI] AuthorizePartner=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerConfigurations/default/authorizePartner" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsSecurity.Grant, @"AzEventGridPartnerConfigurationPartner_AuthorizeExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfiguration))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Authorize a single partner either by partner registration immutable Id or by partner name.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GrantAzEventGridPartnerConfigurationPartner_AuthorizeExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// + /// Expiration time of the partner authorization. If this timer expires, any request from this partner to create, update or + /// delete resources in subscriber'scontext will fail. If specified, the allowed values are between 1 to the value of defaultMaximumExpirationTimeInDays + /// specified in PartnerConfiguration.If not specified, the default value will be the value of defaultMaximumExpirationTimeInDays + /// specified in PartnerConfiguration or 7 if this value is not specified. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Expiration time of the partner authorization. If this timer expires, any request from this partner to create, update or delete resources in subscriber'scontext will fail. If specified, the allowed values are between 1 to the value of defaultMaximumExpirationTimeInDays specified in PartnerConfiguration.If not specified, the default value will be the value of defaultMaximumExpirationTimeInDays specified in PartnerConfiguration or 7 if this value is not specified.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Expiration time of the partner authorization. If this timer expires, any request from this partner to create, update or delete resources in subscriber'scontext will fail. If specified, the allowed values are between 1 to the value of defaultMaximumExpirationTimeInDays specified in PartnerConfiguration.If not specified, the default value will be the value of defaultMaximumExpirationTimeInDays specified in PartnerConfiguration or 7 if this value is not specified.", + SerializedName = @"authorizationExpirationTimeInUtc", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime AuthorizationExpirationTimeInUtc { get => PartnerInfoBody.AuthorizationExpirationTimeInUtc ?? default(global::System.DateTime); set => PartnerInfoBody.AuthorizationExpirationTimeInUtc = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartner _partnerInfoBody= new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.Partner(); + + /// Information about the partner. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartner PartnerInfoBody { get => this._partnerInfoBody; set => this._partnerInfoBody = value; } + + /// The partner name. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The partner name.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The partner name.", + SerializedName = @"partnerName", + PossibleTypes = new [] { typeof(string) })] + public string PartnerName { get => PartnerInfoBody.Name ?? null; set => PartnerInfoBody.Name = value; } + + /// The immutableId of the corresponding partner registration. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The immutableId of the corresponding partner registration.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The immutableId of the corresponding partner registration.", + SerializedName = @"partnerRegistrationImmutableId", + PossibleTypes = new [] { typeof(string) })] + public string PartnerRegistrationImmutableId { get => PartnerInfoBody.RegistrationImmutableId ?? null; set => PartnerInfoBody.RegistrationImmutableId = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GrantAzEventGridPartnerConfigurationPartner_AuthorizeExpanded() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'PartnerConfigurationsAuthorizePartner' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.PartnerConfigurationsAuthorizePartner(SubscriptionId, ResourceGroupName, PartnerInfoBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,body=PartnerInfoBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, body=PartnerInfoBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfiguration + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GrantAzEventGridPartnerConfigurationPartner_AuthorizeViaIdentity.cs b/swaggerci/eventgrid/generated/cmdlets/GrantAzEventGridPartnerConfigurationPartner_AuthorizeViaIdentity.cs new file mode 100644 index 000000000000..aa106f044379 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GrantAzEventGridPartnerConfigurationPartner_AuthorizeViaIdentity.cs @@ -0,0 +1,388 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// + /// Authorize a single partner either by partner registration immutable Id or by partner name. + /// + /// + /// [OpenAPI] AuthorizePartner=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerConfigurations/default/authorizePartner" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsSecurity.Grant, @"AzEventGridPartnerConfigurationPartner_AuthorizeViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfiguration))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Authorize a single partner either by partner registration immutable Id or by partner name.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GrantAzEventGridPartnerConfigurationPartner_AuthorizeViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartner _partnerInfo; + + /// Information about the partner. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Information about the partner.", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Information about the partner.", + SerializedName = @"partnerInfo", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartner) })] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartner PartnerInfo { get => this._partnerInfo; set => this._partnerInfo = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet + /// class. + /// + public GrantAzEventGridPartnerConfigurationPartner_AuthorizeViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'PartnerConfigurationsAuthorizePartner' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.PartnerConfigurationsAuthorizePartnerViaIdentity(InputObject.Id, PartnerInfo, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.PartnerConfigurationsAuthorizePartner(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, PartnerInfo, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=PartnerInfo}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=PartnerInfo }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfiguration + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/GrantAzEventGridPartnerConfigurationPartner_AuthorizeViaIdentityExpanded.cs b/swaggerci/eventgrid/generated/cmdlets/GrantAzEventGridPartnerConfigurationPartner_AuthorizeViaIdentityExpanded.cs new file mode 100644 index 000000000000..e5597f270184 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/GrantAzEventGridPartnerConfigurationPartner_AuthorizeViaIdentityExpanded.cs @@ -0,0 +1,419 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// + /// Authorize a single partner either by partner registration immutable Id or by partner name. + /// + /// + /// [OpenAPI] AuthorizePartner=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerConfigurations/default/authorizePartner" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsSecurity.Grant, @"AzEventGridPartnerConfigurationPartner_AuthorizeViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfiguration))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Authorize a single partner either by partner registration immutable Id or by partner name.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class GrantAzEventGridPartnerConfigurationPartner_AuthorizeViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// + /// Expiration time of the partner authorization. If this timer expires, any request from this partner to create, update or + /// delete resources in subscriber'scontext will fail. If specified, the allowed values are between 1 to the value of defaultMaximumExpirationTimeInDays + /// specified in PartnerConfiguration.If not specified, the default value will be the value of defaultMaximumExpirationTimeInDays + /// specified in PartnerConfiguration or 7 if this value is not specified. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Expiration time of the partner authorization. If this timer expires, any request from this partner to create, update or delete resources in subscriber'scontext will fail. If specified, the allowed values are between 1 to the value of defaultMaximumExpirationTimeInDays specified in PartnerConfiguration.If not specified, the default value will be the value of defaultMaximumExpirationTimeInDays specified in PartnerConfiguration or 7 if this value is not specified.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Expiration time of the partner authorization. If this timer expires, any request from this partner to create, update or delete resources in subscriber'scontext will fail. If specified, the allowed values are between 1 to the value of defaultMaximumExpirationTimeInDays specified in PartnerConfiguration.If not specified, the default value will be the value of defaultMaximumExpirationTimeInDays specified in PartnerConfiguration or 7 if this value is not specified.", + SerializedName = @"authorizationExpirationTimeInUtc", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime AuthorizationExpirationTimeInUtc { get => PartnerInfoBody.AuthorizationExpirationTimeInUtc ?? default(global::System.DateTime); set => PartnerInfoBody.AuthorizationExpirationTimeInUtc = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartner _partnerInfoBody= new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.Partner(); + + /// Information about the partner. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartner PartnerInfoBody { get => this._partnerInfoBody; set => this._partnerInfoBody = value; } + + /// The partner name. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The partner name.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The partner name.", + SerializedName = @"partnerName", + PossibleTypes = new [] { typeof(string) })] + public string PartnerName { get => PartnerInfoBody.Name ?? null; set => PartnerInfoBody.Name = value; } + + /// The immutableId of the corresponding partner registration. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The immutableId of the corresponding partner registration.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The immutableId of the corresponding partner registration.", + SerializedName = @"partnerRegistrationImmutableId", + PossibleTypes = new [] { typeof(string) })] + public string PartnerRegistrationImmutableId { get => PartnerInfoBody.RegistrationImmutableId ?? null; set => PartnerInfoBody.RegistrationImmutableId = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GrantAzEventGridPartnerConfigurationPartner_AuthorizeViaIdentityExpanded() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'PartnerConfigurationsAuthorizePartner' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.PartnerConfigurationsAuthorizePartnerViaIdentity(InputObject.Id, PartnerInfoBody, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.PartnerConfigurationsAuthorizePartner(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, PartnerInfoBody, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=PartnerInfoBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=PartnerInfoBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfiguration + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/InitializeAzEventGridPartnerDestination_Activate.cs b/swaggerci/eventgrid/generated/cmdlets/InitializeAzEventGridPartnerDestination_Activate.cs new file mode 100644 index 000000000000..26ac2c20bccf --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/InitializeAzEventGridPartnerDestination_Activate.cs @@ -0,0 +1,398 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Activate a newly created partner destination. + /// + /// [OpenAPI] Activate=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerDestinations/{partnerDestinationName}/activate" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Initialize, @"AzEventGridPartnerDestination_Activate", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestination))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Activate a newly created partner destination.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class InitializeAzEventGridPartnerDestination_Activate : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the partner destination. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the partner destination.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the partner destination.", + SerializedName = @"partnerDestinationName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("PartnerDestinationName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public InitializeAzEventGridPartnerDestination_Activate() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'PartnerDestinationsActivate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.PartnerDestinationsActivate(SubscriptionId, ResourceGroupName, Name, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestination + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/InitializeAzEventGridPartnerDestination_ActivateViaIdentity.cs b/swaggerci/eventgrid/generated/cmdlets/InitializeAzEventGridPartnerDestination_ActivateViaIdentity.cs new file mode 100644 index 000000000000..23031b1a446b --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/InitializeAzEventGridPartnerDestination_ActivateViaIdentity.cs @@ -0,0 +1,376 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Activate a newly created partner destination. + /// + /// [OpenAPI] Activate=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerDestinations/{partnerDestinationName}/activate" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Initialize, @"AzEventGridPartnerDestination_ActivateViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestination))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Activate a newly created partner destination.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class InitializeAzEventGridPartnerDestination_ActivateViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public InitializeAzEventGridPartnerDestination_ActivateViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'PartnerDestinationsActivate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.PartnerDestinationsActivateViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.PartnerDestinationName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.PartnerDestinationName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.PartnerDestinationsActivate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.PartnerDestinationName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestination + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/InitializeAzEventGridPartnerTopic_Activate.cs b/swaggerci/eventgrid/generated/cmdlets/InitializeAzEventGridPartnerTopic_Activate.cs new file mode 100644 index 000000000000..fff7ac614f02 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/InitializeAzEventGridPartnerTopic_Activate.cs @@ -0,0 +1,398 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Activate a newly created partner topic. + /// + /// [OpenAPI] Activate=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerTopics/{partnerTopicName}/activate" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Initialize, @"AzEventGridPartnerTopic_Activate", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopic))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Activate a newly created partner topic.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class InitializeAzEventGridPartnerTopic_Activate : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the partner topic. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the partner topic.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the partner topic.", + SerializedName = @"partnerTopicName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("PartnerTopicName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public InitializeAzEventGridPartnerTopic_Activate() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'PartnerTopicsActivate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.PartnerTopicsActivate(SubscriptionId, ResourceGroupName, Name, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopic + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/InitializeAzEventGridPartnerTopic_ActivateViaIdentity.cs b/swaggerci/eventgrid/generated/cmdlets/InitializeAzEventGridPartnerTopic_ActivateViaIdentity.cs new file mode 100644 index 000000000000..03f6d4e2d582 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/InitializeAzEventGridPartnerTopic_ActivateViaIdentity.cs @@ -0,0 +1,376 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Activate a newly created partner topic. + /// + /// [OpenAPI] Activate=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerTopics/{partnerTopicName}/activate" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Initialize, @"AzEventGridPartnerTopic_ActivateViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopic))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Activate a newly created partner topic.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class InitializeAzEventGridPartnerTopic_ActivateViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public InitializeAzEventGridPartnerTopic_ActivateViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'PartnerTopicsActivate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.PartnerTopicsActivateViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.PartnerTopicName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.PartnerTopicName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.PartnerTopicsActivate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.PartnerTopicName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopic + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/InvokeAzEventGridDeactivatePartnerTopic_Deactivate.cs b/swaggerci/eventgrid/generated/cmdlets/InvokeAzEventGridDeactivatePartnerTopic_Deactivate.cs new file mode 100644 index 000000000000..73d81fdc08bb --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/InvokeAzEventGridDeactivatePartnerTopic_Deactivate.cs @@ -0,0 +1,397 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Deactivate specific partner topic. + /// + /// [OpenAPI] Deactivate=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerTopics/{partnerTopicName}/deactivate" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzEventGridDeactivatePartnerTopic_Deactivate", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopic))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Deactivate specific partner topic.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class InvokeAzEventGridDeactivatePartnerTopic_Deactivate : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _partnerTopicName; + + /// Name of the partner topic. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the partner topic.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the partner topic.", + SerializedName = @"partnerTopicName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string PartnerTopicName { get => this._partnerTopicName; set => this._partnerTopicName = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public InvokeAzEventGridDeactivatePartnerTopic_Deactivate() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'PartnerTopicsDeactivate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.PartnerTopicsDeactivate(SubscriptionId, ResourceGroupName, PartnerTopicName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PartnerTopicName=PartnerTopicName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PartnerTopicName=PartnerTopicName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopic + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/InvokeAzEventGridDeactivatePartnerTopic_DeactivateViaIdentity.cs b/swaggerci/eventgrid/generated/cmdlets/InvokeAzEventGridDeactivatePartnerTopic_DeactivateViaIdentity.cs new file mode 100644 index 000000000000..83487062c856 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/InvokeAzEventGridDeactivatePartnerTopic_DeactivateViaIdentity.cs @@ -0,0 +1,376 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Deactivate specific partner topic. + /// + /// [OpenAPI] Deactivate=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerTopics/{partnerTopicName}/deactivate" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzEventGridDeactivatePartnerTopic_DeactivateViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopic))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Deactivate specific partner topic.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class InvokeAzEventGridDeactivatePartnerTopic_DeactivateViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public InvokeAzEventGridDeactivatePartnerTopic_DeactivateViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'PartnerTopicsDeactivate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.PartnerTopicsDeactivateViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.PartnerTopicName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.PartnerTopicName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.PartnerTopicsDeactivate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.PartnerTopicName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopic + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/InvokeAzEventGridPartnerConfigurationUnauthorize_Partner.cs b/swaggerci/eventgrid/generated/cmdlets/InvokeAzEventGridPartnerConfigurationUnauthorize_Partner.cs new file mode 100644 index 000000000000..e06bd9127cfd --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/InvokeAzEventGridPartnerConfigurationUnauthorize_Partner.cs @@ -0,0 +1,398 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// + /// Unauthorize a single partner either by partner registration immutable Id or by partner name. + /// + /// + /// [OpenAPI] UnauthorizePartner=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerConfigurations/default/unauthorizePartner" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzEventGridPartnerConfigurationUnauthorize_Partner", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfiguration))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Unauthorize a single partner either by partner registration immutable Id or by partner name.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class InvokeAzEventGridPartnerConfigurationUnauthorize_Partner : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartner _partnerInfo; + + /// Information about the partner. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Information about the partner.", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Information about the partner.", + SerializedName = @"partnerInfo", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartner) })] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartner PartnerInfo { get => this._partnerInfo; set => this._partnerInfo = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public InvokeAzEventGridPartnerConfigurationUnauthorize_Partner() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'PartnerConfigurationsUnauthorizePartner' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.PartnerConfigurationsUnauthorizePartner(SubscriptionId, ResourceGroupName, PartnerInfo, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,body=PartnerInfo}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, body=PartnerInfo }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfiguration + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/InvokeAzEventGridPartnerConfigurationUnauthorize_PartnerExpanded.cs b/swaggerci/eventgrid/generated/cmdlets/InvokeAzEventGridPartnerConfigurationUnauthorize_PartnerExpanded.cs new file mode 100644 index 000000000000..a518e1bf994d --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/InvokeAzEventGridPartnerConfigurationUnauthorize_PartnerExpanded.cs @@ -0,0 +1,430 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// + /// Unauthorize a single partner either by partner registration immutable Id or by partner name. + /// + /// + /// [OpenAPI] UnauthorizePartner=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerConfigurations/default/unauthorizePartner" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzEventGridPartnerConfigurationUnauthorize_PartnerExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfiguration))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Unauthorize a single partner either by partner registration immutable Id or by partner name.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class InvokeAzEventGridPartnerConfigurationUnauthorize_PartnerExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// + /// Expiration time of the partner authorization. If this timer expires, any request from this partner to create, update or + /// delete resources in subscriber'scontext will fail. If specified, the allowed values are between 1 to the value of defaultMaximumExpirationTimeInDays + /// specified in PartnerConfiguration.If not specified, the default value will be the value of defaultMaximumExpirationTimeInDays + /// specified in PartnerConfiguration or 7 if this value is not specified. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Expiration time of the partner authorization. If this timer expires, any request from this partner to create, update or delete resources in subscriber'scontext will fail. If specified, the allowed values are between 1 to the value of defaultMaximumExpirationTimeInDays specified in PartnerConfiguration.If not specified, the default value will be the value of defaultMaximumExpirationTimeInDays specified in PartnerConfiguration or 7 if this value is not specified.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Expiration time of the partner authorization. If this timer expires, any request from this partner to create, update or delete resources in subscriber'scontext will fail. If specified, the allowed values are between 1 to the value of defaultMaximumExpirationTimeInDays specified in PartnerConfiguration.If not specified, the default value will be the value of defaultMaximumExpirationTimeInDays specified in PartnerConfiguration or 7 if this value is not specified.", + SerializedName = @"authorizationExpirationTimeInUtc", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime AuthorizationExpirationTimeInUtc { get => PartnerInfoBody.AuthorizationExpirationTimeInUtc ?? default(global::System.DateTime); set => PartnerInfoBody.AuthorizationExpirationTimeInUtc = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartner _partnerInfoBody= new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.Partner(); + + /// Information about the partner. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartner PartnerInfoBody { get => this._partnerInfoBody; set => this._partnerInfoBody = value; } + + /// The partner name. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The partner name.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The partner name.", + SerializedName = @"partnerName", + PossibleTypes = new [] { typeof(string) })] + public string PartnerName { get => PartnerInfoBody.Name ?? null; set => PartnerInfoBody.Name = value; } + + /// The immutableId of the corresponding partner registration. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The immutableId of the corresponding partner registration.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The immutableId of the corresponding partner registration.", + SerializedName = @"partnerRegistrationImmutableId", + PossibleTypes = new [] { typeof(string) })] + public string PartnerRegistrationImmutableId { get => PartnerInfoBody.RegistrationImmutableId ?? null; set => PartnerInfoBody.RegistrationImmutableId = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet + /// class. + /// + public InvokeAzEventGridPartnerConfigurationUnauthorize_PartnerExpanded() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'PartnerConfigurationsUnauthorizePartner' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.PartnerConfigurationsUnauthorizePartner(SubscriptionId, ResourceGroupName, PartnerInfoBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,body=PartnerInfoBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, body=PartnerInfoBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfiguration + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/InvokeAzEventGridPartnerConfigurationUnauthorize_PartnerViaIdentity.cs b/swaggerci/eventgrid/generated/cmdlets/InvokeAzEventGridPartnerConfigurationUnauthorize_PartnerViaIdentity.cs new file mode 100644 index 000000000000..f1db5c3b48b9 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/InvokeAzEventGridPartnerConfigurationUnauthorize_PartnerViaIdentity.cs @@ -0,0 +1,388 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// + /// Unauthorize a single partner either by partner registration immutable Id or by partner name. + /// + /// + /// [OpenAPI] UnauthorizePartner=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerConfigurations/default/unauthorizePartner" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzEventGridPartnerConfigurationUnauthorize_PartnerViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfiguration))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Unauthorize a single partner either by partner registration immutable Id or by partner name.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class InvokeAzEventGridPartnerConfigurationUnauthorize_PartnerViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartner _partnerInfo; + + /// Information about the partner. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Information about the partner.", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Information about the partner.", + SerializedName = @"partnerInfo", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartner) })] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartner PartnerInfo { get => this._partnerInfo; set => this._partnerInfo = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet + /// class. + /// + public InvokeAzEventGridPartnerConfigurationUnauthorize_PartnerViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'PartnerConfigurationsUnauthorizePartner' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.PartnerConfigurationsUnauthorizePartnerViaIdentity(InputObject.Id, PartnerInfo, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.PartnerConfigurationsUnauthorizePartner(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, PartnerInfo, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=PartnerInfo}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=PartnerInfo }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfiguration + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/InvokeAzEventGridPartnerConfigurationUnauthorize_PartnerViaIdentityExpanded.cs b/swaggerci/eventgrid/generated/cmdlets/InvokeAzEventGridPartnerConfigurationUnauthorize_PartnerViaIdentityExpanded.cs new file mode 100644 index 000000000000..94a660d296a8 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/InvokeAzEventGridPartnerConfigurationUnauthorize_PartnerViaIdentityExpanded.cs @@ -0,0 +1,419 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// + /// Unauthorize a single partner either by partner registration immutable Id or by partner name. + /// + /// + /// [OpenAPI] UnauthorizePartner=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerConfigurations/default/unauthorizePartner" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzEventGridPartnerConfigurationUnauthorize_PartnerViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfiguration))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Unauthorize a single partner either by partner registration immutable Id or by partner name.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class InvokeAzEventGridPartnerConfigurationUnauthorize_PartnerViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// + /// Expiration time of the partner authorization. If this timer expires, any request from this partner to create, update or + /// delete resources in subscriber'scontext will fail. If specified, the allowed values are between 1 to the value of defaultMaximumExpirationTimeInDays + /// specified in PartnerConfiguration.If not specified, the default value will be the value of defaultMaximumExpirationTimeInDays + /// specified in PartnerConfiguration or 7 if this value is not specified. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Expiration time of the partner authorization. If this timer expires, any request from this partner to create, update or delete resources in subscriber'scontext will fail. If specified, the allowed values are between 1 to the value of defaultMaximumExpirationTimeInDays specified in PartnerConfiguration.If not specified, the default value will be the value of defaultMaximumExpirationTimeInDays specified in PartnerConfiguration or 7 if this value is not specified.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Expiration time of the partner authorization. If this timer expires, any request from this partner to create, update or delete resources in subscriber'scontext will fail. If specified, the allowed values are between 1 to the value of defaultMaximumExpirationTimeInDays specified in PartnerConfiguration.If not specified, the default value will be the value of defaultMaximumExpirationTimeInDays specified in PartnerConfiguration or 7 if this value is not specified.", + SerializedName = @"authorizationExpirationTimeInUtc", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime AuthorizationExpirationTimeInUtc { get => PartnerInfoBody.AuthorizationExpirationTimeInUtc ?? default(global::System.DateTime); set => PartnerInfoBody.AuthorizationExpirationTimeInUtc = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartner _partnerInfoBody= new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.Partner(); + + /// Information about the partner. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartner PartnerInfoBody { get => this._partnerInfoBody; set => this._partnerInfoBody = value; } + + /// The partner name. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The partner name.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The partner name.", + SerializedName = @"partnerName", + PossibleTypes = new [] { typeof(string) })] + public string PartnerName { get => PartnerInfoBody.Name ?? null; set => PartnerInfoBody.Name = value; } + + /// The immutableId of the corresponding partner registration. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The immutableId of the corresponding partner registration.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The immutableId of the corresponding partner registration.", + SerializedName = @"partnerRegistrationImmutableId", + PossibleTypes = new [] { typeof(string) })] + public string PartnerRegistrationImmutableId { get => PartnerInfoBody.RegistrationImmutableId ?? null; set => PartnerInfoBody.RegistrationImmutableId = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public InvokeAzEventGridPartnerConfigurationUnauthorize_PartnerViaIdentityExpanded() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'PartnerConfigurationsUnauthorizePartner' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.PartnerConfigurationsUnauthorizePartnerViaIdentity(InputObject.Id, PartnerInfoBody, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.PartnerConfigurationsUnauthorizePartner(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, PartnerInfoBody, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=PartnerInfoBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=PartnerInfoBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfiguration + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/NewAzEventGridChannel_CreateExpanded.cs b/swaggerci/eventgrid/generated/cmdlets/NewAzEventGridChannel_CreateExpanded.cs new file mode 100644 index 000000000000..34e2404644a6 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/NewAzEventGridChannel_CreateExpanded.cs @@ -0,0 +1,660 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Synchronously creates or updates a new channel with the specified parameters. + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerNamespaces/{partnerNamespaceName}/channels/{channelName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzEventGridChannel_CreateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannel))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Synchronously creates or updates a new channel with the specified parameters.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class NewAzEventGridChannel_CreateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannel _channelInfoBody= new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.Channel(); + + /// Channel info. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannel ChannelInfoBody { get => this._channelInfoBody; set => this._channelInfoBody = value; } + + /// The type of the event channel which represents the direction flow of events. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The type of the event channel which represents the direction flow of events.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of the event channel which represents the direction flow of events.", + SerializedName = @"channelType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ChannelType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ChannelType))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ChannelType ChannelType { get => ChannelInfoBody.ChannelType ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ChannelType)""); set => ChannelInfoBody.ChannelType = value; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// + /// A collection of inline event types for the resource. The inline event type keys are of type string which represents the + /// name of the event.An example of a valid inline event name is "Contoso.OrderCreated".The inline event type values are of + /// type InlineEventProperties and will contain additional information for every inline event type. + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "A collection of inline event types for the resource. The inline event type keys are of type string which represents the name of the event.An example of a valid inline event name is \"Contoso.OrderCreated\".The inline event type values are of type InlineEventProperties and will contain additional information for every inline event type.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A collection of inline event types for the resource. The inline event type keys are of type string which represents the name of the event.An example of a valid inline event name is ""Contoso.OrderCreated"".The inline event type values are of type InlineEventProperties and will contain additional information for every inline event type.", + SerializedName = @"inlineEventTypes", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInlineEventTypes) })] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInlineEventTypes EventTypeInfoInlineEventType { get => ChannelInfoBody.EventTypeInfoInlineEventType ?? null /* object */; set => ChannelInfoBody.EventTypeInfoInlineEventType = value; } + + /// The kind of event type used. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The kind of event type used.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The kind of event type used.", + SerializedName = @"kind", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind EventTypeInfoKind { get => ChannelInfoBody.EventTypeInfoKind ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind)""); set => ChannelInfoBody.EventTypeInfoKind = value; } + + /// + /// Expiration time of the channel. If this timer expires while the corresponding partner topic is never activated,the channel + /// and corresponding partner topic are deleted. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Expiration time of the channel. If this timer expires while the corresponding partner topic is never activated,the channel and corresponding partner topic are deleted.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Expiration time of the channel. If this timer expires while the corresponding partner topic is never activated,the channel and corresponding partner topic are deleted.", + SerializedName = @"expirationTimeIfNotActivatedUtc", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime ExpirationTimeIfNotActivatedUtc { get => ChannelInfoBody.ExpirationTimeIfNotActivatedUtc ?? default(global::System.DateTime); set => ChannelInfoBody.ExpirationTimeIfNotActivatedUtc = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// Context or helpful message that can be used during the approval process by the subscriber. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Context or helpful message that can be used during the approval process by the subscriber.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Context or helpful message that can be used during the approval process by the subscriber.", + SerializedName = @"messageForActivation", + PossibleTypes = new [] { typeof(string) })] + public string MessageForActivation { get => ChannelInfoBody.MessageForActivation ?? null; set => ChannelInfoBody.MessageForActivation = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the channel. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the channel.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the channel.", + SerializedName = @"channelName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ChannelName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// Azure subscription ID of the subscriber. The partner destination associated with the channel will becreated under this + /// Azure subscription. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Azure subscription ID of the subscriber. The partner destination associated with the channel will becreated under this Azure subscription.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Azure subscription ID of the subscriber. The partner destination associated with the channel will becreated under this Azure subscription.", + SerializedName = @"azureSubscriptionId", + PossibleTypes = new [] { typeof(string) })] + public string PartnerDestinationInfoAzureSubscriptionId { get => ChannelInfoBody.PartnerDestinationInfoAzureSubscriptionId ?? null; set => ChannelInfoBody.PartnerDestinationInfoAzureSubscriptionId = value; } + + /// Additional context of the partner destination endpoint. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Additional context of the partner destination endpoint.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Additional context of the partner destination endpoint.", + SerializedName = @"endpointServiceContext", + PossibleTypes = new [] { typeof(string) })] + public string PartnerDestinationInfoEndpointServiceContext { get => ChannelInfoBody.PartnerDestinationInfoEndpointServiceContext ?? null; set => ChannelInfoBody.PartnerDestinationInfoEndpointServiceContext = value; } + + /// Name of the partner destination associated with the channel. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Name of the partner destination associated with the channel.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the partner destination associated with the channel.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + public string PartnerDestinationInfoName { get => ChannelInfoBody.PartnerDestinationInfoName ?? null; set => ChannelInfoBody.PartnerDestinationInfoName = value; } + + /// + /// Azure Resource Group of the subscriber. The partner destination associated with the channel will becreated under this + /// resource group. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Azure Resource Group of the subscriber. The partner destination associated with the channel will becreated under this resource group.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Azure Resource Group of the subscriber. The partner destination associated with the channel will becreated under this resource group.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + public string PartnerDestinationInfoResourceGroupName { get => ChannelInfoBody.PartnerDestinationInfoResourceGroupName ?? null; set => ChannelInfoBody.PartnerDestinationInfoResourceGroupName = value; } + + /// Change history of the resource move. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Change history of the resource move.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Change history of the resource move.", + SerializedName = @"resourceMoveChangeHistory", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceMoveChangeHistory) })] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IResourceMoveChangeHistory[] PartnerDestinationInfoResourceMoveChangeHistory { get => ChannelInfoBody.PartnerDestinationInfoResourceMoveChangeHistory ?? null /* arrayOf */; set => ChannelInfoBody.PartnerDestinationInfoResourceMoveChangeHistory = value; } + + /// Backing field for property. + private string _partnerNamespaceName; + + /// Name of the partner namespace. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the partner namespace.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the partner namespace.", + SerializedName = @"partnerNamespaceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string PartnerNamespaceName { get => this._partnerNamespaceName; set => this._partnerNamespaceName = value; } + + /// + /// Azure subscription ID of the subscriber. The partner topic associated with the channel will becreated under this Azure + /// subscription. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Azure subscription ID of the subscriber. The partner topic associated with the channel will becreated under this Azure subscription.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Azure subscription ID of the subscriber. The partner topic associated with the channel will becreated under this Azure subscription.", + SerializedName = @"azureSubscriptionId", + PossibleTypes = new [] { typeof(string) })] + public string PartnerTopicInfoAzureSubscriptionId { get => ChannelInfoBody.PartnerTopicInfoAzureSubscriptionId ?? null; set => ChannelInfoBody.PartnerTopicInfoAzureSubscriptionId = value; } + + /// Name of the partner topic associated with the channel. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Name of the partner topic associated with the channel.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the partner topic associated with the channel.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + public string PartnerTopicInfoName { get => ChannelInfoBody.PartnerTopicInfoName ?? null; set => ChannelInfoBody.PartnerTopicInfoName = value; } + + /// + /// Azure Resource Group of the subscriber. The partner topic associated with the channel will becreated under this resource + /// group. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Azure Resource Group of the subscriber. The partner topic associated with the channel will becreated under this resource group.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Azure Resource Group of the subscriber. The partner topic associated with the channel will becreated under this resource group.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + public string PartnerTopicInfoResourceGroupName { get => ChannelInfoBody.PartnerTopicInfoResourceGroupName ?? null; set => ChannelInfoBody.PartnerTopicInfoResourceGroupName = value; } + + /// + /// The source information is provided by the publisher to determine the scope or context from which the eventsare originating. + /// This information can be used by the subscriber during the approval process of thecreated partner topic. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The source information is provided by the publisher to determine the scope or context from which the eventsare originating. This information can be used by the subscriber during the approval process of thecreated partner topic.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The source information is provided by the publisher to determine the scope or context from which the eventsare originating. This information can be used by the subscriber during the approval process of thecreated partner topic.", + SerializedName = @"source", + PossibleTypes = new [] { typeof(string) })] + public string PartnerTopicInfoSource { get => ChannelInfoBody.PartnerTopicInfoSource ?? null; set => ChannelInfoBody.PartnerTopicInfoSource = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// Provisioning state of the channel. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Provisioning state of the channel.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Provisioning state of the channel.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ChannelProvisioningState) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ChannelProvisioningState))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ChannelProvisioningState ProvisioningState { get => ChannelInfoBody.ProvisioningState ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ChannelProvisioningState)""); set => ChannelInfoBody.ProvisioningState = value; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// The readiness state of the corresponding partner topic. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The readiness state of the corresponding partner topic.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The readiness state of the corresponding partner topic.", + SerializedName = @"readinessState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ReadinessState) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ReadinessState))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ReadinessState ReadinessState { get => ChannelInfoBody.ReadinessState ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ReadinessState)""); set => ChannelInfoBody.ReadinessState = value; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the partners subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the partners subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the partners subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnCreated will be called before the regular onCreated has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onCreated method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public NewAzEventGridChannel_CreateExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ChannelsCreateOrUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ChannelsCreateOrUpdate(SubscriptionId, ResourceGroupName, PartnerNamespaceName, Name, ChannelInfoBody, onOk, onCreated, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PartnerNamespaceName=PartnerNamespaceName,Name=Name,body=ChannelInfoBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// a delegate that is called when the remote service returns 201 (Created). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnCreated(responseMessage, response, ref _returnNow); + // if overrideOnCreated has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onCreated - response for 201 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannel + WriteObject((await response)); + } + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PartnerNamespaceName=PartnerNamespaceName, Name=Name, body=ChannelInfoBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannel + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/NewAzEventGridDomainEventSubscription_CreateExpanded.cs b/swaggerci/eventgrid/generated/cmdlets/NewAzEventGridDomainEventSubscription_CreateExpanded.cs new file mode 100644 index 000000000000..2a666538c038 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/NewAzEventGridDomainEventSubscription_CreateExpanded.cs @@ -0,0 +1,705 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// + /// Asynchronously creates a new event subscription or updates an existing event subscription. + /// + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/eventSubscriptions/{eventSubscriptionName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzEventGridDomainEventSubscription_CreateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Asynchronously creates a new event subscription or updates an existing event subscription.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class NewAzEventGridDomainEventSubscription_CreateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType DeadLetterWithResourceIdentityType { get => EventSubscriptionInfoBody.DeadLetterWithResourceIdentityType ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType)""); set => EventSubscriptionInfoBody.DeadLetterWithResourceIdentityType = value; } + + /// The user identity associated with the resource. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The user identity associated with the resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The user identity associated with the resource.", + SerializedName = @"userAssignedIdentity", + PossibleTypes = new [] { typeof(string) })] + public string DeadLetterWithResourceIdentityUserAssignedIdentity { get => EventSubscriptionInfoBody.DeadLetterWithResourceIdentityUserAssignedIdentity ?? null; set => EventSubscriptionInfoBody.DeadLetterWithResourceIdentityUserAssignedIdentity = value; } + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Type of the endpoint for the event subscription destination. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Type of the endpoint for the event subscription destination.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of the endpoint for the event subscription destination.", + SerializedName = @"endpointType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType DeliveryWithResourceIdentityDestinationEndpointType { get => EventSubscriptionInfoBody.DeliveryWithResourceIdentityDestinationEndpointType ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType)""); set => EventSubscriptionInfoBody.DeliveryWithResourceIdentityDestinationEndpointType = value; } + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType DeliveryWithResourceIdentityType { get => EventSubscriptionInfoBody.DeliveryWithResourceIdentityType ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType)""); set => EventSubscriptionInfoBody.DeliveryWithResourceIdentityType = value; } + + /// The user identity associated with the resource. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The user identity associated with the resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The user identity associated with the resource.", + SerializedName = @"userAssignedIdentity", + PossibleTypes = new [] { typeof(string) })] + public string DeliveryWithResourceIdentityUserAssignedIdentity { get => EventSubscriptionInfoBody.DeliveryWithResourceIdentityUserAssignedIdentity ?? null; set => EventSubscriptionInfoBody.DeliveryWithResourceIdentityUserAssignedIdentity = value; } + + /// Backing field for property. + private string _domainName; + + /// Name of the domain topic. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the domain topic.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the domain topic.", + SerializedName = @"domainName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string DomainName { get => this._domainName; set => this._domainName = value; } + + /// Type of the endpoint for the event subscription destination. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Type of the endpoint for the event subscription destination.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of the endpoint for the event subscription destination.", + SerializedName = @"endpointType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType EndpointType { get => EventSubscriptionInfoBody.EndpointType ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType)""); set => EventSubscriptionInfoBody.EndpointType = value; } + + /// The event delivery schema for the event subscription. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The event delivery schema for the event subscription.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The event delivery schema for the event subscription.", + SerializedName = @"eventDeliverySchema", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema EventDeliverySchema { get => EventSubscriptionInfoBody.EventDeliverySchema ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema)""); set => EventSubscriptionInfoBody.EventDeliverySchema = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription _eventSubscriptionInfoBody= new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscription(); + + /// Event Subscription + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription EventSubscriptionInfoBody { get => this._eventSubscriptionInfoBody; set => this._eventSubscriptionInfoBody = value; } + + /// Backing field for property. + private string _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. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "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.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"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.", + SerializedName = @"eventSubscriptionName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string EventSubscriptionName { get => this._eventSubscriptionName; set => this._eventSubscriptionName = value; } + + /// Expiration time of the event subscription. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Expiration time of the event subscription.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Expiration time of the event subscription.", + SerializedName = @"expirationTimeUtc", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime ExpirationTimeUtc { get => EventSubscriptionInfoBody.ExpirationTimeUtc ?? default(global::System.DateTime); set => EventSubscriptionInfoBody.ExpirationTimeUtc = value; } + + /// An array of advanced filters that are used for filtering event subscriptions. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "An array of advanced filters that are used for filtering event subscriptions.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An array of advanced filters that are used for filtering event subscriptions.", + SerializedName = @"advancedFilters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter) })] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[] FilterAdvancedFilter { get => EventSubscriptionInfoBody.FilterAdvancedFilter ?? null /* arrayOf */; set => EventSubscriptionInfoBody.FilterAdvancedFilter = value; } + + /// + /// Allows advanced filters to be evaluated against an array of values instead of expecting a singular value. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Allows advanced filters to be evaluated against an array of values instead of expecting a singular value.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allows advanced filters to be evaluated against an array of values instead of expecting a singular value.", + SerializedName = @"enableAdvancedFilteringOnArrays", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter FilterEnableAdvancedFilteringOnArray { get => EventSubscriptionInfoBody.FilterEnableAdvancedFilteringOnArray ?? default(global::System.Management.Automation.SwitchParameter); set => EventSubscriptionInfoBody.FilterEnableAdvancedFilteringOnArray = value; } + + /// + /// 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. + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"includedEventTypes", + PossibleTypes = new [] { typeof(string) })] + public string[] FilterIncludedEventType { get => EventSubscriptionInfoBody.FilterIncludedEventType ?? null /* arrayOf */; set => EventSubscriptionInfoBody.FilterIncludedEventType = value; } + + /// + /// Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filtershould be compared in a case sensitive + /// manner. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filtershould be compared in a case sensitive manner.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filtershould be compared in a case sensitive manner.", + SerializedName = @"isSubjectCaseSensitive", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter FilterIsSubjectCaseSensitive { get => EventSubscriptionInfoBody.FilterIsSubjectCaseSensitive ?? default(global::System.Management.Automation.SwitchParameter); set => EventSubscriptionInfoBody.FilterIsSubjectCaseSensitive = value; } + + /// + /// An optional string to filter events for an event subscription based on a resource path prefix.The format of this depends + /// on the publisher of the events.Wildcard characters are not supported in this path. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "An optional string to filter events for an event subscription based on a resource path prefix.The format of this depends on the publisher of the events.Wildcard characters are not supported in this path.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An optional string to filter events for an event subscription based on a resource path prefix.The format of this depends on the publisher of the events.Wildcard characters are not supported in this path.", + SerializedName = @"subjectBeginsWith", + PossibleTypes = new [] { typeof(string) })] + public string FilterSubjectBeginsWith { get => EventSubscriptionInfoBody.FilterSubjectBeginsWith ?? null; set => EventSubscriptionInfoBody.FilterSubjectBeginsWith = value; } + + /// + /// An optional string to filter events for an event subscription based on a resource path suffix.Wildcard characters are + /// not supported in this path. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "An optional string to filter events for an event subscription based on a resource path suffix.Wildcard characters are not supported in this path.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An optional string to filter events for an event subscription based on a resource path suffix.Wildcard characters are not supported in this path.", + SerializedName = @"subjectEndsWith", + PossibleTypes = new [] { typeof(string) })] + public string FilterSubjectEndsWith { get => EventSubscriptionInfoBody.FilterSubjectEndsWith ?? null; set => EventSubscriptionInfoBody.FilterSubjectEndsWith = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// List of user defined labels. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "List of user defined labels.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of user defined labels.", + SerializedName = @"labels", + PossibleTypes = new [] { typeof(string) })] + public string[] Label { get => EventSubscriptionInfoBody.Label ?? null /* arrayOf */; set => EventSubscriptionInfoBody.Label = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Time To Live (in minutes) for events. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Time To Live (in minutes) for events.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Time To Live (in minutes) for events.", + SerializedName = @"eventTimeToLiveInMinutes", + PossibleTypes = new [] { typeof(int) })] + public int RetryPolicyEventTimeToLiveInMinute { get => EventSubscriptionInfoBody.RetryPolicyEventTimeToLiveInMinute ?? default(int); set => EventSubscriptionInfoBody.RetryPolicyEventTimeToLiveInMinute = value; } + + /// Maximum number of delivery retry attempts for events. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Maximum number of delivery retry attempts for events.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Maximum number of delivery retry attempts for events.", + SerializedName = @"maxDeliveryAttempts", + PossibleTypes = new [] { typeof(int) })] + public int RetryPolicyMaxDeliveryAttempt { get => EventSubscriptionInfoBody.RetryPolicyMaxDeliveryAttempt ?? default(int); set => EventSubscriptionInfoBody.RetryPolicyMaxDeliveryAttempt = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzEventGridDomainEventSubscription_CreateExpanded + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets.NewAzEventGridDomainEventSubscription_CreateExpanded Clone() + { + var clone = new NewAzEventGridDomainEventSubscription_CreateExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.EventSubscriptionInfoBody = this.EventSubscriptionInfoBody; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.DomainName = this.DomainName; + clone.EventSubscriptionName = this.EventSubscriptionName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public NewAzEventGridDomainEventSubscription_CreateExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DomainEventSubscriptionsCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DomainEventSubscriptionsCreateOrUpdate(SubscriptionId, ResourceGroupName, DomainName, EventSubscriptionName, EventSubscriptionInfoBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,DomainName=DomainName,EventSubscriptionName=EventSubscriptionName,body=EventSubscriptionInfoBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, DomainName=DomainName, EventSubscriptionName=EventSubscriptionName, body=EventSubscriptionInfoBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/NewAzEventGridDomainKey_Regenerate.cs b/swaggerci/eventgrid/generated/cmdlets/NewAzEventGridDomainKey_Regenerate.cs new file mode 100644 index 000000000000..066ff48e1125 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/NewAzEventGridDomainKey_Regenerate.cs @@ -0,0 +1,410 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Regenerate a shared access key for a domain. + /// + /// [OpenAPI] RegenerateKey=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/regenerateKey" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzEventGridDomainKey_Regenerate", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainSharedAccessKeys))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Regenerate a shared access key for a domain.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class NewAzEventGridDomainKey_Regenerate : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _domainName; + + /// Name of the domain. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the domain.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the domain.", + SerializedName = @"domainName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string DomainName { get => this._domainName; set => this._domainName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainRegenerateKeyRequest _regenerateKeyRequest; + + /// Domain regenerate share access key request. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Domain regenerate share access key request.", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Domain regenerate share access key request.", + SerializedName = @"regenerateKeyRequest", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainRegenerateKeyRequest) })] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainRegenerateKeyRequest RegenerateKeyRequest { get => this._regenerateKeyRequest; set => this._regenerateKeyRequest = value; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public NewAzEventGridDomainKey_Regenerate() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DomainsRegenerateKey' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DomainsRegenerateKey(SubscriptionId, ResourceGroupName, DomainName, RegenerateKeyRequest, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,DomainName=DomainName,body=RegenerateKeyRequest}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, DomainName=DomainName, body=RegenerateKeyRequest }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainSharedAccessKeys + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/NewAzEventGridDomainKey_RegenerateExpanded.cs b/swaggerci/eventgrid/generated/cmdlets/NewAzEventGridDomainKey_RegenerateExpanded.cs new file mode 100644 index 000000000000..440a141537d2 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/NewAzEventGridDomainKey_RegenerateExpanded.cs @@ -0,0 +1,414 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Regenerate a shared access key for a domain. + /// + /// [OpenAPI] RegenerateKey=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/regenerateKey" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzEventGridDomainKey_RegenerateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainSharedAccessKeys))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Regenerate a shared access key for a domain.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class NewAzEventGridDomainKey_RegenerateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _domainName; + + /// Name of the domain. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the domain.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the domain.", + SerializedName = @"domainName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string DomainName { get => this._domainName; set => this._domainName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Key name to regenerate key1 or key2. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Key name to regenerate key1 or key2.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Key name to regenerate key1 or key2.", + SerializedName = @"keyName", + PossibleTypes = new [] { typeof(string) })] + public string KeyName { get => RegenerateKeyRequestBody.KeyName ?? null; set => RegenerateKeyRequestBody.KeyName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainRegenerateKeyRequest _regenerateKeyRequestBody= new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DomainRegenerateKeyRequest(); + + /// Domain regenerate share access key request. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainRegenerateKeyRequest RegenerateKeyRequestBody { get => this._regenerateKeyRequestBody; set => this._regenerateKeyRequestBody = value; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public NewAzEventGridDomainKey_RegenerateExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DomainsRegenerateKey' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DomainsRegenerateKey(SubscriptionId, ResourceGroupName, DomainName, RegenerateKeyRequestBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,DomainName=DomainName,body=RegenerateKeyRequestBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, DomainName=DomainName, body=RegenerateKeyRequestBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainSharedAccessKeys + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/NewAzEventGridDomainKey_RegenerateViaIdentity.cs b/swaggerci/eventgrid/generated/cmdlets/NewAzEventGridDomainKey_RegenerateViaIdentity.cs new file mode 100644 index 000000000000..10249736f59e --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/NewAzEventGridDomainKey_RegenerateViaIdentity.cs @@ -0,0 +1,389 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Regenerate a shared access key for a domain. + /// + /// [OpenAPI] RegenerateKey=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/regenerateKey" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzEventGridDomainKey_RegenerateViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainSharedAccessKeys))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Regenerate a shared access key for a domain.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class NewAzEventGridDomainKey_RegenerateViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainRegenerateKeyRequest _regenerateKeyRequest; + + /// Domain regenerate share access key request. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Domain regenerate share access key request.", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Domain regenerate share access key request.", + SerializedName = @"regenerateKeyRequest", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainRegenerateKeyRequest) })] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainRegenerateKeyRequest RegenerateKeyRequest { get => this._regenerateKeyRequest; set => this._regenerateKeyRequest = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public NewAzEventGridDomainKey_RegenerateViaIdentity() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DomainsRegenerateKey' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.DomainsRegenerateKeyViaIdentity(InputObject.Id, RegenerateKeyRequest, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.DomainName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.DomainName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.DomainsRegenerateKey(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.DomainName ?? null, RegenerateKeyRequest, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=RegenerateKeyRequest}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=RegenerateKeyRequest }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainSharedAccessKeys + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/NewAzEventGridDomainKey_RegenerateViaIdentityExpanded.cs b/swaggerci/eventgrid/generated/cmdlets/NewAzEventGridDomainKey_RegenerateViaIdentityExpanded.cs new file mode 100644 index 000000000000..1d0d6d7b5883 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/NewAzEventGridDomainKey_RegenerateViaIdentityExpanded.cs @@ -0,0 +1,393 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Regenerate a shared access key for a domain. + /// + /// [OpenAPI] RegenerateKey=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/regenerateKey" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzEventGridDomainKey_RegenerateViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainSharedAccessKeys))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Regenerate a shared access key for a domain.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class NewAzEventGridDomainKey_RegenerateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Key name to regenerate key1 or key2. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Key name to regenerate key1 or key2.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Key name to regenerate key1 or key2.", + SerializedName = @"keyName", + PossibleTypes = new [] { typeof(string) })] + public string KeyName { get => RegenerateKeyRequestBody.KeyName ?? null; set => RegenerateKeyRequestBody.KeyName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainRegenerateKeyRequest _regenerateKeyRequestBody= new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DomainRegenerateKeyRequest(); + + /// Domain regenerate share access key request. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainRegenerateKeyRequest RegenerateKeyRequestBody { get => this._regenerateKeyRequestBody; set => this._regenerateKeyRequestBody = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public NewAzEventGridDomainKey_RegenerateViaIdentityExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DomainsRegenerateKey' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.DomainsRegenerateKeyViaIdentity(InputObject.Id, RegenerateKeyRequestBody, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.DomainName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.DomainName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.DomainsRegenerateKey(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.DomainName ?? null, RegenerateKeyRequestBody, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=RegenerateKeyRequestBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=RegenerateKeyRequestBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainSharedAccessKeys + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/NewAzEventGridDomainTopicEventSubscription_CreateExpanded.cs b/swaggerci/eventgrid/generated/cmdlets/NewAzEventGridDomainTopicEventSubscription_CreateExpanded.cs new file mode 100644 index 000000000000..a31f4b216957 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/NewAzEventGridDomainTopicEventSubscription_CreateExpanded.cs @@ -0,0 +1,722 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// + /// Asynchronously creates a new event subscription or updates an existing event subscription. + /// + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/topics/{topicName}/eventSubscriptions/{eventSubscriptionName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzEventGridDomainTopicEventSubscription_CreateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Asynchronously creates a new event subscription or updates an existing event subscription.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class NewAzEventGridDomainTopicEventSubscription_CreateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType DeadLetterWithResourceIdentityType { get => EventSubscriptionInfoBody.DeadLetterWithResourceIdentityType ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType)""); set => EventSubscriptionInfoBody.DeadLetterWithResourceIdentityType = value; } + + /// The user identity associated with the resource. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The user identity associated with the resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The user identity associated with the resource.", + SerializedName = @"userAssignedIdentity", + PossibleTypes = new [] { typeof(string) })] + public string DeadLetterWithResourceIdentityUserAssignedIdentity { get => EventSubscriptionInfoBody.DeadLetterWithResourceIdentityUserAssignedIdentity ?? null; set => EventSubscriptionInfoBody.DeadLetterWithResourceIdentityUserAssignedIdentity = value; } + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Type of the endpoint for the event subscription destination. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Type of the endpoint for the event subscription destination.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of the endpoint for the event subscription destination.", + SerializedName = @"endpointType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType DeliveryWithResourceIdentityDestinationEndpointType { get => EventSubscriptionInfoBody.DeliveryWithResourceIdentityDestinationEndpointType ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType)""); set => EventSubscriptionInfoBody.DeliveryWithResourceIdentityDestinationEndpointType = value; } + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType DeliveryWithResourceIdentityType { get => EventSubscriptionInfoBody.DeliveryWithResourceIdentityType ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType)""); set => EventSubscriptionInfoBody.DeliveryWithResourceIdentityType = value; } + + /// The user identity associated with the resource. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The user identity associated with the resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The user identity associated with the resource.", + SerializedName = @"userAssignedIdentity", + PossibleTypes = new [] { typeof(string) })] + public string DeliveryWithResourceIdentityUserAssignedIdentity { get => EventSubscriptionInfoBody.DeliveryWithResourceIdentityUserAssignedIdentity ?? null; set => EventSubscriptionInfoBody.DeliveryWithResourceIdentityUserAssignedIdentity = value; } + + /// Backing field for property. + private string _domainName; + + /// Name of the top level domain. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the top level domain.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the top level domain.", + SerializedName = @"domainName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string DomainName { get => this._domainName; set => this._domainName = value; } + + /// Type of the endpoint for the event subscription destination. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Type of the endpoint for the event subscription destination.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of the endpoint for the event subscription destination.", + SerializedName = @"endpointType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType EndpointType { get => EventSubscriptionInfoBody.EndpointType ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType)""); set => EventSubscriptionInfoBody.EndpointType = value; } + + /// The event delivery schema for the event subscription. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The event delivery schema for the event subscription.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The event delivery schema for the event subscription.", + SerializedName = @"eventDeliverySchema", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema EventDeliverySchema { get => EventSubscriptionInfoBody.EventDeliverySchema ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema)""); set => EventSubscriptionInfoBody.EventDeliverySchema = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription _eventSubscriptionInfoBody= new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscription(); + + /// Event Subscription + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription EventSubscriptionInfoBody { get => this._eventSubscriptionInfoBody; set => this._eventSubscriptionInfoBody = value; } + + /// Backing field for property. + private string _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. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "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.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"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.", + SerializedName = @"eventSubscriptionName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string EventSubscriptionName { get => this._eventSubscriptionName; set => this._eventSubscriptionName = value; } + + /// Expiration time of the event subscription. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Expiration time of the event subscription.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Expiration time of the event subscription.", + SerializedName = @"expirationTimeUtc", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime ExpirationTimeUtc { get => EventSubscriptionInfoBody.ExpirationTimeUtc ?? default(global::System.DateTime); set => EventSubscriptionInfoBody.ExpirationTimeUtc = value; } + + /// An array of advanced filters that are used for filtering event subscriptions. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "An array of advanced filters that are used for filtering event subscriptions.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An array of advanced filters that are used for filtering event subscriptions.", + SerializedName = @"advancedFilters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter) })] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[] FilterAdvancedFilter { get => EventSubscriptionInfoBody.FilterAdvancedFilter ?? null /* arrayOf */; set => EventSubscriptionInfoBody.FilterAdvancedFilter = value; } + + /// + /// Allows advanced filters to be evaluated against an array of values instead of expecting a singular value. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Allows advanced filters to be evaluated against an array of values instead of expecting a singular value.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allows advanced filters to be evaluated against an array of values instead of expecting a singular value.", + SerializedName = @"enableAdvancedFilteringOnArrays", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter FilterEnableAdvancedFilteringOnArray { get => EventSubscriptionInfoBody.FilterEnableAdvancedFilteringOnArray ?? default(global::System.Management.Automation.SwitchParameter); set => EventSubscriptionInfoBody.FilterEnableAdvancedFilteringOnArray = value; } + + /// + /// 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. + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"includedEventTypes", + PossibleTypes = new [] { typeof(string) })] + public string[] FilterIncludedEventType { get => EventSubscriptionInfoBody.FilterIncludedEventType ?? null /* arrayOf */; set => EventSubscriptionInfoBody.FilterIncludedEventType = value; } + + /// + /// Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filtershould be compared in a case sensitive + /// manner. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filtershould be compared in a case sensitive manner.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filtershould be compared in a case sensitive manner.", + SerializedName = @"isSubjectCaseSensitive", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter FilterIsSubjectCaseSensitive { get => EventSubscriptionInfoBody.FilterIsSubjectCaseSensitive ?? default(global::System.Management.Automation.SwitchParameter); set => EventSubscriptionInfoBody.FilterIsSubjectCaseSensitive = value; } + + /// + /// An optional string to filter events for an event subscription based on a resource path prefix.The format of this depends + /// on the publisher of the events.Wildcard characters are not supported in this path. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "An optional string to filter events for an event subscription based on a resource path prefix.The format of this depends on the publisher of the events.Wildcard characters are not supported in this path.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An optional string to filter events for an event subscription based on a resource path prefix.The format of this depends on the publisher of the events.Wildcard characters are not supported in this path.", + SerializedName = @"subjectBeginsWith", + PossibleTypes = new [] { typeof(string) })] + public string FilterSubjectBeginsWith { get => EventSubscriptionInfoBody.FilterSubjectBeginsWith ?? null; set => EventSubscriptionInfoBody.FilterSubjectBeginsWith = value; } + + /// + /// An optional string to filter events for an event subscription based on a resource path suffix.Wildcard characters are + /// not supported in this path. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "An optional string to filter events for an event subscription based on a resource path suffix.Wildcard characters are not supported in this path.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An optional string to filter events for an event subscription based on a resource path suffix.Wildcard characters are not supported in this path.", + SerializedName = @"subjectEndsWith", + PossibleTypes = new [] { typeof(string) })] + public string FilterSubjectEndsWith { get => EventSubscriptionInfoBody.FilterSubjectEndsWith ?? null; set => EventSubscriptionInfoBody.FilterSubjectEndsWith = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// List of user defined labels. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "List of user defined labels.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of user defined labels.", + SerializedName = @"labels", + PossibleTypes = new [] { typeof(string) })] + public string[] Label { get => EventSubscriptionInfoBody.Label ?? null /* arrayOf */; set => EventSubscriptionInfoBody.Label = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Time To Live (in minutes) for events. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Time To Live (in minutes) for events.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Time To Live (in minutes) for events.", + SerializedName = @"eventTimeToLiveInMinutes", + PossibleTypes = new [] { typeof(int) })] + public int RetryPolicyEventTimeToLiveInMinute { get => EventSubscriptionInfoBody.RetryPolicyEventTimeToLiveInMinute ?? default(int); set => EventSubscriptionInfoBody.RetryPolicyEventTimeToLiveInMinute = value; } + + /// Maximum number of delivery retry attempts for events. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Maximum number of delivery retry attempts for events.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Maximum number of delivery retry attempts for events.", + SerializedName = @"maxDeliveryAttempts", + PossibleTypes = new [] { typeof(int) })] + public int RetryPolicyMaxDeliveryAttempt { get => EventSubscriptionInfoBody.RetryPolicyMaxDeliveryAttempt ?? default(int); set => EventSubscriptionInfoBody.RetryPolicyMaxDeliveryAttempt = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _topicName; + + /// Name of the domain topic. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the domain topic.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the domain topic.", + SerializedName = @"topicName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string TopicName { get => this._topicName; set => this._topicName = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of NewAzEventGridDomainTopicEventSubscription_CreateExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets.NewAzEventGridDomainTopicEventSubscription_CreateExpanded Clone() + { + var clone = new NewAzEventGridDomainTopicEventSubscription_CreateExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.EventSubscriptionInfoBody = this.EventSubscriptionInfoBody; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.DomainName = this.DomainName; + clone.TopicName = this.TopicName; + clone.EventSubscriptionName = this.EventSubscriptionName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public NewAzEventGridDomainTopicEventSubscription_CreateExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DomainTopicEventSubscriptionsCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DomainTopicEventSubscriptionsCreateOrUpdate(SubscriptionId, ResourceGroupName, DomainName, TopicName, EventSubscriptionName, EventSubscriptionInfoBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,DomainName=DomainName,TopicName=TopicName,EventSubscriptionName=EventSubscriptionName,body=EventSubscriptionInfoBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, DomainName=DomainName, TopicName=TopicName, EventSubscriptionName=EventSubscriptionName, body=EventSubscriptionInfoBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/NewAzEventGridDomain_CreateExpanded.cs b/swaggerci/eventgrid/generated/cmdlets/NewAzEventGridDomain_CreateExpanded.cs new file mode 100644 index 000000000000..aea4112da82e --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/NewAzEventGridDomain_CreateExpanded.cs @@ -0,0 +1,634 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Asynchronously creates or updates a new domain with the specified parameters. + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzEventGridDomain_CreateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Asynchronously creates or updates a new domain with the specified parameters.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class NewAzEventGridDomain_CreateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// + /// This Boolean is used to specify the creation mechanism for 'all' the Event Grid Domain Topics associated with this Event + /// Grid Domain resource.In this context, creation of domain topic can be auto-managed (when true) or self-managed (when false). + /// The default value for this property is true.When this property is null or set to true, Event Grid is responsible of automatically + /// creating the domain topic when the first event subscription iscreated at the scope of the domain topic. If this property + /// is set to false, then creating the first event subscription will require creating a domain topicby the user. The self-management + /// mode can be used if the user wants full control of when the domain topic is created, while auto-managed mode provides + /// theflexibility to perform less operations and manage fewer resources by the user. Also, note that in auto-managed creation + /// mode, user is allowed to create thedomain topic on demand if needed. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "This Boolean is used to specify the creation mechanism for 'all' the Event Grid Domain Topics associated with this Event Grid Domain resource.In this context, creation of domain topic can be auto-managed (when true) or self-managed (when false). The default value for this property is true.When this property is null or set to true, Event Grid is responsible of automatically creating the domain topic when the first event subscription iscreated at the scope of the domain topic. If this property is set to false, then creating the first event subscription will require creating a domain topicby the user. The self-management mode can be used if the user wants full control of when the domain topic is created, while auto-managed mode provides theflexibility to perform less operations and manage fewer resources by the user. Also, note that in auto-managed creation mode, user is allowed to create thedomain topic on demand if needed.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This Boolean is used to specify the creation mechanism for 'all' the Event Grid Domain Topics associated with this Event Grid Domain resource.In this context, creation of domain topic can be auto-managed (when true) or self-managed (when false). The default value for this property is true.When this property is null or set to true, Event Grid is responsible of automatically creating the domain topic when the first event subscription iscreated at the scope of the domain topic. If this property is set to false, then creating the first event subscription will require creating a domain topicby the user. The self-management mode can be used if the user wants full control of when the domain topic is created, while auto-managed mode provides theflexibility to perform less operations and manage fewer resources by the user. Also, note that in auto-managed creation mode, user is allowed to create thedomain topic on demand if needed.", + SerializedName = @"autoCreateTopicWithFirstSubscription", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter AutoCreateTopicWithFirstSubscription { get => DomainInfoBody.AutoCreateTopicWithFirstSubscription ?? default(global::System.Management.Automation.SwitchParameter); set => DomainInfoBody.AutoCreateTopicWithFirstSubscription = value; } + + /// + /// This Boolean is used to specify the deletion mechanism for 'all' the Event Grid Domain Topics associated with this Event + /// Grid Domain resource.In this context, deletion of domain topic can be auto-managed (when true) or self-managed (when false). + /// The default value for this property is true.When this property is set to true, Event Grid is responsible of automatically + /// deleting the domain topic when the last event subscription at the scopeof the domain topic is deleted. If this property + /// is set to false, then the user needs to manually delete the domain topic when it is no longer needed(e.g., when last event + /// subscription is deleted and the resource needs to be cleaned up). The self-management mode can be used if the user wants + /// fullcontrol of when the domain topic needs to be deleted, while auto-managed mode provides the flexibility to perform + /// less operations and manage fewerresources by the user. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "This Boolean is used to specify the deletion mechanism for 'all' the Event Grid Domain Topics associated with this Event Grid Domain resource.In this context, deletion of domain topic can be auto-managed (when true) or self-managed (when false). The default value for this property is true.When this property is set to true, Event Grid is responsible of automatically deleting the domain topic when the last event subscription at the scopeof the domain topic is deleted. If this property is set to false, then the user needs to manually delete the domain topic when it is no longer needed(e.g., when last event subscription is deleted and the resource needs to be cleaned up). The self-management mode can be used if the user wants fullcontrol of when the domain topic needs to be deleted, while auto-managed mode provides the flexibility to perform less operations and manage fewerresources by the user.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This Boolean is used to specify the deletion mechanism for 'all' the Event Grid Domain Topics associated with this Event Grid Domain resource.In this context, deletion of domain topic can be auto-managed (when true) or self-managed (when false). The default value for this property is true.When this property is set to true, Event Grid is responsible of automatically deleting the domain topic when the last event subscription at the scopeof the domain topic is deleted. If this property is set to false, then the user needs to manually delete the domain topic when it is no longer needed(e.g., when last event subscription is deleted and the resource needs to be cleaned up). The self-management mode can be used if the user wants fullcontrol of when the domain topic needs to be deleted, while auto-managed mode provides the flexibility to perform less operations and manage fewerresources by the user.", + SerializedName = @"autoDeleteTopicWithLastSubscription", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter AutoDeleteTopicWithLastSubscription { get => DomainInfoBody.AutoDeleteTopicWithLastSubscription ?? default(global::System.Management.Automation.SwitchParameter); set => DomainInfoBody.AutoDeleteTopicWithLastSubscription = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// Data Residency Boundary of the resource. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Data Residency Boundary of the resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Data Residency Boundary of the resource.", + SerializedName = @"dataResidencyBoundary", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary DataResidencyBoundary { get => DomainInfoBody.DataResidencyBoundary ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary)""); set => DomainInfoBody.DataResidencyBoundary = value; } + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// + /// This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD + /// token will be used to authenticate if user is allowed to publish to the domain. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD token will be used to authenticate if user is allowed to publish to the domain.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD token will be used to authenticate if user is allowed to publish to the domain.", + SerializedName = @"disableLocalAuth", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter DisableLocalAuth { get => DomainInfoBody.DisableLocalAuth ?? default(global::System.Management.Automation.SwitchParameter); set => DomainInfoBody.DisableLocalAuth = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomain _domainInfoBody= new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.Domain(); + + /// EventGrid Domain. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomain DomainInfoBody { get => this._domainInfoBody; set => this._domainInfoBody = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// The principal ID of resource identity. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The principal ID of resource identity.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The principal ID of resource identity.", + SerializedName = @"principalId", + PossibleTypes = new [] { typeof(string) })] + public string IdentityPrincipalId { get => DomainInfoBody.IdentityPrincipalId ?? null; set => DomainInfoBody.IdentityPrincipalId = value; } + + /// The tenant ID of resource. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The tenant ID of resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The tenant ID of resource.", + SerializedName = @"tenantId", + PossibleTypes = new [] { typeof(string) })] + public string IdentityTenantId { get => DomainInfoBody.IdentityTenantId ?? null; set => DomainInfoBody.IdentityTenantId = value; } + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType IdentityType { get => DomainInfoBody.IdentityType ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType)""); set => DomainInfoBody.IdentityType = value; } + + /// + /// The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource + /// ids in the form:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.This + /// property is currently not used and reserved for future usage. + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource ids in the form:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.This property is currently not used and reserved for future usage.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource ids in the form:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.This property is currently not used and reserved for future usage.", + SerializedName = @"userAssignedIdentities", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities) })] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities IdentityUserAssignedIdentity { get => DomainInfoBody.IdentityUserAssignedIdentity ?? null /* object */; set => DomainInfoBody.IdentityUserAssignedIdentity = value; } + + /// + /// This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess + /// is enabled. + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess is enabled.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess is enabled.", + SerializedName = @"inboundIpRules", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule) })] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[] InboundIPRule { get => DomainInfoBody.InboundIPRule ?? null /* arrayOf */; set => DomainInfoBody.InboundIPRule = value; } + + /// + /// This determines the format that Event Grid should expect for incoming events published to the Event Grid Domain Resource. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "This determines the format that Event Grid should expect for incoming events published to the Event Grid Domain Resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This determines the format that Event Grid should expect for incoming events published to the Event Grid Domain Resource.", + SerializedName = @"inputSchema", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.InputSchema) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.InputSchema))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.InputSchema InputSchema { get => DomainInfoBody.InputSchema ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.InputSchema)""); set => DomainInfoBody.InputSchema = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Location of the resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Location of the resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Location of the resource.", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + public string Location { get => DomainInfoBody.Location ?? null; set => DomainInfoBody.Location = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the domain. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the domain.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the domain.", + SerializedName = @"domainName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("DomainName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// This determines if traffic is allowed over public network. By default it is enabled.You can further restrict to specific + /// IPs by configuring + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "This determines if traffic is allowed over public network. By default it is enabled.You can further restrict to specific IPs by configuring ")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This determines if traffic is allowed over public network. By default it is enabled.You can further restrict to specific IPs by configuring ", + SerializedName = @"publicNetworkAccess", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess PublicNetworkAccess { get => DomainInfoBody.PublicNetworkAccess ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess)""); set => DomainInfoBody.PublicNetworkAccess = value; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// The Sku name of the resource. The possible values are: Basic or Premium. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The Sku name of the resource. The possible values are: Basic or Premium.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Sku name of the resource. The possible values are: Basic or Premium.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku SkuName { get => DomainInfoBody.SkuName ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku)""); set => DomainInfoBody.SkuName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Tags of the resource. + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Tags of the resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Tags of the resource.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceTags Tag { get => DomainInfoBody.Tag ?? null /* object */; set => DomainInfoBody.Tag = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzEventGridDomain_CreateExpanded + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets.NewAzEventGridDomain_CreateExpanded Clone() + { + var clone = new NewAzEventGridDomain_CreateExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.DomainInfoBody = this.DomainInfoBody; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.Name = this.Name; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public NewAzEventGridDomain_CreateExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DomainsCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DomainsCreateOrUpdate(SubscriptionId, ResourceGroupName, Name, DomainInfoBody, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name,body=DomainInfoBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name, body=DomainInfoBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/NewAzEventGridEventChannel_CreateExpanded.cs b/swaggerci/eventgrid/generated/cmdlets/NewAzEventGridEventChannel_CreateExpanded.cs new file mode 100644 index 000000000000..d81cd24eeb37 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/NewAzEventGridEventChannel_CreateExpanded.cs @@ -0,0 +1,525 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Asynchronously creates a new event channel with the specified parameters. + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerNamespaces/{partnerNamespaceName}/eventChannels/{eventChannelName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzEventGridEventChannel_CreateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannel))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Asynchronously creates a new event channel with the specified parameters.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class NewAzEventGridEventChannel_CreateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// + /// Azure subscription ID of the customer creating the event channel. The partner topicassociated with the event channel will + /// be created under this Azure subscription. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Azure subscription ID of the customer creating the event channel. The partner topicassociated with the event channel will be created under this Azure subscription.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Azure subscription ID of the customer creating the event channel. The partner topicassociated with the event channel will be created under this Azure subscription.", + SerializedName = @"azureSubscriptionId", + PossibleTypes = new [] { typeof(string) })] + public string DestinationAzureSubscriptionId { get => EventChannelInfoBody.DestinationAzureSubscriptionId ?? null; set => EventChannelInfoBody.DestinationAzureSubscriptionId = value; } + + /// Name of the partner topic associated with the event channel. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Name of the partner topic associated with the event channel.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the partner topic associated with the event channel.", + SerializedName = @"partnerTopicName", + PossibleTypes = new [] { typeof(string) })] + public string DestinationPartnerTopicName { get => EventChannelInfoBody.DestinationPartnerTopicName ?? null; set => EventChannelInfoBody.DestinationPartnerTopicName = value; } + + /// + /// Azure Resource Group of the customer creating the event channel. The partner topicassociated with the event channel will + /// be created under this resource group. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Azure Resource Group of the customer creating the event channel. The partner topicassociated with the event channel will be created under this resource group.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Azure Resource Group of the customer creating the event channel. The partner topicassociated with the event channel will be created under this resource group.", + SerializedName = @"resourceGroup", + PossibleTypes = new [] { typeof(string) })] + public string DestinationResourceGroup { get => EventChannelInfoBody.DestinationResourceGroup ?? null; set => EventChannelInfoBody.DestinationResourceGroup = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannel _eventChannelInfoBody= new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventChannel(); + + /// Event Channel. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannel EventChannelInfoBody { get => this._eventChannelInfoBody; set => this._eventChannelInfoBody = value; } + + /// + /// The identifier of the resource that's the source of the events.This represents a unique resource in the partner's resource + /// model. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The identifier of the resource that's the source of the events.This represents a unique resource in the partner's resource model.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identifier of the resource that's the source of the events.This represents a unique resource in the partner's resource model.", + SerializedName = @"source", + PossibleTypes = new [] { typeof(string) })] + public string EventChannelSource { get => EventChannelInfoBody.EventChannelSource ?? null; set => EventChannelInfoBody.EventChannelSource = value; } + + /// + /// Expiration time of the event channel. If this timer expires while the corresponding partner topic is never activated,the + /// event channel and corresponding partner topic are deleted. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Expiration time of the event channel. If this timer expires while the corresponding partner topic is never activated,the event channel and corresponding partner topic are deleted.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Expiration time of the event channel. If this timer expires while the corresponding partner topic is never activated,the event channel and corresponding partner topic are deleted.", + SerializedName = @"expirationTimeIfNotActivatedUtc", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime ExpirationTimeIfNotActivatedUtc { get => EventChannelInfoBody.ExpirationTimeIfNotActivatedUtc ?? default(global::System.DateTime); set => EventChannelInfoBody.ExpirationTimeIfNotActivatedUtc = value; } + + /// An array of advanced filters that are used for filtering event channels. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "An array of advanced filters that are used for filtering event channels.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An array of advanced filters that are used for filtering event channels.", + SerializedName = @"advancedFilters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter) })] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[] FilterAdvancedFilter { get => EventChannelInfoBody.FilterAdvancedFilter ?? null /* arrayOf */; set => EventChannelInfoBody.FilterAdvancedFilter = value; } + + /// + /// Allows advanced filters to be evaluated against an array of values instead of expecting a singular value. The default + /// value is either false or null. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Allows advanced filters to be evaluated against an array of values instead of expecting a singular value. The default value is either false or null.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allows advanced filters to be evaluated against an array of values instead of expecting a singular value. The default value is either false or null.", + SerializedName = @"enableAdvancedFilteringOnArrays", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter FilterEnableAdvancedFilteringOnArray { get => EventChannelInfoBody.FilterEnableAdvancedFilteringOnArray ?? default(global::System.Management.Automation.SwitchParameter); set => EventChannelInfoBody.FilterEnableAdvancedFilteringOnArray = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the event channel. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the event channel.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the event channel.", + SerializedName = @"eventChannelName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("EventChannelName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private string _partnerNamespaceName; + + /// Name of the partner namespace. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the partner namespace.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the partner namespace.", + SerializedName = @"partnerNamespaceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string PartnerNamespaceName { get => this._partnerNamespaceName; set => this._partnerNamespaceName = value; } + + /// + /// Friendly description about the topic. This can be set by the publisher/partner to show custom description for the customer + /// partner topic.This will be helpful to remove any ambiguity of the origin of creation of the partner topic for the customer. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Friendly description about the topic. This can be set by the publisher/partner to show custom description for the customer partner topic.This will be helpful to remove any ambiguity of the origin of creation of the partner topic for the customer.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Friendly description about the topic. This can be set by the publisher/partner to show custom description for the customer partner topic.This will be helpful to remove any ambiguity of the origin of creation of the partner topic for the customer.", + SerializedName = @"partnerTopicFriendlyDescription", + PossibleTypes = new [] { typeof(string) })] + public string PartnerTopicFriendlyDescription { get => EventChannelInfoBody.PartnerTopicFriendlyDescription ?? null; set => EventChannelInfoBody.PartnerTopicFriendlyDescription = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public NewAzEventGridEventChannel_CreateExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'EventChannelsCreateOrUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.EventChannelsCreateOrUpdate(SubscriptionId, ResourceGroupName, PartnerNamespaceName, Name, EventChannelInfoBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PartnerNamespaceName=PartnerNamespaceName,Name=Name,body=EventChannelInfoBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PartnerNamespaceName=PartnerNamespaceName, Name=Name, body=EventChannelInfoBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventChannel + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/NewAzEventGridEventSubscription_CreateExpanded.cs b/swaggerci/eventgrid/generated/cmdlets/NewAzEventGridEventSubscription_CreateExpanded.cs new file mode 100644 index 000000000000..39db56710eb8 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/NewAzEventGridEventSubscription_CreateExpanded.cs @@ -0,0 +1,640 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// + /// Asynchronously creates a new event subscription or updates an existing event subscription based on the specified scope. + /// + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzEventGridEventSubscription_CreateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Asynchronously creates a new event subscription or updates an existing event subscription based on the specified scope.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class NewAzEventGridEventSubscription_CreateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType DeadLetterWithResourceIdentityType { get => EventSubscriptionInfoBody.DeadLetterWithResourceIdentityType ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType)""); set => EventSubscriptionInfoBody.DeadLetterWithResourceIdentityType = value; } + + /// The user identity associated with the resource. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The user identity associated with the resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The user identity associated with the resource.", + SerializedName = @"userAssignedIdentity", + PossibleTypes = new [] { typeof(string) })] + public string DeadLetterWithResourceIdentityUserAssignedIdentity { get => EventSubscriptionInfoBody.DeadLetterWithResourceIdentityUserAssignedIdentity ?? null; set => EventSubscriptionInfoBody.DeadLetterWithResourceIdentityUserAssignedIdentity = value; } + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Type of the endpoint for the event subscription destination. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Type of the endpoint for the event subscription destination.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of the endpoint for the event subscription destination.", + SerializedName = @"endpointType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType DeliveryWithResourceIdentityDestinationEndpointType { get => EventSubscriptionInfoBody.DeliveryWithResourceIdentityDestinationEndpointType ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType)""); set => EventSubscriptionInfoBody.DeliveryWithResourceIdentityDestinationEndpointType = value; } + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType DeliveryWithResourceIdentityType { get => EventSubscriptionInfoBody.DeliveryWithResourceIdentityType ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType)""); set => EventSubscriptionInfoBody.DeliveryWithResourceIdentityType = value; } + + /// The user identity associated with the resource. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The user identity associated with the resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The user identity associated with the resource.", + SerializedName = @"userAssignedIdentity", + PossibleTypes = new [] { typeof(string) })] + public string DeliveryWithResourceIdentityUserAssignedIdentity { get => EventSubscriptionInfoBody.DeliveryWithResourceIdentityUserAssignedIdentity ?? null; set => EventSubscriptionInfoBody.DeliveryWithResourceIdentityUserAssignedIdentity = value; } + + /// Type of the endpoint for the event subscription destination. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Type of the endpoint for the event subscription destination.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of the endpoint for the event subscription destination.", + SerializedName = @"endpointType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType EndpointType { get => EventSubscriptionInfoBody.EndpointType ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType)""); set => EventSubscriptionInfoBody.EndpointType = value; } + + /// The event delivery schema for the event subscription. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The event delivery schema for the event subscription.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The event delivery schema for the event subscription.", + SerializedName = @"eventDeliverySchema", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema EventDeliverySchema { get => EventSubscriptionInfoBody.EventDeliverySchema ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema)""); set => EventSubscriptionInfoBody.EventDeliverySchema = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription _eventSubscriptionInfoBody= new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscription(); + + /// Event Subscription + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription EventSubscriptionInfoBody { get => this._eventSubscriptionInfoBody; set => this._eventSubscriptionInfoBody = value; } + + /// Expiration time of the event subscription. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Expiration time of the event subscription.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Expiration time of the event subscription.", + SerializedName = @"expirationTimeUtc", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime ExpirationTimeUtc { get => EventSubscriptionInfoBody.ExpirationTimeUtc ?? default(global::System.DateTime); set => EventSubscriptionInfoBody.ExpirationTimeUtc = value; } + + /// An array of advanced filters that are used for filtering event subscriptions. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "An array of advanced filters that are used for filtering event subscriptions.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An array of advanced filters that are used for filtering event subscriptions.", + SerializedName = @"advancedFilters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter) })] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[] FilterAdvancedFilter { get => EventSubscriptionInfoBody.FilterAdvancedFilter ?? null /* arrayOf */; set => EventSubscriptionInfoBody.FilterAdvancedFilter = value; } + + /// + /// Allows advanced filters to be evaluated against an array of values instead of expecting a singular value. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Allows advanced filters to be evaluated against an array of values instead of expecting a singular value.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allows advanced filters to be evaluated against an array of values instead of expecting a singular value.", + SerializedName = @"enableAdvancedFilteringOnArrays", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter FilterEnableAdvancedFilteringOnArray { get => EventSubscriptionInfoBody.FilterEnableAdvancedFilteringOnArray ?? default(global::System.Management.Automation.SwitchParameter); set => EventSubscriptionInfoBody.FilterEnableAdvancedFilteringOnArray = value; } + + /// + /// 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. + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"includedEventTypes", + PossibleTypes = new [] { typeof(string) })] + public string[] FilterIncludedEventType { get => EventSubscriptionInfoBody.FilterIncludedEventType ?? null /* arrayOf */; set => EventSubscriptionInfoBody.FilterIncludedEventType = value; } + + /// + /// Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filtershould be compared in a case sensitive + /// manner. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filtershould be compared in a case sensitive manner.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filtershould be compared in a case sensitive manner.", + SerializedName = @"isSubjectCaseSensitive", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter FilterIsSubjectCaseSensitive { get => EventSubscriptionInfoBody.FilterIsSubjectCaseSensitive ?? default(global::System.Management.Automation.SwitchParameter); set => EventSubscriptionInfoBody.FilterIsSubjectCaseSensitive = value; } + + /// + /// An optional string to filter events for an event subscription based on a resource path prefix.The format of this depends + /// on the publisher of the events.Wildcard characters are not supported in this path. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "An optional string to filter events for an event subscription based on a resource path prefix.The format of this depends on the publisher of the events.Wildcard characters are not supported in this path.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An optional string to filter events for an event subscription based on a resource path prefix.The format of this depends on the publisher of the events.Wildcard characters are not supported in this path.", + SerializedName = @"subjectBeginsWith", + PossibleTypes = new [] { typeof(string) })] + public string FilterSubjectBeginsWith { get => EventSubscriptionInfoBody.FilterSubjectBeginsWith ?? null; set => EventSubscriptionInfoBody.FilterSubjectBeginsWith = value; } + + /// + /// An optional string to filter events for an event subscription based on a resource path suffix.Wildcard characters are + /// not supported in this path. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "An optional string to filter events for an event subscription based on a resource path suffix.Wildcard characters are not supported in this path.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An optional string to filter events for an event subscription based on a resource path suffix.Wildcard characters are not supported in this path.", + SerializedName = @"subjectEndsWith", + PossibleTypes = new [] { typeof(string) })] + public string FilterSubjectEndsWith { get => EventSubscriptionInfoBody.FilterSubjectEndsWith ?? null; set => EventSubscriptionInfoBody.FilterSubjectEndsWith = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// List of user defined labels. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "List of user defined labels.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of user defined labels.", + SerializedName = @"labels", + PossibleTypes = new [] { typeof(string) })] + public string[] Label { get => EventSubscriptionInfoBody.Label ?? null /* arrayOf */; set => EventSubscriptionInfoBody.Label = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// + /// Name of the event subscription. Event subscription names must be between 3 and 64 characters in length and should use + /// alphanumeric letters only. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the event subscription. Event subscription names must be between 3 and 64 characters in length and should use alphanumeric letters only.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the event subscription. Event subscription names must be between 3 and 64 characters in length and should use alphanumeric letters only.", + SerializedName = @"eventSubscriptionName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("EventSubscriptionName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Time To Live (in minutes) for events. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Time To Live (in minutes) for events.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Time To Live (in minutes) for events.", + SerializedName = @"eventTimeToLiveInMinutes", + PossibleTypes = new [] { typeof(int) })] + public int RetryPolicyEventTimeToLiveInMinute { get => EventSubscriptionInfoBody.RetryPolicyEventTimeToLiveInMinute ?? default(int); set => EventSubscriptionInfoBody.RetryPolicyEventTimeToLiveInMinute = value; } + + /// Maximum number of delivery retry attempts for events. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Maximum number of delivery retry attempts for events.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Maximum number of delivery retry attempts for events.", + SerializedName = @"maxDeliveryAttempts", + PossibleTypes = new [] { typeof(int) })] + public int RetryPolicyMaxDeliveryAttempt { get => EventSubscriptionInfoBody.RetryPolicyMaxDeliveryAttempt ?? default(int); set => EventSubscriptionInfoBody.RetryPolicyMaxDeliveryAttempt = value; } + + /// Backing field for property. + private string _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}' + /// for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' + /// for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' + /// for an EventGrid topic. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic.", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string Scope { get => this._scope; set => this._scope = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzEventGridEventSubscription_CreateExpanded + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets.NewAzEventGridEventSubscription_CreateExpanded Clone() + { + var clone = new NewAzEventGridEventSubscription_CreateExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.EventSubscriptionInfoBody = this.EventSubscriptionInfoBody; + clone.Scope = this.Scope; + clone.Name = this.Name; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public NewAzEventGridEventSubscription_CreateExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'EventSubscriptionsCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.EventSubscriptionsCreateOrUpdate(Scope, Name, EventSubscriptionInfoBody, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name,body=EventSubscriptionInfoBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope, Name=Name, body=EventSubscriptionInfoBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/NewAzEventGridPartnerConfiguration_CreateExpanded.cs b/swaggerci/eventgrid/generated/cmdlets/NewAzEventGridPartnerConfiguration_CreateExpanded.cs new file mode 100644 index 000000000000..cfe788264d91 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/NewAzEventGridPartnerConfiguration_CreateExpanded.cs @@ -0,0 +1,518 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// + /// Synchronously creates or updates a partner configuration with the specified parameters. + /// + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerConfigurations/default" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzEventGridPartnerConfiguration_CreateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfiguration))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Synchronously creates or updates a partner configuration with the specified parameters.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class NewAzEventGridPartnerConfiguration_CreateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Location of the resource. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Location of the resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Location of the resource.", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + public string Location { get => PartnerConfigurationInfoBody.Location ?? null; set => PartnerConfigurationInfoBody.Location = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// The list of authorized partners. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The list of authorized partners.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of authorized partners.", + SerializedName = @"authorizedPartnersList", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartner) })] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartner[] PartnerAuthorizationAuthorizedPartnersList { get => PartnerConfigurationInfoBody.PartnerAuthorizationAuthorizedPartnersList ?? null /* arrayOf */; set => PartnerConfigurationInfoBody.PartnerAuthorizationAuthorizedPartnersList = value; } + + /// + /// Time used to validate the authorization expiration time for each authorized partner. If DefaultMaximumExpirationTimeInDays + /// isnot specified, the default is 7 days. Otherwise, allowed values are between 1 and 365 days. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Time used to validate the authorization expiration time for each authorized partner. If DefaultMaximumExpirationTimeInDays isnot specified, the default is 7 days. Otherwise, allowed values are between 1 and 365 days.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Time used to validate the authorization expiration time for each authorized partner. If DefaultMaximumExpirationTimeInDays isnot specified, the default is 7 days. Otherwise, allowed values are between 1 and 365 days.", + SerializedName = @"defaultMaximumExpirationTimeInDays", + PossibleTypes = new [] { typeof(int) })] + public int PartnerAuthorizationDefaultMaximumExpirationTimeInDay { get => PartnerConfigurationInfoBody.PartnerAuthorizationDefaultMaximumExpirationTimeInDay ?? default(int); set => PartnerConfigurationInfoBody.PartnerAuthorizationDefaultMaximumExpirationTimeInDay = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfiguration _partnerConfigurationInfoBody= new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerConfiguration(); + + /// Partner configuration information + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfiguration PartnerConfigurationInfoBody { get => this._partnerConfigurationInfoBody; set => this._partnerConfigurationInfoBody = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// Provisioning state of the partner configuration. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Provisioning state of the partner configuration.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Provisioning state of the partner configuration.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerConfigurationProvisioningState) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerConfigurationProvisioningState))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerConfigurationProvisioningState ProvisioningState { get => PartnerConfigurationInfoBody.ProvisioningState ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerConfigurationProvisioningState)""); set => PartnerConfigurationInfoBody.ProvisioningState = value; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Tags of the resource. + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Tags of the resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Tags of the resource.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationTags Tag { get => PartnerConfigurationInfoBody.Tag ?? null /* object */; set => PartnerConfigurationInfoBody.Tag = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzEventGridPartnerConfiguration_CreateExpanded + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets.NewAzEventGridPartnerConfiguration_CreateExpanded Clone() + { + var clone = new NewAzEventGridPartnerConfiguration_CreateExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.PartnerConfigurationInfoBody = this.PartnerConfigurationInfoBody; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public NewAzEventGridPartnerConfiguration_CreateExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'PartnerConfigurationsCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.PartnerConfigurationsCreateOrUpdate(SubscriptionId, ResourceGroupName, PartnerConfigurationInfoBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,body=PartnerConfigurationInfoBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, body=PartnerConfigurationInfoBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfiguration + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/NewAzEventGridPartnerDestination_CreateExpanded.cs b/swaggerci/eventgrid/generated/cmdlets/NewAzEventGridPartnerDestination_CreateExpanded.cs new file mode 100644 index 000000000000..3a7fa63235e7 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/NewAzEventGridPartnerDestination_CreateExpanded.cs @@ -0,0 +1,545 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Asynchronously creates a new partner destination with the specified parameters. + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerDestinations/{partnerDestinationName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzEventGridPartnerDestination_CreateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestination))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Asynchronously creates a new partner destination with the specified parameters.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class NewAzEventGridPartnerDestination_CreateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Activation state of the partner destination. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Activation state of the partner destination.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Activation state of the partner destination.", + SerializedName = @"activationState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerDestinationActivationState) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerDestinationActivationState))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerDestinationActivationState ActivationState { get => PartnerDestinationBody.ActivationState ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerDestinationActivationState)""); set => PartnerDestinationBody.ActivationState = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Endpoint Base URL of the partner destination + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Endpoint Base URL of the partner destination")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Endpoint Base URL of the partner destination", + SerializedName = @"endpointBaseUrl", + PossibleTypes = new [] { typeof(string) })] + public string EndpointBaseUrl { get => PartnerDestinationBody.EndpointBaseUrl ?? null; set => PartnerDestinationBody.EndpointBaseUrl = value; } + + /// Endpoint context associated with this partner destination. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Endpoint context associated with this partner destination.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Endpoint context associated with this partner destination.", + SerializedName = @"endpointServiceContext", + PossibleTypes = new [] { typeof(string) })] + public string EndpointServiceContext { get => PartnerDestinationBody.EndpointServiceContext ?? null; set => PartnerDestinationBody.EndpointServiceContext = value; } + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"expirationTimeIfNotActivatedUtc", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime ExpirationTimeIfNotActivatedUtc { get => PartnerDestinationBody.ExpirationTimeIfNotActivatedUtc ?? default(global::System.DateTime); set => PartnerDestinationBody.ExpirationTimeIfNotActivatedUtc = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Location of the resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Location of the resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Location of the resource.", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + public string Location { get => PartnerDestinationBody.Location ?? null; set => PartnerDestinationBody.Location = value; } + + /// Context or helpful message that can be used during the approval process. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Context or helpful message that can be used during the approval process.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Context or helpful message that can be used during the approval process.", + SerializedName = @"messageForActivation", + PossibleTypes = new [] { typeof(string) })] + public string MessageForActivation { get => PartnerDestinationBody.MessageForActivation ?? null; set => PartnerDestinationBody.MessageForActivation = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the partner destination. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the partner destination.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the partner destination.", + SerializedName = @"partnerDestinationName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("PartnerDestinationName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestination _partnerDestinationBody= new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerDestination(); + + /// Event Grid Partner Destination. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestination PartnerDestinationBody { get => this._partnerDestinationBody; set => this._partnerDestinationBody = value; } + + /// The immutable Id of the corresponding partner registration. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The immutable Id of the corresponding partner registration.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The immutable Id of the corresponding partner registration.", + SerializedName = @"partnerRegistrationImmutableId", + PossibleTypes = new [] { typeof(string) })] + public string PartnerRegistrationImmutableId { get => PartnerDestinationBody.PartnerRegistrationImmutableId ?? null; set => PartnerDestinationBody.PartnerRegistrationImmutableId = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// Provisioning state of the partner destination. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Provisioning state of the partner destination.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Provisioning state of the partner destination.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerDestinationProvisioningState) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerDestinationProvisioningState))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerDestinationProvisioningState ProvisioningState { get => PartnerDestinationBody.ProvisioningState ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerDestinationProvisioningState)""); set => PartnerDestinationBody.ProvisioningState = value; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Tags of the resource. + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Tags of the resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Tags of the resource.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceTags Tag { get => PartnerDestinationBody.Tag ?? null /* object */; set => PartnerDestinationBody.Tag = value; } + + /// + /// overrideOnCreated will be called before the regular onCreated has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onCreated method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public NewAzEventGridPartnerDestination_CreateExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'PartnerDestinationsCreateOrUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.PartnerDestinationsCreateOrUpdate(SubscriptionId, ResourceGroupName, Name, PartnerDestinationBody, onOk, onCreated, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name,body=PartnerDestinationBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// a delegate that is called when the remote service returns 201 (Created). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnCreated(responseMessage, response, ref _returnNow); + // if overrideOnCreated has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onCreated - response for 201 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestination + WriteObject((await response)); + } + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name, body=PartnerDestinationBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestination + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/NewAzEventGridPartnerNamespaceKey_Regenerate.cs b/swaggerci/eventgrid/generated/cmdlets/NewAzEventGridPartnerNamespaceKey_Regenerate.cs new file mode 100644 index 000000000000..31cc2551d647 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/NewAzEventGridPartnerNamespaceKey_Regenerate.cs @@ -0,0 +1,410 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Regenerate a shared access key for a partner namespace. + /// + /// [OpenAPI] RegenerateKey=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerNamespaces/{partnerNamespaceName}/regenerateKey" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzEventGridPartnerNamespaceKey_Regenerate", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceSharedAccessKeys))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Regenerate a shared access key for a partner namespace.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class NewAzEventGridPartnerNamespaceKey_Regenerate : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _partnerNamespaceName; + + /// Name of the partner namespace. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the partner namespace.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the partner namespace.", + SerializedName = @"partnerNamespaceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string PartnerNamespaceName { get => this._partnerNamespaceName; set => this._partnerNamespaceName = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceRegenerateKeyRequest _regenerateKeyRequest; + + /// PartnerNamespace regenerate shared access key request. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "PartnerNamespace regenerate shared access key request.", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"PartnerNamespace regenerate shared access key request.", + SerializedName = @"regenerateKeyRequest", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceRegenerateKeyRequest) })] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceRegenerateKeyRequest RegenerateKeyRequest { get => this._regenerateKeyRequest; set => this._regenerateKeyRequest = value; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public NewAzEventGridPartnerNamespaceKey_Regenerate() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'PartnerNamespacesRegenerateKey' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.PartnerNamespacesRegenerateKey(SubscriptionId, ResourceGroupName, PartnerNamespaceName, RegenerateKeyRequest, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PartnerNamespaceName=PartnerNamespaceName,body=RegenerateKeyRequest}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PartnerNamespaceName=PartnerNamespaceName, body=RegenerateKeyRequest }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceSharedAccessKeys + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/NewAzEventGridPartnerNamespaceKey_RegenerateExpanded.cs b/swaggerci/eventgrid/generated/cmdlets/NewAzEventGridPartnerNamespaceKey_RegenerateExpanded.cs new file mode 100644 index 000000000000..cc4173105ba0 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/NewAzEventGridPartnerNamespaceKey_RegenerateExpanded.cs @@ -0,0 +1,414 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Regenerate a shared access key for a partner namespace. + /// + /// [OpenAPI] RegenerateKey=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerNamespaces/{partnerNamespaceName}/regenerateKey" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzEventGridPartnerNamespaceKey_RegenerateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceSharedAccessKeys))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Regenerate a shared access key for a partner namespace.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class NewAzEventGridPartnerNamespaceKey_RegenerateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Key name to regenerate (key1 or key2). + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Key name to regenerate (key1 or key2).")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Key name to regenerate (key1 or key2).", + SerializedName = @"keyName", + PossibleTypes = new [] { typeof(string) })] + public string KeyName { get => RegenerateKeyRequestBody.KeyName ?? null; set => RegenerateKeyRequestBody.KeyName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _partnerNamespaceName; + + /// Name of the partner namespace. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the partner namespace.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the partner namespace.", + SerializedName = @"partnerNamespaceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string PartnerNamespaceName { get => this._partnerNamespaceName; set => this._partnerNamespaceName = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceRegenerateKeyRequest _regenerateKeyRequestBody= new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerNamespaceRegenerateKeyRequest(); + + /// PartnerNamespace regenerate shared access key request. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceRegenerateKeyRequest RegenerateKeyRequestBody { get => this._regenerateKeyRequestBody; set => this._regenerateKeyRequestBody = value; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public NewAzEventGridPartnerNamespaceKey_RegenerateExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'PartnerNamespacesRegenerateKey' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.PartnerNamespacesRegenerateKey(SubscriptionId, ResourceGroupName, PartnerNamespaceName, RegenerateKeyRequestBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PartnerNamespaceName=PartnerNamespaceName,body=RegenerateKeyRequestBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PartnerNamespaceName=PartnerNamespaceName, body=RegenerateKeyRequestBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceSharedAccessKeys + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/NewAzEventGridPartnerNamespaceKey_RegenerateViaIdentity.cs b/swaggerci/eventgrid/generated/cmdlets/NewAzEventGridPartnerNamespaceKey_RegenerateViaIdentity.cs new file mode 100644 index 000000000000..7ed1d44ff4fc --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/NewAzEventGridPartnerNamespaceKey_RegenerateViaIdentity.cs @@ -0,0 +1,389 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Regenerate a shared access key for a partner namespace. + /// + /// [OpenAPI] RegenerateKey=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerNamespaces/{partnerNamespaceName}/regenerateKey" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzEventGridPartnerNamespaceKey_RegenerateViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceSharedAccessKeys))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Regenerate a shared access key for a partner namespace.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class NewAzEventGridPartnerNamespaceKey_RegenerateViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceRegenerateKeyRequest _regenerateKeyRequest; + + /// PartnerNamespace regenerate shared access key request. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "PartnerNamespace regenerate shared access key request.", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"PartnerNamespace regenerate shared access key request.", + SerializedName = @"regenerateKeyRequest", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceRegenerateKeyRequest) })] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceRegenerateKeyRequest RegenerateKeyRequest { get => this._regenerateKeyRequest; set => this._regenerateKeyRequest = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public NewAzEventGridPartnerNamespaceKey_RegenerateViaIdentity() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'PartnerNamespacesRegenerateKey' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.PartnerNamespacesRegenerateKeyViaIdentity(InputObject.Id, RegenerateKeyRequest, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.PartnerNamespaceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.PartnerNamespaceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.PartnerNamespacesRegenerateKey(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.PartnerNamespaceName ?? null, RegenerateKeyRequest, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=RegenerateKeyRequest}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=RegenerateKeyRequest }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceSharedAccessKeys + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/NewAzEventGridPartnerNamespaceKey_RegenerateViaIdentityExpanded.cs b/swaggerci/eventgrid/generated/cmdlets/NewAzEventGridPartnerNamespaceKey_RegenerateViaIdentityExpanded.cs new file mode 100644 index 000000000000..fa00f0e8cc38 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/NewAzEventGridPartnerNamespaceKey_RegenerateViaIdentityExpanded.cs @@ -0,0 +1,394 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Regenerate a shared access key for a partner namespace. + /// + /// [OpenAPI] RegenerateKey=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerNamespaces/{partnerNamespaceName}/regenerateKey" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzEventGridPartnerNamespaceKey_RegenerateViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceSharedAccessKeys))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Regenerate a shared access key for a partner namespace.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class NewAzEventGridPartnerNamespaceKey_RegenerateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Key name to regenerate (key1 or key2). + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Key name to regenerate (key1 or key2).")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Key name to regenerate (key1 or key2).", + SerializedName = @"keyName", + PossibleTypes = new [] { typeof(string) })] + public string KeyName { get => RegenerateKeyRequestBody.KeyName ?? null; set => RegenerateKeyRequestBody.KeyName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceRegenerateKeyRequest _regenerateKeyRequestBody= new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerNamespaceRegenerateKeyRequest(); + + /// PartnerNamespace regenerate shared access key request. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceRegenerateKeyRequest RegenerateKeyRequestBody { get => this._regenerateKeyRequestBody; set => this._regenerateKeyRequestBody = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet + /// class. + /// + public NewAzEventGridPartnerNamespaceKey_RegenerateViaIdentityExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'PartnerNamespacesRegenerateKey' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.PartnerNamespacesRegenerateKeyViaIdentity(InputObject.Id, RegenerateKeyRequestBody, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.PartnerNamespaceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.PartnerNamespaceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.PartnerNamespacesRegenerateKey(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.PartnerNamespaceName ?? null, RegenerateKeyRequestBody, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=RegenerateKeyRequestBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=RegenerateKeyRequestBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceSharedAccessKeys + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/NewAzEventGridPartnerNamespace_CreateExpanded.cs b/swaggerci/eventgrid/generated/cmdlets/NewAzEventGridPartnerNamespace_CreateExpanded.cs new file mode 100644 index 000000000000..20b24d351a4c --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/NewAzEventGridPartnerNamespace_CreateExpanded.cs @@ -0,0 +1,533 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Asynchronously creates a new partner namespace with the specified parameters. + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerNamespaces/{partnerNamespaceName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzEventGridPartnerNamespace_CreateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Asynchronously creates a new partner namespace with the specified parameters.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class NewAzEventGridPartnerNamespace_CreateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// + /// This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD + /// token will be used to authenticate if user is allowed to publish to the partner namespace. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD token will be used to authenticate if user is allowed to publish to the partner namespace.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD token will be used to authenticate if user is allowed to publish to the partner namespace.", + SerializedName = @"disableLocalAuth", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter DisableLocalAuth { get => PartnerNamespaceInfoBody.DisableLocalAuth ?? default(global::System.Management.Automation.SwitchParameter); set => PartnerNamespaceInfoBody.DisableLocalAuth = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// + /// This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess + /// is enabled. + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess is enabled.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess is enabled.", + SerializedName = @"inboundIpRules", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule) })] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[] InboundIPRule { get => PartnerNamespaceInfoBody.InboundIPRule ?? null /* arrayOf */; set => PartnerNamespaceInfoBody.InboundIPRule = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Location of the resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Location of the resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Location of the resource.", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + public string Location { get => PartnerNamespaceInfoBody.Location ?? null; set => PartnerNamespaceInfoBody.Location = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the partner namespace. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the partner namespace.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the partner namespace.", + SerializedName = @"partnerNamespaceName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("PartnerNamespaceName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespace _partnerNamespaceInfoBody= new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerNamespace(); + + /// EventGrid Partner Namespace. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespace PartnerNamespaceInfoBody { get => this._partnerNamespaceInfoBody; set => this._partnerNamespaceInfoBody = value; } + + /// + /// 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}. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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}.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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}.", + SerializedName = @"partnerRegistrationFullyQualifiedId", + PossibleTypes = new [] { typeof(string) })] + public string PartnerRegistrationFullyQualifiedId { get => PartnerNamespaceInfoBody.PartnerRegistrationFullyQualifiedId ?? null; set => PartnerNamespaceInfoBody.PartnerRegistrationFullyQualifiedId = value; } + + /// + /// This determines if events published to this partner namespace should use the source attribute in the event payloador use + /// the channel name in the header when matching to the partner topic. If none is specified, source attribute routing will + /// be used to match the partner topic. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "This determines if events published to this partner namespace should use the source attribute in the event payloador use the channel name in the header when matching to the partner topic. If none is specified, source attribute routing will be used to match the partner topic.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This determines if events published to this partner namespace should use the source attribute in the event payloador use the channel name in the header when matching to the partner topic. If none is specified, source attribute routing will be used to match the partner topic.", + SerializedName = @"partnerTopicRoutingMode", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicRoutingMode) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicRoutingMode))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicRoutingMode PartnerTopicRoutingMode { get => PartnerNamespaceInfoBody.PartnerTopicRoutingMode ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicRoutingMode)""); set => PartnerNamespaceInfoBody.PartnerTopicRoutingMode = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// This determines if traffic is allowed over public network. By default it is enabled.You can further restrict to specific + /// IPs by configuring + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "This determines if traffic is allowed over public network. By default it is enabled.You can further restrict to specific IPs by configuring ")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This determines if traffic is allowed over public network. By default it is enabled.You can further restrict to specific IPs by configuring ", + SerializedName = @"publicNetworkAccess", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess PublicNetworkAccess { get => PartnerNamespaceInfoBody.PublicNetworkAccess ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess)""); set => PartnerNamespaceInfoBody.PublicNetworkAccess = value; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Tags of the resource. + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Tags of the resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Tags of the resource.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceTags Tag { get => PartnerNamespaceInfoBody.Tag ?? null /* object */; set => PartnerNamespaceInfoBody.Tag = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzEventGridPartnerNamespace_CreateExpanded + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets.NewAzEventGridPartnerNamespace_CreateExpanded Clone() + { + var clone = new NewAzEventGridPartnerNamespace_CreateExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.PartnerNamespaceInfoBody = this.PartnerNamespaceInfoBody; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.Name = this.Name; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public NewAzEventGridPartnerNamespace_CreateExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'PartnerNamespacesCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.PartnerNamespacesCreateOrUpdate(SubscriptionId, ResourceGroupName, Name, PartnerNamespaceInfoBody, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name,body=PartnerNamespaceInfoBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name, body=PartnerNamespaceInfoBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/NewAzEventGridPartnerRegistration_CreateExpanded.cs b/swaggerci/eventgrid/generated/cmdlets/NewAzEventGridPartnerRegistration_CreateExpanded.cs new file mode 100644 index 000000000000..f56f4556f04d --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/NewAzEventGridPartnerRegistration_CreateExpanded.cs @@ -0,0 +1,658 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Creates a new partner registration with the specified parameters. + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerRegistrations/{partnerRegistrationName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzEventGridPartnerRegistration_CreateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistration))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Creates a new partner registration with the specified parameters.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class NewAzEventGridPartnerRegistration_CreateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// + /// List of Azure subscription Ids that are authorized to create a partner namespaceassociated with this partner registration. + /// This is an optional property. Creatingpartner namespaces is always permitted under the same Azure subscription as the + /// one usedfor creating the partner registration. + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "List of Azure subscription Ids that are authorized to create a partner namespaceassociated with this partner registration. This is an optional property. Creatingpartner namespaces is always permitted under the same Azure subscription as the one usedfor creating the partner registration.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of Azure subscription Ids that are authorized to create a partner namespaceassociated with this partner registration. This is an optional property. Creatingpartner namespaces is always permitted under the same Azure subscription as the one usedfor creating the partner registration.", + SerializedName = @"authorizedAzureSubscriptionIds", + PossibleTypes = new [] { typeof(string) })] + public string[] AuthorizedAzureSubscriptionId { get => PartnerRegistrationInfoBody.AuthorizedAzureSubscriptionId ?? null /* arrayOf */; set => PartnerRegistrationInfoBody.AuthorizedAzureSubscriptionId = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// The extension of the customer service URI of the publisher. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The extension of the customer service URI of the publisher.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The extension of the customer service URI of the publisher.", + SerializedName = @"customerServiceUri", + PossibleTypes = new [] { typeof(string) })] + public string CustomerServiceUri { get => PartnerRegistrationInfoBody.CustomerServiceUri ?? null; set => PartnerRegistrationInfoBody.CustomerServiceUri = value; } + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Location of the resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Location of the resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Location of the resource.", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + public string Location { get => PartnerRegistrationInfoBody.Location ?? null; set => PartnerRegistrationInfoBody.Location = value; } + + /// URI of the logo. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "URI of the logo.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"URI of the logo.", + SerializedName = @"logoUri", + PossibleTypes = new [] { typeof(string) })] + public string LogoUri { get => PartnerRegistrationInfoBody.LogoUri ?? null; set => PartnerRegistrationInfoBody.LogoUri = value; } + + /// + /// Long description for the custom scenarios and integration to be displayed in the portal if needed.Length of this description + /// should not exceed 2048 characters. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Long description for the custom scenarios and integration to be displayed in the portal if needed.Length of this description should not exceed 2048 characters.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Long description for the custom scenarios and integration to be displayed in the portal if needed.Length of this description should not exceed 2048 characters.", + SerializedName = @"longDescription", + PossibleTypes = new [] { typeof(string) })] + public string LongDescription { get => PartnerRegistrationInfoBody.LongDescription ?? null; set => PartnerRegistrationInfoBody.LongDescription = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the partner registration. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the partner registration.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the partner registration.", + SerializedName = @"partnerRegistrationName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("PartnerRegistrationName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The extension of the customer service number of the publisher. Only digits are allowed and number of digits should not + /// exceed 10. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The extension of the customer service number of the publisher. Only digits are allowed and number of digits should not exceed 10.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The extension of the customer service number of the publisher. Only digits are allowed and number of digits should not exceed 10.", + SerializedName = @"partnerCustomerServiceExtension", + PossibleTypes = new [] { typeof(string) })] + public string PartnerCustomerServiceExtension { get => PartnerRegistrationInfoBody.PartnerCustomerServiceExtension ?? null; set => PartnerRegistrationInfoBody.PartnerCustomerServiceExtension = value; } + + /// + /// The customer service number of the publisher. The expected phone format should start with a '+' sign followed by the country + /// code. The remaining digits are then followed. Only digits and spaces are allowed and itslength cannot exceed 16 digits + /// including country code. Examples of valid phone numbers are: +1 515 123 4567 and+966 7 5115 2471. Examples of invalid + /// phone numbers are: +1 (515) 123-4567, 1 515 123 4567 and +966 121 5115 24 7 551 1234 43 + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The customer service number of the publisher. The expected phone format should start with a '+' sign followed by the country code. The remaining digits are then followed. Only digits and spaces are allowed and itslength cannot exceed 16 digits including country code. Examples of valid phone numbers are: +1 515 123 4567 and+966 7 5115 2471. Examples of invalid phone numbers are: +1 (515) 123-4567, 1 515 123 4567 and +966 121 5115 24 7 551 1234 43")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The customer service number of the publisher. The expected phone format should start with a '+' sign followed by the country code. The remaining digits are then followed. Only digits and spaces are allowed and itslength cannot exceed 16 digits including country code. Examples of valid phone numbers are: +1 515 123 4567 and+966 7 5115 2471. Examples of invalid phone numbers are: +1 (515) 123-4567, 1 515 123 4567 and +966 121 5115 24 7 551 1234 43", + SerializedName = @"partnerCustomerServiceNumber", + PossibleTypes = new [] { typeof(string) })] + public string PartnerCustomerServiceNumber { get => PartnerRegistrationInfoBody.PartnerCustomerServiceNumber ?? null; set => PartnerRegistrationInfoBody.PartnerCustomerServiceNumber = value; } + + /// Official name of the partner name. For example: "Contoso". + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Official name of the partner name. For example: \"Contoso\".")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Official name of the partner name. For example: ""Contoso"".", + SerializedName = @"partnerName", + PossibleTypes = new [] { typeof(string) })] + public string PartnerName { get => PartnerRegistrationInfoBody.PartnerName ?? null; set => PartnerRegistrationInfoBody.PartnerName = value; } + + /// The immutableId of the corresponding partner registration. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The immutableId of the corresponding partner registration.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The immutableId of the corresponding partner registration.", + SerializedName = @"partnerRegistrationImmutableId", + PossibleTypes = new [] { typeof(string) })] + public string PartnerRegistrationImmutableId { get => PartnerRegistrationInfoBody.ImmutableId ?? null; set => PartnerRegistrationInfoBody.ImmutableId = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistration _partnerRegistrationInfoBody= new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerRegistration(); + + /// Information about a partner registration. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistration PartnerRegistrationInfoBody { get => this._partnerRegistrationInfoBody; set => this._partnerRegistrationInfoBody = value; } + + /// + /// Short description of the partner resource type. The length of this description should not exceed 256 characters. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Short description of the partner resource type. The length of this description should not exceed 256 characters.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Short description of the partner resource type. The length of this description should not exceed 256 characters.", + SerializedName = @"partnerResourceTypeDescription", + PossibleTypes = new [] { typeof(string) })] + public string PartnerResourceTypeDescription { get => PartnerRegistrationInfoBody.PartnerResourceTypeDescription ?? null; set => PartnerRegistrationInfoBody.PartnerResourceTypeDescription = value; } + + /// Display name of the partner resource type. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Display name of the partner resource type.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Display name of the partner resource type.", + SerializedName = @"partnerResourceTypeDisplayName", + PossibleTypes = new [] { typeof(string) })] + public string PartnerResourceTypeDisplayName { get => PartnerRegistrationInfoBody.PartnerResourceTypeDisplayName ?? null; set => PartnerRegistrationInfoBody.PartnerResourceTypeDisplayName = value; } + + /// Name of the partner resource type. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Name of the partner resource type.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the partner resource type.", + SerializedName = @"partnerResourceTypeName", + PossibleTypes = new [] { typeof(string) })] + public string PartnerResourceTypeName { get => PartnerRegistrationInfoBody.PartnerResourceTypeName ?? null; set => PartnerRegistrationInfoBody.PartnerResourceTypeName = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// + /// URI of the partner website that can be used by Azure customers to setup Event Gridintegration on an event source. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "URI of the partner website that can be used by Azure customers to setup Event Gridintegration on an event source.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"URI of the partner website that can be used by Azure customers to setup Event Gridintegration on an event source.", + SerializedName = @"setupUri", + PossibleTypes = new [] { typeof(string) })] + public string SetupUri { get => PartnerRegistrationInfoBody.SetupUri ?? null; set => PartnerRegistrationInfoBody.SetupUri = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Tags of the resource. + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Tags of the resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Tags of the resource.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceTags Tag { get => PartnerRegistrationInfoBody.Tag ?? null /* object */; set => PartnerRegistrationInfoBody.Tag = value; } + + /// Visibility state of the partner registration. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Visibility state of the partner registration.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Visibility state of the partner registration.", + SerializedName = @"visibilityState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerRegistrationVisibilityState) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerRegistrationVisibilityState))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerRegistrationVisibilityState VisibilityState { get => PartnerRegistrationInfoBody.VisibilityState ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerRegistrationVisibilityState)""); set => PartnerRegistrationInfoBody.VisibilityState = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzEventGridPartnerRegistration_CreateExpanded + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets.NewAzEventGridPartnerRegistration_CreateExpanded Clone() + { + var clone = new NewAzEventGridPartnerRegistration_CreateExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.PartnerRegistrationInfoBody = this.PartnerRegistrationInfoBody; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.Name = this.Name; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public NewAzEventGridPartnerRegistration_CreateExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'PartnerRegistrationsCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.PartnerRegistrationsCreateOrUpdate(SubscriptionId, ResourceGroupName, Name, PartnerRegistrationInfoBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name,body=PartnerRegistrationInfoBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name, body=PartnerRegistrationInfoBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistration + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/NewAzEventGridPartnerTopicEventSubscription_CreateExpanded.cs b/swaggerci/eventgrid/generated/cmdlets/NewAzEventGridPartnerTopicEventSubscription_CreateExpanded.cs new file mode 100644 index 000000000000..26e641f686d5 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/NewAzEventGridPartnerTopicEventSubscription_CreateExpanded.cs @@ -0,0 +1,708 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// + /// Asynchronously creates or updates an event subscription of a partner topic with the specified parameters. Existing event + /// subscriptions will be updated with this API. + /// + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerTopics/{partnerTopicName}/eventSubscriptions/{eventSubscriptionName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzEventGridPartnerTopicEventSubscription_CreateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Asynchronously creates or updates an event subscription of a partner topic with the specified parameters. Existing event subscriptions will be updated with this API.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class NewAzEventGridPartnerTopicEventSubscription_CreateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType DeadLetterWithResourceIdentityType { get => EventSubscriptionInfoBody.DeadLetterWithResourceIdentityType ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType)""); set => EventSubscriptionInfoBody.DeadLetterWithResourceIdentityType = value; } + + /// The user identity associated with the resource. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The user identity associated with the resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The user identity associated with the resource.", + SerializedName = @"userAssignedIdentity", + PossibleTypes = new [] { typeof(string) })] + public string DeadLetterWithResourceIdentityUserAssignedIdentity { get => EventSubscriptionInfoBody.DeadLetterWithResourceIdentityUserAssignedIdentity ?? null; set => EventSubscriptionInfoBody.DeadLetterWithResourceIdentityUserAssignedIdentity = value; } + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Type of the endpoint for the event subscription destination. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Type of the endpoint for the event subscription destination.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of the endpoint for the event subscription destination.", + SerializedName = @"endpointType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType DeliveryWithResourceIdentityDestinationEndpointType { get => EventSubscriptionInfoBody.DeliveryWithResourceIdentityDestinationEndpointType ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType)""); set => EventSubscriptionInfoBody.DeliveryWithResourceIdentityDestinationEndpointType = value; } + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType DeliveryWithResourceIdentityType { get => EventSubscriptionInfoBody.DeliveryWithResourceIdentityType ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType)""); set => EventSubscriptionInfoBody.DeliveryWithResourceIdentityType = value; } + + /// The user identity associated with the resource. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The user identity associated with the resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The user identity associated with the resource.", + SerializedName = @"userAssignedIdentity", + PossibleTypes = new [] { typeof(string) })] + public string DeliveryWithResourceIdentityUserAssignedIdentity { get => EventSubscriptionInfoBody.DeliveryWithResourceIdentityUserAssignedIdentity ?? null; set => EventSubscriptionInfoBody.DeliveryWithResourceIdentityUserAssignedIdentity = value; } + + /// Type of the endpoint for the event subscription destination. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Type of the endpoint for the event subscription destination.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of the endpoint for the event subscription destination.", + SerializedName = @"endpointType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType EndpointType { get => EventSubscriptionInfoBody.EndpointType ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType)""); set => EventSubscriptionInfoBody.EndpointType = value; } + + /// The event delivery schema for the event subscription. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The event delivery schema for the event subscription.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The event delivery schema for the event subscription.", + SerializedName = @"eventDeliverySchema", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema EventDeliverySchema { get => EventSubscriptionInfoBody.EventDeliverySchema ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema)""); set => EventSubscriptionInfoBody.EventDeliverySchema = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription _eventSubscriptionInfoBody= new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscription(); + + /// Event Subscription + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription EventSubscriptionInfoBody { get => this._eventSubscriptionInfoBody; set => this._eventSubscriptionInfoBody = value; } + + /// Backing field for property. + private string _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. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "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.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"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.", + SerializedName = @"eventSubscriptionName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string EventSubscriptionName { get => this._eventSubscriptionName; set => this._eventSubscriptionName = value; } + + /// Expiration time of the event subscription. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Expiration time of the event subscription.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Expiration time of the event subscription.", + SerializedName = @"expirationTimeUtc", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime ExpirationTimeUtc { get => EventSubscriptionInfoBody.ExpirationTimeUtc ?? default(global::System.DateTime); set => EventSubscriptionInfoBody.ExpirationTimeUtc = value; } + + /// An array of advanced filters that are used for filtering event subscriptions. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "An array of advanced filters that are used for filtering event subscriptions.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An array of advanced filters that are used for filtering event subscriptions.", + SerializedName = @"advancedFilters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter) })] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[] FilterAdvancedFilter { get => EventSubscriptionInfoBody.FilterAdvancedFilter ?? null /* arrayOf */; set => EventSubscriptionInfoBody.FilterAdvancedFilter = value; } + + /// + /// Allows advanced filters to be evaluated against an array of values instead of expecting a singular value. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Allows advanced filters to be evaluated against an array of values instead of expecting a singular value.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allows advanced filters to be evaluated against an array of values instead of expecting a singular value.", + SerializedName = @"enableAdvancedFilteringOnArrays", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter FilterEnableAdvancedFilteringOnArray { get => EventSubscriptionInfoBody.FilterEnableAdvancedFilteringOnArray ?? default(global::System.Management.Automation.SwitchParameter); set => EventSubscriptionInfoBody.FilterEnableAdvancedFilteringOnArray = value; } + + /// + /// 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. + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"includedEventTypes", + PossibleTypes = new [] { typeof(string) })] + public string[] FilterIncludedEventType { get => EventSubscriptionInfoBody.FilterIncludedEventType ?? null /* arrayOf */; set => EventSubscriptionInfoBody.FilterIncludedEventType = value; } + + /// + /// Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filtershould be compared in a case sensitive + /// manner. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filtershould be compared in a case sensitive manner.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filtershould be compared in a case sensitive manner.", + SerializedName = @"isSubjectCaseSensitive", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter FilterIsSubjectCaseSensitive { get => EventSubscriptionInfoBody.FilterIsSubjectCaseSensitive ?? default(global::System.Management.Automation.SwitchParameter); set => EventSubscriptionInfoBody.FilterIsSubjectCaseSensitive = value; } + + /// + /// An optional string to filter events for an event subscription based on a resource path prefix.The format of this depends + /// on the publisher of the events.Wildcard characters are not supported in this path. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "An optional string to filter events for an event subscription based on a resource path prefix.The format of this depends on the publisher of the events.Wildcard characters are not supported in this path.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An optional string to filter events for an event subscription based on a resource path prefix.The format of this depends on the publisher of the events.Wildcard characters are not supported in this path.", + SerializedName = @"subjectBeginsWith", + PossibleTypes = new [] { typeof(string) })] + public string FilterSubjectBeginsWith { get => EventSubscriptionInfoBody.FilterSubjectBeginsWith ?? null; set => EventSubscriptionInfoBody.FilterSubjectBeginsWith = value; } + + /// + /// An optional string to filter events for an event subscription based on a resource path suffix.Wildcard characters are + /// not supported in this path. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "An optional string to filter events for an event subscription based on a resource path suffix.Wildcard characters are not supported in this path.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An optional string to filter events for an event subscription based on a resource path suffix.Wildcard characters are not supported in this path.", + SerializedName = @"subjectEndsWith", + PossibleTypes = new [] { typeof(string) })] + public string FilterSubjectEndsWith { get => EventSubscriptionInfoBody.FilterSubjectEndsWith ?? null; set => EventSubscriptionInfoBody.FilterSubjectEndsWith = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// List of user defined labels. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "List of user defined labels.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of user defined labels.", + SerializedName = @"labels", + PossibleTypes = new [] { typeof(string) })] + public string[] Label { get => EventSubscriptionInfoBody.Label ?? null /* arrayOf */; set => EventSubscriptionInfoBody.Label = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// Backing field for property. + private string _partnerTopicName; + + /// Name of the partner topic. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the partner topic.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the partner topic.", + SerializedName = @"partnerTopicName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string PartnerTopicName { get => this._partnerTopicName; set => this._partnerTopicName = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Time To Live (in minutes) for events. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Time To Live (in minutes) for events.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Time To Live (in minutes) for events.", + SerializedName = @"eventTimeToLiveInMinutes", + PossibleTypes = new [] { typeof(int) })] + public int RetryPolicyEventTimeToLiveInMinute { get => EventSubscriptionInfoBody.RetryPolicyEventTimeToLiveInMinute ?? default(int); set => EventSubscriptionInfoBody.RetryPolicyEventTimeToLiveInMinute = value; } + + /// Maximum number of delivery retry attempts for events. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Maximum number of delivery retry attempts for events.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Maximum number of delivery retry attempts for events.", + SerializedName = @"maxDeliveryAttempts", + PossibleTypes = new [] { typeof(int) })] + public int RetryPolicyMaxDeliveryAttempt { get => EventSubscriptionInfoBody.RetryPolicyMaxDeliveryAttempt ?? default(int); set => EventSubscriptionInfoBody.RetryPolicyMaxDeliveryAttempt = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of NewAzEventGridPartnerTopicEventSubscription_CreateExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets.NewAzEventGridPartnerTopicEventSubscription_CreateExpanded Clone() + { + var clone = new NewAzEventGridPartnerTopicEventSubscription_CreateExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.EventSubscriptionInfoBody = this.EventSubscriptionInfoBody; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.PartnerTopicName = this.PartnerTopicName; + clone.EventSubscriptionName = this.EventSubscriptionName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public NewAzEventGridPartnerTopicEventSubscription_CreateExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'PartnerTopicEventSubscriptionsCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.PartnerTopicEventSubscriptionsCreateOrUpdate(SubscriptionId, ResourceGroupName, PartnerTopicName, EventSubscriptionName, EventSubscriptionInfoBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PartnerTopicName=PartnerTopicName,EventSubscriptionName=EventSubscriptionName,body=EventSubscriptionInfoBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PartnerTopicName=PartnerTopicName, EventSubscriptionName=EventSubscriptionName, body=EventSubscriptionInfoBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/NewAzEventGridPartnerTopic_CreateExpanded.cs b/swaggerci/eventgrid/generated/cmdlets/NewAzEventGridPartnerTopic_CreateExpanded.cs new file mode 100644 index 000000000000..a725e0d27d1c --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/NewAzEventGridPartnerTopic_CreateExpanded.cs @@ -0,0 +1,621 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Asynchronously creates a new partner topic with the specified parameters. + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerTopics/{partnerTopicName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzEventGridPartnerTopic_CreateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopic))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Asynchronously creates a new partner topic with the specified parameters.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class NewAzEventGridPartnerTopic_CreateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Activation state of the partner topic. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Activation state of the partner topic.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Activation state of the partner topic.", + SerializedName = @"activationState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicActivationState) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicActivationState))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicActivationState ActivationState { get => PartnerTopicInfoBody.ActivationState ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PartnerTopicActivationState)""); set => PartnerTopicInfoBody.ActivationState = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// + /// A collection of inline event types for the resource. The inline event type keys are of type string which represents the + /// name of the event.An example of a valid inline event name is "Contoso.OrderCreated".The inline event type values are of + /// type InlineEventProperties and will contain additional information for every inline event type. + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "A collection of inline event types for the resource. The inline event type keys are of type string which represents the name of the event.An example of a valid inline event name is \"Contoso.OrderCreated\".The inline event type values are of type InlineEventProperties and will contain additional information for every inline event type.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A collection of inline event types for the resource. The inline event type keys are of type string which represents the name of the event.An example of a valid inline event name is ""Contoso.OrderCreated"".The inline event type values are of type InlineEventProperties and will contain additional information for every inline event type.", + SerializedName = @"inlineEventTypes", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInlineEventTypes) })] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInlineEventTypes EventTypeInfoInlineEventType { get => PartnerTopicInfoBody.EventTypeInfoInlineEventType ?? null /* object */; set => PartnerTopicInfoBody.EventTypeInfoInlineEventType = value; } + + /// The kind of event type used. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The kind of event type used.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The kind of event type used.", + SerializedName = @"kind", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind EventTypeInfoKind { get => PartnerTopicInfoBody.EventTypeInfoKind ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind)""); set => PartnerTopicInfoBody.EventTypeInfoKind = value; } + + /// + /// Expiration time of the partner topic. If this timer expires while the partner topic is still never activated,the partner + /// topic and corresponding event channel are deleted. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Expiration time of the partner topic. If this timer expires while the partner topic is still never activated,the partner topic and corresponding event channel are deleted.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Expiration time of the partner topic. If this timer expires while the partner topic is still never activated,the partner topic and corresponding event channel are deleted.", + SerializedName = @"expirationTimeIfNotActivatedUtc", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime ExpirationTimeIfNotActivatedUtc { get => PartnerTopicInfoBody.ExpirationTimeIfNotActivatedUtc ?? default(global::System.DateTime); set => PartnerTopicInfoBody.ExpirationTimeIfNotActivatedUtc = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// The principal ID of resource identity. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The principal ID of resource identity.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The principal ID of resource identity.", + SerializedName = @"principalId", + PossibleTypes = new [] { typeof(string) })] + public string IdentityPrincipalId { get => PartnerTopicInfoBody.IdentityPrincipalId ?? null; set => PartnerTopicInfoBody.IdentityPrincipalId = value; } + + /// The tenant ID of resource. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The tenant ID of resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The tenant ID of resource.", + SerializedName = @"tenantId", + PossibleTypes = new [] { typeof(string) })] + public string IdentityTenantId { get => PartnerTopicInfoBody.IdentityTenantId ?? null; set => PartnerTopicInfoBody.IdentityTenantId = value; } + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType IdentityType { get => PartnerTopicInfoBody.IdentityType ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType)""); set => PartnerTopicInfoBody.IdentityType = value; } + + /// + /// The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource + /// ids in the form:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.This + /// property is currently not used and reserved for future usage. + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource ids in the form:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.This property is currently not used and reserved for future usage.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource ids in the form:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.This property is currently not used and reserved for future usage.", + SerializedName = @"userAssignedIdentities", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities) })] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities IdentityUserAssignedIdentity { get => PartnerTopicInfoBody.IdentityUserAssignedIdentity ?? null /* object */; set => PartnerTopicInfoBody.IdentityUserAssignedIdentity = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Location of the resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Location of the resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Location of the resource.", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + public string Location { get => PartnerTopicInfoBody.Location ?? null; set => PartnerTopicInfoBody.Location = value; } + + /// + /// Context or helpful message that can be used during the approval process by the subscriber. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Context or helpful message that can be used during the approval process by the subscriber.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Context or helpful message that can be used during the approval process by the subscriber.", + SerializedName = @"messageForActivation", + PossibleTypes = new [] { typeof(string) })] + public string MessageForActivation { get => PartnerTopicInfoBody.MessageForActivation ?? null; set => PartnerTopicInfoBody.MessageForActivation = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the partner topic. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the partner topic.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the partner topic.", + SerializedName = @"partnerTopicName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("PartnerTopicName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// The immutableId of the corresponding partner registration. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The immutableId of the corresponding partner registration.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The immutableId of the corresponding partner registration.", + SerializedName = @"partnerRegistrationImmutableId", + PossibleTypes = new [] { typeof(string) })] + public string PartnerRegistrationImmutableId { get => PartnerTopicInfoBody.PartnerRegistrationImmutableId ?? null; set => PartnerTopicInfoBody.PartnerRegistrationImmutableId = value; } + + /// + /// Friendly description about the topic. This can be set by the publisher/partner to show custom description for the customer + /// partner topic.This will be helpful to remove any ambiguity of the origin of creation of the partner topic for the customer. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Friendly description about the topic. This can be set by the publisher/partner to show custom description for the customer partner topic.This will be helpful to remove any ambiguity of the origin of creation of the partner topic for the customer.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Friendly description about the topic. This can be set by the publisher/partner to show custom description for the customer partner topic.This will be helpful to remove any ambiguity of the origin of creation of the partner topic for the customer.", + SerializedName = @"partnerTopicFriendlyDescription", + PossibleTypes = new [] { typeof(string) })] + public string PartnerTopicFriendlyDescription { get => PartnerTopicInfoBody.FriendlyDescription ?? null; set => PartnerTopicInfoBody.FriendlyDescription = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopic _partnerTopicInfoBody= new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerTopic(); + + /// Event Grid Partner Topic. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopic PartnerTopicInfoBody { get => this._partnerTopicInfoBody; set => this._partnerTopicInfoBody = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// + /// Source associated with this partner topic. This represents a unique partner resource. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Source associated with this partner topic. This represents a unique partner resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Source associated with this partner topic. This represents a unique partner resource.", + SerializedName = @"source", + PossibleTypes = new [] { typeof(string) })] + public string Source { get => PartnerTopicInfoBody.Source ?? null; set => PartnerTopicInfoBody.Source = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Tags of the resource. + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Tags of the resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Tags of the resource.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceTags Tag { get => PartnerTopicInfoBody.Tag ?? null /* object */; set => PartnerTopicInfoBody.Tag = value; } + + /// + /// overrideOnCreated will be called before the regular onCreated has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onCreated method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public NewAzEventGridPartnerTopic_CreateExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'PartnerTopicsCreateOrUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.PartnerTopicsCreateOrUpdate(SubscriptionId, ResourceGroupName, Name, PartnerTopicInfoBody, onOk, onCreated, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name,body=PartnerTopicInfoBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// a delegate that is called when the remote service returns 201 (Created). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnCreated(responseMessage, response, ref _returnNow); + // if overrideOnCreated has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onCreated - response for 201 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopic + WriteObject((await response)); + } + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name, body=PartnerTopicInfoBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopic + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/NewAzEventGridSystemTopicEventSubscription_CreateExpanded.cs b/swaggerci/eventgrid/generated/cmdlets/NewAzEventGridSystemTopicEventSubscription_CreateExpanded.cs new file mode 100644 index 000000000000..1fbc4bccce6e --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/NewAzEventGridSystemTopicEventSubscription_CreateExpanded.cs @@ -0,0 +1,672 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// + /// Asynchronously creates or updates an event subscription with the specified parameters. Existing event subscriptions will + /// be updated with this API. + /// + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/systemTopics/{systemTopicName}/eventSubscriptions/{eventSubscriptionName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzEventGridSystemTopicEventSubscription_CreateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Asynchronously creates or updates an event subscription with the specified parameters. Existing event subscriptions will be updated with this API.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class NewAzEventGridSystemTopicEventSubscription_CreateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType DeadLetterWithResourceIdentityType { get => EventSubscriptionInfoBody.DeadLetterWithResourceIdentityType ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType)""); set => EventSubscriptionInfoBody.DeadLetterWithResourceIdentityType = value; } + + /// The user identity associated with the resource. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The user identity associated with the resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The user identity associated with the resource.", + SerializedName = @"userAssignedIdentity", + PossibleTypes = new [] { typeof(string) })] + public string DeadLetterWithResourceIdentityUserAssignedIdentity { get => EventSubscriptionInfoBody.DeadLetterWithResourceIdentityUserAssignedIdentity ?? null; set => EventSubscriptionInfoBody.DeadLetterWithResourceIdentityUserAssignedIdentity = value; } + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Type of the endpoint for the event subscription destination. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Type of the endpoint for the event subscription destination.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of the endpoint for the event subscription destination.", + SerializedName = @"endpointType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType DeliveryWithResourceIdentityDestinationEndpointType { get => EventSubscriptionInfoBody.DeliveryWithResourceIdentityDestinationEndpointType ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType)""); set => EventSubscriptionInfoBody.DeliveryWithResourceIdentityDestinationEndpointType = value; } + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType DeliveryWithResourceIdentityType { get => EventSubscriptionInfoBody.DeliveryWithResourceIdentityType ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType)""); set => EventSubscriptionInfoBody.DeliveryWithResourceIdentityType = value; } + + /// The user identity associated with the resource. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The user identity associated with the resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The user identity associated with the resource.", + SerializedName = @"userAssignedIdentity", + PossibleTypes = new [] { typeof(string) })] + public string DeliveryWithResourceIdentityUserAssignedIdentity { get => EventSubscriptionInfoBody.DeliveryWithResourceIdentityUserAssignedIdentity ?? null; set => EventSubscriptionInfoBody.DeliveryWithResourceIdentityUserAssignedIdentity = value; } + + /// Type of the endpoint for the event subscription destination. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Type of the endpoint for the event subscription destination.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of the endpoint for the event subscription destination.", + SerializedName = @"endpointType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType EndpointType { get => EventSubscriptionInfoBody.EndpointType ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType)""); set => EventSubscriptionInfoBody.EndpointType = value; } + + /// The event delivery schema for the event subscription. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The event delivery schema for the event subscription.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The event delivery schema for the event subscription.", + SerializedName = @"eventDeliverySchema", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema EventDeliverySchema { get => EventSubscriptionInfoBody.EventDeliverySchema ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema)""); set => EventSubscriptionInfoBody.EventDeliverySchema = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription _eventSubscriptionInfoBody= new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscription(); + + /// Event Subscription + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription EventSubscriptionInfoBody { get => this._eventSubscriptionInfoBody; set => this._eventSubscriptionInfoBody = value; } + + /// Backing field for property. + private string _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. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "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.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"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.", + SerializedName = @"eventSubscriptionName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string EventSubscriptionName { get => this._eventSubscriptionName; set => this._eventSubscriptionName = value; } + + /// Expiration time of the event subscription. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Expiration time of the event subscription.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Expiration time of the event subscription.", + SerializedName = @"expirationTimeUtc", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime ExpirationTimeUtc { get => EventSubscriptionInfoBody.ExpirationTimeUtc ?? default(global::System.DateTime); set => EventSubscriptionInfoBody.ExpirationTimeUtc = value; } + + /// An array of advanced filters that are used for filtering event subscriptions. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "An array of advanced filters that are used for filtering event subscriptions.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An array of advanced filters that are used for filtering event subscriptions.", + SerializedName = @"advancedFilters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter) })] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[] FilterAdvancedFilter { get => EventSubscriptionInfoBody.FilterAdvancedFilter ?? null /* arrayOf */; set => EventSubscriptionInfoBody.FilterAdvancedFilter = value; } + + /// + /// Allows advanced filters to be evaluated against an array of values instead of expecting a singular value. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Allows advanced filters to be evaluated against an array of values instead of expecting a singular value.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allows advanced filters to be evaluated against an array of values instead of expecting a singular value.", + SerializedName = @"enableAdvancedFilteringOnArrays", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter FilterEnableAdvancedFilteringOnArray { get => EventSubscriptionInfoBody.FilterEnableAdvancedFilteringOnArray ?? default(global::System.Management.Automation.SwitchParameter); set => EventSubscriptionInfoBody.FilterEnableAdvancedFilteringOnArray = value; } + + /// + /// 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. + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"includedEventTypes", + PossibleTypes = new [] { typeof(string) })] + public string[] FilterIncludedEventType { get => EventSubscriptionInfoBody.FilterIncludedEventType ?? null /* arrayOf */; set => EventSubscriptionInfoBody.FilterIncludedEventType = value; } + + /// + /// Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filtershould be compared in a case sensitive + /// manner. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filtershould be compared in a case sensitive manner.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filtershould be compared in a case sensitive manner.", + SerializedName = @"isSubjectCaseSensitive", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter FilterIsSubjectCaseSensitive { get => EventSubscriptionInfoBody.FilterIsSubjectCaseSensitive ?? default(global::System.Management.Automation.SwitchParameter); set => EventSubscriptionInfoBody.FilterIsSubjectCaseSensitive = value; } + + /// + /// An optional string to filter events for an event subscription based on a resource path prefix.The format of this depends + /// on the publisher of the events.Wildcard characters are not supported in this path. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "An optional string to filter events for an event subscription based on a resource path prefix.The format of this depends on the publisher of the events.Wildcard characters are not supported in this path.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An optional string to filter events for an event subscription based on a resource path prefix.The format of this depends on the publisher of the events.Wildcard characters are not supported in this path.", + SerializedName = @"subjectBeginsWith", + PossibleTypes = new [] { typeof(string) })] + public string FilterSubjectBeginsWith { get => EventSubscriptionInfoBody.FilterSubjectBeginsWith ?? null; set => EventSubscriptionInfoBody.FilterSubjectBeginsWith = value; } + + /// + /// An optional string to filter events for an event subscription based on a resource path suffix.Wildcard characters are + /// not supported in this path. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "An optional string to filter events for an event subscription based on a resource path suffix.Wildcard characters are not supported in this path.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An optional string to filter events for an event subscription based on a resource path suffix.Wildcard characters are not supported in this path.", + SerializedName = @"subjectEndsWith", + PossibleTypes = new [] { typeof(string) })] + public string FilterSubjectEndsWith { get => EventSubscriptionInfoBody.FilterSubjectEndsWith ?? null; set => EventSubscriptionInfoBody.FilterSubjectEndsWith = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// List of user defined labels. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "List of user defined labels.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of user defined labels.", + SerializedName = @"labels", + PossibleTypes = new [] { typeof(string) })] + public string[] Label { get => EventSubscriptionInfoBody.Label ?? null /* arrayOf */; set => EventSubscriptionInfoBody.Label = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Time To Live (in minutes) for events. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Time To Live (in minutes) for events.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Time To Live (in minutes) for events.", + SerializedName = @"eventTimeToLiveInMinutes", + PossibleTypes = new [] { typeof(int) })] + public int RetryPolicyEventTimeToLiveInMinute { get => EventSubscriptionInfoBody.RetryPolicyEventTimeToLiveInMinute ?? default(int); set => EventSubscriptionInfoBody.RetryPolicyEventTimeToLiveInMinute = value; } + + /// Maximum number of delivery retry attempts for events. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Maximum number of delivery retry attempts for events.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Maximum number of delivery retry attempts for events.", + SerializedName = @"maxDeliveryAttempts", + PossibleTypes = new [] { typeof(int) })] + public int RetryPolicyMaxDeliveryAttempt { get => EventSubscriptionInfoBody.RetryPolicyMaxDeliveryAttempt ?? default(int); set => EventSubscriptionInfoBody.RetryPolicyMaxDeliveryAttempt = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _systemTopicName; + + /// Name of the system topic. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the system topic.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the system topic.", + SerializedName = @"systemTopicName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string SystemTopicName { get => this._systemTopicName; set => this._systemTopicName = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of NewAzEventGridSystemTopicEventSubscription_CreateExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets.NewAzEventGridSystemTopicEventSubscription_CreateExpanded Clone() + { + var clone = new NewAzEventGridSystemTopicEventSubscription_CreateExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.EventSubscriptionInfoBody = this.EventSubscriptionInfoBody; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.SystemTopicName = this.SystemTopicName; + clone.EventSubscriptionName = this.EventSubscriptionName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public NewAzEventGridSystemTopicEventSubscription_CreateExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'SystemTopicEventSubscriptionsCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.SystemTopicEventSubscriptionsCreateOrUpdate(SubscriptionId, ResourceGroupName, SystemTopicName, EventSubscriptionName, EventSubscriptionInfoBody, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,SystemTopicName=SystemTopicName,EventSubscriptionName=EventSubscriptionName,body=EventSubscriptionInfoBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, SystemTopicName=SystemTopicName, EventSubscriptionName=EventSubscriptionName, body=EventSubscriptionInfoBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/NewAzEventGridSystemTopic_CreateExpanded.cs b/swaggerci/eventgrid/generated/cmdlets/NewAzEventGridSystemTopic_CreateExpanded.cs new file mode 100644 index 000000000000..54d81877783b --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/NewAzEventGridSystemTopic_CreateExpanded.cs @@ -0,0 +1,569 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Asynchronously creates a new system topic with the specified parameters. + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/systemTopics/{systemTopicName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzEventGridSystemTopic_CreateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopic))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Asynchronously creates a new system topic with the specified parameters.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class NewAzEventGridSystemTopic_CreateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// The principal ID of resource identity. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The principal ID of resource identity.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The principal ID of resource identity.", + SerializedName = @"principalId", + PossibleTypes = new [] { typeof(string) })] + public string IdentityPrincipalId { get => SystemTopicInfoBody.IdentityPrincipalId ?? null; set => SystemTopicInfoBody.IdentityPrincipalId = value; } + + /// The tenant ID of resource. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The tenant ID of resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The tenant ID of resource.", + SerializedName = @"tenantId", + PossibleTypes = new [] { typeof(string) })] + public string IdentityTenantId { get => SystemTopicInfoBody.IdentityTenantId ?? null; set => SystemTopicInfoBody.IdentityTenantId = value; } + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType IdentityType { get => SystemTopicInfoBody.IdentityType ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType)""); set => SystemTopicInfoBody.IdentityType = value; } + + /// + /// The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource + /// ids in the form:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.This + /// property is currently not used and reserved for future usage. + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource ids in the form:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.This property is currently not used and reserved for future usage.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource ids in the form:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.This property is currently not used and reserved for future usage.", + SerializedName = @"userAssignedIdentities", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities) })] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities IdentityUserAssignedIdentity { get => SystemTopicInfoBody.IdentityUserAssignedIdentity ?? null /* object */; set => SystemTopicInfoBody.IdentityUserAssignedIdentity = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Location of the resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Location of the resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Location of the resource.", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + public string Location { get => SystemTopicInfoBody.Location ?? null; set => SystemTopicInfoBody.Location = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the system topic. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the system topic.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the system topic.", + SerializedName = @"systemTopicName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("SystemTopicName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Source for the system topic. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Source for the system topic.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Source for the system topic.", + SerializedName = @"source", + PossibleTypes = new [] { typeof(string) })] + public string Source { get => SystemTopicInfoBody.Source ?? null; set => SystemTopicInfoBody.Source = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopic _systemTopicInfoBody= new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.SystemTopic(); + + /// EventGrid System Topic. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopic SystemTopicInfoBody { get => this._systemTopicInfoBody; set => this._systemTopicInfoBody = value; } + + /// Tags of the resource. + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Tags of the resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Tags of the resource.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceTags Tag { get => SystemTopicInfoBody.Tag ?? null /* object */; set => SystemTopicInfoBody.Tag = value; } + + /// TopicType for the system topic. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "TopicType for the system topic.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"TopicType for the system topic.", + SerializedName = @"topicType", + PossibleTypes = new [] { typeof(string) })] + public string TopicType { get => SystemTopicInfoBody.TopicType ?? null; set => SystemTopicInfoBody.TopicType = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzEventGridSystemTopic_CreateExpanded + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets.NewAzEventGridSystemTopic_CreateExpanded Clone() + { + var clone = new NewAzEventGridSystemTopic_CreateExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SystemTopicInfoBody = this.SystemTopicInfoBody; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.Name = this.Name; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public NewAzEventGridSystemTopic_CreateExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'SystemTopicsCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.SystemTopicsCreateOrUpdate(SubscriptionId, ResourceGroupName, Name, SystemTopicInfoBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name,body=SystemTopicInfoBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name, body=SystemTopicInfoBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopic + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/NewAzEventGridTopicEventSubscription_CreateExpanded.cs b/swaggerci/eventgrid/generated/cmdlets/NewAzEventGridTopicEventSubscription_CreateExpanded.cs new file mode 100644 index 000000000000..0ab985abe50d --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/NewAzEventGridTopicEventSubscription_CreateExpanded.cs @@ -0,0 +1,705 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// + /// Asynchronously creates a new event subscription or updates an existing event subscription. + /// + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}/eventSubscriptions/{eventSubscriptionName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzEventGridTopicEventSubscription_CreateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Asynchronously creates a new event subscription or updates an existing event subscription.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class NewAzEventGridTopicEventSubscription_CreateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType DeadLetterWithResourceIdentityType { get => EventSubscriptionInfoBody.DeadLetterWithResourceIdentityType ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType)""); set => EventSubscriptionInfoBody.DeadLetterWithResourceIdentityType = value; } + + /// The user identity associated with the resource. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The user identity associated with the resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The user identity associated with the resource.", + SerializedName = @"userAssignedIdentity", + PossibleTypes = new [] { typeof(string) })] + public string DeadLetterWithResourceIdentityUserAssignedIdentity { get => EventSubscriptionInfoBody.DeadLetterWithResourceIdentityUserAssignedIdentity ?? null; set => EventSubscriptionInfoBody.DeadLetterWithResourceIdentityUserAssignedIdentity = value; } + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Type of the endpoint for the event subscription destination. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Type of the endpoint for the event subscription destination.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of the endpoint for the event subscription destination.", + SerializedName = @"endpointType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType DeliveryWithResourceIdentityDestinationEndpointType { get => EventSubscriptionInfoBody.DeliveryWithResourceIdentityDestinationEndpointType ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType)""); set => EventSubscriptionInfoBody.DeliveryWithResourceIdentityDestinationEndpointType = value; } + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType DeliveryWithResourceIdentityType { get => EventSubscriptionInfoBody.DeliveryWithResourceIdentityType ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType)""); set => EventSubscriptionInfoBody.DeliveryWithResourceIdentityType = value; } + + /// The user identity associated with the resource. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The user identity associated with the resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The user identity associated with the resource.", + SerializedName = @"userAssignedIdentity", + PossibleTypes = new [] { typeof(string) })] + public string DeliveryWithResourceIdentityUserAssignedIdentity { get => EventSubscriptionInfoBody.DeliveryWithResourceIdentityUserAssignedIdentity ?? null; set => EventSubscriptionInfoBody.DeliveryWithResourceIdentityUserAssignedIdentity = value; } + + /// Type of the endpoint for the event subscription destination. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Type of the endpoint for the event subscription destination.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of the endpoint for the event subscription destination.", + SerializedName = @"endpointType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType EndpointType { get => EventSubscriptionInfoBody.EndpointType ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType)""); set => EventSubscriptionInfoBody.EndpointType = value; } + + /// The event delivery schema for the event subscription. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The event delivery schema for the event subscription.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The event delivery schema for the event subscription.", + SerializedName = @"eventDeliverySchema", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema EventDeliverySchema { get => EventSubscriptionInfoBody.EventDeliverySchema ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema)""); set => EventSubscriptionInfoBody.EventDeliverySchema = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription _eventSubscriptionInfoBody= new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscription(); + + /// Event Subscription + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription EventSubscriptionInfoBody { get => this._eventSubscriptionInfoBody; set => this._eventSubscriptionInfoBody = value; } + + /// Backing field for property. + private string _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. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "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.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"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.", + SerializedName = @"eventSubscriptionName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string EventSubscriptionName { get => this._eventSubscriptionName; set => this._eventSubscriptionName = value; } + + /// Expiration time of the event subscription. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Expiration time of the event subscription.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Expiration time of the event subscription.", + SerializedName = @"expirationTimeUtc", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime ExpirationTimeUtc { get => EventSubscriptionInfoBody.ExpirationTimeUtc ?? default(global::System.DateTime); set => EventSubscriptionInfoBody.ExpirationTimeUtc = value; } + + /// An array of advanced filters that are used for filtering event subscriptions. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "An array of advanced filters that are used for filtering event subscriptions.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An array of advanced filters that are used for filtering event subscriptions.", + SerializedName = @"advancedFilters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter) })] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[] FilterAdvancedFilter { get => EventSubscriptionInfoBody.FilterAdvancedFilter ?? null /* arrayOf */; set => EventSubscriptionInfoBody.FilterAdvancedFilter = value; } + + /// + /// Allows advanced filters to be evaluated against an array of values instead of expecting a singular value. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Allows advanced filters to be evaluated against an array of values instead of expecting a singular value.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allows advanced filters to be evaluated against an array of values instead of expecting a singular value.", + SerializedName = @"enableAdvancedFilteringOnArrays", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter FilterEnableAdvancedFilteringOnArray { get => EventSubscriptionInfoBody.FilterEnableAdvancedFilteringOnArray ?? default(global::System.Management.Automation.SwitchParameter); set => EventSubscriptionInfoBody.FilterEnableAdvancedFilteringOnArray = value; } + + /// + /// 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. + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"includedEventTypes", + PossibleTypes = new [] { typeof(string) })] + public string[] FilterIncludedEventType { get => EventSubscriptionInfoBody.FilterIncludedEventType ?? null /* arrayOf */; set => EventSubscriptionInfoBody.FilterIncludedEventType = value; } + + /// + /// Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filtershould be compared in a case sensitive + /// manner. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filtershould be compared in a case sensitive manner.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filtershould be compared in a case sensitive manner.", + SerializedName = @"isSubjectCaseSensitive", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter FilterIsSubjectCaseSensitive { get => EventSubscriptionInfoBody.FilterIsSubjectCaseSensitive ?? default(global::System.Management.Automation.SwitchParameter); set => EventSubscriptionInfoBody.FilterIsSubjectCaseSensitive = value; } + + /// + /// An optional string to filter events for an event subscription based on a resource path prefix.The format of this depends + /// on the publisher of the events.Wildcard characters are not supported in this path. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "An optional string to filter events for an event subscription based on a resource path prefix.The format of this depends on the publisher of the events.Wildcard characters are not supported in this path.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An optional string to filter events for an event subscription based on a resource path prefix.The format of this depends on the publisher of the events.Wildcard characters are not supported in this path.", + SerializedName = @"subjectBeginsWith", + PossibleTypes = new [] { typeof(string) })] + public string FilterSubjectBeginsWith { get => EventSubscriptionInfoBody.FilterSubjectBeginsWith ?? null; set => EventSubscriptionInfoBody.FilterSubjectBeginsWith = value; } + + /// + /// An optional string to filter events for an event subscription based on a resource path suffix.Wildcard characters are + /// not supported in this path. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "An optional string to filter events for an event subscription based on a resource path suffix.Wildcard characters are not supported in this path.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An optional string to filter events for an event subscription based on a resource path suffix.Wildcard characters are not supported in this path.", + SerializedName = @"subjectEndsWith", + PossibleTypes = new [] { typeof(string) })] + public string FilterSubjectEndsWith { get => EventSubscriptionInfoBody.FilterSubjectEndsWith ?? null; set => EventSubscriptionInfoBody.FilterSubjectEndsWith = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// List of user defined labels. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "List of user defined labels.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of user defined labels.", + SerializedName = @"labels", + PossibleTypes = new [] { typeof(string) })] + public string[] Label { get => EventSubscriptionInfoBody.Label ?? null /* arrayOf */; set => EventSubscriptionInfoBody.Label = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Time To Live (in minutes) for events. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Time To Live (in minutes) for events.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Time To Live (in minutes) for events.", + SerializedName = @"eventTimeToLiveInMinutes", + PossibleTypes = new [] { typeof(int) })] + public int RetryPolicyEventTimeToLiveInMinute { get => EventSubscriptionInfoBody.RetryPolicyEventTimeToLiveInMinute ?? default(int); set => EventSubscriptionInfoBody.RetryPolicyEventTimeToLiveInMinute = value; } + + /// Maximum number of delivery retry attempts for events. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Maximum number of delivery retry attempts for events.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Maximum number of delivery retry attempts for events.", + SerializedName = @"maxDeliveryAttempts", + PossibleTypes = new [] { typeof(int) })] + public int RetryPolicyMaxDeliveryAttempt { get => EventSubscriptionInfoBody.RetryPolicyMaxDeliveryAttempt ?? default(int); set => EventSubscriptionInfoBody.RetryPolicyMaxDeliveryAttempt = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _topicName; + + /// Name of the domain topic. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the domain topic.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the domain topic.", + SerializedName = @"topicName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string TopicName { get => this._topicName; set => this._topicName = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzEventGridTopicEventSubscription_CreateExpanded + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets.NewAzEventGridTopicEventSubscription_CreateExpanded Clone() + { + var clone = new NewAzEventGridTopicEventSubscription_CreateExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.EventSubscriptionInfoBody = this.EventSubscriptionInfoBody; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.TopicName = this.TopicName; + clone.EventSubscriptionName = this.EventSubscriptionName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public NewAzEventGridTopicEventSubscription_CreateExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'TopicEventSubscriptionsCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.TopicEventSubscriptionsCreateOrUpdate(SubscriptionId, ResourceGroupName, TopicName, EventSubscriptionName, EventSubscriptionInfoBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,TopicName=TopicName,EventSubscriptionName=EventSubscriptionName,body=EventSubscriptionInfoBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, TopicName=TopicName, EventSubscriptionName=EventSubscriptionName, body=EventSubscriptionInfoBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscription + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/NewAzEventGridTopicKey_Regenerate.cs b/swaggerci/eventgrid/generated/cmdlets/NewAzEventGridTopicKey_Regenerate.cs new file mode 100644 index 000000000000..5135489d01d0 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/NewAzEventGridTopicKey_Regenerate.cs @@ -0,0 +1,477 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Regenerate a shared access key for a topic. + /// + /// [OpenAPI] RegenerateKey=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}/regenerateKey" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzEventGridTopicKey_Regenerate", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicSharedAccessKeys))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Regenerate a shared access key for a topic.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class NewAzEventGridTopicKey_Regenerate : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicRegenerateKeyRequest _regenerateKeyRequest; + + /// Topic regenerate share access key request + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Topic regenerate share access key request", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Topic regenerate share access key request", + SerializedName = @"regenerateKeyRequest", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicRegenerateKeyRequest) })] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicRegenerateKeyRequest RegenerateKeyRequest { get => this._regenerateKeyRequest; set => this._regenerateKeyRequest = value; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _topicName; + + /// Name of the topic. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the topic.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the topic.", + SerializedName = @"topicName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string TopicName { get => this._topicName; set => this._topicName = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzEventGridTopicKey_Regenerate + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets.NewAzEventGridTopicKey_Regenerate Clone() + { + var clone = new NewAzEventGridTopicKey_Regenerate(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.TopicName = this.TopicName; + clone.RegenerateKeyRequest = this.RegenerateKeyRequest; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public NewAzEventGridTopicKey_Regenerate() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'TopicsRegenerateKey' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.TopicsRegenerateKey(SubscriptionId, ResourceGroupName, TopicName, RegenerateKeyRequest, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,TopicName=TopicName,body=RegenerateKeyRequest}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, TopicName=TopicName, body=RegenerateKeyRequest }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicSharedAccessKeys + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/NewAzEventGridTopicKey_RegenerateExpanded.cs b/swaggerci/eventgrid/generated/cmdlets/NewAzEventGridTopicKey_RegenerateExpanded.cs new file mode 100644 index 000000000000..735a5b735806 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/NewAzEventGridTopicKey_RegenerateExpanded.cs @@ -0,0 +1,481 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Regenerate a shared access key for a topic. + /// + /// [OpenAPI] RegenerateKey=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}/regenerateKey" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzEventGridTopicKey_RegenerateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicSharedAccessKeys))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Regenerate a shared access key for a topic.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class NewAzEventGridTopicKey_RegenerateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Key name to regenerate key1 or key2 + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Key name to regenerate key1 or key2")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Key name to regenerate key1 or key2", + SerializedName = @"keyName", + PossibleTypes = new [] { typeof(string) })] + public string KeyName { get => RegenerateKeyRequestBody.KeyName ?? null; set => RegenerateKeyRequestBody.KeyName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicRegenerateKeyRequest _regenerateKeyRequestBody= new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.TopicRegenerateKeyRequest(); + + /// Topic regenerate share access key request + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicRegenerateKeyRequest RegenerateKeyRequestBody { get => this._regenerateKeyRequestBody; set => this._regenerateKeyRequestBody = value; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _topicName; + + /// Name of the topic. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the topic.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the topic.", + SerializedName = @"topicName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string TopicName { get => this._topicName; set => this._topicName = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzEventGridTopicKey_RegenerateExpanded + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets.NewAzEventGridTopicKey_RegenerateExpanded Clone() + { + var clone = new NewAzEventGridTopicKey_RegenerateExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.RegenerateKeyRequestBody = this.RegenerateKeyRequestBody; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.TopicName = this.TopicName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public NewAzEventGridTopicKey_RegenerateExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'TopicsRegenerateKey' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.TopicsRegenerateKey(SubscriptionId, ResourceGroupName, TopicName, RegenerateKeyRequestBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,TopicName=TopicName,body=RegenerateKeyRequestBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, TopicName=TopicName, body=RegenerateKeyRequestBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicSharedAccessKeys + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/NewAzEventGridTopicKey_RegenerateViaIdentity.cs b/swaggerci/eventgrid/generated/cmdlets/NewAzEventGridTopicKey_RegenerateViaIdentity.cs new file mode 100644 index 000000000000..9b872cb2a52a --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/NewAzEventGridTopicKey_RegenerateViaIdentity.cs @@ -0,0 +1,453 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Regenerate a shared access key for a topic. + /// + /// [OpenAPI] RegenerateKey=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}/regenerateKey" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzEventGridTopicKey_RegenerateViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicSharedAccessKeys))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Regenerate a shared access key for a topic.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class NewAzEventGridTopicKey_RegenerateViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicRegenerateKeyRequest _regenerateKeyRequest; + + /// Topic regenerate share access key request + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Topic regenerate share access key request", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Topic regenerate share access key request", + SerializedName = @"regenerateKeyRequest", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicRegenerateKeyRequest) })] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicRegenerateKeyRequest RegenerateKeyRequest { get => this._regenerateKeyRequest; set => this._regenerateKeyRequest = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzEventGridTopicKey_RegenerateViaIdentity + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets.NewAzEventGridTopicKey_RegenerateViaIdentity Clone() + { + var clone = new NewAzEventGridTopicKey_RegenerateViaIdentity(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.RegenerateKeyRequest = this.RegenerateKeyRequest; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public NewAzEventGridTopicKey_RegenerateViaIdentity() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'TopicsRegenerateKey' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.TopicsRegenerateKeyViaIdentity(InputObject.Id, RegenerateKeyRequest, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.TopicName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.TopicName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.TopicsRegenerateKey(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.TopicName ?? null, RegenerateKeyRequest, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=RegenerateKeyRequest}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=RegenerateKeyRequest }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicSharedAccessKeys + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/NewAzEventGridTopicKey_RegenerateViaIdentityExpanded.cs b/swaggerci/eventgrid/generated/cmdlets/NewAzEventGridTopicKey_RegenerateViaIdentityExpanded.cs new file mode 100644 index 000000000000..0bdc0b6b96f9 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/NewAzEventGridTopicKey_RegenerateViaIdentityExpanded.cs @@ -0,0 +1,457 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Regenerate a shared access key for a topic. + /// + /// [OpenAPI] RegenerateKey=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}/regenerateKey" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzEventGridTopicKey_RegenerateViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicSharedAccessKeys))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Regenerate a shared access key for a topic.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class NewAzEventGridTopicKey_RegenerateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Key name to regenerate key1 or key2 + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Key name to regenerate key1 or key2")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Key name to regenerate key1 or key2", + SerializedName = @"keyName", + PossibleTypes = new [] { typeof(string) })] + public string KeyName { get => RegenerateKeyRequestBody.KeyName ?? null; set => RegenerateKeyRequestBody.KeyName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicRegenerateKeyRequest _regenerateKeyRequestBody= new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.TopicRegenerateKeyRequest(); + + /// Topic regenerate share access key request + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicRegenerateKeyRequest RegenerateKeyRequestBody { get => this._regenerateKeyRequestBody; set => this._regenerateKeyRequestBody = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzEventGridTopicKey_RegenerateViaIdentityExpanded + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets.NewAzEventGridTopicKey_RegenerateViaIdentityExpanded Clone() + { + var clone = new NewAzEventGridTopicKey_RegenerateViaIdentityExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.RegenerateKeyRequestBody = this.RegenerateKeyRequestBody; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public NewAzEventGridTopicKey_RegenerateViaIdentityExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'TopicsRegenerateKey' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.TopicsRegenerateKeyViaIdentity(InputObject.Id, RegenerateKeyRequestBody, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.TopicName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.TopicName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.TopicsRegenerateKey(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.TopicName ?? null, RegenerateKeyRequestBody, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=RegenerateKeyRequestBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=RegenerateKeyRequestBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicSharedAccessKeys + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/NewAzEventGridTopic_CreateExpanded.cs b/swaggerci/eventgrid/generated/cmdlets/NewAzEventGridTopic_CreateExpanded.cs new file mode 100644 index 000000000000..bc07870d6e0f --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/NewAzEventGridTopic_CreateExpanded.cs @@ -0,0 +1,628 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Asynchronously creates a new topic with the specified parameters. + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzEventGridTopic_CreateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Asynchronously creates a new topic with the specified parameters.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class NewAzEventGridTopic_CreateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// Data Residency Boundary of the resource. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Data Residency Boundary of the resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Data Residency Boundary of the resource.", + SerializedName = @"dataResidencyBoundary", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary DataResidencyBoundary { get => TopicInfoBody.DataResidencyBoundary ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary)""); set => TopicInfoBody.DataResidencyBoundary = value; } + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// + /// This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD + /// token will be used to authenticate if user is allowed to publish to the topic. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD token will be used to authenticate if user is allowed to publish to the topic.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD token will be used to authenticate if user is allowed to publish to the topic.", + SerializedName = @"disableLocalAuth", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter DisableLocalAuth { get => TopicInfoBody.DisableLocalAuth ?? default(global::System.Management.Automation.SwitchParameter); set => TopicInfoBody.DisableLocalAuth = value; } + + /// Fully qualified name of the extended location. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Fully qualified name of the extended location.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Fully qualified name of the extended location.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + public string ExtendedLocationName { get => TopicInfoBody.ExtendedLocationName ?? null; set => TopicInfoBody.ExtendedLocationName = value; } + + /// Type of the extended location. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Type of the extended location.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of the extended location.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + public string ExtendedLocationType { get => TopicInfoBody.ExtendedLocationType ?? null; set => TopicInfoBody.ExtendedLocationType = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// The principal ID of resource identity. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The principal ID of resource identity.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The principal ID of resource identity.", + SerializedName = @"principalId", + PossibleTypes = new [] { typeof(string) })] + public string IdentityPrincipalId { get => TopicInfoBody.IdentityPrincipalId ?? null; set => TopicInfoBody.IdentityPrincipalId = value; } + + /// The tenant ID of resource. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The tenant ID of resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The tenant ID of resource.", + SerializedName = @"tenantId", + PossibleTypes = new [] { typeof(string) })] + public string IdentityTenantId { get => TopicInfoBody.IdentityTenantId ?? null; set => TopicInfoBody.IdentityTenantId = value; } + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType IdentityType { get => TopicInfoBody.IdentityType ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType)""); set => TopicInfoBody.IdentityType = value; } + + /// + /// The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource + /// ids in the form:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.This + /// property is currently not used and reserved for future usage. + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource ids in the form:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.This property is currently not used and reserved for future usage.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource ids in the form:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.This property is currently not used and reserved for future usage.", + SerializedName = @"userAssignedIdentities", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities) })] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities IdentityUserAssignedIdentity { get => TopicInfoBody.IdentityUserAssignedIdentity ?? null /* object */; set => TopicInfoBody.IdentityUserAssignedIdentity = value; } + + /// + /// This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess + /// is enabled. + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess is enabled.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess is enabled.", + SerializedName = @"inboundIpRules", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule) })] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[] InboundIPRule { get => TopicInfoBody.InboundIPRule ?? null /* arrayOf */; set => TopicInfoBody.InboundIPRule = value; } + + /// + /// This determines the format that Event Grid should expect for incoming events published to the topic. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "This determines the format that Event Grid should expect for incoming events published to the topic.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This determines the format that Event Grid should expect for incoming events published to the topic.", + SerializedName = @"inputSchema", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.InputSchema) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.InputSchema))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.InputSchema InputSchema { get => TopicInfoBody.InputSchema ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.InputSchema)""); set => TopicInfoBody.InputSchema = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Kind of the resource. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Kind of the resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Kind of the resource.", + SerializedName = @"kind", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceKind) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceKind))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceKind Kind { get => TopicInfoBody.Kind ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ResourceKind)""); set => TopicInfoBody.Kind = value; } + + /// Location of the resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Location of the resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Location of the resource.", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + public string Location { get => TopicInfoBody.Location ?? null; set => TopicInfoBody.Location = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the topic. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the topic.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the topic.", + SerializedName = @"topicName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("TopicName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// This determines if traffic is allowed over public network. By default it is enabled. You can further restrict to specific + /// IPs by configuring + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "This determines if traffic is allowed over public network. By default it is enabled. You can further restrict to specific IPs by configuring ")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This determines if traffic is allowed over public network. By default it is enabled. You can further restrict to specific IPs by configuring ", + SerializedName = @"publicNetworkAccess", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess PublicNetworkAccess { get => TopicInfoBody.PublicNetworkAccess ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess)""); set => TopicInfoBody.PublicNetworkAccess = value; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// The Sku name of the resource. The possible values are: Basic or Premium. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The Sku name of the resource. The possible values are: Basic or Premium.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Sku name of the resource. The possible values are: Basic or Premium.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku SkuName { get => TopicInfoBody.SkuName ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku)""); set => TopicInfoBody.SkuName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Tags of the resource. + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Tags of the resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Tags of the resource.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITrackedResourceTags Tag { get => TopicInfoBody.Tag ?? null /* object */; set => TopicInfoBody.Tag = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopic _topicInfoBody= new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.Topic(); + + /// EventGrid Topic + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopic TopicInfoBody { get => this._topicInfoBody; set => this._topicInfoBody = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzEventGridTopic_CreateExpanded + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets.NewAzEventGridTopic_CreateExpanded Clone() + { + var clone = new NewAzEventGridTopic_CreateExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.TopicInfoBody = this.TopicInfoBody; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.Name = this.Name; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public NewAzEventGridTopic_CreateExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'TopicsCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.TopicsCreateOrUpdate(SubscriptionId, ResourceGroupName, Name, TopicInfoBody, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name,body=TopicInfoBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name, body=TopicInfoBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridChannel_Delete.cs b/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridChannel_Delete.cs new file mode 100644 index 000000000000..66f66ddec06f --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridChannel_Delete.cs @@ -0,0 +1,511 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Delete an existing channel. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerNamespaces/{partnerNamespaceName}/channels/{channelName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzEventGridChannel_Delete", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Delete an existing channel.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class RemoveAzEventGridChannel_Delete : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the channel. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the channel.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the channel.", + SerializedName = @"channelName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ChannelName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// Backing field for property. + private string _partnerNamespaceName; + + /// Name of the partner namespace. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the partner namespace.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the partner namespace.", + SerializedName = @"partnerNamespaceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string PartnerNamespaceName { get => this._partnerNamespaceName; set => this._partnerNamespaceName = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the partners subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the partners subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the partners subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzEventGridChannel_Delete + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets.RemoveAzEventGridChannel_Delete Clone() + { + var clone = new RemoveAzEventGridChannel_Delete(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.PartnerNamespaceName = this.PartnerNamespaceName; + clone.Name = this.Name; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ChannelsDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ChannelsDelete(SubscriptionId, ResourceGroupName, PartnerNamespaceName, Name, onOk, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PartnerNamespaceName=PartnerNamespaceName,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzEventGridChannel_Delete() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PartnerNamespaceName=PartnerNamespaceName, Name=Name }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridChannel_DeleteViaIdentity.cs b/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridChannel_DeleteViaIdentity.cs new file mode 100644 index 000000000000..94779472db78 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridChannel_DeleteViaIdentity.cs @@ -0,0 +1,475 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Delete an existing channel. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerNamespaces/{partnerNamespaceName}/channels/{channelName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzEventGridChannel_DeleteViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Delete an existing channel.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class RemoveAzEventGridChannel_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzEventGridChannel_DeleteViaIdentity + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets.RemoveAzEventGridChannel_DeleteViaIdentity Clone() + { + var clone = new RemoveAzEventGridChannel_DeleteViaIdentity(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ChannelsDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ChannelsDeleteViaIdentity(InputObject.Id, onOk, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.PartnerNamespaceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.PartnerNamespaceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ChannelName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ChannelName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.ChannelsDelete(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.PartnerNamespaceName ?? null, InputObject.ChannelName ?? null, onOk, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzEventGridChannel_DeleteViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridDomainEventSubscription_Delete.cs b/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridDomainEventSubscription_Delete.cs new file mode 100644 index 000000000000..fd95ccf76e59 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridDomainEventSubscription_Delete.cs @@ -0,0 +1,513 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Delete an existing event subscription for a domain. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/eventSubscriptions/{eventSubscriptionName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzEventGridDomainEventSubscription_Delete", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Delete an existing event subscription for a domain.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class RemoveAzEventGridDomainEventSubscription_Delete : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _domainName; + + /// Name of the domain. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the domain.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the domain.", + SerializedName = @"domainName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string DomainName { get => this._domainName; set => this._domainName = value; } + + /// Backing field for property. + private string _eventSubscriptionName; + + /// + /// Name of the event subscription to be deleted. Event subscription names must be between 3 and 100 characters in length + /// and use alphanumeric letters only. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the event subscription to be deleted. Event subscription names must be between 3 and 100 characters in length and use alphanumeric letters only.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the event subscription to be deleted. Event subscription names must be between 3 and 100 characters in length and use alphanumeric letters only.", + SerializedName = @"eventSubscriptionName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string EventSubscriptionName { get => this._eventSubscriptionName; set => this._eventSubscriptionName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzEventGridDomainEventSubscription_Delete + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets.RemoveAzEventGridDomainEventSubscription_Delete Clone() + { + var clone = new RemoveAzEventGridDomainEventSubscription_Delete(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.DomainName = this.DomainName; + clone.EventSubscriptionName = this.EventSubscriptionName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DomainEventSubscriptionsDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DomainEventSubscriptionsDelete(SubscriptionId, ResourceGroupName, DomainName, EventSubscriptionName, onOk, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,DomainName=DomainName,EventSubscriptionName=EventSubscriptionName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzEventGridDomainEventSubscription_Delete() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, DomainName=DomainName, EventSubscriptionName=EventSubscriptionName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridDomainEventSubscription_DeleteViaIdentity.cs b/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridDomainEventSubscription_DeleteViaIdentity.cs new file mode 100644 index 000000000000..f369cb540d37 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridDomainEventSubscription_DeleteViaIdentity.cs @@ -0,0 +1,477 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Delete an existing event subscription for a domain. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/eventSubscriptions/{eventSubscriptionName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzEventGridDomainEventSubscription_DeleteViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Delete an existing event subscription for a domain.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class RemoveAzEventGridDomainEventSubscription_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of RemoveAzEventGridDomainEventSubscription_DeleteViaIdentity + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets.RemoveAzEventGridDomainEventSubscription_DeleteViaIdentity Clone() + { + var clone = new RemoveAzEventGridDomainEventSubscription_DeleteViaIdentity(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DomainEventSubscriptionsDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.DomainEventSubscriptionsDeleteViaIdentity(InputObject.Id, onOk, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.DomainName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.DomainName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.EventSubscriptionName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.EventSubscriptionName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.DomainEventSubscriptionsDelete(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.DomainName ?? null, InputObject.EventSubscriptionName ?? null, onOk, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzEventGridDomainEventSubscription_DeleteViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridDomainTopicEventSubscription_Delete.cs b/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridDomainTopicEventSubscription_Delete.cs new file mode 100644 index 000000000000..62e17d124aa6 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridDomainTopicEventSubscription_Delete.cs @@ -0,0 +1,528 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Delete a nested existing event subscription for a domain topic. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/topics/{topicName}/eventSubscriptions/{eventSubscriptionName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzEventGridDomainTopicEventSubscription_Delete", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Delete a nested existing event subscription for a domain topic.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class RemoveAzEventGridDomainTopicEventSubscription_Delete : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _domainName; + + /// Name of the top level domain. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the top level domain.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the top level domain.", + SerializedName = @"domainName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string DomainName { get => this._domainName; set => this._domainName = value; } + + /// Backing field for property. + private string _eventSubscriptionName; + + /// + /// Name of the event subscription to be deleted. Event subscription names must be between 3 and 100 characters in length + /// and use alphanumeric letters only. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the event subscription to be deleted. Event subscription names must be between 3 and 100 characters in length and use alphanumeric letters only.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the event subscription to be deleted. Event subscription names must be between 3 and 100 characters in length and use alphanumeric letters only.", + SerializedName = @"eventSubscriptionName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string EventSubscriptionName { get => this._eventSubscriptionName; set => this._eventSubscriptionName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _topicName; + + /// Name of the domain topic. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the domain topic.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the domain topic.", + SerializedName = @"topicName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string TopicName { get => this._topicName; set => this._topicName = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzEventGridDomainTopicEventSubscription_Delete + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets.RemoveAzEventGridDomainTopicEventSubscription_Delete Clone() + { + var clone = new RemoveAzEventGridDomainTopicEventSubscription_Delete(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.DomainName = this.DomainName; + clone.TopicName = this.TopicName; + clone.EventSubscriptionName = this.EventSubscriptionName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DomainTopicEventSubscriptionsDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DomainTopicEventSubscriptionsDelete(SubscriptionId, ResourceGroupName, DomainName, TopicName, EventSubscriptionName, onOk, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,DomainName=DomainName,TopicName=TopicName,EventSubscriptionName=EventSubscriptionName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzEventGridDomainTopicEventSubscription_Delete() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, DomainName=DomainName, TopicName=TopicName, EventSubscriptionName=EventSubscriptionName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridDomainTopicEventSubscription_DeleteViaIdentity.cs b/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridDomainTopicEventSubscription_DeleteViaIdentity.cs new file mode 100644 index 000000000000..b2870d814693 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridDomainTopicEventSubscription_DeleteViaIdentity.cs @@ -0,0 +1,482 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Delete a nested existing event subscription for a domain topic. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/topics/{topicName}/eventSubscriptions/{eventSubscriptionName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzEventGridDomainTopicEventSubscription_DeleteViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Delete a nested existing event subscription for a domain topic.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class RemoveAzEventGridDomainTopicEventSubscription_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of RemoveAzEventGridDomainTopicEventSubscription_DeleteViaIdentity + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets.RemoveAzEventGridDomainTopicEventSubscription_DeleteViaIdentity Clone() + { + var clone = new RemoveAzEventGridDomainTopicEventSubscription_DeleteViaIdentity(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DomainTopicEventSubscriptionsDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.DomainTopicEventSubscriptionsDeleteViaIdentity(InputObject.Id, onOk, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.DomainName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.DomainName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.TopicName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.TopicName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.EventSubscriptionName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.EventSubscriptionName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.DomainTopicEventSubscriptionsDelete(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.DomainName ?? null, InputObject.TopicName ?? null, InputObject.EventSubscriptionName ?? null, onOk, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet + /// class. + /// + public RemoveAzEventGridDomainTopicEventSubscription_DeleteViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridDomainTopic_Delete.cs b/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridDomainTopic_Delete.cs new file mode 100644 index 000000000000..cc2e1862d720 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridDomainTopic_Delete.cs @@ -0,0 +1,511 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Delete existing domain topic. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/topics/{domainTopicName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzEventGridDomainTopic_Delete", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Delete existing domain topic.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class RemoveAzEventGridDomainTopic_Delete : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _domainName; + + /// Name of the domain. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the domain.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the domain.", + SerializedName = @"domainName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string DomainName { get => this._domainName; set => this._domainName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the domain topic. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the domain topic.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the domain topic.", + SerializedName = @"domainTopicName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("DomainTopicName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzEventGridDomainTopic_Delete + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets.RemoveAzEventGridDomainTopic_Delete Clone() + { + var clone = new RemoveAzEventGridDomainTopic_Delete(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.DomainName = this.DomainName; + clone.Name = this.Name; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DomainTopicsDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DomainTopicsDelete(SubscriptionId, ResourceGroupName, DomainName, Name, onOk, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,DomainName=DomainName,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzEventGridDomainTopic_Delete() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, DomainName=DomainName, Name=Name }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridDomainTopic_DeleteViaIdentity.cs b/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridDomainTopic_DeleteViaIdentity.cs new file mode 100644 index 000000000000..4f7a52ac88db --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridDomainTopic_DeleteViaIdentity.cs @@ -0,0 +1,475 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Delete existing domain topic. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/topics/{domainTopicName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzEventGridDomainTopic_DeleteViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Delete existing domain topic.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class RemoveAzEventGridDomainTopic_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzEventGridDomainTopic_DeleteViaIdentity + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets.RemoveAzEventGridDomainTopic_DeleteViaIdentity Clone() + { + var clone = new RemoveAzEventGridDomainTopic_DeleteViaIdentity(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DomainTopicsDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.DomainTopicsDeleteViaIdentity(InputObject.Id, onOk, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.DomainName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.DomainName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.DomainTopicName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.DomainTopicName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.DomainTopicsDelete(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.DomainName ?? null, InputObject.DomainTopicName ?? null, onOk, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzEventGridDomainTopic_DeleteViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridDomain_Delete.cs b/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridDomain_Delete.cs new file mode 100644 index 000000000000..efc263500ac0 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridDomain_Delete.cs @@ -0,0 +1,496 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Delete existing domain. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzEventGridDomain_Delete", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Delete existing domain.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class RemoveAzEventGridDomain_Delete : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the domain. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the domain.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the domain.", + SerializedName = @"domainName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("DomainName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzEventGridDomain_Delete + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets.RemoveAzEventGridDomain_Delete Clone() + { + var clone = new RemoveAzEventGridDomain_Delete(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.Name = this.Name; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DomainsDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DomainsDelete(SubscriptionId, ResourceGroupName, Name, onOk, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzEventGridDomain_Delete() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridDomain_DeleteViaIdentity.cs b/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridDomain_DeleteViaIdentity.cs new file mode 100644 index 000000000000..e89d19563777 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridDomain_DeleteViaIdentity.cs @@ -0,0 +1,471 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Delete existing domain. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzEventGridDomain_DeleteViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Delete existing domain.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class RemoveAzEventGridDomain_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzEventGridDomain_DeleteViaIdentity + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets.RemoveAzEventGridDomain_DeleteViaIdentity Clone() + { + var clone = new RemoveAzEventGridDomain_DeleteViaIdentity(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DomainsDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.DomainsDeleteViaIdentity(InputObject.Id, onOk, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.DomainName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.DomainName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.DomainsDelete(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.DomainName ?? null, onOk, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzEventGridDomain_DeleteViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridEventChannel_Delete.cs b/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridEventChannel_Delete.cs new file mode 100644 index 000000000000..b9084c40b1d4 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridEventChannel_Delete.cs @@ -0,0 +1,511 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Delete existing event channel. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerNamespaces/{partnerNamespaceName}/eventChannels/{eventChannelName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzEventGridEventChannel_Delete", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Delete existing event channel.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class RemoveAzEventGridEventChannel_Delete : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the event channel. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the event channel.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the event channel.", + SerializedName = @"eventChannelName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("EventChannelName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// Backing field for property. + private string _partnerNamespaceName; + + /// Name of the partner namespace. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the partner namespace.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the partner namespace.", + SerializedName = @"partnerNamespaceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string PartnerNamespaceName { get => this._partnerNamespaceName; set => this._partnerNamespaceName = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzEventGridEventChannel_Delete + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets.RemoveAzEventGridEventChannel_Delete Clone() + { + var clone = new RemoveAzEventGridEventChannel_Delete(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.PartnerNamespaceName = this.PartnerNamespaceName; + clone.Name = this.Name; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'EventChannelsDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.EventChannelsDelete(SubscriptionId, ResourceGroupName, PartnerNamespaceName, Name, onOk, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PartnerNamespaceName=PartnerNamespaceName,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzEventGridEventChannel_Delete() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PartnerNamespaceName=PartnerNamespaceName, Name=Name }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridEventChannel_DeleteViaIdentity.cs b/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridEventChannel_DeleteViaIdentity.cs new file mode 100644 index 000000000000..b9645b983bae --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridEventChannel_DeleteViaIdentity.cs @@ -0,0 +1,475 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Delete existing event channel. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerNamespaces/{partnerNamespaceName}/eventChannels/{eventChannelName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzEventGridEventChannel_DeleteViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Delete existing event channel.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class RemoveAzEventGridEventChannel_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzEventGridEventChannel_DeleteViaIdentity + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets.RemoveAzEventGridEventChannel_DeleteViaIdentity Clone() + { + var clone = new RemoveAzEventGridEventChannel_DeleteViaIdentity(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'EventChannelsDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.EventChannelsDeleteViaIdentity(InputObject.Id, onOk, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.PartnerNamespaceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.PartnerNamespaceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.EventChannelName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.EventChannelName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.EventChannelsDelete(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.PartnerNamespaceName ?? null, InputObject.EventChannelName ?? null, onOk, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzEventGridEventChannel_DeleteViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridEventSubscription_Delete.cs b/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridEventSubscription_Delete.cs new file mode 100644 index 000000000000..1a012eb8cc38 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridEventSubscription_Delete.cs @@ -0,0 +1,480 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Delete an existing event subscription. + /// + /// [OpenAPI] Delete=>DELETE:"/{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzEventGridEventSubscription_Delete", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Delete an existing event subscription.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class RemoveAzEventGridEventSubscription_Delete : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the event subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the event subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the event subscription.", + SerializedName = @"eventSubscriptionName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("EventSubscriptionName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' + /// for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' + /// for an EventGrid topic. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic.", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string Scope { get => this._scope; set => this._scope = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzEventGridEventSubscription_Delete + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets.RemoveAzEventGridEventSubscription_Delete Clone() + { + var clone = new RemoveAzEventGridEventSubscription_Delete(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.Scope = this.Scope; + clone.Name = this.Name; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'EventSubscriptionsDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.EventSubscriptionsDelete(Scope, Name, onOk, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzEventGridEventSubscription_Delete() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope, Name=Name }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridEventSubscription_DeleteViaIdentity.cs b/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridEventSubscription_DeleteViaIdentity.cs new file mode 100644 index 000000000000..eeea635da008 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridEventSubscription_DeleteViaIdentity.cs @@ -0,0 +1,467 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Delete an existing event subscription. + /// + /// [OpenAPI] Delete=>DELETE:"/{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzEventGridEventSubscription_DeleteViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Delete an existing event subscription.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class RemoveAzEventGridEventSubscription_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzEventGridEventSubscription_DeleteViaIdentity + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets.RemoveAzEventGridEventSubscription_DeleteViaIdentity Clone() + { + var clone = new RemoveAzEventGridEventSubscription_DeleteViaIdentity(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'EventSubscriptionsDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.EventSubscriptionsDeleteViaIdentity(InputObject.Id, onOk, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.Scope) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.Scope"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.EventSubscriptionName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.EventSubscriptionName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.EventSubscriptionsDelete(InputObject.Scope ?? null, InputObject.EventSubscriptionName ?? null, onOk, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzEventGridEventSubscription_DeleteViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridPartnerConfiguration_Delete.cs b/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridPartnerConfiguration_Delete.cs new file mode 100644 index 000000000000..0cfa56bb23a3 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridPartnerConfiguration_Delete.cs @@ -0,0 +1,480 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Delete existing partner configuration. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerConfigurations/default" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzEventGridPartnerConfiguration_Delete", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Delete existing partner configuration.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class RemoveAzEventGridPartnerConfiguration_Delete : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzEventGridPartnerConfiguration_Delete + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets.RemoveAzEventGridPartnerConfiguration_Delete Clone() + { + var clone = new RemoveAzEventGridPartnerConfiguration_Delete(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'PartnerConfigurationsDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.PartnerConfigurationsDelete(SubscriptionId, ResourceGroupName, onOk, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzEventGridPartnerConfiguration_Delete() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridPartnerConfiguration_DeleteViaIdentity.cs b/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridPartnerConfiguration_DeleteViaIdentity.cs new file mode 100644 index 000000000000..b5b87437edc1 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridPartnerConfiguration_DeleteViaIdentity.cs @@ -0,0 +1,467 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Delete existing partner configuration. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerConfigurations/default" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzEventGridPartnerConfiguration_DeleteViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Delete existing partner configuration.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class RemoveAzEventGridPartnerConfiguration_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzEventGridPartnerConfiguration_DeleteViaIdentity + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets.RemoveAzEventGridPartnerConfiguration_DeleteViaIdentity Clone() + { + var clone = new RemoveAzEventGridPartnerConfiguration_DeleteViaIdentity(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'PartnerConfigurationsDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.PartnerConfigurationsDeleteViaIdentity(InputObject.Id, onOk, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.PartnerConfigurationsDelete(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, onOk, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzEventGridPartnerConfiguration_DeleteViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridPartnerDestination_Delete.cs b/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridPartnerDestination_Delete.cs new file mode 100644 index 000000000000..33a06d873d63 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridPartnerDestination_Delete.cs @@ -0,0 +1,496 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Delete existing partner destination. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerDestinations/{partnerDestinationName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzEventGridPartnerDestination_Delete", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Delete existing partner destination.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class RemoveAzEventGridPartnerDestination_Delete : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the partner destination. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the partner destination.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the partner destination.", + SerializedName = @"partnerDestinationName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("PartnerDestinationName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzEventGridPartnerDestination_Delete + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets.RemoveAzEventGridPartnerDestination_Delete Clone() + { + var clone = new RemoveAzEventGridPartnerDestination_Delete(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.Name = this.Name; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'PartnerDestinationsDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.PartnerDestinationsDelete(SubscriptionId, ResourceGroupName, Name, onOk, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzEventGridPartnerDestination_Delete() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridPartnerDestination_DeleteViaIdentity.cs b/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridPartnerDestination_DeleteViaIdentity.cs new file mode 100644 index 000000000000..a487d824baba --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridPartnerDestination_DeleteViaIdentity.cs @@ -0,0 +1,471 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Delete existing partner destination. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerDestinations/{partnerDestinationName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzEventGridPartnerDestination_DeleteViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Delete existing partner destination.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class RemoveAzEventGridPartnerDestination_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzEventGridPartnerDestination_DeleteViaIdentity + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets.RemoveAzEventGridPartnerDestination_DeleteViaIdentity Clone() + { + var clone = new RemoveAzEventGridPartnerDestination_DeleteViaIdentity(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'PartnerDestinationsDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.PartnerDestinationsDeleteViaIdentity(InputObject.Id, onOk, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.PartnerDestinationName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.PartnerDestinationName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.PartnerDestinationsDelete(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.PartnerDestinationName ?? null, onOk, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzEventGridPartnerDestination_DeleteViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridPartnerNamespace_Delete.cs b/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridPartnerNamespace_Delete.cs new file mode 100644 index 000000000000..5db90ba0164c --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridPartnerNamespace_Delete.cs @@ -0,0 +1,496 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Delete existing partner namespace. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerNamespaces/{partnerNamespaceName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzEventGridPartnerNamespace_Delete", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Delete existing partner namespace.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class RemoveAzEventGridPartnerNamespace_Delete : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the partner namespace. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the partner namespace.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the partner namespace.", + SerializedName = @"partnerNamespaceName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("PartnerNamespaceName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzEventGridPartnerNamespace_Delete + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets.RemoveAzEventGridPartnerNamespace_Delete Clone() + { + var clone = new RemoveAzEventGridPartnerNamespace_Delete(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.Name = this.Name; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'PartnerNamespacesDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.PartnerNamespacesDelete(SubscriptionId, ResourceGroupName, Name, onOk, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzEventGridPartnerNamespace_Delete() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridPartnerNamespace_DeleteViaIdentity.cs b/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridPartnerNamespace_DeleteViaIdentity.cs new file mode 100644 index 000000000000..73ab1cd6114b --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridPartnerNamespace_DeleteViaIdentity.cs @@ -0,0 +1,471 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Delete existing partner namespace. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerNamespaces/{partnerNamespaceName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzEventGridPartnerNamespace_DeleteViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Delete existing partner namespace.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class RemoveAzEventGridPartnerNamespace_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzEventGridPartnerNamespace_DeleteViaIdentity + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets.RemoveAzEventGridPartnerNamespace_DeleteViaIdentity Clone() + { + var clone = new RemoveAzEventGridPartnerNamespace_DeleteViaIdentity(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'PartnerNamespacesDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.PartnerNamespacesDeleteViaIdentity(InputObject.Id, onOk, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.PartnerNamespaceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.PartnerNamespaceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.PartnerNamespacesDelete(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.PartnerNamespaceName ?? null, onOk, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzEventGridPartnerNamespace_DeleteViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridPartnerRegistration_Delete.cs b/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridPartnerRegistration_Delete.cs new file mode 100644 index 000000000000..966ac2156a17 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridPartnerRegistration_Delete.cs @@ -0,0 +1,496 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Deletes a partner registration with the specified parameters. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerRegistrations/{partnerRegistrationName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzEventGridPartnerRegistration_Delete", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Deletes a partner registration with the specified parameters.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class RemoveAzEventGridPartnerRegistration_Delete : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the partner registration. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the partner registration.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the partner registration.", + SerializedName = @"partnerRegistrationName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("PartnerRegistrationName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzEventGridPartnerRegistration_Delete + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets.RemoveAzEventGridPartnerRegistration_Delete Clone() + { + var clone = new RemoveAzEventGridPartnerRegistration_Delete(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.Name = this.Name; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'PartnerRegistrationsDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.PartnerRegistrationsDelete(SubscriptionId, ResourceGroupName, Name, onOk, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzEventGridPartnerRegistration_Delete() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridPartnerRegistration_DeleteViaIdentity.cs b/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridPartnerRegistration_DeleteViaIdentity.cs new file mode 100644 index 000000000000..83abe56384de --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridPartnerRegistration_DeleteViaIdentity.cs @@ -0,0 +1,471 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Deletes a partner registration with the specified parameters. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerRegistrations/{partnerRegistrationName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzEventGridPartnerRegistration_DeleteViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Deletes a partner registration with the specified parameters.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class RemoveAzEventGridPartnerRegistration_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzEventGridPartnerRegistration_DeleteViaIdentity + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets.RemoveAzEventGridPartnerRegistration_DeleteViaIdentity Clone() + { + var clone = new RemoveAzEventGridPartnerRegistration_DeleteViaIdentity(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'PartnerRegistrationsDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.PartnerRegistrationsDeleteViaIdentity(InputObject.Id, onOk, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.PartnerRegistrationName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.PartnerRegistrationName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.PartnerRegistrationsDelete(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.PartnerRegistrationName ?? null, onOk, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzEventGridPartnerRegistration_DeleteViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridPartnerTopicEventSubscription_Delete.cs b/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridPartnerTopicEventSubscription_Delete.cs new file mode 100644 index 000000000000..fb6ca406ba08 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridPartnerTopicEventSubscription_Delete.cs @@ -0,0 +1,513 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Delete an existing event subscription of a partner topic. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerTopics/{partnerTopicName}/eventSubscriptions/{eventSubscriptionName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzEventGridPartnerTopicEventSubscription_Delete", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Delete an existing event subscription of a partner topic.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class RemoveAzEventGridPartnerTopicEventSubscription_Delete : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _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. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "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.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"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.", + SerializedName = @"eventSubscriptionName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string EventSubscriptionName { get => this._eventSubscriptionName; set => this._eventSubscriptionName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// Backing field for property. + private string _partnerTopicName; + + /// Name of the partner topic. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the partner topic.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the partner topic.", + SerializedName = @"partnerTopicName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string PartnerTopicName { get => this._partnerTopicName; set => this._partnerTopicName = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzEventGridPartnerTopicEventSubscription_Delete + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets.RemoveAzEventGridPartnerTopicEventSubscription_Delete Clone() + { + var clone = new RemoveAzEventGridPartnerTopicEventSubscription_Delete(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.PartnerTopicName = this.PartnerTopicName; + clone.EventSubscriptionName = this.EventSubscriptionName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'PartnerTopicEventSubscriptionsDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.PartnerTopicEventSubscriptionsDelete(SubscriptionId, ResourceGroupName, PartnerTopicName, EventSubscriptionName, onOk, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PartnerTopicName=PartnerTopicName,EventSubscriptionName=EventSubscriptionName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzEventGridPartnerTopicEventSubscription_Delete() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PartnerTopicName=PartnerTopicName, EventSubscriptionName=EventSubscriptionName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridPartnerTopicEventSubscription_DeleteViaIdentity.cs b/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridPartnerTopicEventSubscription_DeleteViaIdentity.cs new file mode 100644 index 000000000000..8f87c6488aee --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridPartnerTopicEventSubscription_DeleteViaIdentity.cs @@ -0,0 +1,478 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Delete an existing event subscription of a partner topic. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerTopics/{partnerTopicName}/eventSubscriptions/{eventSubscriptionName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzEventGridPartnerTopicEventSubscription_DeleteViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Delete an existing event subscription of a partner topic.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class RemoveAzEventGridPartnerTopicEventSubscription_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of RemoveAzEventGridPartnerTopicEventSubscription_DeleteViaIdentity + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets.RemoveAzEventGridPartnerTopicEventSubscription_DeleteViaIdentity Clone() + { + var clone = new RemoveAzEventGridPartnerTopicEventSubscription_DeleteViaIdentity(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'PartnerTopicEventSubscriptionsDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.PartnerTopicEventSubscriptionsDeleteViaIdentity(InputObject.Id, onOk, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.PartnerTopicName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.PartnerTopicName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.EventSubscriptionName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.EventSubscriptionName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.PartnerTopicEventSubscriptionsDelete(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.PartnerTopicName ?? null, InputObject.EventSubscriptionName ?? null, onOk, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet + /// class. + /// + public RemoveAzEventGridPartnerTopicEventSubscription_DeleteViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridPartnerTopic_Delete.cs b/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridPartnerTopic_Delete.cs new file mode 100644 index 000000000000..3cee738bb448 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridPartnerTopic_Delete.cs @@ -0,0 +1,496 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Delete existing partner topic. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerTopics/{partnerTopicName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzEventGridPartnerTopic_Delete", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Delete existing partner topic.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class RemoveAzEventGridPartnerTopic_Delete : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the partner topic. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the partner topic.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the partner topic.", + SerializedName = @"partnerTopicName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("PartnerTopicName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzEventGridPartnerTopic_Delete + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets.RemoveAzEventGridPartnerTopic_Delete Clone() + { + var clone = new RemoveAzEventGridPartnerTopic_Delete(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.Name = this.Name; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'PartnerTopicsDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.PartnerTopicsDelete(SubscriptionId, ResourceGroupName, Name, onOk, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzEventGridPartnerTopic_Delete() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridPartnerTopic_DeleteViaIdentity.cs b/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridPartnerTopic_DeleteViaIdentity.cs new file mode 100644 index 000000000000..90a645138d5f --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridPartnerTopic_DeleteViaIdentity.cs @@ -0,0 +1,471 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Delete existing partner topic. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerTopics/{partnerTopicName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzEventGridPartnerTopic_DeleteViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Delete existing partner topic.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class RemoveAzEventGridPartnerTopic_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzEventGridPartnerTopic_DeleteViaIdentity + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets.RemoveAzEventGridPartnerTopic_DeleteViaIdentity Clone() + { + var clone = new RemoveAzEventGridPartnerTopic_DeleteViaIdentity(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'PartnerTopicsDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.PartnerTopicsDeleteViaIdentity(InputObject.Id, onOk, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.PartnerTopicName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.PartnerTopicName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.PartnerTopicsDelete(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.PartnerTopicName ?? null, onOk, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzEventGridPartnerTopic_DeleteViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridPrivateEndpointConnection_Delete.cs b/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridPrivateEndpointConnection_Delete.cs new file mode 100644 index 000000000000..6852fe6aa5db --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridPrivateEndpointConnection_Delete.cs @@ -0,0 +1,499 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// + /// Delete a specific private endpoint connection under a topic, domain, or partner namespace. + /// + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/{parentType}/{parentName}/privateEndpointConnections/{privateEndpointConnectionName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzEventGridPrivateEndpointConnection_Delete", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Delete a specific private endpoint connection under a topic, domain, or partner namespace.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class RemoveAzEventGridPrivateEndpointConnection_Delete : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the private endpoint connection connection. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the private endpoint connection connection.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the private endpoint connection connection.", + SerializedName = @"privateEndpointConnectionName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("PrivateEndpointConnectionName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// Backing field for property. + private string _parentName; + + /// + /// The name of the parent resource (namely, either, the topic name, domain name, or partner namespace name). + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the parent resource (namely, either, the topic name, domain name, or partner namespace name).")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the parent resource (namely, either, the topic name, domain name, or partner namespace name).", + SerializedName = @"parentName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ParentName { get => this._parentName; set => this._parentName = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ParentType _parentType; + + /// + /// The type of the parent resource. This can be either \'topics\', \'domains\', or \'partnerNamespaces\'. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The type of the parent resource. This can be either \\'topics\\', \\'domains\\', or \\'partnerNamespaces\\'.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The type of the parent resource. This can be either \'topics\', \'domains\', or \'partnerNamespaces\'.", + SerializedName = @"parentType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ParentType) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ParentType))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ParentType ParentType { get => this._parentType; set => this._parentType = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzEventGridPrivateEndpointConnection_Delete + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets.RemoveAzEventGridPrivateEndpointConnection_Delete Clone() + { + var clone = new RemoveAzEventGridPrivateEndpointConnection_Delete(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.ParentType = this.ParentType; + clone.ParentName = this.ParentName; + clone.Name = this.Name; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'PrivateEndpointConnectionsDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.PrivateEndpointConnectionsDelete(SubscriptionId, ResourceGroupName, ParentType, ParentName, Name, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ParentType=ParentType,ParentName=ParentName,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzEventGridPrivateEndpointConnection_Delete() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ParentType=ParentType, ParentName=ParentName, Name=Name }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridPrivateEndpointConnection_DeleteViaIdentity.cs b/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridPrivateEndpointConnection_DeleteViaIdentity.cs new file mode 100644 index 000000000000..ac0bc618db8d --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridPrivateEndpointConnection_DeleteViaIdentity.cs @@ -0,0 +1,449 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// + /// Delete a specific private endpoint connection under a topic, domain, or partner namespace. + /// + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/{parentType}/{parentName}/privateEndpointConnections/{privateEndpointConnectionName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzEventGridPrivateEndpointConnection_DeleteViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Delete a specific private endpoint connection under a topic, domain, or partner namespace.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class RemoveAzEventGridPrivateEndpointConnection_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of RemoveAzEventGridPrivateEndpointConnection_DeleteViaIdentity + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets.RemoveAzEventGridPrivateEndpointConnection_DeleteViaIdentity Clone() + { + var clone = new RemoveAzEventGridPrivateEndpointConnection_DeleteViaIdentity(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'PrivateEndpointConnectionsDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.PrivateEndpointConnectionsDeleteViaIdentity(InputObject.Id, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ParentType) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ParentType"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ParentName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ParentName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.PrivateEndpointConnectionName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.PrivateEndpointConnectionName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.PrivateEndpointConnectionsDelete(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ParentType ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.ParentType)""), InputObject.ParentName ?? null, InputObject.PrivateEndpointConnectionName ?? null, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzEventGridPrivateEndpointConnection_DeleteViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridSystemTopicEventSubscription_Delete.cs b/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridSystemTopicEventSubscription_Delete.cs new file mode 100644 index 000000000000..515a6009cfa3 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridSystemTopicEventSubscription_Delete.cs @@ -0,0 +1,513 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Delete an existing event subscription of a system topic. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/systemTopics/{systemTopicName}/eventSubscriptions/{eventSubscriptionName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzEventGridSystemTopicEventSubscription_Delete", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Delete an existing event subscription of a system topic.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class RemoveAzEventGridSystemTopicEventSubscription_Delete : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _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. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "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.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"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.", + SerializedName = @"eventSubscriptionName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string EventSubscriptionName { get => this._eventSubscriptionName; set => this._eventSubscriptionName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _systemTopicName; + + /// Name of the system topic. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the system topic.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the system topic.", + SerializedName = @"systemTopicName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string SystemTopicName { get => this._systemTopicName; set => this._systemTopicName = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzEventGridSystemTopicEventSubscription_Delete + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets.RemoveAzEventGridSystemTopicEventSubscription_Delete Clone() + { + var clone = new RemoveAzEventGridSystemTopicEventSubscription_Delete(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.SystemTopicName = this.SystemTopicName; + clone.EventSubscriptionName = this.EventSubscriptionName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'SystemTopicEventSubscriptionsDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.SystemTopicEventSubscriptionsDelete(SubscriptionId, ResourceGroupName, SystemTopicName, EventSubscriptionName, onOk, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,SystemTopicName=SystemTopicName,EventSubscriptionName=EventSubscriptionName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzEventGridSystemTopicEventSubscription_Delete() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, SystemTopicName=SystemTopicName, EventSubscriptionName=EventSubscriptionName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridSystemTopicEventSubscription_DeleteViaIdentity.cs b/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridSystemTopicEventSubscription_DeleteViaIdentity.cs new file mode 100644 index 000000000000..068838b1a01e --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridSystemTopicEventSubscription_DeleteViaIdentity.cs @@ -0,0 +1,478 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Delete an existing event subscription of a system topic. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/systemTopics/{systemTopicName}/eventSubscriptions/{eventSubscriptionName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzEventGridSystemTopicEventSubscription_DeleteViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Delete an existing event subscription of a system topic.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class RemoveAzEventGridSystemTopicEventSubscription_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of RemoveAzEventGridSystemTopicEventSubscription_DeleteViaIdentity + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets.RemoveAzEventGridSystemTopicEventSubscription_DeleteViaIdentity Clone() + { + var clone = new RemoveAzEventGridSystemTopicEventSubscription_DeleteViaIdentity(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'SystemTopicEventSubscriptionsDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.SystemTopicEventSubscriptionsDeleteViaIdentity(InputObject.Id, onOk, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SystemTopicName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SystemTopicName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.EventSubscriptionName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.EventSubscriptionName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.SystemTopicEventSubscriptionsDelete(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.SystemTopicName ?? null, InputObject.EventSubscriptionName ?? null, onOk, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet + /// class. + /// + public RemoveAzEventGridSystemTopicEventSubscription_DeleteViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridSystemTopic_Delete.cs b/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridSystemTopic_Delete.cs new file mode 100644 index 000000000000..781327408868 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridSystemTopic_Delete.cs @@ -0,0 +1,496 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Delete existing system topic. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/systemTopics/{systemTopicName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzEventGridSystemTopic_Delete", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Delete existing system topic.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class RemoveAzEventGridSystemTopic_Delete : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the system topic. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the system topic.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the system topic.", + SerializedName = @"systemTopicName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("SystemTopicName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzEventGridSystemTopic_Delete + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets.RemoveAzEventGridSystemTopic_Delete Clone() + { + var clone = new RemoveAzEventGridSystemTopic_Delete(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.Name = this.Name; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'SystemTopicsDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.SystemTopicsDelete(SubscriptionId, ResourceGroupName, Name, onOk, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzEventGridSystemTopic_Delete() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridSystemTopic_DeleteViaIdentity.cs b/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridSystemTopic_DeleteViaIdentity.cs new file mode 100644 index 000000000000..cd892cfe0df3 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridSystemTopic_DeleteViaIdentity.cs @@ -0,0 +1,471 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Delete existing system topic. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/systemTopics/{systemTopicName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzEventGridSystemTopic_DeleteViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Delete existing system topic.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class RemoveAzEventGridSystemTopic_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzEventGridSystemTopic_DeleteViaIdentity + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets.RemoveAzEventGridSystemTopic_DeleteViaIdentity Clone() + { + var clone = new RemoveAzEventGridSystemTopic_DeleteViaIdentity(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'SystemTopicsDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.SystemTopicsDeleteViaIdentity(InputObject.Id, onOk, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SystemTopicName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SystemTopicName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.SystemTopicsDelete(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.SystemTopicName ?? null, onOk, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzEventGridSystemTopic_DeleteViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridTopicEventSubscription_Delete.cs b/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridTopicEventSubscription_Delete.cs new file mode 100644 index 000000000000..632d195aa1e1 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridTopicEventSubscription_Delete.cs @@ -0,0 +1,513 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Delete an existing event subscription for a topic. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}/eventSubscriptions/{eventSubscriptionName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzEventGridTopicEventSubscription_Delete", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Delete an existing event subscription for a topic.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class RemoveAzEventGridTopicEventSubscription_Delete : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _eventSubscriptionName; + + /// + /// Name of the event subscription to be deleted. Event subscription names must be between 3 and 100 characters in length + /// and use alphanumeric letters only. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the event subscription to be deleted. Event subscription names must be between 3 and 100 characters in length and use alphanumeric letters only.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the event subscription to be deleted. Event subscription names must be between 3 and 100 characters in length and use alphanumeric letters only.", + SerializedName = @"eventSubscriptionName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string EventSubscriptionName { get => this._eventSubscriptionName; set => this._eventSubscriptionName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _topicName; + + /// Name of the topic. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the topic.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the topic.", + SerializedName = @"topicName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string TopicName { get => this._topicName; set => this._topicName = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzEventGridTopicEventSubscription_Delete + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets.RemoveAzEventGridTopicEventSubscription_Delete Clone() + { + var clone = new RemoveAzEventGridTopicEventSubscription_Delete(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.TopicName = this.TopicName; + clone.EventSubscriptionName = this.EventSubscriptionName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'TopicEventSubscriptionsDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.TopicEventSubscriptionsDelete(SubscriptionId, ResourceGroupName, TopicName, EventSubscriptionName, onOk, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,TopicName=TopicName,EventSubscriptionName=EventSubscriptionName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzEventGridTopicEventSubscription_Delete() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, TopicName=TopicName, EventSubscriptionName=EventSubscriptionName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridTopicEventSubscription_DeleteViaIdentity.cs b/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridTopicEventSubscription_DeleteViaIdentity.cs new file mode 100644 index 000000000000..964385d67d73 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridTopicEventSubscription_DeleteViaIdentity.cs @@ -0,0 +1,477 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Delete an existing event subscription for a topic. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}/eventSubscriptions/{eventSubscriptionName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzEventGridTopicEventSubscription_DeleteViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Delete an existing event subscription for a topic.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class RemoveAzEventGridTopicEventSubscription_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of RemoveAzEventGridTopicEventSubscription_DeleteViaIdentity + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets.RemoveAzEventGridTopicEventSubscription_DeleteViaIdentity Clone() + { + var clone = new RemoveAzEventGridTopicEventSubscription_DeleteViaIdentity(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'TopicEventSubscriptionsDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.TopicEventSubscriptionsDeleteViaIdentity(InputObject.Id, onOk, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.TopicName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.TopicName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.EventSubscriptionName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.EventSubscriptionName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.TopicEventSubscriptionsDelete(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.TopicName ?? null, InputObject.EventSubscriptionName ?? null, onOk, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzEventGridTopicEventSubscription_DeleteViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridTopic_Delete.cs b/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridTopic_Delete.cs new file mode 100644 index 000000000000..f289c90f590d --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridTopic_Delete.cs @@ -0,0 +1,462 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Delete existing topic. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzEventGridTopic_Delete", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Delete existing topic.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class RemoveAzEventGridTopic_Delete : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the topic. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the topic.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the topic.", + SerializedName = @"topicName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("TopicName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzEventGridTopic_Delete + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets.RemoveAzEventGridTopic_Delete Clone() + { + var clone = new RemoveAzEventGridTopic_Delete(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.Name = this.Name; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'TopicsDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.TopicsDelete(SubscriptionId, ResourceGroupName, Name, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzEventGridTopic_Delete() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridTopic_DeleteViaIdentity.cs b/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridTopic_DeleteViaIdentity.cs new file mode 100644 index 000000000000..c39553fc269b --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/RemoveAzEventGridTopic_DeleteViaIdentity.cs @@ -0,0 +1,437 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Delete existing topic. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzEventGridTopic_DeleteViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Delete existing topic.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class RemoveAzEventGridTopic_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzEventGridTopic_DeleteViaIdentity + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets.RemoveAzEventGridTopic_DeleteViaIdentity Clone() + { + var clone = new RemoveAzEventGridTopic_DeleteViaIdentity(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'TopicsDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.TopicsDeleteViaIdentity(InputObject.Id, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.TopicName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.TopicName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.TopicsDelete(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.TopicName ?? null, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzEventGridTopic_DeleteViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/UpdateAzEventGridChannel_UpdateExpanded.cs b/swaggerci/eventgrid/generated/cmdlets/UpdateAzEventGridChannel_UpdateExpanded.cs new file mode 100644 index 000000000000..e77d6339c0e3 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/UpdateAzEventGridChannel_UpdateExpanded.cs @@ -0,0 +1,458 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Synchronously updates a channel with the specified parameters. + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerNamespaces/{partnerNamespaceName}/channels/{channelName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzEventGridChannel_UpdateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Synchronously updates a channel with the specified parameters.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class UpdateAzEventGridChannel_UpdateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParameters _channelUpdateParametersBody= new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ChannelUpdateParameters(); + + /// Properties of the Channel update. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParameters ChannelUpdateParametersBody { get => this._channelUpdateParametersBody; set => this._channelUpdateParametersBody = value; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// + /// A collection of inline event types for the resource. The inline event type keys are of type string which represents the + /// name of the event.An example of a valid inline event name is "Contoso.OrderCreated".The inline event type values are of + /// type InlineEventProperties and will contain additional information for every inline event type. + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "A collection of inline event types for the resource. The inline event type keys are of type string which represents the name of the event.An example of a valid inline event name is \"Contoso.OrderCreated\".The inline event type values are of type InlineEventProperties and will contain additional information for every inline event type.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A collection of inline event types for the resource. The inline event type keys are of type string which represents the name of the event.An example of a valid inline event name is ""Contoso.OrderCreated"".The inline event type values are of type InlineEventProperties and will contain additional information for every inline event type.", + SerializedName = @"inlineEventTypes", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInlineEventTypes) })] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInlineEventTypes EventTypeInfoInlineEventType { get => ChannelUpdateParametersBody.EventTypeInfoInlineEventType ?? null /* object */; set => ChannelUpdateParametersBody.EventTypeInfoInlineEventType = value; } + + /// The kind of event type used. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The kind of event type used.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The kind of event type used.", + SerializedName = @"kind", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind EventTypeInfoKind { get => ChannelUpdateParametersBody.EventTypeInfoKind ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind)""); set => ChannelUpdateParametersBody.EventTypeInfoKind = value; } + + /// + /// Expiration time of the event channel. If this timer expires while the corresponding partner topic or partner destination + /// is never activated,the channel and corresponding partner topic or partner destination are deleted. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Expiration time of the event channel. If this timer expires while the corresponding partner topic or partner destination is never activated,the channel and corresponding partner topic or partner destination are deleted.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Expiration time of the event channel. If this timer expires while the corresponding partner topic or partner destination is never activated,the channel and corresponding partner topic or partner destination are deleted.", + SerializedName = @"expirationTimeIfNotActivatedUtc", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime ExpirationTimeIfNotActivatedUtc { get => ChannelUpdateParametersBody.ExpirationTimeIfNotActivatedUtc ?? default(global::System.DateTime); set => ChannelUpdateParametersBody.ExpirationTimeIfNotActivatedUtc = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the channel. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the channel.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the channel.", + SerializedName = @"channelName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ChannelName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private string _partnerNamespaceName; + + /// Name of the partner namespace. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the partner namespace.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the partner namespace.", + SerializedName = @"partnerNamespaceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string PartnerNamespaceName { get => this._partnerNamespaceName; set => this._partnerNamespaceName = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the partners subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the partners subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the partners subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ChannelsUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ChannelsUpdate(SubscriptionId, ResourceGroupName, PartnerNamespaceName, Name, ChannelUpdateParametersBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PartnerNamespaceName=PartnerNamespaceName,Name=Name,body=ChannelUpdateParametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public UpdateAzEventGridChannel_UpdateExpanded() + { + + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PartnerNamespaceName=PartnerNamespaceName, Name=Name, body=ChannelUpdateParametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/UpdateAzEventGridChannel_UpdateViaIdentityExpanded.cs b/swaggerci/eventgrid/generated/cmdlets/UpdateAzEventGridChannel_UpdateViaIdentityExpanded.cs new file mode 100644 index 000000000000..1c7ae5ec488a --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/UpdateAzEventGridChannel_UpdateViaIdentityExpanded.cs @@ -0,0 +1,426 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Synchronously updates a channel with the specified parameters. + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerNamespaces/{partnerNamespaceName}/channels/{channelName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzEventGridChannel_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Synchronously updates a channel with the specified parameters.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class UpdateAzEventGridChannel_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParameters _channelUpdateParametersBody= new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ChannelUpdateParameters(); + + /// Properties of the Channel update. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IChannelUpdateParameters ChannelUpdateParametersBody { get => this._channelUpdateParametersBody; set => this._channelUpdateParametersBody = value; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// + /// A collection of inline event types for the resource. The inline event type keys are of type string which represents the + /// name of the event.An example of a valid inline event name is "Contoso.OrderCreated".The inline event type values are of + /// type InlineEventProperties and will contain additional information for every inline event type. + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "A collection of inline event types for the resource. The inline event type keys are of type string which represents the name of the event.An example of a valid inline event name is \"Contoso.OrderCreated\".The inline event type values are of type InlineEventProperties and will contain additional information for every inline event type.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A collection of inline event types for the resource. The inline event type keys are of type string which represents the name of the event.An example of a valid inline event name is ""Contoso.OrderCreated"".The inline event type values are of type InlineEventProperties and will contain additional information for every inline event type.", + SerializedName = @"inlineEventTypes", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInlineEventTypes) })] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventTypeInfoInlineEventTypes EventTypeInfoInlineEventType { get => ChannelUpdateParametersBody.EventTypeInfoInlineEventType ?? null /* object */; set => ChannelUpdateParametersBody.EventTypeInfoInlineEventType = value; } + + /// The kind of event type used. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The kind of event type used.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The kind of event type used.", + SerializedName = @"kind", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind EventTypeInfoKind { get => ChannelUpdateParametersBody.EventTypeInfoKind ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDefinitionKind)""); set => ChannelUpdateParametersBody.EventTypeInfoKind = value; } + + /// + /// Expiration time of the event channel. If this timer expires while the corresponding partner topic or partner destination + /// is never activated,the channel and corresponding partner topic or partner destination are deleted. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Expiration time of the event channel. If this timer expires while the corresponding partner topic or partner destination is never activated,the channel and corresponding partner topic or partner destination are deleted.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Expiration time of the event channel. If this timer expires while the corresponding partner topic or partner destination is never activated,the channel and corresponding partner topic or partner destination are deleted.", + SerializedName = @"expirationTimeIfNotActivatedUtc", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime ExpirationTimeIfNotActivatedUtc { get => ChannelUpdateParametersBody.ExpirationTimeIfNotActivatedUtc ?? default(global::System.DateTime); set => ChannelUpdateParametersBody.ExpirationTimeIfNotActivatedUtc = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ChannelsUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ChannelsUpdateViaIdentity(InputObject.Id, ChannelUpdateParametersBody, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.PartnerNamespaceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.PartnerNamespaceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ChannelName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ChannelName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.ChannelsUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.PartnerNamespaceName ?? null, InputObject.ChannelName ?? null, ChannelUpdateParametersBody, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=ChannelUpdateParametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public UpdateAzEventGridChannel_UpdateViaIdentityExpanded() + { + + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=ChannelUpdateParametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/UpdateAzEventGridDomainEventSubscription_UpdateExpanded.cs b/swaggerci/eventgrid/generated/cmdlets/UpdateAzEventGridDomainEventSubscription_UpdateExpanded.cs new file mode 100644 index 000000000000..471673f480bc --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/UpdateAzEventGridDomainEventSubscription_UpdateExpanded.cs @@ -0,0 +1,666 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Update an existing event subscription for a topic. + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/eventSubscriptions/{eventSubscriptionName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzEventGridDomainEventSubscription_UpdateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Update an existing event subscription for a topic.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class UpdateAzEventGridDomainEventSubscription_UpdateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType DeadLetterWithResourceIdentityType { get => EventSubscriptionUpdateParametersBody.DeadLetterWithResourceIdentityType ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType)""); set => EventSubscriptionUpdateParametersBody.DeadLetterWithResourceIdentityType = value; } + + /// The user identity associated with the resource. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The user identity associated with the resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The user identity associated with the resource.", + SerializedName = @"userAssignedIdentity", + PossibleTypes = new [] { typeof(string) })] + public string DeadLetterWithResourceIdentityUserAssignedIdentity { get => EventSubscriptionUpdateParametersBody.DeadLetterWithResourceIdentityUserAssignedIdentity ?? null; set => EventSubscriptionUpdateParametersBody.DeadLetterWithResourceIdentityUserAssignedIdentity = value; } + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Type of the endpoint for the event subscription destination. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Type of the endpoint for the event subscription destination.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of the endpoint for the event subscription destination.", + SerializedName = @"endpointType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType DeliveryWithResourceIdentityDestinationEndpointType { get => EventSubscriptionUpdateParametersBody.DeliveryWithResourceIdentityDestinationEndpointType ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType)""); set => EventSubscriptionUpdateParametersBody.DeliveryWithResourceIdentityDestinationEndpointType = value; } + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType DeliveryWithResourceIdentityType { get => EventSubscriptionUpdateParametersBody.DeliveryWithResourceIdentityType ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType)""); set => EventSubscriptionUpdateParametersBody.DeliveryWithResourceIdentityType = value; } + + /// The user identity associated with the resource. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The user identity associated with the resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The user identity associated with the resource.", + SerializedName = @"userAssignedIdentity", + PossibleTypes = new [] { typeof(string) })] + public string DeliveryWithResourceIdentityUserAssignedIdentity { get => EventSubscriptionUpdateParametersBody.DeliveryWithResourceIdentityUserAssignedIdentity ?? null; set => EventSubscriptionUpdateParametersBody.DeliveryWithResourceIdentityUserAssignedIdentity = value; } + + /// Backing field for property. + private string _domainName; + + /// Name of the domain. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the domain.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the domain.", + SerializedName = @"domainName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string DomainName { get => this._domainName; set => this._domainName = value; } + + /// Type of the endpoint for the event subscription destination. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Type of the endpoint for the event subscription destination.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of the endpoint for the event subscription destination.", + SerializedName = @"endpointType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType EndpointType { get => EventSubscriptionUpdateParametersBody.EndpointType ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType)""); set => EventSubscriptionUpdateParametersBody.EndpointType = value; } + + /// The event delivery schema for the event subscription. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The event delivery schema for the event subscription.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The event delivery schema for the event subscription.", + SerializedName = @"eventDeliverySchema", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema EventDeliverySchema { get => EventSubscriptionUpdateParametersBody.EventDeliverySchema ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema)""); set => EventSubscriptionUpdateParametersBody.EventDeliverySchema = value; } + + /// Backing field for property. + private string _eventSubscriptionName; + + /// Name of the event subscription to be updated. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the event subscription to be updated.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the event subscription to be updated.", + SerializedName = @"eventSubscriptionName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string EventSubscriptionName { get => this._eventSubscriptionName; set => this._eventSubscriptionName = value; } + + /// + /// Backing field for property. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParameters _eventSubscriptionUpdateParametersBody= new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionUpdateParameters(); + + /// Properties of the Event Subscription update. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParameters EventSubscriptionUpdateParametersBody { get => this._eventSubscriptionUpdateParametersBody; set => this._eventSubscriptionUpdateParametersBody = value; } + + /// Information about the expiration time for the event subscription. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Information about the expiration time for the event subscription.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Information about the expiration time for the event subscription.", + SerializedName = @"expirationTimeUtc", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime ExpirationTimeUtc { get => EventSubscriptionUpdateParametersBody.ExpirationTimeUtc ?? default(global::System.DateTime); set => EventSubscriptionUpdateParametersBody.ExpirationTimeUtc = value; } + + /// An array of advanced filters that are used for filtering event subscriptions. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "An array of advanced filters that are used for filtering event subscriptions.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An array of advanced filters that are used for filtering event subscriptions.", + SerializedName = @"advancedFilters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter) })] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[] FilterAdvancedFilter { get => EventSubscriptionUpdateParametersBody.FilterAdvancedFilter ?? null /* arrayOf */; set => EventSubscriptionUpdateParametersBody.FilterAdvancedFilter = value; } + + /// + /// Allows advanced filters to be evaluated against an array of values instead of expecting a singular value. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Allows advanced filters to be evaluated against an array of values instead of expecting a singular value.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allows advanced filters to be evaluated against an array of values instead of expecting a singular value.", + SerializedName = @"enableAdvancedFilteringOnArrays", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter FilterEnableAdvancedFilteringOnArray { get => EventSubscriptionUpdateParametersBody.FilterEnableAdvancedFilteringOnArray ?? default(global::System.Management.Automation.SwitchParameter); set => EventSubscriptionUpdateParametersBody.FilterEnableAdvancedFilteringOnArray = value; } + + /// + /// 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. + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"includedEventTypes", + PossibleTypes = new [] { typeof(string) })] + public string[] FilterIncludedEventType { get => EventSubscriptionUpdateParametersBody.FilterIncludedEventType ?? null /* arrayOf */; set => EventSubscriptionUpdateParametersBody.FilterIncludedEventType = value; } + + /// + /// Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filtershould be compared in a case sensitive + /// manner. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filtershould be compared in a case sensitive manner.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filtershould be compared in a case sensitive manner.", + SerializedName = @"isSubjectCaseSensitive", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter FilterIsSubjectCaseSensitive { get => EventSubscriptionUpdateParametersBody.FilterIsSubjectCaseSensitive ?? default(global::System.Management.Automation.SwitchParameter); set => EventSubscriptionUpdateParametersBody.FilterIsSubjectCaseSensitive = value; } + + /// + /// An optional string to filter events for an event subscription based on a resource path prefix.The format of this depends + /// on the publisher of the events.Wildcard characters are not supported in this path. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "An optional string to filter events for an event subscription based on a resource path prefix.The format of this depends on the publisher of the events.Wildcard characters are not supported in this path.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An optional string to filter events for an event subscription based on a resource path prefix.The format of this depends on the publisher of the events.Wildcard characters are not supported in this path.", + SerializedName = @"subjectBeginsWith", + PossibleTypes = new [] { typeof(string) })] + public string FilterSubjectBeginsWith { get => EventSubscriptionUpdateParametersBody.FilterSubjectBeginsWith ?? null; set => EventSubscriptionUpdateParametersBody.FilterSubjectBeginsWith = value; } + + /// + /// An optional string to filter events for an event subscription based on a resource path suffix.Wildcard characters are + /// not supported in this path. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "An optional string to filter events for an event subscription based on a resource path suffix.Wildcard characters are not supported in this path.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An optional string to filter events for an event subscription based on a resource path suffix.Wildcard characters are not supported in this path.", + SerializedName = @"subjectEndsWith", + PossibleTypes = new [] { typeof(string) })] + public string FilterSubjectEndsWith { get => EventSubscriptionUpdateParametersBody.FilterSubjectEndsWith ?? null; set => EventSubscriptionUpdateParametersBody.FilterSubjectEndsWith = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// List of user defined labels. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "List of user defined labels.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of user defined labels.", + SerializedName = @"labels", + PossibleTypes = new [] { typeof(string) })] + public string[] Label { get => EventSubscriptionUpdateParametersBody.Label ?? null /* arrayOf */; set => EventSubscriptionUpdateParametersBody.Label = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Time To Live (in minutes) for events. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Time To Live (in minutes) for events.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Time To Live (in minutes) for events.", + SerializedName = @"eventTimeToLiveInMinutes", + PossibleTypes = new [] { typeof(int) })] + public int RetryPolicyEventTimeToLiveInMinute { get => EventSubscriptionUpdateParametersBody.RetryPolicyEventTimeToLiveInMinute ?? default(int); set => EventSubscriptionUpdateParametersBody.RetryPolicyEventTimeToLiveInMinute = value; } + + /// Maximum number of delivery retry attempts for events. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Maximum number of delivery retry attempts for events.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Maximum number of delivery retry attempts for events.", + SerializedName = @"maxDeliveryAttempts", + PossibleTypes = new [] { typeof(int) })] + public int RetryPolicyMaxDeliveryAttempt { get => EventSubscriptionUpdateParametersBody.RetryPolicyMaxDeliveryAttempt ?? default(int); set => EventSubscriptionUpdateParametersBody.RetryPolicyMaxDeliveryAttempt = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of UpdateAzEventGridDomainEventSubscription_UpdateExpanded + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets.UpdateAzEventGridDomainEventSubscription_UpdateExpanded Clone() + { + var clone = new UpdateAzEventGridDomainEventSubscription_UpdateExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.EventSubscriptionUpdateParametersBody = this.EventSubscriptionUpdateParametersBody; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.DomainName = this.DomainName; + clone.EventSubscriptionName = this.EventSubscriptionName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DomainEventSubscriptionsUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DomainEventSubscriptionsUpdate(SubscriptionId, ResourceGroupName, DomainName, EventSubscriptionName, EventSubscriptionUpdateParametersBody, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,DomainName=DomainName,EventSubscriptionName=EventSubscriptionName,body=EventSubscriptionUpdateParametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public UpdateAzEventGridDomainEventSubscription_UpdateExpanded() + { + + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, DomainName=DomainName, EventSubscriptionName=EventSubscriptionName, body=EventSubscriptionUpdateParametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/UpdateAzEventGridDomainEventSubscription_UpdateViaIdentityExpanded.cs b/swaggerci/eventgrid/generated/cmdlets/UpdateAzEventGridDomainEventSubscription_UpdateViaIdentityExpanded.cs new file mode 100644 index 000000000000..6f37f16f8306 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/UpdateAzEventGridDomainEventSubscription_UpdateViaIdentityExpanded.cs @@ -0,0 +1,634 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Update an existing event subscription for a topic. + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/eventSubscriptions/{eventSubscriptionName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzEventGridDomainEventSubscription_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Update an existing event subscription for a topic.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class UpdateAzEventGridDomainEventSubscription_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType DeadLetterWithResourceIdentityType { get => EventSubscriptionUpdateParametersBody.DeadLetterWithResourceIdentityType ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType)""); set => EventSubscriptionUpdateParametersBody.DeadLetterWithResourceIdentityType = value; } + + /// The user identity associated with the resource. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The user identity associated with the resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The user identity associated with the resource.", + SerializedName = @"userAssignedIdentity", + PossibleTypes = new [] { typeof(string) })] + public string DeadLetterWithResourceIdentityUserAssignedIdentity { get => EventSubscriptionUpdateParametersBody.DeadLetterWithResourceIdentityUserAssignedIdentity ?? null; set => EventSubscriptionUpdateParametersBody.DeadLetterWithResourceIdentityUserAssignedIdentity = value; } + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Type of the endpoint for the event subscription destination. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Type of the endpoint for the event subscription destination.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of the endpoint for the event subscription destination.", + SerializedName = @"endpointType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType DeliveryWithResourceIdentityDestinationEndpointType { get => EventSubscriptionUpdateParametersBody.DeliveryWithResourceIdentityDestinationEndpointType ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType)""); set => EventSubscriptionUpdateParametersBody.DeliveryWithResourceIdentityDestinationEndpointType = value; } + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType DeliveryWithResourceIdentityType { get => EventSubscriptionUpdateParametersBody.DeliveryWithResourceIdentityType ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType)""); set => EventSubscriptionUpdateParametersBody.DeliveryWithResourceIdentityType = value; } + + /// The user identity associated with the resource. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The user identity associated with the resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The user identity associated with the resource.", + SerializedName = @"userAssignedIdentity", + PossibleTypes = new [] { typeof(string) })] + public string DeliveryWithResourceIdentityUserAssignedIdentity { get => EventSubscriptionUpdateParametersBody.DeliveryWithResourceIdentityUserAssignedIdentity ?? null; set => EventSubscriptionUpdateParametersBody.DeliveryWithResourceIdentityUserAssignedIdentity = value; } + + /// Type of the endpoint for the event subscription destination. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Type of the endpoint for the event subscription destination.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of the endpoint for the event subscription destination.", + SerializedName = @"endpointType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType EndpointType { get => EventSubscriptionUpdateParametersBody.EndpointType ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType)""); set => EventSubscriptionUpdateParametersBody.EndpointType = value; } + + /// The event delivery schema for the event subscription. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The event delivery schema for the event subscription.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The event delivery schema for the event subscription.", + SerializedName = @"eventDeliverySchema", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema EventDeliverySchema { get => EventSubscriptionUpdateParametersBody.EventDeliverySchema ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema)""); set => EventSubscriptionUpdateParametersBody.EventDeliverySchema = value; } + + /// + /// Backing field for property. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParameters _eventSubscriptionUpdateParametersBody= new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionUpdateParameters(); + + /// Properties of the Event Subscription update. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParameters EventSubscriptionUpdateParametersBody { get => this._eventSubscriptionUpdateParametersBody; set => this._eventSubscriptionUpdateParametersBody = value; } + + /// Information about the expiration time for the event subscription. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Information about the expiration time for the event subscription.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Information about the expiration time for the event subscription.", + SerializedName = @"expirationTimeUtc", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime ExpirationTimeUtc { get => EventSubscriptionUpdateParametersBody.ExpirationTimeUtc ?? default(global::System.DateTime); set => EventSubscriptionUpdateParametersBody.ExpirationTimeUtc = value; } + + /// An array of advanced filters that are used for filtering event subscriptions. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "An array of advanced filters that are used for filtering event subscriptions.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An array of advanced filters that are used for filtering event subscriptions.", + SerializedName = @"advancedFilters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter) })] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[] FilterAdvancedFilter { get => EventSubscriptionUpdateParametersBody.FilterAdvancedFilter ?? null /* arrayOf */; set => EventSubscriptionUpdateParametersBody.FilterAdvancedFilter = value; } + + /// + /// Allows advanced filters to be evaluated against an array of values instead of expecting a singular value. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Allows advanced filters to be evaluated against an array of values instead of expecting a singular value.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allows advanced filters to be evaluated against an array of values instead of expecting a singular value.", + SerializedName = @"enableAdvancedFilteringOnArrays", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter FilterEnableAdvancedFilteringOnArray { get => EventSubscriptionUpdateParametersBody.FilterEnableAdvancedFilteringOnArray ?? default(global::System.Management.Automation.SwitchParameter); set => EventSubscriptionUpdateParametersBody.FilterEnableAdvancedFilteringOnArray = value; } + + /// + /// 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. + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"includedEventTypes", + PossibleTypes = new [] { typeof(string) })] + public string[] FilterIncludedEventType { get => EventSubscriptionUpdateParametersBody.FilterIncludedEventType ?? null /* arrayOf */; set => EventSubscriptionUpdateParametersBody.FilterIncludedEventType = value; } + + /// + /// Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filtershould be compared in a case sensitive + /// manner. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filtershould be compared in a case sensitive manner.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filtershould be compared in a case sensitive manner.", + SerializedName = @"isSubjectCaseSensitive", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter FilterIsSubjectCaseSensitive { get => EventSubscriptionUpdateParametersBody.FilterIsSubjectCaseSensitive ?? default(global::System.Management.Automation.SwitchParameter); set => EventSubscriptionUpdateParametersBody.FilterIsSubjectCaseSensitive = value; } + + /// + /// An optional string to filter events for an event subscription based on a resource path prefix.The format of this depends + /// on the publisher of the events.Wildcard characters are not supported in this path. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "An optional string to filter events for an event subscription based on a resource path prefix.The format of this depends on the publisher of the events.Wildcard characters are not supported in this path.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An optional string to filter events for an event subscription based on a resource path prefix.The format of this depends on the publisher of the events.Wildcard characters are not supported in this path.", + SerializedName = @"subjectBeginsWith", + PossibleTypes = new [] { typeof(string) })] + public string FilterSubjectBeginsWith { get => EventSubscriptionUpdateParametersBody.FilterSubjectBeginsWith ?? null; set => EventSubscriptionUpdateParametersBody.FilterSubjectBeginsWith = value; } + + /// + /// An optional string to filter events for an event subscription based on a resource path suffix.Wildcard characters are + /// not supported in this path. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "An optional string to filter events for an event subscription based on a resource path suffix.Wildcard characters are not supported in this path.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An optional string to filter events for an event subscription based on a resource path suffix.Wildcard characters are not supported in this path.", + SerializedName = @"subjectEndsWith", + PossibleTypes = new [] { typeof(string) })] + public string FilterSubjectEndsWith { get => EventSubscriptionUpdateParametersBody.FilterSubjectEndsWith ?? null; set => EventSubscriptionUpdateParametersBody.FilterSubjectEndsWith = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// List of user defined labels. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "List of user defined labels.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of user defined labels.", + SerializedName = @"labels", + PossibleTypes = new [] { typeof(string) })] + public string[] Label { get => EventSubscriptionUpdateParametersBody.Label ?? null /* arrayOf */; set => EventSubscriptionUpdateParametersBody.Label = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Time To Live (in minutes) for events. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Time To Live (in minutes) for events.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Time To Live (in minutes) for events.", + SerializedName = @"eventTimeToLiveInMinutes", + PossibleTypes = new [] { typeof(int) })] + public int RetryPolicyEventTimeToLiveInMinute { get => EventSubscriptionUpdateParametersBody.RetryPolicyEventTimeToLiveInMinute ?? default(int); set => EventSubscriptionUpdateParametersBody.RetryPolicyEventTimeToLiveInMinute = value; } + + /// Maximum number of delivery retry attempts for events. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Maximum number of delivery retry attempts for events.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Maximum number of delivery retry attempts for events.", + SerializedName = @"maxDeliveryAttempts", + PossibleTypes = new [] { typeof(int) })] + public int RetryPolicyMaxDeliveryAttempt { get => EventSubscriptionUpdateParametersBody.RetryPolicyMaxDeliveryAttempt ?? default(int); set => EventSubscriptionUpdateParametersBody.RetryPolicyMaxDeliveryAttempt = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of UpdateAzEventGridDomainEventSubscription_UpdateViaIdentityExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets.UpdateAzEventGridDomainEventSubscription_UpdateViaIdentityExpanded Clone() + { + var clone = new UpdateAzEventGridDomainEventSubscription_UpdateViaIdentityExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.EventSubscriptionUpdateParametersBody = this.EventSubscriptionUpdateParametersBody; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DomainEventSubscriptionsUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.DomainEventSubscriptionsUpdateViaIdentity(InputObject.Id, EventSubscriptionUpdateParametersBody, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.DomainName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.DomainName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.EventSubscriptionName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.EventSubscriptionName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.DomainEventSubscriptionsUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.DomainName ?? null, InputObject.EventSubscriptionName ?? null, EventSubscriptionUpdateParametersBody, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=EventSubscriptionUpdateParametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet + /// class. + /// + public UpdateAzEventGridDomainEventSubscription_UpdateViaIdentityExpanded() + { + + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=EventSubscriptionUpdateParametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/UpdateAzEventGridDomainTopicEventSubscription_UpdateExpanded.cs b/swaggerci/eventgrid/generated/cmdlets/UpdateAzEventGridDomainTopicEventSubscription_UpdateExpanded.cs new file mode 100644 index 000000000000..28b2575eec5f --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/UpdateAzEventGridDomainTopicEventSubscription_UpdateExpanded.cs @@ -0,0 +1,683 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Update an existing event subscription for a domain topic. + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/topics/{topicName}/eventSubscriptions/{eventSubscriptionName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzEventGridDomainTopicEventSubscription_UpdateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Update an existing event subscription for a domain topic.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class UpdateAzEventGridDomainTopicEventSubscription_UpdateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType DeadLetterWithResourceIdentityType { get => EventSubscriptionUpdateParametersBody.DeadLetterWithResourceIdentityType ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType)""); set => EventSubscriptionUpdateParametersBody.DeadLetterWithResourceIdentityType = value; } + + /// The user identity associated with the resource. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The user identity associated with the resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The user identity associated with the resource.", + SerializedName = @"userAssignedIdentity", + PossibleTypes = new [] { typeof(string) })] + public string DeadLetterWithResourceIdentityUserAssignedIdentity { get => EventSubscriptionUpdateParametersBody.DeadLetterWithResourceIdentityUserAssignedIdentity ?? null; set => EventSubscriptionUpdateParametersBody.DeadLetterWithResourceIdentityUserAssignedIdentity = value; } + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Type of the endpoint for the event subscription destination. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Type of the endpoint for the event subscription destination.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of the endpoint for the event subscription destination.", + SerializedName = @"endpointType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType DeliveryWithResourceIdentityDestinationEndpointType { get => EventSubscriptionUpdateParametersBody.DeliveryWithResourceIdentityDestinationEndpointType ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType)""); set => EventSubscriptionUpdateParametersBody.DeliveryWithResourceIdentityDestinationEndpointType = value; } + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType DeliveryWithResourceIdentityType { get => EventSubscriptionUpdateParametersBody.DeliveryWithResourceIdentityType ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType)""); set => EventSubscriptionUpdateParametersBody.DeliveryWithResourceIdentityType = value; } + + /// The user identity associated with the resource. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The user identity associated with the resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The user identity associated with the resource.", + SerializedName = @"userAssignedIdentity", + PossibleTypes = new [] { typeof(string) })] + public string DeliveryWithResourceIdentityUserAssignedIdentity { get => EventSubscriptionUpdateParametersBody.DeliveryWithResourceIdentityUserAssignedIdentity ?? null; set => EventSubscriptionUpdateParametersBody.DeliveryWithResourceIdentityUserAssignedIdentity = value; } + + /// Backing field for property. + private string _domainName; + + /// Name of the domain. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the domain.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the domain.", + SerializedName = @"domainName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string DomainName { get => this._domainName; set => this._domainName = value; } + + /// Type of the endpoint for the event subscription destination. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Type of the endpoint for the event subscription destination.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of the endpoint for the event subscription destination.", + SerializedName = @"endpointType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType EndpointType { get => EventSubscriptionUpdateParametersBody.EndpointType ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType)""); set => EventSubscriptionUpdateParametersBody.EndpointType = value; } + + /// The event delivery schema for the event subscription. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The event delivery schema for the event subscription.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The event delivery schema for the event subscription.", + SerializedName = @"eventDeliverySchema", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema EventDeliverySchema { get => EventSubscriptionUpdateParametersBody.EventDeliverySchema ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema)""); set => EventSubscriptionUpdateParametersBody.EventDeliverySchema = value; } + + /// Backing field for property. + private string _eventSubscriptionName; + + /// Name of the event subscription to be updated. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the event subscription to be updated.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the event subscription to be updated.", + SerializedName = @"eventSubscriptionName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string EventSubscriptionName { get => this._eventSubscriptionName; set => this._eventSubscriptionName = value; } + + /// + /// Backing field for property. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParameters _eventSubscriptionUpdateParametersBody= new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionUpdateParameters(); + + /// Properties of the Event Subscription update. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParameters EventSubscriptionUpdateParametersBody { get => this._eventSubscriptionUpdateParametersBody; set => this._eventSubscriptionUpdateParametersBody = value; } + + /// Information about the expiration time for the event subscription. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Information about the expiration time for the event subscription.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Information about the expiration time for the event subscription.", + SerializedName = @"expirationTimeUtc", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime ExpirationTimeUtc { get => EventSubscriptionUpdateParametersBody.ExpirationTimeUtc ?? default(global::System.DateTime); set => EventSubscriptionUpdateParametersBody.ExpirationTimeUtc = value; } + + /// An array of advanced filters that are used for filtering event subscriptions. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "An array of advanced filters that are used for filtering event subscriptions.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An array of advanced filters that are used for filtering event subscriptions.", + SerializedName = @"advancedFilters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter) })] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[] FilterAdvancedFilter { get => EventSubscriptionUpdateParametersBody.FilterAdvancedFilter ?? null /* arrayOf */; set => EventSubscriptionUpdateParametersBody.FilterAdvancedFilter = value; } + + /// + /// Allows advanced filters to be evaluated against an array of values instead of expecting a singular value. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Allows advanced filters to be evaluated against an array of values instead of expecting a singular value.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allows advanced filters to be evaluated against an array of values instead of expecting a singular value.", + SerializedName = @"enableAdvancedFilteringOnArrays", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter FilterEnableAdvancedFilteringOnArray { get => EventSubscriptionUpdateParametersBody.FilterEnableAdvancedFilteringOnArray ?? default(global::System.Management.Automation.SwitchParameter); set => EventSubscriptionUpdateParametersBody.FilterEnableAdvancedFilteringOnArray = value; } + + /// + /// 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. + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"includedEventTypes", + PossibleTypes = new [] { typeof(string) })] + public string[] FilterIncludedEventType { get => EventSubscriptionUpdateParametersBody.FilterIncludedEventType ?? null /* arrayOf */; set => EventSubscriptionUpdateParametersBody.FilterIncludedEventType = value; } + + /// + /// Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filtershould be compared in a case sensitive + /// manner. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filtershould be compared in a case sensitive manner.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filtershould be compared in a case sensitive manner.", + SerializedName = @"isSubjectCaseSensitive", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter FilterIsSubjectCaseSensitive { get => EventSubscriptionUpdateParametersBody.FilterIsSubjectCaseSensitive ?? default(global::System.Management.Automation.SwitchParameter); set => EventSubscriptionUpdateParametersBody.FilterIsSubjectCaseSensitive = value; } + + /// + /// An optional string to filter events for an event subscription based on a resource path prefix.The format of this depends + /// on the publisher of the events.Wildcard characters are not supported in this path. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "An optional string to filter events for an event subscription based on a resource path prefix.The format of this depends on the publisher of the events.Wildcard characters are not supported in this path.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An optional string to filter events for an event subscription based on a resource path prefix.The format of this depends on the publisher of the events.Wildcard characters are not supported in this path.", + SerializedName = @"subjectBeginsWith", + PossibleTypes = new [] { typeof(string) })] + public string FilterSubjectBeginsWith { get => EventSubscriptionUpdateParametersBody.FilterSubjectBeginsWith ?? null; set => EventSubscriptionUpdateParametersBody.FilterSubjectBeginsWith = value; } + + /// + /// An optional string to filter events for an event subscription based on a resource path suffix.Wildcard characters are + /// not supported in this path. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "An optional string to filter events for an event subscription based on a resource path suffix.Wildcard characters are not supported in this path.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An optional string to filter events for an event subscription based on a resource path suffix.Wildcard characters are not supported in this path.", + SerializedName = @"subjectEndsWith", + PossibleTypes = new [] { typeof(string) })] + public string FilterSubjectEndsWith { get => EventSubscriptionUpdateParametersBody.FilterSubjectEndsWith ?? null; set => EventSubscriptionUpdateParametersBody.FilterSubjectEndsWith = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// List of user defined labels. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "List of user defined labels.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of user defined labels.", + SerializedName = @"labels", + PossibleTypes = new [] { typeof(string) })] + public string[] Label { get => EventSubscriptionUpdateParametersBody.Label ?? null /* arrayOf */; set => EventSubscriptionUpdateParametersBody.Label = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Time To Live (in minutes) for events. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Time To Live (in minutes) for events.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Time To Live (in minutes) for events.", + SerializedName = @"eventTimeToLiveInMinutes", + PossibleTypes = new [] { typeof(int) })] + public int RetryPolicyEventTimeToLiveInMinute { get => EventSubscriptionUpdateParametersBody.RetryPolicyEventTimeToLiveInMinute ?? default(int); set => EventSubscriptionUpdateParametersBody.RetryPolicyEventTimeToLiveInMinute = value; } + + /// Maximum number of delivery retry attempts for events. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Maximum number of delivery retry attempts for events.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Maximum number of delivery retry attempts for events.", + SerializedName = @"maxDeliveryAttempts", + PossibleTypes = new [] { typeof(int) })] + public int RetryPolicyMaxDeliveryAttempt { get => EventSubscriptionUpdateParametersBody.RetryPolicyMaxDeliveryAttempt ?? default(int); set => EventSubscriptionUpdateParametersBody.RetryPolicyMaxDeliveryAttempt = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _topicName; + + /// Name of the topic. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the topic.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the topic.", + SerializedName = @"topicName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string TopicName { get => this._topicName; set => this._topicName = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of UpdateAzEventGridDomainTopicEventSubscription_UpdateExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets.UpdateAzEventGridDomainTopicEventSubscription_UpdateExpanded Clone() + { + var clone = new UpdateAzEventGridDomainTopicEventSubscription_UpdateExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.EventSubscriptionUpdateParametersBody = this.EventSubscriptionUpdateParametersBody; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.DomainName = this.DomainName; + clone.TopicName = this.TopicName; + clone.EventSubscriptionName = this.EventSubscriptionName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DomainTopicEventSubscriptionsUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DomainTopicEventSubscriptionsUpdate(SubscriptionId, ResourceGroupName, DomainName, TopicName, EventSubscriptionName, EventSubscriptionUpdateParametersBody, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,DomainName=DomainName,TopicName=TopicName,EventSubscriptionName=EventSubscriptionName,body=EventSubscriptionUpdateParametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public UpdateAzEventGridDomainTopicEventSubscription_UpdateExpanded() + { + + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, DomainName=DomainName, TopicName=TopicName, EventSubscriptionName=EventSubscriptionName, body=EventSubscriptionUpdateParametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/UpdateAzEventGridDomainTopicEventSubscription_UpdateViaIdentityExpanded.cs b/swaggerci/eventgrid/generated/cmdlets/UpdateAzEventGridDomainTopicEventSubscription_UpdateViaIdentityExpanded.cs new file mode 100644 index 000000000000..f40d72d7b7be --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/UpdateAzEventGridDomainTopicEventSubscription_UpdateViaIdentityExpanded.cs @@ -0,0 +1,638 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Update an existing event subscription for a domain topic. + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/topics/{topicName}/eventSubscriptions/{eventSubscriptionName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzEventGridDomainTopicEventSubscription_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Update an existing event subscription for a domain topic.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class UpdateAzEventGridDomainTopicEventSubscription_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType DeadLetterWithResourceIdentityType { get => EventSubscriptionUpdateParametersBody.DeadLetterWithResourceIdentityType ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType)""); set => EventSubscriptionUpdateParametersBody.DeadLetterWithResourceIdentityType = value; } + + /// The user identity associated with the resource. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The user identity associated with the resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The user identity associated with the resource.", + SerializedName = @"userAssignedIdentity", + PossibleTypes = new [] { typeof(string) })] + public string DeadLetterWithResourceIdentityUserAssignedIdentity { get => EventSubscriptionUpdateParametersBody.DeadLetterWithResourceIdentityUserAssignedIdentity ?? null; set => EventSubscriptionUpdateParametersBody.DeadLetterWithResourceIdentityUserAssignedIdentity = value; } + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Type of the endpoint for the event subscription destination. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Type of the endpoint for the event subscription destination.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of the endpoint for the event subscription destination.", + SerializedName = @"endpointType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType DeliveryWithResourceIdentityDestinationEndpointType { get => EventSubscriptionUpdateParametersBody.DeliveryWithResourceIdentityDestinationEndpointType ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType)""); set => EventSubscriptionUpdateParametersBody.DeliveryWithResourceIdentityDestinationEndpointType = value; } + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType DeliveryWithResourceIdentityType { get => EventSubscriptionUpdateParametersBody.DeliveryWithResourceIdentityType ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType)""); set => EventSubscriptionUpdateParametersBody.DeliveryWithResourceIdentityType = value; } + + /// The user identity associated with the resource. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The user identity associated with the resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The user identity associated with the resource.", + SerializedName = @"userAssignedIdentity", + PossibleTypes = new [] { typeof(string) })] + public string DeliveryWithResourceIdentityUserAssignedIdentity { get => EventSubscriptionUpdateParametersBody.DeliveryWithResourceIdentityUserAssignedIdentity ?? null; set => EventSubscriptionUpdateParametersBody.DeliveryWithResourceIdentityUserAssignedIdentity = value; } + + /// Type of the endpoint for the event subscription destination. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Type of the endpoint for the event subscription destination.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of the endpoint for the event subscription destination.", + SerializedName = @"endpointType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType EndpointType { get => EventSubscriptionUpdateParametersBody.EndpointType ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType)""); set => EventSubscriptionUpdateParametersBody.EndpointType = value; } + + /// The event delivery schema for the event subscription. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The event delivery schema for the event subscription.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The event delivery schema for the event subscription.", + SerializedName = @"eventDeliverySchema", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema EventDeliverySchema { get => EventSubscriptionUpdateParametersBody.EventDeliverySchema ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema)""); set => EventSubscriptionUpdateParametersBody.EventDeliverySchema = value; } + + /// + /// Backing field for property. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParameters _eventSubscriptionUpdateParametersBody= new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionUpdateParameters(); + + /// Properties of the Event Subscription update. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParameters EventSubscriptionUpdateParametersBody { get => this._eventSubscriptionUpdateParametersBody; set => this._eventSubscriptionUpdateParametersBody = value; } + + /// Information about the expiration time for the event subscription. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Information about the expiration time for the event subscription.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Information about the expiration time for the event subscription.", + SerializedName = @"expirationTimeUtc", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime ExpirationTimeUtc { get => EventSubscriptionUpdateParametersBody.ExpirationTimeUtc ?? default(global::System.DateTime); set => EventSubscriptionUpdateParametersBody.ExpirationTimeUtc = value; } + + /// An array of advanced filters that are used for filtering event subscriptions. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "An array of advanced filters that are used for filtering event subscriptions.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An array of advanced filters that are used for filtering event subscriptions.", + SerializedName = @"advancedFilters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter) })] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[] FilterAdvancedFilter { get => EventSubscriptionUpdateParametersBody.FilterAdvancedFilter ?? null /* arrayOf */; set => EventSubscriptionUpdateParametersBody.FilterAdvancedFilter = value; } + + /// + /// Allows advanced filters to be evaluated against an array of values instead of expecting a singular value. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Allows advanced filters to be evaluated against an array of values instead of expecting a singular value.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allows advanced filters to be evaluated against an array of values instead of expecting a singular value.", + SerializedName = @"enableAdvancedFilteringOnArrays", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter FilterEnableAdvancedFilteringOnArray { get => EventSubscriptionUpdateParametersBody.FilterEnableAdvancedFilteringOnArray ?? default(global::System.Management.Automation.SwitchParameter); set => EventSubscriptionUpdateParametersBody.FilterEnableAdvancedFilteringOnArray = value; } + + /// + /// 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. + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"includedEventTypes", + PossibleTypes = new [] { typeof(string) })] + public string[] FilterIncludedEventType { get => EventSubscriptionUpdateParametersBody.FilterIncludedEventType ?? null /* arrayOf */; set => EventSubscriptionUpdateParametersBody.FilterIncludedEventType = value; } + + /// + /// Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filtershould be compared in a case sensitive + /// manner. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filtershould be compared in a case sensitive manner.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filtershould be compared in a case sensitive manner.", + SerializedName = @"isSubjectCaseSensitive", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter FilterIsSubjectCaseSensitive { get => EventSubscriptionUpdateParametersBody.FilterIsSubjectCaseSensitive ?? default(global::System.Management.Automation.SwitchParameter); set => EventSubscriptionUpdateParametersBody.FilterIsSubjectCaseSensitive = value; } + + /// + /// An optional string to filter events for an event subscription based on a resource path prefix.The format of this depends + /// on the publisher of the events.Wildcard characters are not supported in this path. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "An optional string to filter events for an event subscription based on a resource path prefix.The format of this depends on the publisher of the events.Wildcard characters are not supported in this path.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An optional string to filter events for an event subscription based on a resource path prefix.The format of this depends on the publisher of the events.Wildcard characters are not supported in this path.", + SerializedName = @"subjectBeginsWith", + PossibleTypes = new [] { typeof(string) })] + public string FilterSubjectBeginsWith { get => EventSubscriptionUpdateParametersBody.FilterSubjectBeginsWith ?? null; set => EventSubscriptionUpdateParametersBody.FilterSubjectBeginsWith = value; } + + /// + /// An optional string to filter events for an event subscription based on a resource path suffix.Wildcard characters are + /// not supported in this path. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "An optional string to filter events for an event subscription based on a resource path suffix.Wildcard characters are not supported in this path.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An optional string to filter events for an event subscription based on a resource path suffix.Wildcard characters are not supported in this path.", + SerializedName = @"subjectEndsWith", + PossibleTypes = new [] { typeof(string) })] + public string FilterSubjectEndsWith { get => EventSubscriptionUpdateParametersBody.FilterSubjectEndsWith ?? null; set => EventSubscriptionUpdateParametersBody.FilterSubjectEndsWith = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// List of user defined labels. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "List of user defined labels.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of user defined labels.", + SerializedName = @"labels", + PossibleTypes = new [] { typeof(string) })] + public string[] Label { get => EventSubscriptionUpdateParametersBody.Label ?? null /* arrayOf */; set => EventSubscriptionUpdateParametersBody.Label = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Time To Live (in minutes) for events. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Time To Live (in minutes) for events.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Time To Live (in minutes) for events.", + SerializedName = @"eventTimeToLiveInMinutes", + PossibleTypes = new [] { typeof(int) })] + public int RetryPolicyEventTimeToLiveInMinute { get => EventSubscriptionUpdateParametersBody.RetryPolicyEventTimeToLiveInMinute ?? default(int); set => EventSubscriptionUpdateParametersBody.RetryPolicyEventTimeToLiveInMinute = value; } + + /// Maximum number of delivery retry attempts for events. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Maximum number of delivery retry attempts for events.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Maximum number of delivery retry attempts for events.", + SerializedName = @"maxDeliveryAttempts", + PossibleTypes = new [] { typeof(int) })] + public int RetryPolicyMaxDeliveryAttempt { get => EventSubscriptionUpdateParametersBody.RetryPolicyMaxDeliveryAttempt ?? default(int); set => EventSubscriptionUpdateParametersBody.RetryPolicyMaxDeliveryAttempt = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of UpdateAzEventGridDomainTopicEventSubscription_UpdateViaIdentityExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets.UpdateAzEventGridDomainTopicEventSubscription_UpdateViaIdentityExpanded Clone() + { + var clone = new UpdateAzEventGridDomainTopicEventSubscription_UpdateViaIdentityExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.EventSubscriptionUpdateParametersBody = this.EventSubscriptionUpdateParametersBody; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DomainTopicEventSubscriptionsUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.DomainTopicEventSubscriptionsUpdateViaIdentity(InputObject.Id, EventSubscriptionUpdateParametersBody, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.DomainName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.DomainName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.TopicName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.TopicName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.EventSubscriptionName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.EventSubscriptionName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.DomainTopicEventSubscriptionsUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.DomainName ?? null, InputObject.TopicName ?? null, InputObject.EventSubscriptionName ?? null, EventSubscriptionUpdateParametersBody, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=EventSubscriptionUpdateParametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the + /// cmdlet class. + /// + public UpdateAzEventGridDomainTopicEventSubscription_UpdateViaIdentityExpanded() + { + + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=EventSubscriptionUpdateParametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/UpdateAzEventGridDomain_UpdateExpanded.cs b/swaggerci/eventgrid/generated/cmdlets/UpdateAzEventGridDomain_UpdateExpanded.cs new file mode 100644 index 000000000000..b48710016102 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/UpdateAzEventGridDomain_UpdateExpanded.cs @@ -0,0 +1,643 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Asynchronously updates a domain with the specified parameters. + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzEventGridDomain_UpdateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Asynchronously updates a domain with the specified parameters.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class UpdateAzEventGridDomain_UpdateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// + /// This Boolean is used to specify the creation mechanism for 'all' the Event Grid Domain Topics associated with this Event + /// Grid Domain resource.In this context, creation of domain topic can be auto-managed (when true) or self-managed (when false). + /// The default value for this property is true.When this property is null or set to true, Event Grid is responsible of automatically + /// creating the domain topic when the first event subscription iscreated at the scope of the domain topic. If this property + /// is set to false, then creating the first event subscription will require creating a domain topicby the user. The self-management + /// mode can be used if the user wants full control of when the domain topic is created, while auto-managed mode provides + /// theflexibility to perform less operations and manage fewer resources by the user. Also, note that in auto-managed creation + /// mode, user is allowed to create thedomain topic on demand if needed. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "This Boolean is used to specify the creation mechanism for 'all' the Event Grid Domain Topics associated with this Event Grid Domain resource.In this context, creation of domain topic can be auto-managed (when true) or self-managed (when false). The default value for this property is true.When this property is null or set to true, Event Grid is responsible of automatically creating the domain topic when the first event subscription iscreated at the scope of the domain topic. If this property is set to false, then creating the first event subscription will require creating a domain topicby the user. The self-management mode can be used if the user wants full control of when the domain topic is created, while auto-managed mode provides theflexibility to perform less operations and manage fewer resources by the user. Also, note that in auto-managed creation mode, user is allowed to create thedomain topic on demand if needed.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This Boolean is used to specify the creation mechanism for 'all' the Event Grid Domain Topics associated with this Event Grid Domain resource.In this context, creation of domain topic can be auto-managed (when true) or self-managed (when false). The default value for this property is true.When this property is null or set to true, Event Grid is responsible of automatically creating the domain topic when the first event subscription iscreated at the scope of the domain topic. If this property is set to false, then creating the first event subscription will require creating a domain topicby the user. The self-management mode can be used if the user wants full control of when the domain topic is created, while auto-managed mode provides theflexibility to perform less operations and manage fewer resources by the user. Also, note that in auto-managed creation mode, user is allowed to create thedomain topic on demand if needed.", + SerializedName = @"autoCreateTopicWithFirstSubscription", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter AutoCreateTopicWithFirstSubscription { get => DomainUpdateParametersBody.AutoCreateTopicWithFirstSubscription ?? default(global::System.Management.Automation.SwitchParameter); set => DomainUpdateParametersBody.AutoCreateTopicWithFirstSubscription = value; } + + /// + /// This Boolean is used to specify the deletion mechanism for 'all' the Event Grid Domain Topics associated with this Event + /// Grid Domain resource.In this context, deletion of domain topic can be auto-managed (when true) or self-managed (when false). + /// The default value for this property is true.When this property is set to true, Event Grid is responsible of automatically + /// deleting the domain topic when the last event subscription at the scopeof the domain topic is deleted. If this property + /// is set to false, then the user needs to manually delete the domain topic when it is no longer needed(e.g., when last event + /// subscription is deleted and the resource needs to be cleaned up). The self-management mode can be used if the user wants + /// fullcontrol of when the domain topic needs to be deleted, while auto-managed mode provides the flexibility to perform + /// less operations and manage fewerresources by the user. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "This Boolean is used to specify the deletion mechanism for 'all' the Event Grid Domain Topics associated with this Event Grid Domain resource.In this context, deletion of domain topic can be auto-managed (when true) or self-managed (when false). The default value for this property is true.When this property is set to true, Event Grid is responsible of automatically deleting the domain topic when the last event subscription at the scopeof the domain topic is deleted. If this property is set to false, then the user needs to manually delete the domain topic when it is no longer needed(e.g., when last event subscription is deleted and the resource needs to be cleaned up). The self-management mode can be used if the user wants fullcontrol of when the domain topic needs to be deleted, while auto-managed mode provides the flexibility to perform less operations and manage fewerresources by the user.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This Boolean is used to specify the deletion mechanism for 'all' the Event Grid Domain Topics associated with this Event Grid Domain resource.In this context, deletion of domain topic can be auto-managed (when true) or self-managed (when false). The default value for this property is true.When this property is set to true, Event Grid is responsible of automatically deleting the domain topic when the last event subscription at the scopeof the domain topic is deleted. If this property is set to false, then the user needs to manually delete the domain topic when it is no longer needed(e.g., when last event subscription is deleted and the resource needs to be cleaned up). The self-management mode can be used if the user wants fullcontrol of when the domain topic needs to be deleted, while auto-managed mode provides the flexibility to perform less operations and manage fewerresources by the user.", + SerializedName = @"autoDeleteTopicWithLastSubscription", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter AutoDeleteTopicWithLastSubscription { get => DomainUpdateParametersBody.AutoDeleteTopicWithLastSubscription ?? default(global::System.Management.Automation.SwitchParameter); set => DomainUpdateParametersBody.AutoDeleteTopicWithLastSubscription = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// The data residency boundary for the domain. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The data residency boundary for the domain.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The data residency boundary for the domain.", + SerializedName = @"dataResidencyBoundary", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary DataResidencyBoundary { get => DomainUpdateParametersBody.DataResidencyBoundary ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary)""); set => DomainUpdateParametersBody.DataResidencyBoundary = value; } + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// + /// This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD + /// token will be used to authenticate if user is allowed to publish to the domain. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD token will be used to authenticate if user is allowed to publish to the domain.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD token will be used to authenticate if user is allowed to publish to the domain.", + SerializedName = @"disableLocalAuth", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter DisableLocalAuth { get => DomainUpdateParametersBody.DisableLocalAuth ?? default(global::System.Management.Automation.SwitchParameter); set => DomainUpdateParametersBody.DisableLocalAuth = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParameters _domainUpdateParametersBody= new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DomainUpdateParameters(); + + /// Properties of the Domain update. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParameters DomainUpdateParametersBody { get => this._domainUpdateParametersBody; set => this._domainUpdateParametersBody = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// The principal ID of resource identity. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The principal ID of resource identity.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The principal ID of resource identity.", + SerializedName = @"principalId", + PossibleTypes = new [] { typeof(string) })] + public string IdentityPrincipalId { get => DomainUpdateParametersBody.IdentityPrincipalId ?? null; set => DomainUpdateParametersBody.IdentityPrincipalId = value; } + + /// The tenant ID of resource. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The tenant ID of resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The tenant ID of resource.", + SerializedName = @"tenantId", + PossibleTypes = new [] { typeof(string) })] + public string IdentityTenantId { get => DomainUpdateParametersBody.IdentityTenantId ?? null; set => DomainUpdateParametersBody.IdentityTenantId = value; } + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType IdentityType { get => DomainUpdateParametersBody.IdentityType ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType)""); set => DomainUpdateParametersBody.IdentityType = value; } + + /// + /// The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource + /// ids in the form:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.This + /// property is currently not used and reserved for future usage. + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource ids in the form:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.This property is currently not used and reserved for future usage.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource ids in the form:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.This property is currently not used and reserved for future usage.", + SerializedName = @"userAssignedIdentities", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities) })] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities IdentityUserAssignedIdentity { get => DomainUpdateParametersBody.IdentityUserAssignedIdentity ?? null /* object */; set => DomainUpdateParametersBody.IdentityUserAssignedIdentity = value; } + + /// + /// This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess + /// is enabled. + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess is enabled.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess is enabled.", + SerializedName = @"inboundIpRules", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule) })] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[] InboundIPRule { get => DomainUpdateParametersBody.InboundIPRule ?? null /* arrayOf */; set => DomainUpdateParametersBody.InboundIPRule = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the domain. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the domain.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the domain.", + SerializedName = @"domainName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("DomainName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// This determines if traffic is allowed over public network. By default it is enabled. You can further restrict to specific + /// IPs by configuring + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "This determines if traffic is allowed over public network. By default it is enabled. You can further restrict to specific IPs by configuring ")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This determines if traffic is allowed over public network. By default it is enabled. You can further restrict to specific IPs by configuring ", + SerializedName = @"publicNetworkAccess", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess PublicNetworkAccess { get => DomainUpdateParametersBody.PublicNetworkAccess ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess)""); set => DomainUpdateParametersBody.PublicNetworkAccess = value; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// The Sku name of the resource. The possible values are: Basic or Premium. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The Sku name of the resource. The possible values are: Basic or Premium.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Sku name of the resource. The possible values are: Basic or Premium.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku SkuName { get => DomainUpdateParametersBody.SkuName ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku)""); set => DomainUpdateParametersBody.SkuName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Tags of the domains resource. + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Tags of the domains resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Tags of the domains resource.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParametersTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParametersTags Tag { get => DomainUpdateParametersBody.Tag ?? null /* object */; set => DomainUpdateParametersBody.Tag = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of UpdateAzEventGridDomain_UpdateExpanded + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets.UpdateAzEventGridDomain_UpdateExpanded Clone() + { + var clone = new UpdateAzEventGridDomain_UpdateExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.DomainUpdateParametersBody = this.DomainUpdateParametersBody; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.Name = this.Name; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DomainsUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DomainsUpdate(SubscriptionId, ResourceGroupName, Name, DomainUpdateParametersBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name,body=DomainUpdateParametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public UpdateAzEventGridDomain_UpdateExpanded() + { + + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name, body=DomainUpdateParametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/UpdateAzEventGridDomain_UpdateViaIdentityExpanded.cs b/swaggerci/eventgrid/generated/cmdlets/UpdateAzEventGridDomain_UpdateViaIdentityExpanded.cs new file mode 100644 index 000000000000..de6067def905 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/UpdateAzEventGridDomain_UpdateViaIdentityExpanded.cs @@ -0,0 +1,618 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Asynchronously updates a domain with the specified parameters. + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzEventGridDomain_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Asynchronously updates a domain with the specified parameters.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class UpdateAzEventGridDomain_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// + /// This Boolean is used to specify the creation mechanism for 'all' the Event Grid Domain Topics associated with this Event + /// Grid Domain resource.In this context, creation of domain topic can be auto-managed (when true) or self-managed (when false). + /// The default value for this property is true.When this property is null or set to true, Event Grid is responsible of automatically + /// creating the domain topic when the first event subscription iscreated at the scope of the domain topic. If this property + /// is set to false, then creating the first event subscription will require creating a domain topicby the user. The self-management + /// mode can be used if the user wants full control of when the domain topic is created, while auto-managed mode provides + /// theflexibility to perform less operations and manage fewer resources by the user. Also, note that in auto-managed creation + /// mode, user is allowed to create thedomain topic on demand if needed. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "This Boolean is used to specify the creation mechanism for 'all' the Event Grid Domain Topics associated with this Event Grid Domain resource.In this context, creation of domain topic can be auto-managed (when true) or self-managed (when false). The default value for this property is true.When this property is null or set to true, Event Grid is responsible of automatically creating the domain topic when the first event subscription iscreated at the scope of the domain topic. If this property is set to false, then creating the first event subscription will require creating a domain topicby the user. The self-management mode can be used if the user wants full control of when the domain topic is created, while auto-managed mode provides theflexibility to perform less operations and manage fewer resources by the user. Also, note that in auto-managed creation mode, user is allowed to create thedomain topic on demand if needed.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This Boolean is used to specify the creation mechanism for 'all' the Event Grid Domain Topics associated with this Event Grid Domain resource.In this context, creation of domain topic can be auto-managed (when true) or self-managed (when false). The default value for this property is true.When this property is null or set to true, Event Grid is responsible of automatically creating the domain topic when the first event subscription iscreated at the scope of the domain topic. If this property is set to false, then creating the first event subscription will require creating a domain topicby the user. The self-management mode can be used if the user wants full control of when the domain topic is created, while auto-managed mode provides theflexibility to perform less operations and manage fewer resources by the user. Also, note that in auto-managed creation mode, user is allowed to create thedomain topic on demand if needed.", + SerializedName = @"autoCreateTopicWithFirstSubscription", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter AutoCreateTopicWithFirstSubscription { get => DomainUpdateParametersBody.AutoCreateTopicWithFirstSubscription ?? default(global::System.Management.Automation.SwitchParameter); set => DomainUpdateParametersBody.AutoCreateTopicWithFirstSubscription = value; } + + /// + /// This Boolean is used to specify the deletion mechanism for 'all' the Event Grid Domain Topics associated with this Event + /// Grid Domain resource.In this context, deletion of domain topic can be auto-managed (when true) or self-managed (when false). + /// The default value for this property is true.When this property is set to true, Event Grid is responsible of automatically + /// deleting the domain topic when the last event subscription at the scopeof the domain topic is deleted. If this property + /// is set to false, then the user needs to manually delete the domain topic when it is no longer needed(e.g., when last event + /// subscription is deleted and the resource needs to be cleaned up). The self-management mode can be used if the user wants + /// fullcontrol of when the domain topic needs to be deleted, while auto-managed mode provides the flexibility to perform + /// less operations and manage fewerresources by the user. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "This Boolean is used to specify the deletion mechanism for 'all' the Event Grid Domain Topics associated with this Event Grid Domain resource.In this context, deletion of domain topic can be auto-managed (when true) or self-managed (when false). The default value for this property is true.When this property is set to true, Event Grid is responsible of automatically deleting the domain topic when the last event subscription at the scopeof the domain topic is deleted. If this property is set to false, then the user needs to manually delete the domain topic when it is no longer needed(e.g., when last event subscription is deleted and the resource needs to be cleaned up). The self-management mode can be used if the user wants fullcontrol of when the domain topic needs to be deleted, while auto-managed mode provides the flexibility to perform less operations and manage fewerresources by the user.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This Boolean is used to specify the deletion mechanism for 'all' the Event Grid Domain Topics associated with this Event Grid Domain resource.In this context, deletion of domain topic can be auto-managed (when true) or self-managed (when false). The default value for this property is true.When this property is set to true, Event Grid is responsible of automatically deleting the domain topic when the last event subscription at the scopeof the domain topic is deleted. If this property is set to false, then the user needs to manually delete the domain topic when it is no longer needed(e.g., when last event subscription is deleted and the resource needs to be cleaned up). The self-management mode can be used if the user wants fullcontrol of when the domain topic needs to be deleted, while auto-managed mode provides the flexibility to perform less operations and manage fewerresources by the user.", + SerializedName = @"autoDeleteTopicWithLastSubscription", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter AutoDeleteTopicWithLastSubscription { get => DomainUpdateParametersBody.AutoDeleteTopicWithLastSubscription ?? default(global::System.Management.Automation.SwitchParameter); set => DomainUpdateParametersBody.AutoDeleteTopicWithLastSubscription = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// The data residency boundary for the domain. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The data residency boundary for the domain.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The data residency boundary for the domain.", + SerializedName = @"dataResidencyBoundary", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary DataResidencyBoundary { get => DomainUpdateParametersBody.DataResidencyBoundary ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary)""); set => DomainUpdateParametersBody.DataResidencyBoundary = value; } + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// + /// This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD + /// token will be used to authenticate if user is allowed to publish to the domain. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD token will be used to authenticate if user is allowed to publish to the domain.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD token will be used to authenticate if user is allowed to publish to the domain.", + SerializedName = @"disableLocalAuth", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter DisableLocalAuth { get => DomainUpdateParametersBody.DisableLocalAuth ?? default(global::System.Management.Automation.SwitchParameter); set => DomainUpdateParametersBody.DisableLocalAuth = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParameters _domainUpdateParametersBody= new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.DomainUpdateParameters(); + + /// Properties of the Domain update. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParameters DomainUpdateParametersBody { get => this._domainUpdateParametersBody; set => this._domainUpdateParametersBody = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// The principal ID of resource identity. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The principal ID of resource identity.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The principal ID of resource identity.", + SerializedName = @"principalId", + PossibleTypes = new [] { typeof(string) })] + public string IdentityPrincipalId { get => DomainUpdateParametersBody.IdentityPrincipalId ?? null; set => DomainUpdateParametersBody.IdentityPrincipalId = value; } + + /// The tenant ID of resource. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The tenant ID of resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The tenant ID of resource.", + SerializedName = @"tenantId", + PossibleTypes = new [] { typeof(string) })] + public string IdentityTenantId { get => DomainUpdateParametersBody.IdentityTenantId ?? null; set => DomainUpdateParametersBody.IdentityTenantId = value; } + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType IdentityType { get => DomainUpdateParametersBody.IdentityType ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType)""); set => DomainUpdateParametersBody.IdentityType = value; } + + /// + /// The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource + /// ids in the form:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.This + /// property is currently not used and reserved for future usage. + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource ids in the form:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.This property is currently not used and reserved for future usage.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource ids in the form:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.This property is currently not used and reserved for future usage.", + SerializedName = @"userAssignedIdentities", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities) })] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities IdentityUserAssignedIdentity { get => DomainUpdateParametersBody.IdentityUserAssignedIdentity ?? null /* object */; set => DomainUpdateParametersBody.IdentityUserAssignedIdentity = value; } + + /// + /// This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess + /// is enabled. + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess is enabled.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess is enabled.", + SerializedName = @"inboundIpRules", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule) })] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[] InboundIPRule { get => DomainUpdateParametersBody.InboundIPRule ?? null /* arrayOf */; set => DomainUpdateParametersBody.InboundIPRule = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// This determines if traffic is allowed over public network. By default it is enabled. You can further restrict to specific + /// IPs by configuring + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "This determines if traffic is allowed over public network. By default it is enabled. You can further restrict to specific IPs by configuring ")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This determines if traffic is allowed over public network. By default it is enabled. You can further restrict to specific IPs by configuring ", + SerializedName = @"publicNetworkAccess", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess PublicNetworkAccess { get => DomainUpdateParametersBody.PublicNetworkAccess ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess)""); set => DomainUpdateParametersBody.PublicNetworkAccess = value; } + + /// The Sku name of the resource. The possible values are: Basic or Premium. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The Sku name of the resource. The possible values are: Basic or Premium.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Sku name of the resource. The possible values are: Basic or Premium.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku SkuName { get => DomainUpdateParametersBody.SkuName ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku)""); set => DomainUpdateParametersBody.SkuName = value; } + + /// Tags of the domains resource. + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Tags of the domains resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Tags of the domains resource.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParametersTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IDomainUpdateParametersTags Tag { get => DomainUpdateParametersBody.Tag ?? null /* object */; set => DomainUpdateParametersBody.Tag = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of UpdateAzEventGridDomain_UpdateViaIdentityExpanded + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets.UpdateAzEventGridDomain_UpdateViaIdentityExpanded Clone() + { + var clone = new UpdateAzEventGridDomain_UpdateViaIdentityExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.DomainUpdateParametersBody = this.DomainUpdateParametersBody; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DomainsUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.DomainsUpdateViaIdentity(InputObject.Id, DomainUpdateParametersBody, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.DomainName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.DomainName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.DomainsUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.DomainName ?? null, DomainUpdateParametersBody, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=DomainUpdateParametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public UpdateAzEventGridDomain_UpdateViaIdentityExpanded() + { + + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=DomainUpdateParametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/UpdateAzEventGridEventSubscription_UpdateExpanded.cs b/swaggerci/eventgrid/generated/cmdlets/UpdateAzEventGridEventSubscription_UpdateExpanded.cs new file mode 100644 index 000000000000..33390d6a7345 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/UpdateAzEventGridEventSubscription_UpdateExpanded.cs @@ -0,0 +1,636 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Asynchronously updates an existing event subscription. + /// + /// [OpenAPI] Update=>PATCH:"/{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzEventGridEventSubscription_UpdateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Asynchronously updates an existing event subscription.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class UpdateAzEventGridEventSubscription_UpdateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType DeadLetterWithResourceIdentityType { get => EventSubscriptionUpdateParametersBody.DeadLetterWithResourceIdentityType ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType)""); set => EventSubscriptionUpdateParametersBody.DeadLetterWithResourceIdentityType = value; } + + /// The user identity associated with the resource. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The user identity associated with the resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The user identity associated with the resource.", + SerializedName = @"userAssignedIdentity", + PossibleTypes = new [] { typeof(string) })] + public string DeadLetterWithResourceIdentityUserAssignedIdentity { get => EventSubscriptionUpdateParametersBody.DeadLetterWithResourceIdentityUserAssignedIdentity ?? null; set => EventSubscriptionUpdateParametersBody.DeadLetterWithResourceIdentityUserAssignedIdentity = value; } + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Type of the endpoint for the event subscription destination. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Type of the endpoint for the event subscription destination.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of the endpoint for the event subscription destination.", + SerializedName = @"endpointType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType DeliveryWithResourceIdentityDestinationEndpointType { get => EventSubscriptionUpdateParametersBody.DeliveryWithResourceIdentityDestinationEndpointType ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType)""); set => EventSubscriptionUpdateParametersBody.DeliveryWithResourceIdentityDestinationEndpointType = value; } + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType DeliveryWithResourceIdentityType { get => EventSubscriptionUpdateParametersBody.DeliveryWithResourceIdentityType ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType)""); set => EventSubscriptionUpdateParametersBody.DeliveryWithResourceIdentityType = value; } + + /// The user identity associated with the resource. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The user identity associated with the resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The user identity associated with the resource.", + SerializedName = @"userAssignedIdentity", + PossibleTypes = new [] { typeof(string) })] + public string DeliveryWithResourceIdentityUserAssignedIdentity { get => EventSubscriptionUpdateParametersBody.DeliveryWithResourceIdentityUserAssignedIdentity ?? null; set => EventSubscriptionUpdateParametersBody.DeliveryWithResourceIdentityUserAssignedIdentity = value; } + + /// Type of the endpoint for the event subscription destination. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Type of the endpoint for the event subscription destination.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of the endpoint for the event subscription destination.", + SerializedName = @"endpointType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType EndpointType { get => EventSubscriptionUpdateParametersBody.EndpointType ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType)""); set => EventSubscriptionUpdateParametersBody.EndpointType = value; } + + /// The event delivery schema for the event subscription. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The event delivery schema for the event subscription.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The event delivery schema for the event subscription.", + SerializedName = @"eventDeliverySchema", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema EventDeliverySchema { get => EventSubscriptionUpdateParametersBody.EventDeliverySchema ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema)""); set => EventSubscriptionUpdateParametersBody.EventDeliverySchema = value; } + + /// + /// Backing field for property. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParameters _eventSubscriptionUpdateParametersBody= new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionUpdateParameters(); + + /// Properties of the Event Subscription update. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParameters EventSubscriptionUpdateParametersBody { get => this._eventSubscriptionUpdateParametersBody; set => this._eventSubscriptionUpdateParametersBody = value; } + + /// Information about the expiration time for the event subscription. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Information about the expiration time for the event subscription.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Information about the expiration time for the event subscription.", + SerializedName = @"expirationTimeUtc", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime ExpirationTimeUtc { get => EventSubscriptionUpdateParametersBody.ExpirationTimeUtc ?? default(global::System.DateTime); set => EventSubscriptionUpdateParametersBody.ExpirationTimeUtc = value; } + + /// An array of advanced filters that are used for filtering event subscriptions. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "An array of advanced filters that are used for filtering event subscriptions.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An array of advanced filters that are used for filtering event subscriptions.", + SerializedName = @"advancedFilters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter) })] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[] FilterAdvancedFilter { get => EventSubscriptionUpdateParametersBody.FilterAdvancedFilter ?? null /* arrayOf */; set => EventSubscriptionUpdateParametersBody.FilterAdvancedFilter = value; } + + /// + /// Allows advanced filters to be evaluated against an array of values instead of expecting a singular value. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Allows advanced filters to be evaluated against an array of values instead of expecting a singular value.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allows advanced filters to be evaluated against an array of values instead of expecting a singular value.", + SerializedName = @"enableAdvancedFilteringOnArrays", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter FilterEnableAdvancedFilteringOnArray { get => EventSubscriptionUpdateParametersBody.FilterEnableAdvancedFilteringOnArray ?? default(global::System.Management.Automation.SwitchParameter); set => EventSubscriptionUpdateParametersBody.FilterEnableAdvancedFilteringOnArray = value; } + + /// + /// 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. + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"includedEventTypes", + PossibleTypes = new [] { typeof(string) })] + public string[] FilterIncludedEventType { get => EventSubscriptionUpdateParametersBody.FilterIncludedEventType ?? null /* arrayOf */; set => EventSubscriptionUpdateParametersBody.FilterIncludedEventType = value; } + + /// + /// Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filtershould be compared in a case sensitive + /// manner. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filtershould be compared in a case sensitive manner.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filtershould be compared in a case sensitive manner.", + SerializedName = @"isSubjectCaseSensitive", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter FilterIsSubjectCaseSensitive { get => EventSubscriptionUpdateParametersBody.FilterIsSubjectCaseSensitive ?? default(global::System.Management.Automation.SwitchParameter); set => EventSubscriptionUpdateParametersBody.FilterIsSubjectCaseSensitive = value; } + + /// + /// An optional string to filter events for an event subscription based on a resource path prefix.The format of this depends + /// on the publisher of the events.Wildcard characters are not supported in this path. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "An optional string to filter events for an event subscription based on a resource path prefix.The format of this depends on the publisher of the events.Wildcard characters are not supported in this path.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An optional string to filter events for an event subscription based on a resource path prefix.The format of this depends on the publisher of the events.Wildcard characters are not supported in this path.", + SerializedName = @"subjectBeginsWith", + PossibleTypes = new [] { typeof(string) })] + public string FilterSubjectBeginsWith { get => EventSubscriptionUpdateParametersBody.FilterSubjectBeginsWith ?? null; set => EventSubscriptionUpdateParametersBody.FilterSubjectBeginsWith = value; } + + /// + /// An optional string to filter events for an event subscription based on a resource path suffix.Wildcard characters are + /// not supported in this path. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "An optional string to filter events for an event subscription based on a resource path suffix.Wildcard characters are not supported in this path.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An optional string to filter events for an event subscription based on a resource path suffix.Wildcard characters are not supported in this path.", + SerializedName = @"subjectEndsWith", + PossibleTypes = new [] { typeof(string) })] + public string FilterSubjectEndsWith { get => EventSubscriptionUpdateParametersBody.FilterSubjectEndsWith ?? null; set => EventSubscriptionUpdateParametersBody.FilterSubjectEndsWith = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// List of user defined labels. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "List of user defined labels.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of user defined labels.", + SerializedName = @"labels", + PossibleTypes = new [] { typeof(string) })] + public string[] Label { get => EventSubscriptionUpdateParametersBody.Label ?? null /* arrayOf */; set => EventSubscriptionUpdateParametersBody.Label = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the event subscription to be updated. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the event subscription to be updated.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the event subscription to be updated.", + SerializedName = @"eventSubscriptionName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("EventSubscriptionName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Time To Live (in minutes) for events. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Time To Live (in minutes) for events.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Time To Live (in minutes) for events.", + SerializedName = @"eventTimeToLiveInMinutes", + PossibleTypes = new [] { typeof(int) })] + public int RetryPolicyEventTimeToLiveInMinute { get => EventSubscriptionUpdateParametersBody.RetryPolicyEventTimeToLiveInMinute ?? default(int); set => EventSubscriptionUpdateParametersBody.RetryPolicyEventTimeToLiveInMinute = value; } + + /// Maximum number of delivery retry attempts for events. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Maximum number of delivery retry attempts for events.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Maximum number of delivery retry attempts for events.", + SerializedName = @"maxDeliveryAttempts", + PossibleTypes = new [] { typeof(int) })] + public int RetryPolicyMaxDeliveryAttempt { get => EventSubscriptionUpdateParametersBody.RetryPolicyMaxDeliveryAttempt ?? default(int); set => EventSubscriptionUpdateParametersBody.RetryPolicyMaxDeliveryAttempt = value; } + + /// Backing field for property. + private string _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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' + /// for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' + /// for an EventGrid topic. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"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}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic.", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string Scope { get => this._scope; set => this._scope = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of UpdateAzEventGridEventSubscription_UpdateExpanded + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets.UpdateAzEventGridEventSubscription_UpdateExpanded Clone() + { + var clone = new UpdateAzEventGridEventSubscription_UpdateExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.EventSubscriptionUpdateParametersBody = this.EventSubscriptionUpdateParametersBody; + clone.Scope = this.Scope; + clone.Name = this.Name; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'EventSubscriptionsUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.EventSubscriptionsUpdate(Scope, Name, EventSubscriptionUpdateParametersBody, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name,body=EventSubscriptionUpdateParametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public UpdateAzEventGridEventSubscription_UpdateExpanded() + { + + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope, Name=Name, body=EventSubscriptionUpdateParametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/UpdateAzEventGridEventSubscription_UpdateViaIdentityExpanded.cs b/swaggerci/eventgrid/generated/cmdlets/UpdateAzEventGridEventSubscription_UpdateViaIdentityExpanded.cs new file mode 100644 index 000000000000..033b70faa95d --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/UpdateAzEventGridEventSubscription_UpdateViaIdentityExpanded.cs @@ -0,0 +1,625 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Asynchronously updates an existing event subscription. + /// + /// [OpenAPI] Update=>PATCH:"/{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzEventGridEventSubscription_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Asynchronously updates an existing event subscription.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class UpdateAzEventGridEventSubscription_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType DeadLetterWithResourceIdentityType { get => EventSubscriptionUpdateParametersBody.DeadLetterWithResourceIdentityType ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType)""); set => EventSubscriptionUpdateParametersBody.DeadLetterWithResourceIdentityType = value; } + + /// The user identity associated with the resource. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The user identity associated with the resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The user identity associated with the resource.", + SerializedName = @"userAssignedIdentity", + PossibleTypes = new [] { typeof(string) })] + public string DeadLetterWithResourceIdentityUserAssignedIdentity { get => EventSubscriptionUpdateParametersBody.DeadLetterWithResourceIdentityUserAssignedIdentity ?? null; set => EventSubscriptionUpdateParametersBody.DeadLetterWithResourceIdentityUserAssignedIdentity = value; } + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Type of the endpoint for the event subscription destination. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Type of the endpoint for the event subscription destination.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of the endpoint for the event subscription destination.", + SerializedName = @"endpointType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType DeliveryWithResourceIdentityDestinationEndpointType { get => EventSubscriptionUpdateParametersBody.DeliveryWithResourceIdentityDestinationEndpointType ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType)""); set => EventSubscriptionUpdateParametersBody.DeliveryWithResourceIdentityDestinationEndpointType = value; } + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType DeliveryWithResourceIdentityType { get => EventSubscriptionUpdateParametersBody.DeliveryWithResourceIdentityType ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType)""); set => EventSubscriptionUpdateParametersBody.DeliveryWithResourceIdentityType = value; } + + /// The user identity associated with the resource. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The user identity associated with the resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The user identity associated with the resource.", + SerializedName = @"userAssignedIdentity", + PossibleTypes = new [] { typeof(string) })] + public string DeliveryWithResourceIdentityUserAssignedIdentity { get => EventSubscriptionUpdateParametersBody.DeliveryWithResourceIdentityUserAssignedIdentity ?? null; set => EventSubscriptionUpdateParametersBody.DeliveryWithResourceIdentityUserAssignedIdentity = value; } + + /// Type of the endpoint for the event subscription destination. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Type of the endpoint for the event subscription destination.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of the endpoint for the event subscription destination.", + SerializedName = @"endpointType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType EndpointType { get => EventSubscriptionUpdateParametersBody.EndpointType ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType)""); set => EventSubscriptionUpdateParametersBody.EndpointType = value; } + + /// The event delivery schema for the event subscription. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The event delivery schema for the event subscription.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The event delivery schema for the event subscription.", + SerializedName = @"eventDeliverySchema", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema EventDeliverySchema { get => EventSubscriptionUpdateParametersBody.EventDeliverySchema ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema)""); set => EventSubscriptionUpdateParametersBody.EventDeliverySchema = value; } + + /// + /// Backing field for property. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParameters _eventSubscriptionUpdateParametersBody= new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionUpdateParameters(); + + /// Properties of the Event Subscription update. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParameters EventSubscriptionUpdateParametersBody { get => this._eventSubscriptionUpdateParametersBody; set => this._eventSubscriptionUpdateParametersBody = value; } + + /// Information about the expiration time for the event subscription. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Information about the expiration time for the event subscription.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Information about the expiration time for the event subscription.", + SerializedName = @"expirationTimeUtc", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime ExpirationTimeUtc { get => EventSubscriptionUpdateParametersBody.ExpirationTimeUtc ?? default(global::System.DateTime); set => EventSubscriptionUpdateParametersBody.ExpirationTimeUtc = value; } + + /// An array of advanced filters that are used for filtering event subscriptions. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "An array of advanced filters that are used for filtering event subscriptions.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An array of advanced filters that are used for filtering event subscriptions.", + SerializedName = @"advancedFilters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter) })] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[] FilterAdvancedFilter { get => EventSubscriptionUpdateParametersBody.FilterAdvancedFilter ?? null /* arrayOf */; set => EventSubscriptionUpdateParametersBody.FilterAdvancedFilter = value; } + + /// + /// Allows advanced filters to be evaluated against an array of values instead of expecting a singular value. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Allows advanced filters to be evaluated against an array of values instead of expecting a singular value.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allows advanced filters to be evaluated against an array of values instead of expecting a singular value.", + SerializedName = @"enableAdvancedFilteringOnArrays", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter FilterEnableAdvancedFilteringOnArray { get => EventSubscriptionUpdateParametersBody.FilterEnableAdvancedFilteringOnArray ?? default(global::System.Management.Automation.SwitchParameter); set => EventSubscriptionUpdateParametersBody.FilterEnableAdvancedFilteringOnArray = value; } + + /// + /// 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. + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"includedEventTypes", + PossibleTypes = new [] { typeof(string) })] + public string[] FilterIncludedEventType { get => EventSubscriptionUpdateParametersBody.FilterIncludedEventType ?? null /* arrayOf */; set => EventSubscriptionUpdateParametersBody.FilterIncludedEventType = value; } + + /// + /// Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filtershould be compared in a case sensitive + /// manner. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filtershould be compared in a case sensitive manner.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filtershould be compared in a case sensitive manner.", + SerializedName = @"isSubjectCaseSensitive", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter FilterIsSubjectCaseSensitive { get => EventSubscriptionUpdateParametersBody.FilterIsSubjectCaseSensitive ?? default(global::System.Management.Automation.SwitchParameter); set => EventSubscriptionUpdateParametersBody.FilterIsSubjectCaseSensitive = value; } + + /// + /// An optional string to filter events for an event subscription based on a resource path prefix.The format of this depends + /// on the publisher of the events.Wildcard characters are not supported in this path. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "An optional string to filter events for an event subscription based on a resource path prefix.The format of this depends on the publisher of the events.Wildcard characters are not supported in this path.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An optional string to filter events for an event subscription based on a resource path prefix.The format of this depends on the publisher of the events.Wildcard characters are not supported in this path.", + SerializedName = @"subjectBeginsWith", + PossibleTypes = new [] { typeof(string) })] + public string FilterSubjectBeginsWith { get => EventSubscriptionUpdateParametersBody.FilterSubjectBeginsWith ?? null; set => EventSubscriptionUpdateParametersBody.FilterSubjectBeginsWith = value; } + + /// + /// An optional string to filter events for an event subscription based on a resource path suffix.Wildcard characters are + /// not supported in this path. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "An optional string to filter events for an event subscription based on a resource path suffix.Wildcard characters are not supported in this path.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An optional string to filter events for an event subscription based on a resource path suffix.Wildcard characters are not supported in this path.", + SerializedName = @"subjectEndsWith", + PossibleTypes = new [] { typeof(string) })] + public string FilterSubjectEndsWith { get => EventSubscriptionUpdateParametersBody.FilterSubjectEndsWith ?? null; set => EventSubscriptionUpdateParametersBody.FilterSubjectEndsWith = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// List of user defined labels. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "List of user defined labels.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of user defined labels.", + SerializedName = @"labels", + PossibleTypes = new [] { typeof(string) })] + public string[] Label { get => EventSubscriptionUpdateParametersBody.Label ?? null /* arrayOf */; set => EventSubscriptionUpdateParametersBody.Label = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Time To Live (in minutes) for events. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Time To Live (in minutes) for events.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Time To Live (in minutes) for events.", + SerializedName = @"eventTimeToLiveInMinutes", + PossibleTypes = new [] { typeof(int) })] + public int RetryPolicyEventTimeToLiveInMinute { get => EventSubscriptionUpdateParametersBody.RetryPolicyEventTimeToLiveInMinute ?? default(int); set => EventSubscriptionUpdateParametersBody.RetryPolicyEventTimeToLiveInMinute = value; } + + /// Maximum number of delivery retry attempts for events. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Maximum number of delivery retry attempts for events.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Maximum number of delivery retry attempts for events.", + SerializedName = @"maxDeliveryAttempts", + PossibleTypes = new [] { typeof(int) })] + public int RetryPolicyMaxDeliveryAttempt { get => EventSubscriptionUpdateParametersBody.RetryPolicyMaxDeliveryAttempt ?? default(int); set => EventSubscriptionUpdateParametersBody.RetryPolicyMaxDeliveryAttempt = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of UpdateAzEventGridEventSubscription_UpdateViaIdentityExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets.UpdateAzEventGridEventSubscription_UpdateViaIdentityExpanded Clone() + { + var clone = new UpdateAzEventGridEventSubscription_UpdateViaIdentityExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.EventSubscriptionUpdateParametersBody = this.EventSubscriptionUpdateParametersBody; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'EventSubscriptionsUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.EventSubscriptionsUpdateViaIdentity(InputObject.Id, EventSubscriptionUpdateParametersBody, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.Scope) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.Scope"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.EventSubscriptionName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.EventSubscriptionName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.EventSubscriptionsUpdate(InputObject.Scope ?? null, InputObject.EventSubscriptionName ?? null, EventSubscriptionUpdateParametersBody, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=EventSubscriptionUpdateParametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public UpdateAzEventGridEventSubscription_UpdateViaIdentityExpanded() + { + + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=EventSubscriptionUpdateParametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/UpdateAzEventGridPartnerConfiguration_UpdateExpanded.cs b/swaggerci/eventgrid/generated/cmdlets/UpdateAzEventGridPartnerConfiguration_UpdateExpanded.cs new file mode 100644 index 000000000000..b0e2dc3aaebb --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/UpdateAzEventGridPartnerConfiguration_UpdateExpanded.cs @@ -0,0 +1,483 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Synchronously updates a partner configuration with the specified parameters. + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerConfigurations/default" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzEventGridPartnerConfiguration_UpdateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfiguration))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Synchronously updates a partner configuration with the specified parameters.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class UpdateAzEventGridPartnerConfiguration_UpdateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The default time used to validate the maximum expiration time for each authorized partners in days. Allowed values ar + /// between 1 and 365 days. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The default time used to validate the maximum expiration time for each authorized partners in days. Allowed values ar between 1 and 365 days.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default time used to validate the maximum expiration time for each authorized partners in days. Allowed values ar between 1 and 365 days.", + SerializedName = @"defaultMaximumExpirationTimeInDays", + PossibleTypes = new [] { typeof(int) })] + public int DefaultMaximumExpirationTimeInDay { get => PartnerConfigurationUpdateParametersBody.DefaultMaximumExpirationTimeInDay ?? default(int); set => PartnerConfigurationUpdateParametersBody.DefaultMaximumExpirationTimeInDay = value; } + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// Backing field for property. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationUpdateParameters _partnerConfigurationUpdateParametersBody= new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerConfigurationUpdateParameters(); + + /// Properties of the partner configuration update. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationUpdateParameters PartnerConfigurationUpdateParametersBody { get => this._partnerConfigurationUpdateParametersBody; set => this._partnerConfigurationUpdateParametersBody = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Tags of the partner configuration resource. + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Tags of the partner configuration resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Tags of the partner configuration resource.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationUpdateParametersTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationUpdateParametersTags Tag { get => PartnerConfigurationUpdateParametersBody.Tag ?? null /* object */; set => PartnerConfigurationUpdateParametersBody.Tag = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of UpdateAzEventGridPartnerConfiguration_UpdateExpanded + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets.UpdateAzEventGridPartnerConfiguration_UpdateExpanded Clone() + { + var clone = new UpdateAzEventGridPartnerConfiguration_UpdateExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.PartnerConfigurationUpdateParametersBody = this.PartnerConfigurationUpdateParametersBody; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'PartnerConfigurationsUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.PartnerConfigurationsUpdate(SubscriptionId, ResourceGroupName, PartnerConfigurationUpdateParametersBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,body=PartnerConfigurationUpdateParametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public UpdateAzEventGridPartnerConfiguration_UpdateExpanded() + { + + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, body=PartnerConfigurationUpdateParametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfiguration + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/UpdateAzEventGridPartnerConfiguration_UpdateViaIdentityExpanded.cs b/swaggerci/eventgrid/generated/cmdlets/UpdateAzEventGridPartnerConfiguration_UpdateViaIdentityExpanded.cs new file mode 100644 index 000000000000..0295f9889233 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/UpdateAzEventGridPartnerConfiguration_UpdateViaIdentityExpanded.cs @@ -0,0 +1,473 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Synchronously updates a partner configuration with the specified parameters. + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerConfigurations/default" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzEventGridPartnerConfiguration_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfiguration))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Synchronously updates a partner configuration with the specified parameters.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class UpdateAzEventGridPartnerConfiguration_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The default time used to validate the maximum expiration time for each authorized partners in days. Allowed values ar + /// between 1 and 365 days. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The default time used to validate the maximum expiration time for each authorized partners in days. Allowed values ar between 1 and 365 days.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default time used to validate the maximum expiration time for each authorized partners in days. Allowed values ar between 1 and 365 days.", + SerializedName = @"defaultMaximumExpirationTimeInDays", + PossibleTypes = new [] { typeof(int) })] + public int DefaultMaximumExpirationTimeInDay { get => PartnerConfigurationUpdateParametersBody.DefaultMaximumExpirationTimeInDay ?? default(int); set => PartnerConfigurationUpdateParametersBody.DefaultMaximumExpirationTimeInDay = value; } + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// Backing field for property. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationUpdateParameters _partnerConfigurationUpdateParametersBody= new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerConfigurationUpdateParameters(); + + /// Properties of the partner configuration update. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationUpdateParameters PartnerConfigurationUpdateParametersBody { get => this._partnerConfigurationUpdateParametersBody; set => this._partnerConfigurationUpdateParametersBody = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Tags of the partner configuration resource. + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Tags of the partner configuration resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Tags of the partner configuration resource.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationUpdateParametersTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfigurationUpdateParametersTags Tag { get => PartnerConfigurationUpdateParametersBody.Tag ?? null /* object */; set => PartnerConfigurationUpdateParametersBody.Tag = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of UpdateAzEventGridPartnerConfiguration_UpdateViaIdentityExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets.UpdateAzEventGridPartnerConfiguration_UpdateViaIdentityExpanded Clone() + { + var clone = new UpdateAzEventGridPartnerConfiguration_UpdateViaIdentityExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.PartnerConfigurationUpdateParametersBody = this.PartnerConfigurationUpdateParametersBody; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'PartnerConfigurationsUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.PartnerConfigurationsUpdateViaIdentity(InputObject.Id, PartnerConfigurationUpdateParametersBody, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.PartnerConfigurationsUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, PartnerConfigurationUpdateParametersBody, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=PartnerConfigurationUpdateParametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet + /// class. + /// + public UpdateAzEventGridPartnerConfiguration_UpdateViaIdentityExpanded() + { + + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=PartnerConfigurationUpdateParametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerConfiguration + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/UpdateAzEventGridPartnerDestination_UpdateExpanded.cs b/swaggerci/eventgrid/generated/cmdlets/UpdateAzEventGridPartnerDestination_UpdateExpanded.cs new file mode 100644 index 000000000000..625b275f3efc --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/UpdateAzEventGridPartnerDestination_UpdateExpanded.cs @@ -0,0 +1,452 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Asynchronously updates a partner destination with the specified parameters. + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerDestinations/{partnerDestinationName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzEventGridPartnerDestination_UpdateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestination))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Asynchronously updates a partner destination with the specified parameters.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class UpdateAzEventGridPartnerDestination_UpdateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the partner destination. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the partner destination.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the partner destination.", + SerializedName = @"partnerDestinationName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("PartnerDestinationName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// Backing field for property. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationUpdateParameters _partnerDestinationUpdateParametersBody= new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerDestinationUpdateParameters(); + + /// Properties of the Partner Destination that can be updated. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationUpdateParameters PartnerDestinationUpdateParametersBody { get => this._partnerDestinationUpdateParametersBody; set => this._partnerDestinationUpdateParametersBody = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Tags of the Partner Destination resource. + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Tags of the Partner Destination resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Tags of the Partner Destination resource.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationUpdateParametersTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationUpdateParametersTags Tag { get => PartnerDestinationUpdateParametersBody.Tag ?? null /* object */; set => PartnerDestinationUpdateParametersBody.Tag = value; } + + /// + /// overrideOnCreated will be called before the regular onCreated has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onCreated method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'PartnerDestinationsUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.PartnerDestinationsUpdate(SubscriptionId, ResourceGroupName, Name, PartnerDestinationUpdateParametersBody, onOk, onCreated, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name,body=PartnerDestinationUpdateParametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public UpdateAzEventGridPartnerDestination_UpdateExpanded() + { + + } + + /// a delegate that is called when the remote service returns 201 (Created). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnCreated(responseMessage, response, ref _returnNow); + // if overrideOnCreated has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onCreated - response for 201 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestination + WriteObject((await response)); + } + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name, body=PartnerDestinationUpdateParametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/UpdateAzEventGridPartnerDestination_UpdateViaIdentityExpanded.cs b/swaggerci/eventgrid/generated/cmdlets/UpdateAzEventGridPartnerDestination_UpdateViaIdentityExpanded.cs new file mode 100644 index 000000000000..21fbd88ec543 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/UpdateAzEventGridPartnerDestination_UpdateViaIdentityExpanded.cs @@ -0,0 +1,430 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Asynchronously updates a partner destination with the specified parameters. + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerDestinations/{partnerDestinationName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzEventGridPartnerDestination_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestination))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Asynchronously updates a partner destination with the specified parameters.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class UpdateAzEventGridPartnerDestination_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// Backing field for property. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationUpdateParameters _partnerDestinationUpdateParametersBody= new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerDestinationUpdateParameters(); + + /// Properties of the Partner Destination that can be updated. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationUpdateParameters PartnerDestinationUpdateParametersBody { get => this._partnerDestinationUpdateParametersBody; set => this._partnerDestinationUpdateParametersBody = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Tags of the Partner Destination resource. + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Tags of the Partner Destination resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Tags of the Partner Destination resource.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationUpdateParametersTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestinationUpdateParametersTags Tag { get => PartnerDestinationUpdateParametersBody.Tag ?? null /* object */; set => PartnerDestinationUpdateParametersBody.Tag = value; } + + /// + /// overrideOnCreated will be called before the regular onCreated has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onCreated method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'PartnerDestinationsUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.PartnerDestinationsUpdateViaIdentity(InputObject.Id, PartnerDestinationUpdateParametersBody, onOk, onCreated, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.PartnerDestinationName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.PartnerDestinationName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.PartnerDestinationsUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.PartnerDestinationName ?? null, PartnerDestinationUpdateParametersBody, onOk, onCreated, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=PartnerDestinationUpdateParametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public UpdateAzEventGridPartnerDestination_UpdateViaIdentityExpanded() + { + + } + + /// a delegate that is called when the remote service returns 201 (Created). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnCreated(responseMessage, response, ref _returnNow); + // if overrideOnCreated has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onCreated - response for 201 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerDestination + WriteObject((await response)); + } + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=PartnerDestinationUpdateParametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/UpdateAzEventGridPartnerNamespace_UpdateExpanded.cs b/swaggerci/eventgrid/generated/cmdlets/UpdateAzEventGridPartnerNamespace_UpdateExpanded.cs new file mode 100644 index 000000000000..1d576b2893af --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/UpdateAzEventGridPartnerNamespace_UpdateExpanded.cs @@ -0,0 +1,526 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Asynchronously updates a partner namespace with the specified parameters. + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerNamespaces/{partnerNamespaceName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzEventGridPartnerNamespace_UpdateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Asynchronously updates a partner namespace with the specified parameters.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class UpdateAzEventGridPartnerNamespace_UpdateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// + /// This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD + /// token will be used to authenticate if user is allowed to publish to the partner namespace. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD token will be used to authenticate if user is allowed to publish to the partner namespace.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD token will be used to authenticate if user is allowed to publish to the partner namespace.", + SerializedName = @"disableLocalAuth", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter DisableLocalAuth { get => PartnerNamespaceUpdateParametersBody.DisableLocalAuth ?? default(global::System.Management.Automation.SwitchParameter); set => PartnerNamespaceUpdateParametersBody.DisableLocalAuth = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// + /// This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess + /// is enabled. + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess is enabled.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess is enabled.", + SerializedName = @"inboundIpRules", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule) })] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[] InboundIPRule { get => PartnerNamespaceUpdateParametersBody.InboundIPRule ?? null /* arrayOf */; set => PartnerNamespaceUpdateParametersBody.InboundIPRule = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the partner namespace. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the partner namespace.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the partner namespace.", + SerializedName = @"partnerNamespaceName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("PartnerNamespaceName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParameters _partnerNamespaceUpdateParametersBody= new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerNamespaceUpdateParameters(); + + /// Properties of the Partner Namespace update. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParameters PartnerNamespaceUpdateParametersBody { get => this._partnerNamespaceUpdateParametersBody; set => this._partnerNamespaceUpdateParametersBody = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// This determines if traffic is allowed over public network. By default it is enabled. You can further restrict to specific + /// IPs by configuring + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "This determines if traffic is allowed over public network. By default it is enabled. You can further restrict to specific IPs by configuring ")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This determines if traffic is allowed over public network. By default it is enabled. You can further restrict to specific IPs by configuring ", + SerializedName = @"publicNetworkAccess", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess PublicNetworkAccess { get => PartnerNamespaceUpdateParametersBody.PublicNetworkAccess ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess)""); set => PartnerNamespaceUpdateParametersBody.PublicNetworkAccess = value; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Tags of the Partner Namespace. + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Tags of the Partner Namespace.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Tags of the Partner Namespace.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParametersTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParametersTags Tag { get => PartnerNamespaceUpdateParametersBody.Tag ?? null /* object */; set => PartnerNamespaceUpdateParametersBody.Tag = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of UpdateAzEventGridPartnerNamespace_UpdateExpanded + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets.UpdateAzEventGridPartnerNamespace_UpdateExpanded Clone() + { + var clone = new UpdateAzEventGridPartnerNamespace_UpdateExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.PartnerNamespaceUpdateParametersBody = this.PartnerNamespaceUpdateParametersBody; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.Name = this.Name; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'PartnerNamespacesUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.PartnerNamespacesUpdate(SubscriptionId, ResourceGroupName, Name, PartnerNamespaceUpdateParametersBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name,body=PartnerNamespaceUpdateParametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public UpdateAzEventGridPartnerNamespace_UpdateExpanded() + { + + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name, body=PartnerNamespaceUpdateParametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/UpdateAzEventGridPartnerNamespace_UpdateViaIdentityExpanded.cs b/swaggerci/eventgrid/generated/cmdlets/UpdateAzEventGridPartnerNamespace_UpdateViaIdentityExpanded.cs new file mode 100644 index 000000000000..c6623f4538fe --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/UpdateAzEventGridPartnerNamespace_UpdateViaIdentityExpanded.cs @@ -0,0 +1,503 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Asynchronously updates a partner namespace with the specified parameters. + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerNamespaces/{partnerNamespaceName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzEventGridPartnerNamespace_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Asynchronously updates a partner namespace with the specified parameters.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class UpdateAzEventGridPartnerNamespace_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// + /// This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD + /// token will be used to authenticate if user is allowed to publish to the partner namespace. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD token will be used to authenticate if user is allowed to publish to the partner namespace.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD token will be used to authenticate if user is allowed to publish to the partner namespace.", + SerializedName = @"disableLocalAuth", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter DisableLocalAuth { get => PartnerNamespaceUpdateParametersBody.DisableLocalAuth ?? default(global::System.Management.Automation.SwitchParameter); set => PartnerNamespaceUpdateParametersBody.DisableLocalAuth = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// + /// This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess + /// is enabled. + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess is enabled.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess is enabled.", + SerializedName = @"inboundIpRules", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule) })] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[] InboundIPRule { get => PartnerNamespaceUpdateParametersBody.InboundIPRule ?? null /* arrayOf */; set => PartnerNamespaceUpdateParametersBody.InboundIPRule = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParameters _partnerNamespaceUpdateParametersBody= new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerNamespaceUpdateParameters(); + + /// Properties of the Partner Namespace update. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParameters PartnerNamespaceUpdateParametersBody { get => this._partnerNamespaceUpdateParametersBody; set => this._partnerNamespaceUpdateParametersBody = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// This determines if traffic is allowed over public network. By default it is enabled. You can further restrict to specific + /// IPs by configuring + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "This determines if traffic is allowed over public network. By default it is enabled. You can further restrict to specific IPs by configuring ")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This determines if traffic is allowed over public network. By default it is enabled. You can further restrict to specific IPs by configuring ", + SerializedName = @"publicNetworkAccess", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess PublicNetworkAccess { get => PartnerNamespaceUpdateParametersBody.PublicNetworkAccess ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess)""); set => PartnerNamespaceUpdateParametersBody.PublicNetworkAccess = value; } + + /// Tags of the Partner Namespace. + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Tags of the Partner Namespace.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Tags of the Partner Namespace.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParametersTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerNamespaceUpdateParametersTags Tag { get => PartnerNamespaceUpdateParametersBody.Tag ?? null /* object */; set => PartnerNamespaceUpdateParametersBody.Tag = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of UpdateAzEventGridPartnerNamespace_UpdateViaIdentityExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets.UpdateAzEventGridPartnerNamespace_UpdateViaIdentityExpanded Clone() + { + var clone = new UpdateAzEventGridPartnerNamespace_UpdateViaIdentityExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.PartnerNamespaceUpdateParametersBody = this.PartnerNamespaceUpdateParametersBody; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'PartnerNamespacesUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.PartnerNamespacesUpdateViaIdentity(InputObject.Id, PartnerNamespaceUpdateParametersBody, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.PartnerNamespaceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.PartnerNamespaceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.PartnerNamespacesUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.PartnerNamespaceName ?? null, PartnerNamespaceUpdateParametersBody, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=PartnerNamespaceUpdateParametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public UpdateAzEventGridPartnerNamespace_UpdateViaIdentityExpanded() + { + + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=PartnerNamespaceUpdateParametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/UpdateAzEventGridPartnerRegistration_UpdateExpanded.cs b/swaggerci/eventgrid/generated/cmdlets/UpdateAzEventGridPartnerRegistration_UpdateExpanded.cs new file mode 100644 index 000000000000..0e8a353f19c7 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/UpdateAzEventGridPartnerRegistration_UpdateExpanded.cs @@ -0,0 +1,556 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Updates a partner registration with the specified parameters. + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerRegistrations/{partnerRegistrationName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzEventGridPartnerRegistration_UpdateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Updates a partner registration with the specified parameters.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class UpdateAzEventGridPartnerRegistration_UpdateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// + /// List of IDs of Azure AD applications that are authorized to create a partner namespaceassociated with this partner registration. + /// This is an optional property. Creatingpartner namespaces is always permitted under the same Azure subscription as the + /// one usedfor creating the partner registration. + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "List of IDs of Azure AD applications that are authorized to create a partner namespaceassociated with this partner registration. This is an optional property. Creatingpartner namespaces is always permitted under the same Azure subscription as the one usedfor creating the partner registration.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of IDs of Azure AD applications that are authorized to create a partner namespaceassociated with this partner registration. This is an optional property. Creatingpartner namespaces is always permitted under the same Azure subscription as the one usedfor creating the partner registration.", + SerializedName = @"authorizedAzureSubscriptionIds", + PossibleTypes = new [] { typeof(string) })] + public string[] AuthorizedAzureSubscriptionId { get => PartnerRegistrationUpdateParametersBody.AuthorizedAzureSubscriptionId ?? null /* arrayOf */; set => PartnerRegistrationUpdateParametersBody.AuthorizedAzureSubscriptionId = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// URI of the partner logo. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "URI of the partner logo.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"URI of the partner logo.", + SerializedName = @"logoUri", + PossibleTypes = new [] { typeof(string) })] + public string LogoUri { get => PartnerRegistrationUpdateParametersBody.LogoUri ?? null; set => PartnerRegistrationUpdateParametersBody.LogoUri = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the partner registration. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the partner registration.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the partner registration.", + SerializedName = @"partnerRegistrationName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("PartnerRegistrationName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// Backing field for property. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationUpdateParameters _partnerRegistrationUpdateParametersBody= new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerRegistrationUpdateParameters(); + + /// Properties of the Partner Registration update. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationUpdateParameters PartnerRegistrationUpdateParametersBody { get => this._partnerRegistrationUpdateParametersBody; set => this._partnerRegistrationUpdateParametersBody = value; } + + /// Description of the partner topic type. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Description of the partner topic type.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Description of the partner topic type.", + SerializedName = @"partnerTopicTypeDescription", + PossibleTypes = new [] { typeof(string) })] + public string PartnerTopicTypeDescription { get => PartnerRegistrationUpdateParametersBody.PartnerTopicTypeDescription ?? null; set => PartnerRegistrationUpdateParametersBody.PartnerTopicTypeDescription = value; } + + /// Display name of the partner topic type. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Display name of the partner topic type.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Display name of the partner topic type.", + SerializedName = @"partnerTopicTypeDisplayName", + PossibleTypes = new [] { typeof(string) })] + public string PartnerTopicTypeDisplayName { get => PartnerRegistrationUpdateParametersBody.PartnerTopicTypeDisplayName ?? null; set => PartnerRegistrationUpdateParametersBody.PartnerTopicTypeDisplayName = value; } + + /// Name of the partner topic type. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Name of the partner topic type.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the partner topic type.", + SerializedName = @"partnerTopicTypeName", + PossibleTypes = new [] { typeof(string) })] + public string PartnerTopicTypeName { get => PartnerRegistrationUpdateParametersBody.PartnerTopicTypeName ?? null; set => PartnerRegistrationUpdateParametersBody.PartnerTopicTypeName = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// + /// URI of the partner website that can be used by Azure customers to setup Event Gridintegration on an event source. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "URI of the partner website that can be used by Azure customers to setup Event Gridintegration on an event source.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"URI of the partner website that can be used by Azure customers to setup Event Gridintegration on an event source.", + SerializedName = @"setupUri", + PossibleTypes = new [] { typeof(string) })] + public string SetupUri { get => PartnerRegistrationUpdateParametersBody.SetupUri ?? null; set => PartnerRegistrationUpdateParametersBody.SetupUri = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Tags of the partner registration resource. + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Tags of the partner registration resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Tags of the partner registration resource.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationUpdateParametersTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationUpdateParametersTags Tag { get => PartnerRegistrationUpdateParametersBody.Tag ?? null /* object */; set => PartnerRegistrationUpdateParametersBody.Tag = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of UpdateAzEventGridPartnerRegistration_UpdateExpanded + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets.UpdateAzEventGridPartnerRegistration_UpdateExpanded Clone() + { + var clone = new UpdateAzEventGridPartnerRegistration_UpdateExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.PartnerRegistrationUpdateParametersBody = this.PartnerRegistrationUpdateParametersBody; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.Name = this.Name; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'PartnerRegistrationsUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.PartnerRegistrationsUpdate(SubscriptionId, ResourceGroupName, Name, PartnerRegistrationUpdateParametersBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name,body=PartnerRegistrationUpdateParametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public UpdateAzEventGridPartnerRegistration_UpdateExpanded() + { + + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name, body=PartnerRegistrationUpdateParametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/UpdateAzEventGridPartnerRegistration_UpdateViaIdentityExpanded.cs b/swaggerci/eventgrid/generated/cmdlets/UpdateAzEventGridPartnerRegistration_UpdateViaIdentityExpanded.cs new file mode 100644 index 000000000000..cc54a88b4fb6 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/UpdateAzEventGridPartnerRegistration_UpdateViaIdentityExpanded.cs @@ -0,0 +1,534 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Updates a partner registration with the specified parameters. + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerRegistrations/{partnerRegistrationName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzEventGridPartnerRegistration_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Updates a partner registration with the specified parameters.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class UpdateAzEventGridPartnerRegistration_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// + /// List of IDs of Azure AD applications that are authorized to create a partner namespaceassociated with this partner registration. + /// This is an optional property. Creatingpartner namespaces is always permitted under the same Azure subscription as the + /// one usedfor creating the partner registration. + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "List of IDs of Azure AD applications that are authorized to create a partner namespaceassociated with this partner registration. This is an optional property. Creatingpartner namespaces is always permitted under the same Azure subscription as the one usedfor creating the partner registration.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of IDs of Azure AD applications that are authorized to create a partner namespaceassociated with this partner registration. This is an optional property. Creatingpartner namespaces is always permitted under the same Azure subscription as the one usedfor creating the partner registration.", + SerializedName = @"authorizedAzureSubscriptionIds", + PossibleTypes = new [] { typeof(string) })] + public string[] AuthorizedAzureSubscriptionId { get => PartnerRegistrationUpdateParametersBody.AuthorizedAzureSubscriptionId ?? null /* arrayOf */; set => PartnerRegistrationUpdateParametersBody.AuthorizedAzureSubscriptionId = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// URI of the partner logo. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "URI of the partner logo.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"URI of the partner logo.", + SerializedName = @"logoUri", + PossibleTypes = new [] { typeof(string) })] + public string LogoUri { get => PartnerRegistrationUpdateParametersBody.LogoUri ?? null; set => PartnerRegistrationUpdateParametersBody.LogoUri = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// Backing field for property. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationUpdateParameters _partnerRegistrationUpdateParametersBody= new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerRegistrationUpdateParameters(); + + /// Properties of the Partner Registration update. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationUpdateParameters PartnerRegistrationUpdateParametersBody { get => this._partnerRegistrationUpdateParametersBody; set => this._partnerRegistrationUpdateParametersBody = value; } + + /// Description of the partner topic type. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Description of the partner topic type.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Description of the partner topic type.", + SerializedName = @"partnerTopicTypeDescription", + PossibleTypes = new [] { typeof(string) })] + public string PartnerTopicTypeDescription { get => PartnerRegistrationUpdateParametersBody.PartnerTopicTypeDescription ?? null; set => PartnerRegistrationUpdateParametersBody.PartnerTopicTypeDescription = value; } + + /// Display name of the partner topic type. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Display name of the partner topic type.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Display name of the partner topic type.", + SerializedName = @"partnerTopicTypeDisplayName", + PossibleTypes = new [] { typeof(string) })] + public string PartnerTopicTypeDisplayName { get => PartnerRegistrationUpdateParametersBody.PartnerTopicTypeDisplayName ?? null; set => PartnerRegistrationUpdateParametersBody.PartnerTopicTypeDisplayName = value; } + + /// Name of the partner topic type. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Name of the partner topic type.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the partner topic type.", + SerializedName = @"partnerTopicTypeName", + PossibleTypes = new [] { typeof(string) })] + public string PartnerTopicTypeName { get => PartnerRegistrationUpdateParametersBody.PartnerTopicTypeName ?? null; set => PartnerRegistrationUpdateParametersBody.PartnerTopicTypeName = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// URI of the partner website that can be used by Azure customers to setup Event Gridintegration on an event source. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "URI of the partner website that can be used by Azure customers to setup Event Gridintegration on an event source.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"URI of the partner website that can be used by Azure customers to setup Event Gridintegration on an event source.", + SerializedName = @"setupUri", + PossibleTypes = new [] { typeof(string) })] + public string SetupUri { get => PartnerRegistrationUpdateParametersBody.SetupUri ?? null; set => PartnerRegistrationUpdateParametersBody.SetupUri = value; } + + /// Tags of the partner registration resource. + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Tags of the partner registration resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Tags of the partner registration resource.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationUpdateParametersTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerRegistrationUpdateParametersTags Tag { get => PartnerRegistrationUpdateParametersBody.Tag ?? null /* object */; set => PartnerRegistrationUpdateParametersBody.Tag = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of UpdateAzEventGridPartnerRegistration_UpdateViaIdentityExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets.UpdateAzEventGridPartnerRegistration_UpdateViaIdentityExpanded Clone() + { + var clone = new UpdateAzEventGridPartnerRegistration_UpdateViaIdentityExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.PartnerRegistrationUpdateParametersBody = this.PartnerRegistrationUpdateParametersBody; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'PartnerRegistrationsUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.PartnerRegistrationsUpdateViaIdentity(InputObject.Id, PartnerRegistrationUpdateParametersBody, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.PartnerRegistrationName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.PartnerRegistrationName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.PartnerRegistrationsUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.PartnerRegistrationName ?? null, PartnerRegistrationUpdateParametersBody, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=PartnerRegistrationUpdateParametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet + /// class. + /// + public UpdateAzEventGridPartnerRegistration_UpdateViaIdentityExpanded() + { + + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=PartnerRegistrationUpdateParametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/UpdateAzEventGridPartnerTopicEventSubscription_UpdateExpanded.cs b/swaggerci/eventgrid/generated/cmdlets/UpdateAzEventGridPartnerTopicEventSubscription_UpdateExpanded.cs new file mode 100644 index 000000000000..d02980b0f0c3 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/UpdateAzEventGridPartnerTopicEventSubscription_UpdateExpanded.cs @@ -0,0 +1,671 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Update an existing event subscription of a partner topic. + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerTopics/{partnerTopicName}/eventSubscriptions/{eventSubscriptionName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzEventGridPartnerTopicEventSubscription_UpdateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Update an existing event subscription of a partner topic.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class UpdateAzEventGridPartnerTopicEventSubscription_UpdateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType DeadLetterWithResourceIdentityType { get => EventSubscriptionUpdateParametersBody.DeadLetterWithResourceIdentityType ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType)""); set => EventSubscriptionUpdateParametersBody.DeadLetterWithResourceIdentityType = value; } + + /// The user identity associated with the resource. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The user identity associated with the resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The user identity associated with the resource.", + SerializedName = @"userAssignedIdentity", + PossibleTypes = new [] { typeof(string) })] + public string DeadLetterWithResourceIdentityUserAssignedIdentity { get => EventSubscriptionUpdateParametersBody.DeadLetterWithResourceIdentityUserAssignedIdentity ?? null; set => EventSubscriptionUpdateParametersBody.DeadLetterWithResourceIdentityUserAssignedIdentity = value; } + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Type of the endpoint for the event subscription destination. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Type of the endpoint for the event subscription destination.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of the endpoint for the event subscription destination.", + SerializedName = @"endpointType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType DeliveryWithResourceIdentityDestinationEndpointType { get => EventSubscriptionUpdateParametersBody.DeliveryWithResourceIdentityDestinationEndpointType ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType)""); set => EventSubscriptionUpdateParametersBody.DeliveryWithResourceIdentityDestinationEndpointType = value; } + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType DeliveryWithResourceIdentityType { get => EventSubscriptionUpdateParametersBody.DeliveryWithResourceIdentityType ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType)""); set => EventSubscriptionUpdateParametersBody.DeliveryWithResourceIdentityType = value; } + + /// The user identity associated with the resource. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The user identity associated with the resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The user identity associated with the resource.", + SerializedName = @"userAssignedIdentity", + PossibleTypes = new [] { typeof(string) })] + public string DeliveryWithResourceIdentityUserAssignedIdentity { get => EventSubscriptionUpdateParametersBody.DeliveryWithResourceIdentityUserAssignedIdentity ?? null; set => EventSubscriptionUpdateParametersBody.DeliveryWithResourceIdentityUserAssignedIdentity = value; } + + /// Type of the endpoint for the event subscription destination. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Type of the endpoint for the event subscription destination.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of the endpoint for the event subscription destination.", + SerializedName = @"endpointType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType EndpointType { get => EventSubscriptionUpdateParametersBody.EndpointType ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType)""); set => EventSubscriptionUpdateParametersBody.EndpointType = value; } + + /// The event delivery schema for the event subscription. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The event delivery schema for the event subscription.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The event delivery schema for the event subscription.", + SerializedName = @"eventDeliverySchema", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema EventDeliverySchema { get => EventSubscriptionUpdateParametersBody.EventDeliverySchema ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema)""); set => EventSubscriptionUpdateParametersBody.EventDeliverySchema = value; } + + /// Backing field for property. + private string _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. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "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.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"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.", + SerializedName = @"eventSubscriptionName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string EventSubscriptionName { get => this._eventSubscriptionName; set => this._eventSubscriptionName = value; } + + /// + /// Backing field for property. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParameters _eventSubscriptionUpdateParametersBody= new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionUpdateParameters(); + + /// Properties of the Event Subscription update. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParameters EventSubscriptionUpdateParametersBody { get => this._eventSubscriptionUpdateParametersBody; set => this._eventSubscriptionUpdateParametersBody = value; } + + /// Information about the expiration time for the event subscription. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Information about the expiration time for the event subscription.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Information about the expiration time for the event subscription.", + SerializedName = @"expirationTimeUtc", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime ExpirationTimeUtc { get => EventSubscriptionUpdateParametersBody.ExpirationTimeUtc ?? default(global::System.DateTime); set => EventSubscriptionUpdateParametersBody.ExpirationTimeUtc = value; } + + /// An array of advanced filters that are used for filtering event subscriptions. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "An array of advanced filters that are used for filtering event subscriptions.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An array of advanced filters that are used for filtering event subscriptions.", + SerializedName = @"advancedFilters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter) })] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[] FilterAdvancedFilter { get => EventSubscriptionUpdateParametersBody.FilterAdvancedFilter ?? null /* arrayOf */; set => EventSubscriptionUpdateParametersBody.FilterAdvancedFilter = value; } + + /// + /// Allows advanced filters to be evaluated against an array of values instead of expecting a singular value. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Allows advanced filters to be evaluated against an array of values instead of expecting a singular value.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allows advanced filters to be evaluated against an array of values instead of expecting a singular value.", + SerializedName = @"enableAdvancedFilteringOnArrays", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter FilterEnableAdvancedFilteringOnArray { get => EventSubscriptionUpdateParametersBody.FilterEnableAdvancedFilteringOnArray ?? default(global::System.Management.Automation.SwitchParameter); set => EventSubscriptionUpdateParametersBody.FilterEnableAdvancedFilteringOnArray = value; } + + /// + /// 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. + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"includedEventTypes", + PossibleTypes = new [] { typeof(string) })] + public string[] FilterIncludedEventType { get => EventSubscriptionUpdateParametersBody.FilterIncludedEventType ?? null /* arrayOf */; set => EventSubscriptionUpdateParametersBody.FilterIncludedEventType = value; } + + /// + /// Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filtershould be compared in a case sensitive + /// manner. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filtershould be compared in a case sensitive manner.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filtershould be compared in a case sensitive manner.", + SerializedName = @"isSubjectCaseSensitive", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter FilterIsSubjectCaseSensitive { get => EventSubscriptionUpdateParametersBody.FilterIsSubjectCaseSensitive ?? default(global::System.Management.Automation.SwitchParameter); set => EventSubscriptionUpdateParametersBody.FilterIsSubjectCaseSensitive = value; } + + /// + /// An optional string to filter events for an event subscription based on a resource path prefix.The format of this depends + /// on the publisher of the events.Wildcard characters are not supported in this path. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "An optional string to filter events for an event subscription based on a resource path prefix.The format of this depends on the publisher of the events.Wildcard characters are not supported in this path.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An optional string to filter events for an event subscription based on a resource path prefix.The format of this depends on the publisher of the events.Wildcard characters are not supported in this path.", + SerializedName = @"subjectBeginsWith", + PossibleTypes = new [] { typeof(string) })] + public string FilterSubjectBeginsWith { get => EventSubscriptionUpdateParametersBody.FilterSubjectBeginsWith ?? null; set => EventSubscriptionUpdateParametersBody.FilterSubjectBeginsWith = value; } + + /// + /// An optional string to filter events for an event subscription based on a resource path suffix.Wildcard characters are + /// not supported in this path. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "An optional string to filter events for an event subscription based on a resource path suffix.Wildcard characters are not supported in this path.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An optional string to filter events for an event subscription based on a resource path suffix.Wildcard characters are not supported in this path.", + SerializedName = @"subjectEndsWith", + PossibleTypes = new [] { typeof(string) })] + public string FilterSubjectEndsWith { get => EventSubscriptionUpdateParametersBody.FilterSubjectEndsWith ?? null; set => EventSubscriptionUpdateParametersBody.FilterSubjectEndsWith = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// List of user defined labels. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "List of user defined labels.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of user defined labels.", + SerializedName = @"labels", + PossibleTypes = new [] { typeof(string) })] + public string[] Label { get => EventSubscriptionUpdateParametersBody.Label ?? null /* arrayOf */; set => EventSubscriptionUpdateParametersBody.Label = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// Backing field for property. + private string _partnerTopicName; + + /// Name of the partner topic. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the partner topic.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the partner topic.", + SerializedName = @"partnerTopicName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string PartnerTopicName { get => this._partnerTopicName; set => this._partnerTopicName = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Time To Live (in minutes) for events. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Time To Live (in minutes) for events.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Time To Live (in minutes) for events.", + SerializedName = @"eventTimeToLiveInMinutes", + PossibleTypes = new [] { typeof(int) })] + public int RetryPolicyEventTimeToLiveInMinute { get => EventSubscriptionUpdateParametersBody.RetryPolicyEventTimeToLiveInMinute ?? default(int); set => EventSubscriptionUpdateParametersBody.RetryPolicyEventTimeToLiveInMinute = value; } + + /// Maximum number of delivery retry attempts for events. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Maximum number of delivery retry attempts for events.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Maximum number of delivery retry attempts for events.", + SerializedName = @"maxDeliveryAttempts", + PossibleTypes = new [] { typeof(int) })] + public int RetryPolicyMaxDeliveryAttempt { get => EventSubscriptionUpdateParametersBody.RetryPolicyMaxDeliveryAttempt ?? default(int); set => EventSubscriptionUpdateParametersBody.RetryPolicyMaxDeliveryAttempt = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of UpdateAzEventGridPartnerTopicEventSubscription_UpdateExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets.UpdateAzEventGridPartnerTopicEventSubscription_UpdateExpanded Clone() + { + var clone = new UpdateAzEventGridPartnerTopicEventSubscription_UpdateExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.EventSubscriptionUpdateParametersBody = this.EventSubscriptionUpdateParametersBody; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.PartnerTopicName = this.PartnerTopicName; + clone.EventSubscriptionName = this.EventSubscriptionName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'PartnerTopicEventSubscriptionsUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.PartnerTopicEventSubscriptionsUpdate(SubscriptionId, ResourceGroupName, PartnerTopicName, EventSubscriptionName, EventSubscriptionUpdateParametersBody, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PartnerTopicName=PartnerTopicName,EventSubscriptionName=EventSubscriptionName,body=EventSubscriptionUpdateParametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public UpdateAzEventGridPartnerTopicEventSubscription_UpdateExpanded() + { + + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PartnerTopicName=PartnerTopicName, EventSubscriptionName=EventSubscriptionName, body=EventSubscriptionUpdateParametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/UpdateAzEventGridPartnerTopicEventSubscription_UpdateViaIdentityExpanded.cs b/swaggerci/eventgrid/generated/cmdlets/UpdateAzEventGridPartnerTopicEventSubscription_UpdateViaIdentityExpanded.cs new file mode 100644 index 000000000000..517da76c2778 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/UpdateAzEventGridPartnerTopicEventSubscription_UpdateViaIdentityExpanded.cs @@ -0,0 +1,634 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Update an existing event subscription of a partner topic. + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerTopics/{partnerTopicName}/eventSubscriptions/{eventSubscriptionName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzEventGridPartnerTopicEventSubscription_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Update an existing event subscription of a partner topic.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class UpdateAzEventGridPartnerTopicEventSubscription_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType DeadLetterWithResourceIdentityType { get => EventSubscriptionUpdateParametersBody.DeadLetterWithResourceIdentityType ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType)""); set => EventSubscriptionUpdateParametersBody.DeadLetterWithResourceIdentityType = value; } + + /// The user identity associated with the resource. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The user identity associated with the resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The user identity associated with the resource.", + SerializedName = @"userAssignedIdentity", + PossibleTypes = new [] { typeof(string) })] + public string DeadLetterWithResourceIdentityUserAssignedIdentity { get => EventSubscriptionUpdateParametersBody.DeadLetterWithResourceIdentityUserAssignedIdentity ?? null; set => EventSubscriptionUpdateParametersBody.DeadLetterWithResourceIdentityUserAssignedIdentity = value; } + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Type of the endpoint for the event subscription destination. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Type of the endpoint for the event subscription destination.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of the endpoint for the event subscription destination.", + SerializedName = @"endpointType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType DeliveryWithResourceIdentityDestinationEndpointType { get => EventSubscriptionUpdateParametersBody.DeliveryWithResourceIdentityDestinationEndpointType ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType)""); set => EventSubscriptionUpdateParametersBody.DeliveryWithResourceIdentityDestinationEndpointType = value; } + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType DeliveryWithResourceIdentityType { get => EventSubscriptionUpdateParametersBody.DeliveryWithResourceIdentityType ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType)""); set => EventSubscriptionUpdateParametersBody.DeliveryWithResourceIdentityType = value; } + + /// The user identity associated with the resource. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The user identity associated with the resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The user identity associated with the resource.", + SerializedName = @"userAssignedIdentity", + PossibleTypes = new [] { typeof(string) })] + public string DeliveryWithResourceIdentityUserAssignedIdentity { get => EventSubscriptionUpdateParametersBody.DeliveryWithResourceIdentityUserAssignedIdentity ?? null; set => EventSubscriptionUpdateParametersBody.DeliveryWithResourceIdentityUserAssignedIdentity = value; } + + /// Type of the endpoint for the event subscription destination. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Type of the endpoint for the event subscription destination.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of the endpoint for the event subscription destination.", + SerializedName = @"endpointType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType EndpointType { get => EventSubscriptionUpdateParametersBody.EndpointType ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType)""); set => EventSubscriptionUpdateParametersBody.EndpointType = value; } + + /// The event delivery schema for the event subscription. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The event delivery schema for the event subscription.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The event delivery schema for the event subscription.", + SerializedName = @"eventDeliverySchema", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema EventDeliverySchema { get => EventSubscriptionUpdateParametersBody.EventDeliverySchema ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema)""); set => EventSubscriptionUpdateParametersBody.EventDeliverySchema = value; } + + /// + /// Backing field for property. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParameters _eventSubscriptionUpdateParametersBody= new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionUpdateParameters(); + + /// Properties of the Event Subscription update. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParameters EventSubscriptionUpdateParametersBody { get => this._eventSubscriptionUpdateParametersBody; set => this._eventSubscriptionUpdateParametersBody = value; } + + /// Information about the expiration time for the event subscription. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Information about the expiration time for the event subscription.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Information about the expiration time for the event subscription.", + SerializedName = @"expirationTimeUtc", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime ExpirationTimeUtc { get => EventSubscriptionUpdateParametersBody.ExpirationTimeUtc ?? default(global::System.DateTime); set => EventSubscriptionUpdateParametersBody.ExpirationTimeUtc = value; } + + /// An array of advanced filters that are used for filtering event subscriptions. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "An array of advanced filters that are used for filtering event subscriptions.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An array of advanced filters that are used for filtering event subscriptions.", + SerializedName = @"advancedFilters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter) })] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[] FilterAdvancedFilter { get => EventSubscriptionUpdateParametersBody.FilterAdvancedFilter ?? null /* arrayOf */; set => EventSubscriptionUpdateParametersBody.FilterAdvancedFilter = value; } + + /// + /// Allows advanced filters to be evaluated against an array of values instead of expecting a singular value. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Allows advanced filters to be evaluated against an array of values instead of expecting a singular value.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allows advanced filters to be evaluated against an array of values instead of expecting a singular value.", + SerializedName = @"enableAdvancedFilteringOnArrays", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter FilterEnableAdvancedFilteringOnArray { get => EventSubscriptionUpdateParametersBody.FilterEnableAdvancedFilteringOnArray ?? default(global::System.Management.Automation.SwitchParameter); set => EventSubscriptionUpdateParametersBody.FilterEnableAdvancedFilteringOnArray = value; } + + /// + /// 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. + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"includedEventTypes", + PossibleTypes = new [] { typeof(string) })] + public string[] FilterIncludedEventType { get => EventSubscriptionUpdateParametersBody.FilterIncludedEventType ?? null /* arrayOf */; set => EventSubscriptionUpdateParametersBody.FilterIncludedEventType = value; } + + /// + /// Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filtershould be compared in a case sensitive + /// manner. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filtershould be compared in a case sensitive manner.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filtershould be compared in a case sensitive manner.", + SerializedName = @"isSubjectCaseSensitive", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter FilterIsSubjectCaseSensitive { get => EventSubscriptionUpdateParametersBody.FilterIsSubjectCaseSensitive ?? default(global::System.Management.Automation.SwitchParameter); set => EventSubscriptionUpdateParametersBody.FilterIsSubjectCaseSensitive = value; } + + /// + /// An optional string to filter events for an event subscription based on a resource path prefix.The format of this depends + /// on the publisher of the events.Wildcard characters are not supported in this path. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "An optional string to filter events for an event subscription based on a resource path prefix.The format of this depends on the publisher of the events.Wildcard characters are not supported in this path.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An optional string to filter events for an event subscription based on a resource path prefix.The format of this depends on the publisher of the events.Wildcard characters are not supported in this path.", + SerializedName = @"subjectBeginsWith", + PossibleTypes = new [] { typeof(string) })] + public string FilterSubjectBeginsWith { get => EventSubscriptionUpdateParametersBody.FilterSubjectBeginsWith ?? null; set => EventSubscriptionUpdateParametersBody.FilterSubjectBeginsWith = value; } + + /// + /// An optional string to filter events for an event subscription based on a resource path suffix.Wildcard characters are + /// not supported in this path. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "An optional string to filter events for an event subscription based on a resource path suffix.Wildcard characters are not supported in this path.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An optional string to filter events for an event subscription based on a resource path suffix.Wildcard characters are not supported in this path.", + SerializedName = @"subjectEndsWith", + PossibleTypes = new [] { typeof(string) })] + public string FilterSubjectEndsWith { get => EventSubscriptionUpdateParametersBody.FilterSubjectEndsWith ?? null; set => EventSubscriptionUpdateParametersBody.FilterSubjectEndsWith = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// List of user defined labels. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "List of user defined labels.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of user defined labels.", + SerializedName = @"labels", + PossibleTypes = new [] { typeof(string) })] + public string[] Label { get => EventSubscriptionUpdateParametersBody.Label ?? null /* arrayOf */; set => EventSubscriptionUpdateParametersBody.Label = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Time To Live (in minutes) for events. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Time To Live (in minutes) for events.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Time To Live (in minutes) for events.", + SerializedName = @"eventTimeToLiveInMinutes", + PossibleTypes = new [] { typeof(int) })] + public int RetryPolicyEventTimeToLiveInMinute { get => EventSubscriptionUpdateParametersBody.RetryPolicyEventTimeToLiveInMinute ?? default(int); set => EventSubscriptionUpdateParametersBody.RetryPolicyEventTimeToLiveInMinute = value; } + + /// Maximum number of delivery retry attempts for events. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Maximum number of delivery retry attempts for events.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Maximum number of delivery retry attempts for events.", + SerializedName = @"maxDeliveryAttempts", + PossibleTypes = new [] { typeof(int) })] + public int RetryPolicyMaxDeliveryAttempt { get => EventSubscriptionUpdateParametersBody.RetryPolicyMaxDeliveryAttempt ?? default(int); set => EventSubscriptionUpdateParametersBody.RetryPolicyMaxDeliveryAttempt = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of UpdateAzEventGridPartnerTopicEventSubscription_UpdateViaIdentityExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets.UpdateAzEventGridPartnerTopicEventSubscription_UpdateViaIdentityExpanded Clone() + { + var clone = new UpdateAzEventGridPartnerTopicEventSubscription_UpdateViaIdentityExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.EventSubscriptionUpdateParametersBody = this.EventSubscriptionUpdateParametersBody; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'PartnerTopicEventSubscriptionsUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.PartnerTopicEventSubscriptionsUpdateViaIdentity(InputObject.Id, EventSubscriptionUpdateParametersBody, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.PartnerTopicName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.PartnerTopicName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.EventSubscriptionName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.EventSubscriptionName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.PartnerTopicEventSubscriptionsUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.PartnerTopicName ?? null, InputObject.EventSubscriptionName ?? null, EventSubscriptionUpdateParametersBody, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=EventSubscriptionUpdateParametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public UpdateAzEventGridPartnerTopicEventSubscription_UpdateViaIdentityExpanded() + { + + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=EventSubscriptionUpdateParametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/UpdateAzEventGridPartnerTopic_UpdateExpanded.cs b/swaggerci/eventgrid/generated/cmdlets/UpdateAzEventGridPartnerTopic_UpdateExpanded.cs new file mode 100644 index 000000000000..43e2af31a07f --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/UpdateAzEventGridPartnerTopic_UpdateExpanded.cs @@ -0,0 +1,503 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Asynchronously updates a partner topic with the specified parameters. + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerTopics/{partnerTopicName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzEventGridPartnerTopic_UpdateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopic))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Asynchronously updates a partner topic with the specified parameters.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class UpdateAzEventGridPartnerTopic_UpdateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// The principal ID of resource identity. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The principal ID of resource identity.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The principal ID of resource identity.", + SerializedName = @"principalId", + PossibleTypes = new [] { typeof(string) })] + public string IdentityPrincipalId { get => PartnerTopicUpdateParametersBody.IdentityPrincipalId ?? null; set => PartnerTopicUpdateParametersBody.IdentityPrincipalId = value; } + + /// The tenant ID of resource. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The tenant ID of resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The tenant ID of resource.", + SerializedName = @"tenantId", + PossibleTypes = new [] { typeof(string) })] + public string IdentityTenantId { get => PartnerTopicUpdateParametersBody.IdentityTenantId ?? null; set => PartnerTopicUpdateParametersBody.IdentityTenantId = value; } + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType IdentityType { get => PartnerTopicUpdateParametersBody.IdentityType ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType)""); set => PartnerTopicUpdateParametersBody.IdentityType = value; } + + /// + /// The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource + /// ids in the form:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.This + /// property is currently not used and reserved for future usage. + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource ids in the form:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.This property is currently not used and reserved for future usage.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource ids in the form:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.This property is currently not used and reserved for future usage.", + SerializedName = @"userAssignedIdentities", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities) })] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities IdentityUserAssignedIdentity { get => PartnerTopicUpdateParametersBody.IdentityUserAssignedIdentity ?? null /* object */; set => PartnerTopicUpdateParametersBody.IdentityUserAssignedIdentity = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the partner topic. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the partner topic.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the partner topic.", + SerializedName = @"partnerTopicName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("PartnerTopicName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicUpdateParameters _partnerTopicUpdateParametersBody= new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerTopicUpdateParameters(); + + /// Properties of the Partner Topic update. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicUpdateParameters PartnerTopicUpdateParametersBody { get => this._partnerTopicUpdateParametersBody; set => this._partnerTopicUpdateParametersBody = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Tags of the Partner Topic resource. + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Tags of the Partner Topic resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Tags of the Partner Topic resource.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicUpdateParametersTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicUpdateParametersTags Tag { get => PartnerTopicUpdateParametersBody.Tag ?? null /* object */; set => PartnerTopicUpdateParametersBody.Tag = value; } + + /// + /// overrideOnCreated will be called before the regular onCreated has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onCreated method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'PartnerTopicsUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.PartnerTopicsUpdate(SubscriptionId, ResourceGroupName, Name, PartnerTopicUpdateParametersBody, onOk, onCreated, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name,body=PartnerTopicUpdateParametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public UpdateAzEventGridPartnerTopic_UpdateExpanded() + { + + } + + /// a delegate that is called when the remote service returns 201 (Created). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnCreated(responseMessage, response, ref _returnNow); + // if overrideOnCreated has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onCreated - response for 201 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopic + WriteObject((await response)); + } + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name, body=PartnerTopicUpdateParametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/UpdateAzEventGridPartnerTopic_UpdateViaIdentityExpanded.cs b/swaggerci/eventgrid/generated/cmdlets/UpdateAzEventGridPartnerTopic_UpdateViaIdentityExpanded.cs new file mode 100644 index 000000000000..d70c990f6d20 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/UpdateAzEventGridPartnerTopic_UpdateViaIdentityExpanded.cs @@ -0,0 +1,481 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Asynchronously updates a partner topic with the specified parameters. + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerTopics/{partnerTopicName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzEventGridPartnerTopic_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopic))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Asynchronously updates a partner topic with the specified parameters.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class UpdateAzEventGridPartnerTopic_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// The principal ID of resource identity. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The principal ID of resource identity.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The principal ID of resource identity.", + SerializedName = @"principalId", + PossibleTypes = new [] { typeof(string) })] + public string IdentityPrincipalId { get => PartnerTopicUpdateParametersBody.IdentityPrincipalId ?? null; set => PartnerTopicUpdateParametersBody.IdentityPrincipalId = value; } + + /// The tenant ID of resource. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The tenant ID of resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The tenant ID of resource.", + SerializedName = @"tenantId", + PossibleTypes = new [] { typeof(string) })] + public string IdentityTenantId { get => PartnerTopicUpdateParametersBody.IdentityTenantId ?? null; set => PartnerTopicUpdateParametersBody.IdentityTenantId = value; } + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType IdentityType { get => PartnerTopicUpdateParametersBody.IdentityType ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType)""); set => PartnerTopicUpdateParametersBody.IdentityType = value; } + + /// + /// The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource + /// ids in the form:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.This + /// property is currently not used and reserved for future usage. + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource ids in the form:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.This property is currently not used and reserved for future usage.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource ids in the form:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.This property is currently not used and reserved for future usage.", + SerializedName = @"userAssignedIdentities", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities) })] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities IdentityUserAssignedIdentity { get => PartnerTopicUpdateParametersBody.IdentityUserAssignedIdentity ?? null /* object */; set => PartnerTopicUpdateParametersBody.IdentityUserAssignedIdentity = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicUpdateParameters _partnerTopicUpdateParametersBody= new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.PartnerTopicUpdateParameters(); + + /// Properties of the Partner Topic update. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicUpdateParameters PartnerTopicUpdateParametersBody { get => this._partnerTopicUpdateParametersBody; set => this._partnerTopicUpdateParametersBody = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Tags of the Partner Topic resource. + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Tags of the Partner Topic resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Tags of the Partner Topic resource.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicUpdateParametersTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopicUpdateParametersTags Tag { get => PartnerTopicUpdateParametersBody.Tag ?? null /* object */; set => PartnerTopicUpdateParametersBody.Tag = value; } + + /// + /// overrideOnCreated will be called before the regular onCreated has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onCreated method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'PartnerTopicsUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.PartnerTopicsUpdateViaIdentity(InputObject.Id, PartnerTopicUpdateParametersBody, onOk, onCreated, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.PartnerTopicName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.PartnerTopicName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.PartnerTopicsUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.PartnerTopicName ?? null, PartnerTopicUpdateParametersBody, onOk, onCreated, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=PartnerTopicUpdateParametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public UpdateAzEventGridPartnerTopic_UpdateViaIdentityExpanded() + { + + } + + /// a delegate that is called when the remote service returns 201 (Created). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnCreated(responseMessage, response, ref _returnNow); + // if overrideOnCreated has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onCreated - response for 201 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IPartnerTopic + WriteObject((await response)); + } + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=PartnerTopicUpdateParametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/UpdateAzEventGridSystemTopicEventSubscription_UpdateExpanded.cs b/swaggerci/eventgrid/generated/cmdlets/UpdateAzEventGridSystemTopicEventSubscription_UpdateExpanded.cs new file mode 100644 index 000000000000..80baaae431a4 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/UpdateAzEventGridSystemTopicEventSubscription_UpdateExpanded.cs @@ -0,0 +1,671 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Update an existing event subscription of a system topic. + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/systemTopics/{systemTopicName}/eventSubscriptions/{eventSubscriptionName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzEventGridSystemTopicEventSubscription_UpdateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Update an existing event subscription of a system topic.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class UpdateAzEventGridSystemTopicEventSubscription_UpdateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType DeadLetterWithResourceIdentityType { get => EventSubscriptionUpdateParametersBody.DeadLetterWithResourceIdentityType ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType)""); set => EventSubscriptionUpdateParametersBody.DeadLetterWithResourceIdentityType = value; } + + /// The user identity associated with the resource. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The user identity associated with the resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The user identity associated with the resource.", + SerializedName = @"userAssignedIdentity", + PossibleTypes = new [] { typeof(string) })] + public string DeadLetterWithResourceIdentityUserAssignedIdentity { get => EventSubscriptionUpdateParametersBody.DeadLetterWithResourceIdentityUserAssignedIdentity ?? null; set => EventSubscriptionUpdateParametersBody.DeadLetterWithResourceIdentityUserAssignedIdentity = value; } + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Type of the endpoint for the event subscription destination. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Type of the endpoint for the event subscription destination.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of the endpoint for the event subscription destination.", + SerializedName = @"endpointType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType DeliveryWithResourceIdentityDestinationEndpointType { get => EventSubscriptionUpdateParametersBody.DeliveryWithResourceIdentityDestinationEndpointType ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType)""); set => EventSubscriptionUpdateParametersBody.DeliveryWithResourceIdentityDestinationEndpointType = value; } + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType DeliveryWithResourceIdentityType { get => EventSubscriptionUpdateParametersBody.DeliveryWithResourceIdentityType ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType)""); set => EventSubscriptionUpdateParametersBody.DeliveryWithResourceIdentityType = value; } + + /// The user identity associated with the resource. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The user identity associated with the resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The user identity associated with the resource.", + SerializedName = @"userAssignedIdentity", + PossibleTypes = new [] { typeof(string) })] + public string DeliveryWithResourceIdentityUserAssignedIdentity { get => EventSubscriptionUpdateParametersBody.DeliveryWithResourceIdentityUserAssignedIdentity ?? null; set => EventSubscriptionUpdateParametersBody.DeliveryWithResourceIdentityUserAssignedIdentity = value; } + + /// Type of the endpoint for the event subscription destination. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Type of the endpoint for the event subscription destination.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of the endpoint for the event subscription destination.", + SerializedName = @"endpointType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType EndpointType { get => EventSubscriptionUpdateParametersBody.EndpointType ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType)""); set => EventSubscriptionUpdateParametersBody.EndpointType = value; } + + /// The event delivery schema for the event subscription. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The event delivery schema for the event subscription.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The event delivery schema for the event subscription.", + SerializedName = @"eventDeliverySchema", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema EventDeliverySchema { get => EventSubscriptionUpdateParametersBody.EventDeliverySchema ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema)""); set => EventSubscriptionUpdateParametersBody.EventDeliverySchema = value; } + + /// Backing field for property. + private string _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. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "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.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"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.", + SerializedName = @"eventSubscriptionName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string EventSubscriptionName { get => this._eventSubscriptionName; set => this._eventSubscriptionName = value; } + + /// + /// Backing field for property. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParameters _eventSubscriptionUpdateParametersBody= new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionUpdateParameters(); + + /// Properties of the Event Subscription update. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParameters EventSubscriptionUpdateParametersBody { get => this._eventSubscriptionUpdateParametersBody; set => this._eventSubscriptionUpdateParametersBody = value; } + + /// Information about the expiration time for the event subscription. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Information about the expiration time for the event subscription.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Information about the expiration time for the event subscription.", + SerializedName = @"expirationTimeUtc", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime ExpirationTimeUtc { get => EventSubscriptionUpdateParametersBody.ExpirationTimeUtc ?? default(global::System.DateTime); set => EventSubscriptionUpdateParametersBody.ExpirationTimeUtc = value; } + + /// An array of advanced filters that are used for filtering event subscriptions. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "An array of advanced filters that are used for filtering event subscriptions.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An array of advanced filters that are used for filtering event subscriptions.", + SerializedName = @"advancedFilters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter) })] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[] FilterAdvancedFilter { get => EventSubscriptionUpdateParametersBody.FilterAdvancedFilter ?? null /* arrayOf */; set => EventSubscriptionUpdateParametersBody.FilterAdvancedFilter = value; } + + /// + /// Allows advanced filters to be evaluated against an array of values instead of expecting a singular value. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Allows advanced filters to be evaluated against an array of values instead of expecting a singular value.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allows advanced filters to be evaluated against an array of values instead of expecting a singular value.", + SerializedName = @"enableAdvancedFilteringOnArrays", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter FilterEnableAdvancedFilteringOnArray { get => EventSubscriptionUpdateParametersBody.FilterEnableAdvancedFilteringOnArray ?? default(global::System.Management.Automation.SwitchParameter); set => EventSubscriptionUpdateParametersBody.FilterEnableAdvancedFilteringOnArray = value; } + + /// + /// 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. + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"includedEventTypes", + PossibleTypes = new [] { typeof(string) })] + public string[] FilterIncludedEventType { get => EventSubscriptionUpdateParametersBody.FilterIncludedEventType ?? null /* arrayOf */; set => EventSubscriptionUpdateParametersBody.FilterIncludedEventType = value; } + + /// + /// Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filtershould be compared in a case sensitive + /// manner. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filtershould be compared in a case sensitive manner.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filtershould be compared in a case sensitive manner.", + SerializedName = @"isSubjectCaseSensitive", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter FilterIsSubjectCaseSensitive { get => EventSubscriptionUpdateParametersBody.FilterIsSubjectCaseSensitive ?? default(global::System.Management.Automation.SwitchParameter); set => EventSubscriptionUpdateParametersBody.FilterIsSubjectCaseSensitive = value; } + + /// + /// An optional string to filter events for an event subscription based on a resource path prefix.The format of this depends + /// on the publisher of the events.Wildcard characters are not supported in this path. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "An optional string to filter events for an event subscription based on a resource path prefix.The format of this depends on the publisher of the events.Wildcard characters are not supported in this path.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An optional string to filter events for an event subscription based on a resource path prefix.The format of this depends on the publisher of the events.Wildcard characters are not supported in this path.", + SerializedName = @"subjectBeginsWith", + PossibleTypes = new [] { typeof(string) })] + public string FilterSubjectBeginsWith { get => EventSubscriptionUpdateParametersBody.FilterSubjectBeginsWith ?? null; set => EventSubscriptionUpdateParametersBody.FilterSubjectBeginsWith = value; } + + /// + /// An optional string to filter events for an event subscription based on a resource path suffix.Wildcard characters are + /// not supported in this path. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "An optional string to filter events for an event subscription based on a resource path suffix.Wildcard characters are not supported in this path.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An optional string to filter events for an event subscription based on a resource path suffix.Wildcard characters are not supported in this path.", + SerializedName = @"subjectEndsWith", + PossibleTypes = new [] { typeof(string) })] + public string FilterSubjectEndsWith { get => EventSubscriptionUpdateParametersBody.FilterSubjectEndsWith ?? null; set => EventSubscriptionUpdateParametersBody.FilterSubjectEndsWith = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// List of user defined labels. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "List of user defined labels.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of user defined labels.", + SerializedName = @"labels", + PossibleTypes = new [] { typeof(string) })] + public string[] Label { get => EventSubscriptionUpdateParametersBody.Label ?? null /* arrayOf */; set => EventSubscriptionUpdateParametersBody.Label = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Time To Live (in minutes) for events. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Time To Live (in minutes) for events.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Time To Live (in minutes) for events.", + SerializedName = @"eventTimeToLiveInMinutes", + PossibleTypes = new [] { typeof(int) })] + public int RetryPolicyEventTimeToLiveInMinute { get => EventSubscriptionUpdateParametersBody.RetryPolicyEventTimeToLiveInMinute ?? default(int); set => EventSubscriptionUpdateParametersBody.RetryPolicyEventTimeToLiveInMinute = value; } + + /// Maximum number of delivery retry attempts for events. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Maximum number of delivery retry attempts for events.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Maximum number of delivery retry attempts for events.", + SerializedName = @"maxDeliveryAttempts", + PossibleTypes = new [] { typeof(int) })] + public int RetryPolicyMaxDeliveryAttempt { get => EventSubscriptionUpdateParametersBody.RetryPolicyMaxDeliveryAttempt ?? default(int); set => EventSubscriptionUpdateParametersBody.RetryPolicyMaxDeliveryAttempt = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _systemTopicName; + + /// Name of the system topic. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the system topic.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the system topic.", + SerializedName = @"systemTopicName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string SystemTopicName { get => this._systemTopicName; set => this._systemTopicName = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of UpdateAzEventGridSystemTopicEventSubscription_UpdateExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets.UpdateAzEventGridSystemTopicEventSubscription_UpdateExpanded Clone() + { + var clone = new UpdateAzEventGridSystemTopicEventSubscription_UpdateExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.EventSubscriptionUpdateParametersBody = this.EventSubscriptionUpdateParametersBody; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.SystemTopicName = this.SystemTopicName; + clone.EventSubscriptionName = this.EventSubscriptionName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'SystemTopicEventSubscriptionsUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.SystemTopicEventSubscriptionsUpdate(SubscriptionId, ResourceGroupName, SystemTopicName, EventSubscriptionName, EventSubscriptionUpdateParametersBody, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,SystemTopicName=SystemTopicName,EventSubscriptionName=EventSubscriptionName,body=EventSubscriptionUpdateParametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public UpdateAzEventGridSystemTopicEventSubscription_UpdateExpanded() + { + + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, SystemTopicName=SystemTopicName, EventSubscriptionName=EventSubscriptionName, body=EventSubscriptionUpdateParametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/UpdateAzEventGridSystemTopicEventSubscription_UpdateViaIdentityExpanded.cs b/swaggerci/eventgrid/generated/cmdlets/UpdateAzEventGridSystemTopicEventSubscription_UpdateViaIdentityExpanded.cs new file mode 100644 index 000000000000..a65c8f7bcf47 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/UpdateAzEventGridSystemTopicEventSubscription_UpdateViaIdentityExpanded.cs @@ -0,0 +1,634 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Update an existing event subscription of a system topic. + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/systemTopics/{systemTopicName}/eventSubscriptions/{eventSubscriptionName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzEventGridSystemTopicEventSubscription_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Update an existing event subscription of a system topic.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class UpdateAzEventGridSystemTopicEventSubscription_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType DeadLetterWithResourceIdentityType { get => EventSubscriptionUpdateParametersBody.DeadLetterWithResourceIdentityType ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType)""); set => EventSubscriptionUpdateParametersBody.DeadLetterWithResourceIdentityType = value; } + + /// The user identity associated with the resource. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The user identity associated with the resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The user identity associated with the resource.", + SerializedName = @"userAssignedIdentity", + PossibleTypes = new [] { typeof(string) })] + public string DeadLetterWithResourceIdentityUserAssignedIdentity { get => EventSubscriptionUpdateParametersBody.DeadLetterWithResourceIdentityUserAssignedIdentity ?? null; set => EventSubscriptionUpdateParametersBody.DeadLetterWithResourceIdentityUserAssignedIdentity = value; } + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Type of the endpoint for the event subscription destination. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Type of the endpoint for the event subscription destination.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of the endpoint for the event subscription destination.", + SerializedName = @"endpointType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType DeliveryWithResourceIdentityDestinationEndpointType { get => EventSubscriptionUpdateParametersBody.DeliveryWithResourceIdentityDestinationEndpointType ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType)""); set => EventSubscriptionUpdateParametersBody.DeliveryWithResourceIdentityDestinationEndpointType = value; } + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType DeliveryWithResourceIdentityType { get => EventSubscriptionUpdateParametersBody.DeliveryWithResourceIdentityType ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType)""); set => EventSubscriptionUpdateParametersBody.DeliveryWithResourceIdentityType = value; } + + /// The user identity associated with the resource. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The user identity associated with the resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The user identity associated with the resource.", + SerializedName = @"userAssignedIdentity", + PossibleTypes = new [] { typeof(string) })] + public string DeliveryWithResourceIdentityUserAssignedIdentity { get => EventSubscriptionUpdateParametersBody.DeliveryWithResourceIdentityUserAssignedIdentity ?? null; set => EventSubscriptionUpdateParametersBody.DeliveryWithResourceIdentityUserAssignedIdentity = value; } + + /// Type of the endpoint for the event subscription destination. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Type of the endpoint for the event subscription destination.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of the endpoint for the event subscription destination.", + SerializedName = @"endpointType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType EndpointType { get => EventSubscriptionUpdateParametersBody.EndpointType ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType)""); set => EventSubscriptionUpdateParametersBody.EndpointType = value; } + + /// The event delivery schema for the event subscription. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The event delivery schema for the event subscription.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The event delivery schema for the event subscription.", + SerializedName = @"eventDeliverySchema", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema EventDeliverySchema { get => EventSubscriptionUpdateParametersBody.EventDeliverySchema ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema)""); set => EventSubscriptionUpdateParametersBody.EventDeliverySchema = value; } + + /// + /// Backing field for property. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParameters _eventSubscriptionUpdateParametersBody= new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionUpdateParameters(); + + /// Properties of the Event Subscription update. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParameters EventSubscriptionUpdateParametersBody { get => this._eventSubscriptionUpdateParametersBody; set => this._eventSubscriptionUpdateParametersBody = value; } + + /// Information about the expiration time for the event subscription. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Information about the expiration time for the event subscription.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Information about the expiration time for the event subscription.", + SerializedName = @"expirationTimeUtc", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime ExpirationTimeUtc { get => EventSubscriptionUpdateParametersBody.ExpirationTimeUtc ?? default(global::System.DateTime); set => EventSubscriptionUpdateParametersBody.ExpirationTimeUtc = value; } + + /// An array of advanced filters that are used for filtering event subscriptions. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "An array of advanced filters that are used for filtering event subscriptions.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An array of advanced filters that are used for filtering event subscriptions.", + SerializedName = @"advancedFilters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter) })] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[] FilterAdvancedFilter { get => EventSubscriptionUpdateParametersBody.FilterAdvancedFilter ?? null /* arrayOf */; set => EventSubscriptionUpdateParametersBody.FilterAdvancedFilter = value; } + + /// + /// Allows advanced filters to be evaluated against an array of values instead of expecting a singular value. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Allows advanced filters to be evaluated against an array of values instead of expecting a singular value.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allows advanced filters to be evaluated against an array of values instead of expecting a singular value.", + SerializedName = @"enableAdvancedFilteringOnArrays", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter FilterEnableAdvancedFilteringOnArray { get => EventSubscriptionUpdateParametersBody.FilterEnableAdvancedFilteringOnArray ?? default(global::System.Management.Automation.SwitchParameter); set => EventSubscriptionUpdateParametersBody.FilterEnableAdvancedFilteringOnArray = value; } + + /// + /// 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. + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"includedEventTypes", + PossibleTypes = new [] { typeof(string) })] + public string[] FilterIncludedEventType { get => EventSubscriptionUpdateParametersBody.FilterIncludedEventType ?? null /* arrayOf */; set => EventSubscriptionUpdateParametersBody.FilterIncludedEventType = value; } + + /// + /// Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filtershould be compared in a case sensitive + /// manner. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filtershould be compared in a case sensitive manner.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filtershould be compared in a case sensitive manner.", + SerializedName = @"isSubjectCaseSensitive", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter FilterIsSubjectCaseSensitive { get => EventSubscriptionUpdateParametersBody.FilterIsSubjectCaseSensitive ?? default(global::System.Management.Automation.SwitchParameter); set => EventSubscriptionUpdateParametersBody.FilterIsSubjectCaseSensitive = value; } + + /// + /// An optional string to filter events for an event subscription based on a resource path prefix.The format of this depends + /// on the publisher of the events.Wildcard characters are not supported in this path. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "An optional string to filter events for an event subscription based on a resource path prefix.The format of this depends on the publisher of the events.Wildcard characters are not supported in this path.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An optional string to filter events for an event subscription based on a resource path prefix.The format of this depends on the publisher of the events.Wildcard characters are not supported in this path.", + SerializedName = @"subjectBeginsWith", + PossibleTypes = new [] { typeof(string) })] + public string FilterSubjectBeginsWith { get => EventSubscriptionUpdateParametersBody.FilterSubjectBeginsWith ?? null; set => EventSubscriptionUpdateParametersBody.FilterSubjectBeginsWith = value; } + + /// + /// An optional string to filter events for an event subscription based on a resource path suffix.Wildcard characters are + /// not supported in this path. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "An optional string to filter events for an event subscription based on a resource path suffix.Wildcard characters are not supported in this path.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An optional string to filter events for an event subscription based on a resource path suffix.Wildcard characters are not supported in this path.", + SerializedName = @"subjectEndsWith", + PossibleTypes = new [] { typeof(string) })] + public string FilterSubjectEndsWith { get => EventSubscriptionUpdateParametersBody.FilterSubjectEndsWith ?? null; set => EventSubscriptionUpdateParametersBody.FilterSubjectEndsWith = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// List of user defined labels. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "List of user defined labels.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of user defined labels.", + SerializedName = @"labels", + PossibleTypes = new [] { typeof(string) })] + public string[] Label { get => EventSubscriptionUpdateParametersBody.Label ?? null /* arrayOf */; set => EventSubscriptionUpdateParametersBody.Label = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Time To Live (in minutes) for events. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Time To Live (in minutes) for events.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Time To Live (in minutes) for events.", + SerializedName = @"eventTimeToLiveInMinutes", + PossibleTypes = new [] { typeof(int) })] + public int RetryPolicyEventTimeToLiveInMinute { get => EventSubscriptionUpdateParametersBody.RetryPolicyEventTimeToLiveInMinute ?? default(int); set => EventSubscriptionUpdateParametersBody.RetryPolicyEventTimeToLiveInMinute = value; } + + /// Maximum number of delivery retry attempts for events. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Maximum number of delivery retry attempts for events.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Maximum number of delivery retry attempts for events.", + SerializedName = @"maxDeliveryAttempts", + PossibleTypes = new [] { typeof(int) })] + public int RetryPolicyMaxDeliveryAttempt { get => EventSubscriptionUpdateParametersBody.RetryPolicyMaxDeliveryAttempt ?? default(int); set => EventSubscriptionUpdateParametersBody.RetryPolicyMaxDeliveryAttempt = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of UpdateAzEventGridSystemTopicEventSubscription_UpdateViaIdentityExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets.UpdateAzEventGridSystemTopicEventSubscription_UpdateViaIdentityExpanded Clone() + { + var clone = new UpdateAzEventGridSystemTopicEventSubscription_UpdateViaIdentityExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.EventSubscriptionUpdateParametersBody = this.EventSubscriptionUpdateParametersBody; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'SystemTopicEventSubscriptionsUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.SystemTopicEventSubscriptionsUpdateViaIdentity(InputObject.Id, EventSubscriptionUpdateParametersBody, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SystemTopicName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SystemTopicName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.EventSubscriptionName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.EventSubscriptionName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.SystemTopicEventSubscriptionsUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.SystemTopicName ?? null, InputObject.EventSubscriptionName ?? null, EventSubscriptionUpdateParametersBody, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=EventSubscriptionUpdateParametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the + /// cmdlet class. + /// + public UpdateAzEventGridSystemTopicEventSubscription_UpdateViaIdentityExpanded() + { + + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=EventSubscriptionUpdateParametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/UpdateAzEventGridSystemTopic_UpdateExpanded.cs b/swaggerci/eventgrid/generated/cmdlets/UpdateAzEventGridSystemTopic_UpdateExpanded.cs new file mode 100644 index 000000000000..ca24f41f8d66 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/UpdateAzEventGridSystemTopic_UpdateExpanded.cs @@ -0,0 +1,536 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Asynchronously updates a system topic with the specified parameters. + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/systemTopics/{systemTopicName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzEventGridSystemTopic_UpdateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopic))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Asynchronously updates a system topic with the specified parameters.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class UpdateAzEventGridSystemTopic_UpdateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// The principal ID of resource identity. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The principal ID of resource identity.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The principal ID of resource identity.", + SerializedName = @"principalId", + PossibleTypes = new [] { typeof(string) })] + public string IdentityPrincipalId { get => SystemTopicUpdateParametersBody.IdentityPrincipalId ?? null; set => SystemTopicUpdateParametersBody.IdentityPrincipalId = value; } + + /// The tenant ID of resource. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The tenant ID of resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The tenant ID of resource.", + SerializedName = @"tenantId", + PossibleTypes = new [] { typeof(string) })] + public string IdentityTenantId { get => SystemTopicUpdateParametersBody.IdentityTenantId ?? null; set => SystemTopicUpdateParametersBody.IdentityTenantId = value; } + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType IdentityType { get => SystemTopicUpdateParametersBody.IdentityType ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType)""); set => SystemTopicUpdateParametersBody.IdentityType = value; } + + /// + /// The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource + /// ids in the form:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.This + /// property is currently not used and reserved for future usage. + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource ids in the form:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.This property is currently not used and reserved for future usage.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource ids in the form:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.This property is currently not used and reserved for future usage.", + SerializedName = @"userAssignedIdentities", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities) })] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities IdentityUserAssignedIdentity { get => SystemTopicUpdateParametersBody.IdentityUserAssignedIdentity ?? null /* object */; set => SystemTopicUpdateParametersBody.IdentityUserAssignedIdentity = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the system topic. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the system topic.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the system topic.", + SerializedName = @"systemTopicName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("SystemTopicName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicUpdateParameters _systemTopicUpdateParametersBody= new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.SystemTopicUpdateParameters(); + + /// Properties of the System Topic update. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicUpdateParameters SystemTopicUpdateParametersBody { get => this._systemTopicUpdateParametersBody; set => this._systemTopicUpdateParametersBody = value; } + + /// Tags of the system topic. + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Tags of the system topic.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Tags of the system topic.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicUpdateParametersTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicUpdateParametersTags Tag { get => SystemTopicUpdateParametersBody.Tag ?? null /* object */; set => SystemTopicUpdateParametersBody.Tag = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of UpdateAzEventGridSystemTopic_UpdateExpanded + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets.UpdateAzEventGridSystemTopic_UpdateExpanded Clone() + { + var clone = new UpdateAzEventGridSystemTopic_UpdateExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SystemTopicUpdateParametersBody = this.SystemTopicUpdateParametersBody; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.Name = this.Name; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'SystemTopicsUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.SystemTopicsUpdate(SubscriptionId, ResourceGroupName, Name, SystemTopicUpdateParametersBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name,body=SystemTopicUpdateParametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public UpdateAzEventGridSystemTopic_UpdateExpanded() + { + + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name, body=SystemTopicUpdateParametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopic + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/UpdateAzEventGridSystemTopic_UpdateViaIdentityExpanded.cs b/swaggerci/eventgrid/generated/cmdlets/UpdateAzEventGridSystemTopic_UpdateViaIdentityExpanded.cs new file mode 100644 index 000000000000..413997070f8a --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/UpdateAzEventGridSystemTopic_UpdateViaIdentityExpanded.cs @@ -0,0 +1,511 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Asynchronously updates a system topic with the specified parameters. + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/systemTopics/{systemTopicName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzEventGridSystemTopic_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopic))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Asynchronously updates a system topic with the specified parameters.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class UpdateAzEventGridSystemTopic_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// The principal ID of resource identity. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The principal ID of resource identity.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The principal ID of resource identity.", + SerializedName = @"principalId", + PossibleTypes = new [] { typeof(string) })] + public string IdentityPrincipalId { get => SystemTopicUpdateParametersBody.IdentityPrincipalId ?? null; set => SystemTopicUpdateParametersBody.IdentityPrincipalId = value; } + + /// The tenant ID of resource. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The tenant ID of resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The tenant ID of resource.", + SerializedName = @"tenantId", + PossibleTypes = new [] { typeof(string) })] + public string IdentityTenantId { get => SystemTopicUpdateParametersBody.IdentityTenantId ?? null; set => SystemTopicUpdateParametersBody.IdentityTenantId = value; } + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType IdentityType { get => SystemTopicUpdateParametersBody.IdentityType ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType)""); set => SystemTopicUpdateParametersBody.IdentityType = value; } + + /// + /// The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource + /// ids in the form:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.This + /// property is currently not used and reserved for future usage. + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource ids in the form:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.This property is currently not used and reserved for future usage.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource ids in the form:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.This property is currently not used and reserved for future usage.", + SerializedName = @"userAssignedIdentities", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities) })] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities IdentityUserAssignedIdentity { get => SystemTopicUpdateParametersBody.IdentityUserAssignedIdentity ?? null /* object */; set => SystemTopicUpdateParametersBody.IdentityUserAssignedIdentity = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicUpdateParameters _systemTopicUpdateParametersBody= new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.SystemTopicUpdateParameters(); + + /// Properties of the System Topic update. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicUpdateParameters SystemTopicUpdateParametersBody { get => this._systemTopicUpdateParametersBody; set => this._systemTopicUpdateParametersBody = value; } + + /// Tags of the system topic. + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Tags of the system topic.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Tags of the system topic.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicUpdateParametersTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopicUpdateParametersTags Tag { get => SystemTopicUpdateParametersBody.Tag ?? null /* object */; set => SystemTopicUpdateParametersBody.Tag = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of UpdateAzEventGridSystemTopic_UpdateViaIdentityExpanded + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets.UpdateAzEventGridSystemTopic_UpdateViaIdentityExpanded Clone() + { + var clone = new UpdateAzEventGridSystemTopic_UpdateViaIdentityExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SystemTopicUpdateParametersBody = this.SystemTopicUpdateParametersBody; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'SystemTopicsUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.SystemTopicsUpdateViaIdentity(InputObject.Id, SystemTopicUpdateParametersBody, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SystemTopicName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SystemTopicName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.SystemTopicsUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.SystemTopicName ?? null, SystemTopicUpdateParametersBody, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=SystemTopicUpdateParametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public UpdateAzEventGridSystemTopic_UpdateViaIdentityExpanded() + { + + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=SystemTopicUpdateParametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ISystemTopic + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/UpdateAzEventGridTopicEventSubscription_UpdateExpanded.cs b/swaggerci/eventgrid/generated/cmdlets/UpdateAzEventGridTopicEventSubscription_UpdateExpanded.cs new file mode 100644 index 000000000000..7c41aa3b2fe6 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/UpdateAzEventGridTopicEventSubscription_UpdateExpanded.cs @@ -0,0 +1,666 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Update an existing event subscription for a topic. + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}/eventSubscriptions/{eventSubscriptionName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzEventGridTopicEventSubscription_UpdateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Update an existing event subscription for a topic.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class UpdateAzEventGridTopicEventSubscription_UpdateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType DeadLetterWithResourceIdentityType { get => EventSubscriptionUpdateParametersBody.DeadLetterWithResourceIdentityType ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType)""); set => EventSubscriptionUpdateParametersBody.DeadLetterWithResourceIdentityType = value; } + + /// The user identity associated with the resource. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The user identity associated with the resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The user identity associated with the resource.", + SerializedName = @"userAssignedIdentity", + PossibleTypes = new [] { typeof(string) })] + public string DeadLetterWithResourceIdentityUserAssignedIdentity { get => EventSubscriptionUpdateParametersBody.DeadLetterWithResourceIdentityUserAssignedIdentity ?? null; set => EventSubscriptionUpdateParametersBody.DeadLetterWithResourceIdentityUserAssignedIdentity = value; } + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Type of the endpoint for the event subscription destination. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Type of the endpoint for the event subscription destination.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of the endpoint for the event subscription destination.", + SerializedName = @"endpointType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType DeliveryWithResourceIdentityDestinationEndpointType { get => EventSubscriptionUpdateParametersBody.DeliveryWithResourceIdentityDestinationEndpointType ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType)""); set => EventSubscriptionUpdateParametersBody.DeliveryWithResourceIdentityDestinationEndpointType = value; } + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType DeliveryWithResourceIdentityType { get => EventSubscriptionUpdateParametersBody.DeliveryWithResourceIdentityType ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType)""); set => EventSubscriptionUpdateParametersBody.DeliveryWithResourceIdentityType = value; } + + /// The user identity associated with the resource. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The user identity associated with the resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The user identity associated with the resource.", + SerializedName = @"userAssignedIdentity", + PossibleTypes = new [] { typeof(string) })] + public string DeliveryWithResourceIdentityUserAssignedIdentity { get => EventSubscriptionUpdateParametersBody.DeliveryWithResourceIdentityUserAssignedIdentity ?? null; set => EventSubscriptionUpdateParametersBody.DeliveryWithResourceIdentityUserAssignedIdentity = value; } + + /// Type of the endpoint for the event subscription destination. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Type of the endpoint for the event subscription destination.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of the endpoint for the event subscription destination.", + SerializedName = @"endpointType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType EndpointType { get => EventSubscriptionUpdateParametersBody.EndpointType ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType)""); set => EventSubscriptionUpdateParametersBody.EndpointType = value; } + + /// The event delivery schema for the event subscription. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The event delivery schema for the event subscription.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The event delivery schema for the event subscription.", + SerializedName = @"eventDeliverySchema", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema EventDeliverySchema { get => EventSubscriptionUpdateParametersBody.EventDeliverySchema ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema)""); set => EventSubscriptionUpdateParametersBody.EventDeliverySchema = value; } + + /// Backing field for property. + private string _eventSubscriptionName; + + /// Name of the event subscription to be updated. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the event subscription to be updated.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the event subscription to be updated.", + SerializedName = @"eventSubscriptionName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string EventSubscriptionName { get => this._eventSubscriptionName; set => this._eventSubscriptionName = value; } + + /// + /// Backing field for property. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParameters _eventSubscriptionUpdateParametersBody= new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionUpdateParameters(); + + /// Properties of the Event Subscription update. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParameters EventSubscriptionUpdateParametersBody { get => this._eventSubscriptionUpdateParametersBody; set => this._eventSubscriptionUpdateParametersBody = value; } + + /// Information about the expiration time for the event subscription. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Information about the expiration time for the event subscription.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Information about the expiration time for the event subscription.", + SerializedName = @"expirationTimeUtc", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime ExpirationTimeUtc { get => EventSubscriptionUpdateParametersBody.ExpirationTimeUtc ?? default(global::System.DateTime); set => EventSubscriptionUpdateParametersBody.ExpirationTimeUtc = value; } + + /// An array of advanced filters that are used for filtering event subscriptions. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "An array of advanced filters that are used for filtering event subscriptions.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An array of advanced filters that are used for filtering event subscriptions.", + SerializedName = @"advancedFilters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter) })] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[] FilterAdvancedFilter { get => EventSubscriptionUpdateParametersBody.FilterAdvancedFilter ?? null /* arrayOf */; set => EventSubscriptionUpdateParametersBody.FilterAdvancedFilter = value; } + + /// + /// Allows advanced filters to be evaluated against an array of values instead of expecting a singular value. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Allows advanced filters to be evaluated against an array of values instead of expecting a singular value.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allows advanced filters to be evaluated against an array of values instead of expecting a singular value.", + SerializedName = @"enableAdvancedFilteringOnArrays", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter FilterEnableAdvancedFilteringOnArray { get => EventSubscriptionUpdateParametersBody.FilterEnableAdvancedFilteringOnArray ?? default(global::System.Management.Automation.SwitchParameter); set => EventSubscriptionUpdateParametersBody.FilterEnableAdvancedFilteringOnArray = value; } + + /// + /// 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. + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"includedEventTypes", + PossibleTypes = new [] { typeof(string) })] + public string[] FilterIncludedEventType { get => EventSubscriptionUpdateParametersBody.FilterIncludedEventType ?? null /* arrayOf */; set => EventSubscriptionUpdateParametersBody.FilterIncludedEventType = value; } + + /// + /// Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filtershould be compared in a case sensitive + /// manner. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filtershould be compared in a case sensitive manner.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filtershould be compared in a case sensitive manner.", + SerializedName = @"isSubjectCaseSensitive", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter FilterIsSubjectCaseSensitive { get => EventSubscriptionUpdateParametersBody.FilterIsSubjectCaseSensitive ?? default(global::System.Management.Automation.SwitchParameter); set => EventSubscriptionUpdateParametersBody.FilterIsSubjectCaseSensitive = value; } + + /// + /// An optional string to filter events for an event subscription based on a resource path prefix.The format of this depends + /// on the publisher of the events.Wildcard characters are not supported in this path. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "An optional string to filter events for an event subscription based on a resource path prefix.The format of this depends on the publisher of the events.Wildcard characters are not supported in this path.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An optional string to filter events for an event subscription based on a resource path prefix.The format of this depends on the publisher of the events.Wildcard characters are not supported in this path.", + SerializedName = @"subjectBeginsWith", + PossibleTypes = new [] { typeof(string) })] + public string FilterSubjectBeginsWith { get => EventSubscriptionUpdateParametersBody.FilterSubjectBeginsWith ?? null; set => EventSubscriptionUpdateParametersBody.FilterSubjectBeginsWith = value; } + + /// + /// An optional string to filter events for an event subscription based on a resource path suffix.Wildcard characters are + /// not supported in this path. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "An optional string to filter events for an event subscription based on a resource path suffix.Wildcard characters are not supported in this path.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An optional string to filter events for an event subscription based on a resource path suffix.Wildcard characters are not supported in this path.", + SerializedName = @"subjectEndsWith", + PossibleTypes = new [] { typeof(string) })] + public string FilterSubjectEndsWith { get => EventSubscriptionUpdateParametersBody.FilterSubjectEndsWith ?? null; set => EventSubscriptionUpdateParametersBody.FilterSubjectEndsWith = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// List of user defined labels. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "List of user defined labels.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of user defined labels.", + SerializedName = @"labels", + PossibleTypes = new [] { typeof(string) })] + public string[] Label { get => EventSubscriptionUpdateParametersBody.Label ?? null /* arrayOf */; set => EventSubscriptionUpdateParametersBody.Label = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Time To Live (in minutes) for events. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Time To Live (in minutes) for events.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Time To Live (in minutes) for events.", + SerializedName = @"eventTimeToLiveInMinutes", + PossibleTypes = new [] { typeof(int) })] + public int RetryPolicyEventTimeToLiveInMinute { get => EventSubscriptionUpdateParametersBody.RetryPolicyEventTimeToLiveInMinute ?? default(int); set => EventSubscriptionUpdateParametersBody.RetryPolicyEventTimeToLiveInMinute = value; } + + /// Maximum number of delivery retry attempts for events. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Maximum number of delivery retry attempts for events.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Maximum number of delivery retry attempts for events.", + SerializedName = @"maxDeliveryAttempts", + PossibleTypes = new [] { typeof(int) })] + public int RetryPolicyMaxDeliveryAttempt { get => EventSubscriptionUpdateParametersBody.RetryPolicyMaxDeliveryAttempt ?? default(int); set => EventSubscriptionUpdateParametersBody.RetryPolicyMaxDeliveryAttempt = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _topicName; + + /// Name of the domain. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the domain.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the domain.", + SerializedName = @"topicName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string TopicName { get => this._topicName; set => this._topicName = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of UpdateAzEventGridTopicEventSubscription_UpdateExpanded + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets.UpdateAzEventGridTopicEventSubscription_UpdateExpanded Clone() + { + var clone = new UpdateAzEventGridTopicEventSubscription_UpdateExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.EventSubscriptionUpdateParametersBody = this.EventSubscriptionUpdateParametersBody; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.TopicName = this.TopicName; + clone.EventSubscriptionName = this.EventSubscriptionName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'TopicEventSubscriptionsUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.TopicEventSubscriptionsUpdate(SubscriptionId, ResourceGroupName, TopicName, EventSubscriptionName, EventSubscriptionUpdateParametersBody, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,TopicName=TopicName,EventSubscriptionName=EventSubscriptionName,body=EventSubscriptionUpdateParametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public UpdateAzEventGridTopicEventSubscription_UpdateExpanded() + { + + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, TopicName=TopicName, EventSubscriptionName=EventSubscriptionName, body=EventSubscriptionUpdateParametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/UpdateAzEventGridTopicEventSubscription_UpdateViaIdentityExpanded.cs b/swaggerci/eventgrid/generated/cmdlets/UpdateAzEventGridTopicEventSubscription_UpdateViaIdentityExpanded.cs new file mode 100644 index 000000000000..e61bf2b39e15 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/UpdateAzEventGridTopicEventSubscription_UpdateViaIdentityExpanded.cs @@ -0,0 +1,634 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Update an existing event subscription for a topic. + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}/eventSubscriptions/{eventSubscriptionName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzEventGridTopicEventSubscription_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Update an existing event subscription for a topic.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class UpdateAzEventGridTopicEventSubscription_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType DeadLetterWithResourceIdentityType { get => EventSubscriptionUpdateParametersBody.DeadLetterWithResourceIdentityType ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType)""); set => EventSubscriptionUpdateParametersBody.DeadLetterWithResourceIdentityType = value; } + + /// The user identity associated with the resource. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The user identity associated with the resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The user identity associated with the resource.", + SerializedName = @"userAssignedIdentity", + PossibleTypes = new [] { typeof(string) })] + public string DeadLetterWithResourceIdentityUserAssignedIdentity { get => EventSubscriptionUpdateParametersBody.DeadLetterWithResourceIdentityUserAssignedIdentity ?? null; set => EventSubscriptionUpdateParametersBody.DeadLetterWithResourceIdentityUserAssignedIdentity = value; } + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Type of the endpoint for the event subscription destination. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Type of the endpoint for the event subscription destination.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of the endpoint for the event subscription destination.", + SerializedName = @"endpointType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType DeliveryWithResourceIdentityDestinationEndpointType { get => EventSubscriptionUpdateParametersBody.DeliveryWithResourceIdentityDestinationEndpointType ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType)""); set => EventSubscriptionUpdateParametersBody.DeliveryWithResourceIdentityDestinationEndpointType = value; } + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType DeliveryWithResourceIdentityType { get => EventSubscriptionUpdateParametersBody.DeliveryWithResourceIdentityType ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventSubscriptionIdentityType)""); set => EventSubscriptionUpdateParametersBody.DeliveryWithResourceIdentityType = value; } + + /// The user identity associated with the resource. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The user identity associated with the resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The user identity associated with the resource.", + SerializedName = @"userAssignedIdentity", + PossibleTypes = new [] { typeof(string) })] + public string DeliveryWithResourceIdentityUserAssignedIdentity { get => EventSubscriptionUpdateParametersBody.DeliveryWithResourceIdentityUserAssignedIdentity ?? null; set => EventSubscriptionUpdateParametersBody.DeliveryWithResourceIdentityUserAssignedIdentity = value; } + + /// Type of the endpoint for the event subscription destination. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Type of the endpoint for the event subscription destination.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of the endpoint for the event subscription destination.", + SerializedName = @"endpointType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType EndpointType { get => EventSubscriptionUpdateParametersBody.EndpointType ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EndpointType)""); set => EventSubscriptionUpdateParametersBody.EndpointType = value; } + + /// The event delivery schema for the event subscription. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The event delivery schema for the event subscription.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The event delivery schema for the event subscription.", + SerializedName = @"eventDeliverySchema", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema EventDeliverySchema { get => EventSubscriptionUpdateParametersBody.EventDeliverySchema ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.EventDeliverySchema)""); set => EventSubscriptionUpdateParametersBody.EventDeliverySchema = value; } + + /// + /// Backing field for property. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParameters _eventSubscriptionUpdateParametersBody= new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.EventSubscriptionUpdateParameters(); + + /// Properties of the Event Subscription update. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IEventSubscriptionUpdateParameters EventSubscriptionUpdateParametersBody { get => this._eventSubscriptionUpdateParametersBody; set => this._eventSubscriptionUpdateParametersBody = value; } + + /// Information about the expiration time for the event subscription. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Information about the expiration time for the event subscription.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Information about the expiration time for the event subscription.", + SerializedName = @"expirationTimeUtc", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime ExpirationTimeUtc { get => EventSubscriptionUpdateParametersBody.ExpirationTimeUtc ?? default(global::System.DateTime); set => EventSubscriptionUpdateParametersBody.ExpirationTimeUtc = value; } + + /// An array of advanced filters that are used for filtering event subscriptions. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "An array of advanced filters that are used for filtering event subscriptions.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An array of advanced filters that are used for filtering event subscriptions.", + SerializedName = @"advancedFilters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter) })] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IAdvancedFilter[] FilterAdvancedFilter { get => EventSubscriptionUpdateParametersBody.FilterAdvancedFilter ?? null /* arrayOf */; set => EventSubscriptionUpdateParametersBody.FilterAdvancedFilter = value; } + + /// + /// Allows advanced filters to be evaluated against an array of values instead of expecting a singular value. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Allows advanced filters to be evaluated against an array of values instead of expecting a singular value.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allows advanced filters to be evaluated against an array of values instead of expecting a singular value.", + SerializedName = @"enableAdvancedFilteringOnArrays", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter FilterEnableAdvancedFilteringOnArray { get => EventSubscriptionUpdateParametersBody.FilterEnableAdvancedFilteringOnArray ?? default(global::System.Management.Automation.SwitchParameter); set => EventSubscriptionUpdateParametersBody.FilterEnableAdvancedFilteringOnArray = value; } + + /// + /// 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. + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"includedEventTypes", + PossibleTypes = new [] { typeof(string) })] + public string[] FilterIncludedEventType { get => EventSubscriptionUpdateParametersBody.FilterIncludedEventType ?? null /* arrayOf */; set => EventSubscriptionUpdateParametersBody.FilterIncludedEventType = value; } + + /// + /// Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filtershould be compared in a case sensitive + /// manner. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filtershould be compared in a case sensitive manner.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filtershould be compared in a case sensitive manner.", + SerializedName = @"isSubjectCaseSensitive", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter FilterIsSubjectCaseSensitive { get => EventSubscriptionUpdateParametersBody.FilterIsSubjectCaseSensitive ?? default(global::System.Management.Automation.SwitchParameter); set => EventSubscriptionUpdateParametersBody.FilterIsSubjectCaseSensitive = value; } + + /// + /// An optional string to filter events for an event subscription based on a resource path prefix.The format of this depends + /// on the publisher of the events.Wildcard characters are not supported in this path. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "An optional string to filter events for an event subscription based on a resource path prefix.The format of this depends on the publisher of the events.Wildcard characters are not supported in this path.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An optional string to filter events for an event subscription based on a resource path prefix.The format of this depends on the publisher of the events.Wildcard characters are not supported in this path.", + SerializedName = @"subjectBeginsWith", + PossibleTypes = new [] { typeof(string) })] + public string FilterSubjectBeginsWith { get => EventSubscriptionUpdateParametersBody.FilterSubjectBeginsWith ?? null; set => EventSubscriptionUpdateParametersBody.FilterSubjectBeginsWith = value; } + + /// + /// An optional string to filter events for an event subscription based on a resource path suffix.Wildcard characters are + /// not supported in this path. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "An optional string to filter events for an event subscription based on a resource path suffix.Wildcard characters are not supported in this path.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An optional string to filter events for an event subscription based on a resource path suffix.Wildcard characters are not supported in this path.", + SerializedName = @"subjectEndsWith", + PossibleTypes = new [] { typeof(string) })] + public string FilterSubjectEndsWith { get => EventSubscriptionUpdateParametersBody.FilterSubjectEndsWith ?? null; set => EventSubscriptionUpdateParametersBody.FilterSubjectEndsWith = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// List of user defined labels. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "List of user defined labels.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of user defined labels.", + SerializedName = @"labels", + PossibleTypes = new [] { typeof(string) })] + public string[] Label { get => EventSubscriptionUpdateParametersBody.Label ?? null /* arrayOf */; set => EventSubscriptionUpdateParametersBody.Label = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Time To Live (in minutes) for events. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Time To Live (in minutes) for events.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Time To Live (in minutes) for events.", + SerializedName = @"eventTimeToLiveInMinutes", + PossibleTypes = new [] { typeof(int) })] + public int RetryPolicyEventTimeToLiveInMinute { get => EventSubscriptionUpdateParametersBody.RetryPolicyEventTimeToLiveInMinute ?? default(int); set => EventSubscriptionUpdateParametersBody.RetryPolicyEventTimeToLiveInMinute = value; } + + /// Maximum number of delivery retry attempts for events. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Maximum number of delivery retry attempts for events.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Maximum number of delivery retry attempts for events.", + SerializedName = @"maxDeliveryAttempts", + PossibleTypes = new [] { typeof(int) })] + public int RetryPolicyMaxDeliveryAttempt { get => EventSubscriptionUpdateParametersBody.RetryPolicyMaxDeliveryAttempt ?? default(int); set => EventSubscriptionUpdateParametersBody.RetryPolicyMaxDeliveryAttempt = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of UpdateAzEventGridTopicEventSubscription_UpdateViaIdentityExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets.UpdateAzEventGridTopicEventSubscription_UpdateViaIdentityExpanded Clone() + { + var clone = new UpdateAzEventGridTopicEventSubscription_UpdateViaIdentityExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.EventSubscriptionUpdateParametersBody = this.EventSubscriptionUpdateParametersBody; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'TopicEventSubscriptionsUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.TopicEventSubscriptionsUpdateViaIdentity(InputObject.Id, EventSubscriptionUpdateParametersBody, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.TopicName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.TopicName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.EventSubscriptionName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.EventSubscriptionName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.TopicEventSubscriptionsUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.TopicName ?? null, InputObject.EventSubscriptionName ?? null, EventSubscriptionUpdateParametersBody, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=EventSubscriptionUpdateParametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet + /// class. + /// + public UpdateAzEventGridTopicEventSubscription_UpdateViaIdentityExpanded() + { + + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=EventSubscriptionUpdateParametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/UpdateAzEventGridTopic_UpdateExpanded.cs b/swaggerci/eventgrid/generated/cmdlets/UpdateAzEventGridTopic_UpdateExpanded.cs new file mode 100644 index 000000000000..3e1527dfc6b9 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/UpdateAzEventGridTopic_UpdateExpanded.cs @@ -0,0 +1,603 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Asynchronously updates a topic with the specified parameters. + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzEventGridTopic_UpdateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Asynchronously updates a topic with the specified parameters.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class UpdateAzEventGridTopic_UpdateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// The data residency boundary for the topic. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The data residency boundary for the topic.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The data residency boundary for the topic.", + SerializedName = @"dataResidencyBoundary", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary DataResidencyBoundary { get => TopicUpdateParametersBody.DataResidencyBoundary ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary)""); set => TopicUpdateParametersBody.DataResidencyBoundary = value; } + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// + /// This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD + /// token will be used to authenticate if user is allowed to publish to the topic. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD token will be used to authenticate if user is allowed to publish to the topic.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD token will be used to authenticate if user is allowed to publish to the topic.", + SerializedName = @"disableLocalAuth", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter DisableLocalAuth { get => TopicUpdateParametersBody.DisableLocalAuth ?? default(global::System.Management.Automation.SwitchParameter); set => TopicUpdateParametersBody.DisableLocalAuth = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// The principal ID of resource identity. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The principal ID of resource identity.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The principal ID of resource identity.", + SerializedName = @"principalId", + PossibleTypes = new [] { typeof(string) })] + public string IdentityPrincipalId { get => TopicUpdateParametersBody.IdentityPrincipalId ?? null; set => TopicUpdateParametersBody.IdentityPrincipalId = value; } + + /// The tenant ID of resource. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The tenant ID of resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The tenant ID of resource.", + SerializedName = @"tenantId", + PossibleTypes = new [] { typeof(string) })] + public string IdentityTenantId { get => TopicUpdateParametersBody.IdentityTenantId ?? null; set => TopicUpdateParametersBody.IdentityTenantId = value; } + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType IdentityType { get => TopicUpdateParametersBody.IdentityType ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType)""); set => TopicUpdateParametersBody.IdentityType = value; } + + /// + /// The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource + /// ids in the form:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.This + /// property is currently not used and reserved for future usage. + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource ids in the form:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.This property is currently not used and reserved for future usage.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource ids in the form:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.This property is currently not used and reserved for future usage.", + SerializedName = @"userAssignedIdentities", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities) })] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities IdentityUserAssignedIdentity { get => TopicUpdateParametersBody.IdentityUserAssignedIdentity ?? null /* object */; set => TopicUpdateParametersBody.IdentityUserAssignedIdentity = value; } + + /// + /// This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess + /// is enabled. + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess is enabled.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess is enabled.", + SerializedName = @"inboundIpRules", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule) })] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[] InboundIPRule { get => TopicUpdateParametersBody.InboundIPRule ?? null /* arrayOf */; set => TopicUpdateParametersBody.InboundIPRule = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the topic. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the topic.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the topic.", + SerializedName = @"topicName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("TopicName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// This determines if traffic is allowed over public network. By default it is enabled. You can further restrict to specific + /// IPs by configuring + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "This determines if traffic is allowed over public network. By default it is enabled. You can further restrict to specific IPs by configuring ")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This determines if traffic is allowed over public network. By default it is enabled. You can further restrict to specific IPs by configuring ", + SerializedName = @"publicNetworkAccess", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess PublicNetworkAccess { get => TopicUpdateParametersBody.PublicNetworkAccess ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess)""); set => TopicUpdateParametersBody.PublicNetworkAccess = value; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group within the user's subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// The Sku name of the resource. The possible values are: Basic or Premium. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The Sku name of the resource. The possible values are: Basic or Premium.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Sku name of the resource. The possible values are: Basic or Premium.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku SkuName { get => TopicUpdateParametersBody.SkuName ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku)""); set => TopicUpdateParametersBody.SkuName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the + /// URI for every service call. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Tags of the Topic resource. + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Tags of the Topic resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Tags of the Topic resource.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParametersTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParametersTags Tag { get => TopicUpdateParametersBody.Tag ?? null /* object */; set => TopicUpdateParametersBody.Tag = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParameters _topicUpdateParametersBody= new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.TopicUpdateParameters(); + + /// Properties of the Topic update + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParameters TopicUpdateParametersBody { get => this._topicUpdateParametersBody; set => this._topicUpdateParametersBody = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of UpdateAzEventGridTopic_UpdateExpanded + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets.UpdateAzEventGridTopic_UpdateExpanded Clone() + { + var clone = new UpdateAzEventGridTopic_UpdateExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.TopicUpdateParametersBody = this.TopicUpdateParametersBody; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.Name = this.Name; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'TopicsUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.TopicsUpdate(SubscriptionId, ResourceGroupName, Name, TopicUpdateParametersBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name,body=TopicUpdateParametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public UpdateAzEventGridTopic_UpdateExpanded() + { + + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name, body=TopicUpdateParametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/cmdlets/UpdateAzEventGridTopic_UpdateViaIdentityExpanded.cs b/swaggerci/eventgrid/generated/cmdlets/UpdateAzEventGridTopic_UpdateViaIdentityExpanded.cs new file mode 100644 index 000000000000..31c47b578445 --- /dev/null +++ b/swaggerci/eventgrid/generated/cmdlets/UpdateAzEventGridTopic_UpdateViaIdentityExpanded.cs @@ -0,0 +1,578 @@ +// 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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + using System; + + /// Asynchronously updates a topic with the specified parameters. + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzEventGridTopic_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Description(@"Asynchronously updates a topic with the specified parameters.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Generated] + public partial class UpdateAzEventGridTopic_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.EventGridManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.ClientAPI; + + /// The data residency boundary for the topic. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The data residency boundary for the topic.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The data residency boundary for the topic.", + SerializedName = @"dataResidencyBoundary", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary DataResidencyBoundary { get => TopicUpdateParametersBody.DataResidencyBoundary ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.DataResidencyBoundary)""); set => TopicUpdateParametersBody.DataResidencyBoundary = value; } + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// + /// This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD + /// token will be used to authenticate if user is allowed to publish to the topic. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD token will be used to authenticate if user is allowed to publish to the topic.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD token will be used to authenticate if user is allowed to publish to the topic.", + SerializedName = @"disableLocalAuth", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter DisableLocalAuth { get => TopicUpdateParametersBody.DisableLocalAuth ?? default(global::System.Management.Automation.SwitchParameter); set => TopicUpdateParametersBody.DisableLocalAuth = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// The principal ID of resource identity. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The principal ID of resource identity.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The principal ID of resource identity.", + SerializedName = @"principalId", + PossibleTypes = new [] { typeof(string) })] + public string IdentityPrincipalId { get => TopicUpdateParametersBody.IdentityPrincipalId ?? null; set => TopicUpdateParametersBody.IdentityPrincipalId = value; } + + /// The tenant ID of resource. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The tenant ID of resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The tenant ID of resource.", + SerializedName = @"tenantId", + PossibleTypes = new [] { typeof(string) })] + public string IdentityTenantId { get => TopicUpdateParametersBody.IdentityTenantId ?? null; set => TopicUpdateParametersBody.IdentityTenantId = value; } + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType IdentityType { get => TopicUpdateParametersBody.IdentityType ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.IdentityType)""); set => TopicUpdateParametersBody.IdentityType = value; } + + /// + /// The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource + /// ids in the form:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.This + /// property is currently not used and reserved for future usage. + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource ids in the form:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.This property is currently not used and reserved for future usage.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource ids in the form:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.This property is currently not used and reserved for future usage.", + SerializedName = @"userAssignedIdentities", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities) })] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IIdentityInfoUserAssignedIdentities IdentityUserAssignedIdentity { get => TopicUpdateParametersBody.IdentityUserAssignedIdentity ?? null /* object */; set => TopicUpdateParametersBody.IdentityUserAssignedIdentity = value; } + + /// + /// This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess + /// is enabled. + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess is enabled.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess is enabled.", + SerializedName = @"inboundIpRules", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule) })] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IInboundIPRule[] InboundIPRule { get => TopicUpdateParametersBody.InboundIPRule ?? null /* arrayOf */; set => TopicUpdateParametersBody.InboundIPRule = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.IEventGridIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// This determines if traffic is allowed over public network. By default it is enabled. You can further restrict to specific + /// IPs by configuring + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "This determines if traffic is allowed over public network. By default it is enabled. You can further restrict to specific IPs by configuring ")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This determines if traffic is allowed over public network. By default it is enabled. You can further restrict to specific IPs by configuring ", + SerializedName = @"publicNetworkAccess", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess PublicNetworkAccess { get => TopicUpdateParametersBody.PublicNetworkAccess ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.PublicNetworkAccess)""); set => TopicUpdateParametersBody.PublicNetworkAccess = value; } + + /// The Sku name of the resource. The possible values are: Basic or Premium. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The Sku name of the resource. The possible values are: Basic or Premium.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Sku name of the resource. The possible values are: Basic or Premium.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku))] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku SkuName { get => TopicUpdateParametersBody.SkuName ?? ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support.Sku)""); set => TopicUpdateParametersBody.SkuName = value; } + + /// Tags of the Topic resource. + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Tags of the Topic resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category(global::Microsoft.Azure.PowerShell.Cmdlets.EventGrid.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Tags of the Topic resource.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParametersTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParametersTags Tag { get => TopicUpdateParametersBody.Tag ?? null /* object */; set => TopicUpdateParametersBody.Tag = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParameters _topicUpdateParametersBody= new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.TopicUpdateParameters(); + + /// Properties of the Topic update + private Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.ITopicUpdateParameters TopicUpdateParametersBody { get => this._topicUpdateParametersBody; set => this._topicUpdateParametersBody = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of UpdateAzEventGridTopic_UpdateViaIdentityExpanded + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Cmdlets.UpdateAzEventGridTopic_UpdateViaIdentityExpanded Clone() + { + var clone = new UpdateAzEventGridTopic_UpdateViaIdentityExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.TopicUpdateParametersBody = this.TopicUpdateParametersBody; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'TopicsUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.TopicsUpdateViaIdentity(InputObject.Id, TopicUpdateParametersBody, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.TopicName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.TopicName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.TopicsUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.TopicName ?? null, TopicUpdateParametersBody, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=TopicUpdateParametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public UpdateAzEventGridTopic_UpdateViaIdentityExpanded() + { + + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.RestException(responseMessage); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=TopicUpdateParametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Accounts.format.ps1xml b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Accounts.format.ps1xml new file mode 100644 index 000000000000..ae0c12dd4efa --- /dev/null +++ b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Accounts.format.ps1xml @@ -0,0 +1,496 @@ + + + + + AzureErrorRecords + + Microsoft.Azure.Commands.Profile.Errors.AzureErrorRecord + Microsoft.Azure.Commands.Profile.Errors.AzureExceptionRecord + Microsoft.Azure.Commands.Profile.Errors.AzureRestExceptionRecord + + + + + + Microsoft.Azure.Commands.Profile.Errors.AzureRestExceptionRecord + + AzureErrorRecords + + + $_.InvocationInfo.HistoryId + + + + + + + + ErrorCategory + + + ErrorDetail + + + + "{" + $_.InvocationInfo.MyCommand + "}" + + + + $_.InvocationInfo.Line + + + + $_.InvocationInfo.PositionMessage + + + + $_.InvocationInfo.BoundParameters + + + + $_.InvocationInfo.UnboundParameters + + + + $_.InvocationInfo.HistoryId + + + + + + + AzureErrorRecords + $_.GetType() -eq [Microsoft.Azure.Commands.Profile.Errors.AzureRestExceptionRecord] + + + + + RequestId + + + Message + + + ServerMessage + + + ServerResponse + + + RequestMessage + + + + "{" + $_.InvocationInfo.MyCommand + "}" + + + + $_.InvocationInfo.Line + + + + $_.InvocationInfo.PositionMessage + + + StackTrace + + + + $_.InvocationInfo.HistoryId + + + + + + + AzureErrorRecords + $_.GetType() -eq [Microsoft.Azure.Commands.Profile.Errors.AzureExceptionRecord] + + + + + Message + + + StackTrace + + + + $_.Exception.GetType() + + + + "{" + $_.InvocationInfo.MyCommand + "}" + + + + $_.InvocationInfo.Line + + + + $_.InvocationInfo.PositionMessage + + + + $_.InvocationInfo.HistoryId + + + + + + + + Microsoft.Azure.Commands.Profile.CommonModule.PSAzureServiceProfile + + Microsoft.Azure.Commands.Profile.CommonModule.PSAzureServiceProfile + + + + + Left + + + + Left + + + + + + + + Left + Name + + + Left + Description + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAccessToken + + Microsoft.Azure.Commands.Profile.Models.PSAccessToken + + + + + + + Token + + + ExpiresOn + + + Type + + + TenantId + + + UserId + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureSubscriptionPolicy + + Microsoft.Azure.Commands.Profile.Models.PSAzureSubscriptionPolicy + + + + + Left + + + + Left + + + + Left + + + + + + + + Left + locationPlacementId + + + Left + QuotaId + + + Left + SpendingLimit + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureRmAccount + + Microsoft.Azure.Commands.Profile.Models.PSAzureRmAccount + + + + + + + Id + + + Type + + + Tenants + + + Credential + + + TenantMap + + + CertificateThumbprint + + + + $_.ExtendedProperties.GetEnumerator() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Accounts.generated.format.ps1xml b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Accounts.generated.format.ps1xml new file mode 100644 index 000000000000..a81dae94b4db --- /dev/null +++ b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Accounts.generated.format.ps1xml @@ -0,0 +1,468 @@ + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureEnvironment + + Microsoft.Azure.Commands.Profile.Models.PSAzureEnvironment + + + + + Left + + + + Left + + + + Left + + + + Left + + + + + + + + Left + Name + + + Left + ResourceManagerUrl + + + Left + ActiveDirectoryAuthority + + + Left + Type + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureSubscription + + Microsoft.Azure.Commands.Profile.Models.PSAzureSubscription + + + + + Left + + + + Left + + + + Left + + + + Left + + + + + + + + Left + Name + + + Left + Id + + + Left + TenantId + + + Left + State + + + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureProfile + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureProfile + + + + + Left + + + + Left + + + + Left + + + + Left + + + + + + + + Left + $_.Context.Account.ToString() + + + Left + $_.Context.Subscription.Name + + + Left + $_.Context.Tenant.ToString() + + + Left + $_.Context.Environment.ToString() + + + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + + + 40 + Left + + + + Left + + + + Left + + + + Left + + + + Left + + + + + + + + Left + Name + + + Left + Account + + + Left + $_.Subscription.Name + + + Left + Environment + + + Left + $_.Tenant.ToString() + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureTenant + + Microsoft.Azure.Commands.Profile.Models.PSAzureTenant + + + + + Left + + + + Left + + + + Left + + + + Left + + + + + + + + Left + Id + + + Left + $_.Name + + + Left + $_.TenantCategory + + + Left + $_.Domains + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Accounts.types.ps1xml b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Accounts.types.ps1xml new file mode 100644 index 000000000000..e3b670a7daff --- /dev/null +++ b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Accounts.types.ps1xml @@ -0,0 +1,303 @@ + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureProfile + + + PSStandardMembers + + + SerializationDepth + 10 + + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + PSStandardMembers + + + SerializationDepth + 10 + + + + + + + Microsoft.Azure.Commands.Common.Authentication.Core.AuthenticationStoreTokenCache + + + PSStandardMembers + + + SerializationMethod + SpecificProperties + + + PropertySerializationSet + + CacheData + + + + + + + + Microsoft.Azure.Commands.Common.Authentication.Core.ProtectedFileTokenCache + + + PSStandardMembers + + + SerializationMethod + SpecificProperties + + + PropertySerializationSet + + CacheData + + + + + + + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + PSStandardMembers + + + SerializationDepth + 10 + + + + + + Microsoft.Azure.Commands.Profile.Models.AzureContextConverter + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Az.Accounts.nuspec b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Az.Accounts.nuspec new file mode 100644 index 000000000000..f664d888f3b8 --- /dev/null +++ b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Az.Accounts.nuspec @@ -0,0 +1,20 @@ + + + + Az.Accounts + 2.7.5 + Microsoft Corporation + Microsoft Corporation + true + https://aka.ms/azps-license + https://github.com/Azure/azure-powershell + Microsoft Azure PowerShell - Accounts credential management cmdlets for Azure Resource Manager in Windows PowerShell and PowerShell Core. + +For more information on account credential management, please visit the following: https://docs.microsoft.com/powershell/azure/authenticate-azureps + * Added 'SshCredentialFactory' to support get ssh credential of vm from msal. +* Fixed the bug of cmdlet fails when -DefaultProfile is set to service principal login context. [#16617] +* Fixed the issue that authorization does not work in Dogfood environment + Microsoft Corporation. All rights reserved. + Azure ResourceManager ARM Accounts Authentication Environment Subscription PSModule PSIncludes_Cmdlet PSCmdlet_Disable-AzDataCollection PSCmdlet_Disable-AzContextAutosave PSCmdlet_Enable-AzDataCollection PSCmdlet_Enable-AzContextAutosave PSCmdlet_Remove-AzEnvironment PSCmdlet_Get-AzEnvironment PSCmdlet_Set-AzEnvironment PSCmdlet_Add-AzEnvironment PSCmdlet_Get-AzSubscription PSCmdlet_Connect-AzAccount PSCmdlet_Get-AzContext PSCmdlet_Set-AzContext PSCmdlet_Import-AzContext PSCmdlet_Save-AzContext PSCmdlet_Get-AzTenant PSCmdlet_Send-Feedback PSCmdlet_Resolve-AzError PSCmdlet_Select-AzContext PSCmdlet_Rename-AzContext PSCmdlet_Remove-AzContext PSCmdlet_Clear-AzContext PSCmdlet_Disconnect-AzAccount PSCmdlet_Get-AzContextAutosaveSetting PSCmdlet_Set-AzDefault PSCmdlet_Get-AzDefault PSCmdlet_Clear-AzDefault PSCmdlet_Register-AzModule PSCmdlet_Enable-AzureRmAlias PSCmdlet_Disable-AzureRmAlias PSCmdlet_Uninstall-AzureRm PSCmdlet_Invoke-AzRestMethod PSCmdlet_Get-AzAccessToken PSCmdlet_Open-AzSurveyLink PSCommand_Disable-AzDataCollection PSCommand_Disable-AzContextAutosave PSCommand_Enable-AzDataCollection PSCommand_Enable-AzContextAutosave PSCommand_Remove-AzEnvironment PSCommand_Get-AzEnvironment PSCommand_Set-AzEnvironment PSCommand_Add-AzEnvironment PSCommand_Get-AzSubscription PSCommand_Connect-AzAccount PSCommand_Get-AzContext PSCommand_Set-AzContext PSCommand_Import-AzContext PSCommand_Save-AzContext PSCommand_Get-AzTenant PSCommand_Send-Feedback PSCommand_Resolve-AzError PSCommand_Select-AzContext PSCommand_Rename-AzContext PSCommand_Remove-AzContext PSCommand_Clear-AzContext PSCommand_Disconnect-AzAccount PSCommand_Get-AzContextAutosaveSetting PSCommand_Set-AzDefault PSCommand_Get-AzDefault PSCommand_Clear-AzDefault PSCommand_Register-AzModule PSCommand_Enable-AzureRmAlias PSCommand_Disable-AzureRmAlias PSCommand_Uninstall-AzureRm PSCommand_Invoke-AzRestMethod PSCommand_Get-AzAccessToken PSCommand_Open-AzSurveyLink PSCommand_Add-AzAccount PSCommand_Login-AzAccount PSCommand_Remove-AzAccount PSCommand_Logout-AzAccount PSCommand_Select-AzSubscription PSCommand_Resolve-Error PSCommand_Save-AzProfile PSCommand_Get-AzDomain PSCommand_Invoke-AzRest + + \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Az.Accounts.psd1 b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Az.Accounts.psd1 new file mode 100644 index 000000000000..5597a247fce7 --- /dev/null +++ b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Az.Accounts.psd1 @@ -0,0 +1,387 @@ +# +# Module manifest for module 'Az.Accounts' +# +# Generated by: Microsoft Corporation +# +# Generated on: 3/31/2022 +# + +@{ + +# Script module or binary module file associated with this manifest. +RootModule = 'Az.Accounts.psm1' + +# Version number of this module. +ModuleVersion = '2.7.5' + +# Supported PSEditions +CompatiblePSEditions = 'Core', 'Desktop' + +# ID used to uniquely identify this module +GUID = '17a2feff-488b-47f9-8729-e2cec094624c' + +# Author of this module +Author = 'Microsoft Corporation' + +# Company or vendor of this module +CompanyName = 'Microsoft Corporation' + +# Copyright statement for this module +Copyright = 'Microsoft Corporation. All rights reserved.' + +# Description of the functionality provided by this module +Description = 'Microsoft Azure PowerShell - Accounts credential management cmdlets for Azure Resource Manager in Windows PowerShell and PowerShell Core. + +For more information on account credential management, please visit the following: https://docs.microsoft.com/powershell/azure/authenticate-azureps' + +# Minimum version of the PowerShell engine required by this module +PowerShellVersion = '5.1' + +# Name of the PowerShell host required by this module +# PowerShellHostName = '' + +# Minimum version of the PowerShell host required by this module +# PowerShellHostVersion = '' + +# Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only. +DotNetFrameworkVersion = '4.7.2' + +# Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only. +# ClrVersion = '' + +# Processor architecture (None, X86, Amd64) required by this module +# ProcessorArchitecture = '' + +# Modules that must be imported into the global environment prior to importing this module +# RequiredModules = @() + +# Assemblies that must be loaded prior to importing this module +RequiredAssemblies = 'Microsoft.Azure.PowerShell.Authentication.Abstractions.dll', + 'Microsoft.Azure.PowerShell.Authentication.dll', + 'Microsoft.Azure.PowerShell.Authenticators.dll', + 'Microsoft.Azure.PowerShell.Authentication.ResourceManager.dll', + 'Microsoft.Azure.PowerShell.Clients.Authorization.dll', + 'Microsoft.Azure.PowerShell.Clients.Compute.dll', + 'Microsoft.Azure.PowerShell.Clients.Graph.Rbac.dll', + 'Microsoft.Azure.PowerShell.Clients.Monitor.dll', + 'Microsoft.Azure.PowerShell.Clients.Network.dll', + 'Microsoft.Azure.PowerShell.Clients.PolicyInsights.dll', + 'Microsoft.Azure.PowerShell.Clients.ResourceManager.dll', + 'Microsoft.Azure.PowerShell.Common.dll', + 'Microsoft.Azure.PowerShell.Storage.dll', + 'Microsoft.Azure.PowerShell.Clients.Storage.Management.dll', + 'Microsoft.Azure.PowerShell.Clients.KeyVault.dll', + 'Microsoft.Azure.PowerShell.Clients.Websites.dll', + 'Hyak.Common.dll', 'Microsoft.ApplicationInsights.dll', + 'Microsoft.Azure.Common.dll', 'Microsoft.Rest.ClientRuntime.dll', + 'Microsoft.Rest.ClientRuntime.Azure.dll', + 'Microsoft.WindowsAzure.Storage.dll', + 'Microsoft.WindowsAzure.Storage.DataMovement.dll', + 'Microsoft.Azure.PowerShell.Clients.Aks.dll', + 'Microsoft.Azure.PowerShell.Strategies.dll', + 'Microsoft.Azure.PowerShell.Common.Share.dll' + +# Script files (.ps1) that are run in the caller's environment prior to importing this module. +# ScriptsToProcess = @() + +# Type files (.ps1xml) to be loaded when importing this module +# TypesToProcess = @() + +# Format files (.ps1xml) to be loaded when importing this module +FormatsToProcess = 'Accounts.format.ps1xml', 'Accounts.generated.format.ps1xml' + +# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess +NestedModules = @() + +# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export. +FunctionsToExport = @() + +# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export. +CmdletsToExport = 'Disable-AzDataCollection', 'Disable-AzContextAutosave', + 'Enable-AzDataCollection', 'Enable-AzContextAutosave', + 'Remove-AzEnvironment', 'Get-AzEnvironment', 'Set-AzEnvironment', + 'Add-AzEnvironment', 'Get-AzSubscription', 'Connect-AzAccount', + 'Get-AzContext', 'Set-AzContext', 'Import-AzContext', 'Save-AzContext', + 'Get-AzTenant', 'Send-Feedback', 'Resolve-AzError', 'Select-AzContext', + 'Rename-AzContext', 'Remove-AzContext', 'Clear-AzContext', + 'Disconnect-AzAccount', 'Get-AzContextAutosaveSetting', + 'Set-AzDefault', 'Get-AzDefault', 'Clear-AzDefault', + 'Register-AzModule', 'Enable-AzureRmAlias', 'Disable-AzureRmAlias', + 'Uninstall-AzureRm', 'Invoke-AzRestMethod', 'Get-AzAccessToken', + 'Open-AzSurveyLink' + +# Variables to export from this module +# VariablesToExport = @() + +# Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export. +AliasesToExport = 'Add-AzAccount', 'Login-AzAccount', 'Remove-AzAccount', + 'Logout-AzAccount', 'Select-AzSubscription', 'Resolve-Error', + 'Save-AzProfile', 'Get-AzDomain', 'Invoke-AzRest' + +# DSC resources to export from this module +# DscResourcesToExport = @() + +# List of all modules packaged with this module +# ModuleList = @() + +# List of all files packaged with this module +# FileList = @() + +# Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell. +PrivateData = @{ + + PSData = @{ + + # Tags applied to this module. These help with module discovery in online galleries. + Tags = 'Azure','ResourceManager','ARM','Accounts','Authentication','Environment','Subscription' + + # A URL to the license for this module. + LicenseUri = 'https://aka.ms/azps-license' + + # A URL to the main website for this project. + ProjectUri = 'https://github.com/Azure/azure-powershell' + + # A URL to an icon representing this module. + # IconUri = '' + + # ReleaseNotes of this module + ReleaseNotes = '* Added ''SshCredentialFactory'' to support get ssh credential of vm from msal. +* Fixed the bug of cmdlet fails when -DefaultProfile is set to service principal login context. [#16617] +* Fixed the issue that authorization does not work in Dogfood environment' + + # Prerelease string of this module + # Prerelease = '' + + # Flag to indicate whether the module requires explicit user acceptance for install/update/save + # RequireLicenseAcceptance = $false + + # External dependent modules of this module + # ExternalModuleDependencies = @() + + } # End of PSData hashtable + + } # End of PrivateData hashtable + +# HelpInfo URI of this module +# HelpInfoURI = '' + +# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix. +# DefaultCommandPrefix = '' + +} + + +# SIG # Begin signature block +# MIInoQYJKoZIhvcNAQcCoIInkjCCJ44CAQExDzANBglghkgBZQMEAgEFADB5Bgor +# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG +# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCBfih7Yjug0H4t7 +# yWl+P37e8ytBZAxLWrUP62/jyADYPKCCDYEwggX/MIID56ADAgECAhMzAAACUosz +# qviV8znbAAAAAAJSMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD +# VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01pY3Jvc29mdCBDb2RlIFNpZ25p +# bmcgUENBIDIwMTEwHhcNMjEwOTAyMTgzMjU5WhcNMjIwOTAxMTgzMjU5WjB0MQsw +# CQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9u +# ZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMR4wHAYDVQQDExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB +# AQDQ5M+Ps/X7BNuv5B/0I6uoDwj0NJOo1KrVQqO7ggRXccklyTrWL4xMShjIou2I +# sbYnF67wXzVAq5Om4oe+LfzSDOzjcb6ms00gBo0OQaqwQ1BijyJ7NvDf80I1fW9O +# L76Kt0Wpc2zrGhzcHdb7upPrvxvSNNUvxK3sgw7YTt31410vpEp8yfBEl/hd8ZzA +# v47DCgJ5j1zm295s1RVZHNp6MoiQFVOECm4AwK2l28i+YER1JO4IplTH44uvzX9o +# RnJHaMvWzZEpozPy4jNO2DDqbcNs4zh7AWMhE1PWFVA+CHI/En5nASvCvLmuR/t8 +# q4bc8XR8QIZJQSp+2U6m2ldNAgMBAAGjggF+MIIBejAfBgNVHSUEGDAWBgorBgEE +# AYI3TAgBBggrBgEFBQcDAzAdBgNVHQ4EFgQUNZJaEUGL2Guwt7ZOAu4efEYXedEw +# UAYDVR0RBEkwR6RFMEMxKTAnBgNVBAsTIE1pY3Jvc29mdCBPcGVyYXRpb25zIFB1 +# ZXJ0byBSaWNvMRYwFAYDVQQFEw0yMzAwMTIrNDY3NTk3MB8GA1UdIwQYMBaAFEhu +# ZOVQBdOCqhc3NyK1bajKdQKVMFQGA1UdHwRNMEswSaBHoEWGQ2h0dHA6Ly93d3cu +# bWljcm9zb2Z0LmNvbS9wa2lvcHMvY3JsL01pY0NvZFNpZ1BDQTIwMTFfMjAxMS0w +# Ny0wOC5jcmwwYQYIKwYBBQUHAQEEVTBTMFEGCCsGAQUFBzAChkVodHRwOi8vd3d3 +# Lm1pY3Jvc29mdC5jb20vcGtpb3BzL2NlcnRzL01pY0NvZFNpZ1BDQTIwMTFfMjAx +# MS0wNy0wOC5jcnQwDAYDVR0TAQH/BAIwADANBgkqhkiG9w0BAQsFAAOCAgEAFkk3 +# uSxkTEBh1NtAl7BivIEsAWdgX1qZ+EdZMYbQKasY6IhSLXRMxF1B3OKdR9K/kccp +# kvNcGl8D7YyYS4mhCUMBR+VLrg3f8PUj38A9V5aiY2/Jok7WZFOAmjPRNNGnyeg7 +# l0lTiThFqE+2aOs6+heegqAdelGgNJKRHLWRuhGKuLIw5lkgx9Ky+QvZrn/Ddi8u +# TIgWKp+MGG8xY6PBvvjgt9jQShlnPrZ3UY8Bvwy6rynhXBaV0V0TTL0gEx7eh/K1 +# o8Miaru6s/7FyqOLeUS4vTHh9TgBL5DtxCYurXbSBVtL1Fj44+Od/6cmC9mmvrti +# yG709Y3Rd3YdJj2f3GJq7Y7KdWq0QYhatKhBeg4fxjhg0yut2g6aM1mxjNPrE48z +# 6HWCNGu9gMK5ZudldRw4a45Z06Aoktof0CqOyTErvq0YjoE4Xpa0+87T/PVUXNqf +# 7Y+qSU7+9LtLQuMYR4w3cSPjuNusvLf9gBnch5RqM7kaDtYWDgLyB42EfsxeMqwK +# WwA+TVi0HrWRqfSx2olbE56hJcEkMjOSKz3sRuupFCX3UroyYf52L+2iVTrda8XW +# esPG62Mnn3T8AuLfzeJFuAbfOSERx7IFZO92UPoXE1uEjL5skl1yTZB3MubgOA4F +# 8KoRNhviFAEST+nG8c8uIsbZeb08SeYQMqjVEmkwggd6MIIFYqADAgECAgphDpDS +# AAAAAAADMA0GCSqGSIb3DQEBCwUAMIGIMQswCQYDVQQGEwJVUzETMBEGA1UECBMK +# V2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0 +# IENvcnBvcmF0aW9uMTIwMAYDVQQDEylNaWNyb3NvZnQgUm9vdCBDZXJ0aWZpY2F0 +# ZSBBdXRob3JpdHkgMjAxMTAeFw0xMTA3MDgyMDU5MDlaFw0yNjA3MDgyMTA5MDla +# MH4xCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdS +# ZWRtb25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMT +# H01pY3Jvc29mdCBDb2RlIFNpZ25pbmcgUENBIDIwMTEwggIiMA0GCSqGSIb3DQEB +# AQUAA4ICDwAwggIKAoICAQCr8PpyEBwurdhuqoIQTTS68rZYIZ9CGypr6VpQqrgG +# OBoESbp/wwwe3TdrxhLYC/A4wpkGsMg51QEUMULTiQ15ZId+lGAkbK+eSZzpaF7S +# 35tTsgosw6/ZqSuuegmv15ZZymAaBelmdugyUiYSL+erCFDPs0S3XdjELgN1q2jz +# y23zOlyhFvRGuuA4ZKxuZDV4pqBjDy3TQJP4494HDdVceaVJKecNvqATd76UPe/7 +# 4ytaEB9NViiienLgEjq3SV7Y7e1DkYPZe7J7hhvZPrGMXeiJT4Qa8qEvWeSQOy2u +# M1jFtz7+MtOzAz2xsq+SOH7SnYAs9U5WkSE1JcM5bmR/U7qcD60ZI4TL9LoDho33 +# X/DQUr+MlIe8wCF0JV8YKLbMJyg4JZg5SjbPfLGSrhwjp6lm7GEfauEoSZ1fiOIl +# XdMhSz5SxLVXPyQD8NF6Wy/VI+NwXQ9RRnez+ADhvKwCgl/bwBWzvRvUVUvnOaEP +# 6SNJvBi4RHxF5MHDcnrgcuck379GmcXvwhxX24ON7E1JMKerjt/sW5+v/N2wZuLB +# l4F77dbtS+dJKacTKKanfWeA5opieF+yL4TXV5xcv3coKPHtbcMojyyPQDdPweGF +# RInECUzF1KVDL3SV9274eCBYLBNdYJWaPk8zhNqwiBfenk70lrC8RqBsmNLg1oiM +# CwIDAQABo4IB7TCCAekwEAYJKwYBBAGCNxUBBAMCAQAwHQYDVR0OBBYEFEhuZOVQ +# BdOCqhc3NyK1bajKdQKVMBkGCSsGAQQBgjcUAgQMHgoAUwB1AGIAQwBBMAsGA1Ud +# DwQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFHItOgIxkEO5FAVO +# 4eqnxzHRI4k0MFoGA1UdHwRTMFEwT6BNoEuGSWh0dHA6Ly9jcmwubWljcm9zb2Z0 +# LmNvbS9wa2kvY3JsL3Byb2R1Y3RzL01pY1Jvb0NlckF1dDIwMTFfMjAxMV8wM18y +# Mi5jcmwwXgYIKwYBBQUHAQEEUjBQME4GCCsGAQUFBzAChkJodHRwOi8vd3d3Lm1p +# Y3Jvc29mdC5jb20vcGtpL2NlcnRzL01pY1Jvb0NlckF1dDIwMTFfMjAxMV8wM18y +# Mi5jcnQwgZ8GA1UdIASBlzCBlDCBkQYJKwYBBAGCNy4DMIGDMD8GCCsGAQUFBwIB +# FjNodHRwOi8vd3d3Lm1pY3Jvc29mdC5jb20vcGtpb3BzL2RvY3MvcHJpbWFyeWNw +# cy5odG0wQAYIKwYBBQUHAgIwNB4yIB0ATABlAGcAYQBsAF8AcABvAGwAaQBjAHkA +# XwBzAHQAYQB0AGUAbQBlAG4AdAAuIB0wDQYJKoZIhvcNAQELBQADggIBAGfyhqWY +# 4FR5Gi7T2HRnIpsLlhHhY5KZQpZ90nkMkMFlXy4sPvjDctFtg/6+P+gKyju/R6mj +# 82nbY78iNaWXXWWEkH2LRlBV2AySfNIaSxzzPEKLUtCw/WvjPgcuKZvmPRul1LUd +# d5Q54ulkyUQ9eHoj8xN9ppB0g430yyYCRirCihC7pKkFDJvtaPpoLpWgKj8qa1hJ +# Yx8JaW5amJbkg/TAj/NGK978O9C9Ne9uJa7lryft0N3zDq+ZKJeYTQ49C/IIidYf +# wzIY4vDFLc5bnrRJOQrGCsLGra7lstnbFYhRRVg4MnEnGn+x9Cf43iw6IGmYslmJ +# aG5vp7d0w0AFBqYBKig+gj8TTWYLwLNN9eGPfxxvFX1Fp3blQCplo8NdUmKGwx1j +# NpeG39rz+PIWoZon4c2ll9DuXWNB41sHnIc+BncG0QaxdR8UvmFhtfDcxhsEvt9B +# xw4o7t5lL+yX9qFcltgA1qFGvVnzl6UJS0gQmYAf0AApxbGbpT9Fdx41xtKiop96 +# eiL6SJUfq/tHI4D1nvi/a7dLl+LrdXga7Oo3mXkYS//WsyNodeav+vyL6wuA6mk7 +# r/ww7QRMjt/fdW1jkT3RnVZOT7+AVyKheBEyIXrvQQqxP/uozKRdwaGIm1dxVk5I +# RcBCyZt2WwqASGv9eZ/BvW1taslScxMNelDNMYIZdjCCGXICAQEwgZUwfjELMAkG +# A1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQx +# HjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEoMCYGA1UEAxMfTWljcm9z +# b2Z0IENvZGUgU2lnbmluZyBQQ0EgMjAxMQITMwAAAlKLM6r4lfM52wAAAAACUjAN +# BglghkgBZQMEAgEFAKCBrjAZBgkqhkiG9w0BCQMxDAYKKwYBBAGCNwIBBDAcBgor +# BgEEAYI3AgELMQ4wDAYKKwYBBAGCNwIBFTAvBgkqhkiG9w0BCQQxIgQgXA6GKgxI +# VhLOuEe05JK0ofRRaS3Iixk8S4yAEDyheGcwQgYKKwYBBAGCNwIBDDE0MDKgFIAS +# AE0AaQBjAHIAbwBzAG8AZgB0oRqAGGh0dHA6Ly93d3cubWljcm9zb2Z0LmNvbTAN +# BgkqhkiG9w0BAQEFAASCAQCk7+MONSYp7vxlpfSvtfVGPGdZ5LuxWlb4eimh/TgO +# qAAMDghpYUB8mFe46dAf/OoVHrcxhCfAof+aWlMkEqZTwIZ6p0XsXZ72jDLDFLgf +# WJNQ605jndPQx7/b3tDvqqI1sCHz4CvYnqiQn4/JpHjiE4321HRDFjhWv1lhTpMx +# Xaifyrvwc1OwLcSqMrEPSShevbYOH54J0MG+qI+t+AQ9D/WQdL/5HBJZ8PDZ2n9b +# I4FxGwm0aeTSnAiV602r8db+jebwv/5ypKfkok4IzN9qdQY1y3jXdP9MfEK2nCod +# Mbuby8eakQsarqZJovnvBOsZANYE8UafuSbYMQtJaEtnoYIXADCCFvwGCisGAQQB +# gjcDAwExghbsMIIW6AYJKoZIhvcNAQcCoIIW2TCCFtUCAQMxDzANBglghkgBZQME +# AgEFADCCAVEGCyqGSIb3DQEJEAEEoIIBQASCATwwggE4AgEBBgorBgEEAYRZCgMB +# MDEwDQYJYIZIAWUDBAIBBQAEIPieBDiQ8jeOJOjc2VK1Wl36ph7izu7GPD9rSN/j +# BxeOAgZiFm2JbrQYEzIwMjIwMzMxMTAyMDU2LjYzNlowBIACAfSggdCkgc0wgcox +# CzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRt +# b25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xJTAjBgNVBAsTHE1p +# Y3Jvc29mdCBBbWVyaWNhIE9wZXJhdGlvbnMxJjAkBgNVBAsTHVRoYWxlcyBUU1Mg +# RVNOOjEyQkMtRTNBRS03NEVCMSUwIwYDVQQDExxNaWNyb3NvZnQgVGltZS1TdGFt +# cCBTZXJ2aWNloIIRVzCCBwwwggT0oAMCAQICEzMAAAGhAYVVmblUXYoAAQAAAaEw +# DQYJKoZIhvcNAQELBQAwfDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0 +# b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3Jh +# dGlvbjEmMCQGA1UEAxMdTWljcm9zb2Z0IFRpbWUtU3RhbXAgUENBIDIwMTAwHhcN +# MjExMjAyMTkwNTI0WhcNMjMwMjI4MTkwNTI0WjCByjELMAkGA1UEBhMCVVMxEzAR +# BgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoTFU1p +# Y3Jvc29mdCBDb3Jwb3JhdGlvbjElMCMGA1UECxMcTWljcm9zb2Z0IEFtZXJpY2Eg +# T3BlcmF0aW9uczEmMCQGA1UECxMdVGhhbGVzIFRTUyBFU046MTJCQy1FM0FFLTc0 +# RUIxJTAjBgNVBAMTHE1pY3Jvc29mdCBUaW1lLVN0YW1wIFNlcnZpY2UwggIiMA0G +# CSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDayTxe5WukkrYxxVuHLYW9BEWCD9kk +# jnnHsOKwGddIPbZlLY+l5ovLDNf+BEMQKAZQI3DX91l1yCDuP9X7tOPC48ZRGXA/ +# bf9ql0FK5438gIl7cV528XeEOFwc/A+UbIUfW296Omg8Z62xaQv3jrG4U/priArF +# /er1UA1HNuIGUyqjlygiSPwK2NnFApi1JD+Uef5c47kh7pW1Kj7RnchpFeY9MekP +# QRia7cEaUYU4sqCiJVdDJpefLvPT9EdthlQx75ldx+AwZf2a9T7uQRSBh8tpxPdI +# DDkKiWMwjKTrAY09A3I/jidqPuc8PvX+sqxqyZEN2h4GA0Edjmk64nkIukAK18K5 +# nALDLO9SMTxpAwQIHRDtZeTClvAPCEoy1vtPD7f+eqHqStuu+XCkfRjXEpX9+h9f +# rsB0/BgD5CBf3ELLAa8TefMfHZWEJRTPNrbXMKizSrUSkVv/3HP/ZsJpwaz5My2R +# byc3Ah9bT76eBJkyfT5FN9v/KQ0HnxhRMs6HHhTmNx+LztYci+vHf0D3QH1eCjZW +# ZRjp1mOyxpPU2mDMG6gelvJse1JzRADo7YIok/J3Ccbm8MbBbm85iogFltFHecHF +# EFwrsDGBFnNYHMhcbarQNA+gY2e2l9fAkX3MjI7Uklkoz74/P6KIqe5jcd9FPCbb +# SbYH9OLsteeYOQIDAQABo4IBNjCCATIwHQYDVR0OBBYEFBa/IDLbY475VQyKiZSw +# 47l0/cypMB8GA1UdIwQYMBaAFJ+nFV0AXmJdg/Tl0mWnG1M1GelyMF8GA1UdHwRY +# MFYwVKBSoFCGTmh0dHA6Ly93d3cubWljcm9zb2Z0LmNvbS9wa2lvcHMvY3JsL01p +# Y3Jvc29mdCUyMFRpbWUtU3RhbXAlMjBQQ0ElMjAyMDEwKDEpLmNybDBsBggrBgEF +# BQcBAQRgMF4wXAYIKwYBBQUHMAKGUGh0dHA6Ly93d3cubWljcm9zb2Z0LmNvbS9w +# a2lvcHMvY2VydHMvTWljcm9zb2Z0JTIwVGltZS1TdGFtcCUyMFBDQSUyMDIwMTAo +# MSkuY3J0MAwGA1UdEwEB/wQCMAAwEwYDVR0lBAwwCgYIKwYBBQUHAwgwDQYJKoZI +# hvcNAQELBQADggIBACDDIxElfXlG5YKcKrLPSS+f3JWZprwKEiASvivaHTBRlXtA +# s+TkadcsEei+9w5vmF5tCUzTH4c0nCI7bZxnsL+S6XsiOs3Z1V4WX+IwoXUJ4zLv +# s0+mT4vjGDtYfKQ/bsmJKar2c99m/fHv1Wm2CTcyaePvi86Jh3UyLjdRILWbtzs4 +# oImFMwwKbzHdPopxrBhgi+C1YZshosWLlgzyuxjUl+qNg1m52MJmf11loI7D9HJo +# aQzd+rf928Y8rvULmg2h/G50o+D0UJ1Fa/cJJaHfB3sfKw9X6GrtXYGjmM3+g+Ah +# aVsfupKXNtOFu5tnLKvAH5OIjEDYV1YKmlXuBuhbYassygPFMmNgG2Ank3drEcDc +# ZhCXXqpRszNo1F6Gu5JCpQZXbOJM9Ue5PlJKtmImAYIGsw+pnHy/r5ggSYOp4g5Z +# 1oU9GhVCM3V0T9adee6OUXBk1rE4dZc/UsPlj0qoiljL+lN1A5gkmmz7k5tIObVG +# B7dJdz8J0FwXRE5qYu1AdvauVbZwGQkL1x8aK/svjEQW0NUyJ29znDHiXl5vLoRT +# jjFpshUBi2+IY+mNqbLmj24j5eT+bjDlE3HmNtLPpLcMDYqZ1H+6U6YmaiNmac2j +# RXDAaeEE/uoDMt2dArfJP7M+MDv3zzNNTINeuNEtDVgm9zwfgIUCXnDZuVtiMIIH +# cTCCBVmgAwIBAgITMwAAABXF52ueAptJmQAAAAAAFTANBgkqhkiG9w0BAQsFADCB +# iDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1Jl +# ZG1vbmQxHjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEyMDAGA1UEAxMp +# TWljcm9zb2Z0IFJvb3QgQ2VydGlmaWNhdGUgQXV0aG9yaXR5IDIwMTAwHhcNMjEw +# OTMwMTgyMjI1WhcNMzAwOTMwMTgzMjI1WjB8MQswCQYDVQQGEwJVUzETMBEGA1UE +# CBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9z +# b2Z0IENvcnBvcmF0aW9uMSYwJAYDVQQDEx1NaWNyb3NvZnQgVGltZS1TdGFtcCBQ +# Q0EgMjAxMDCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAOThpkzntHIh +# C3miy9ckeb0O1YLT/e6cBwfSqWxOdcjKNVf2AX9sSuDivbk+F2Az/1xPx2b3lVNx +# WuJ+Slr+uDZnhUYjDLWNE893MsAQGOhgfWpSg0S3po5GawcU88V29YZQ3MFEyHFc +# UTE3oAo4bo3t1w/YJlN8OWECesSq/XJprx2rrPY2vjUmZNqYO7oaezOtgFt+jBAc +# nVL+tuhiJdxqD89d9P6OU8/W7IVWTe/dvI2k45GPsjksUZzpcGkNyjYtcI4xyDUo +# veO0hyTD4MmPfrVUj9z6BVWYbWg7mka97aSueik3rMvrg0XnRm7KMtXAhjBcTyzi +# YrLNueKNiOSWrAFKu75xqRdbZ2De+JKRHh09/SDPc31BmkZ1zcRfNN0Sidb9pSB9 +# fvzZnkXftnIv231fgLrbqn427DZM9ituqBJR6L8FA6PRc6ZNN3SUHDSCD/AQ8rdH +# GO2n6Jl8P0zbr17C89XYcz1DTsEzOUyOArxCaC4Q6oRRRuLRvWoYWmEBc8pnol7X +# KHYC4jMYctenIPDC+hIK12NvDMk2ZItboKaDIV1fMHSRlJTYuVD5C4lh8zYGNRiE +# R9vcG9H9stQcxWv2XFJRXRLbJbqvUAV6bMURHXLvjflSxIUXk8A8FdsaN8cIFRg/ +# eKtFtvUeh17aj54WcmnGrnu3tz5q4i6tAgMBAAGjggHdMIIB2TASBgkrBgEEAYI3 +# FQEEBQIDAQABMCMGCSsGAQQBgjcVAgQWBBQqp1L+ZMSavoKRPEY1Kc8Q/y8E7jAd +# BgNVHQ4EFgQUn6cVXQBeYl2D9OXSZacbUzUZ6XIwXAYDVR0gBFUwUzBRBgwrBgEE +# AYI3TIN9AQEwQTA/BggrBgEFBQcCARYzaHR0cDovL3d3dy5taWNyb3NvZnQuY29t +# L3BraW9wcy9Eb2NzL1JlcG9zaXRvcnkuaHRtMBMGA1UdJQQMMAoGCCsGAQUFBwMI +# MBkGCSsGAQQBgjcUAgQMHgoAUwB1AGIAQwBBMAsGA1UdDwQEAwIBhjAPBgNVHRMB +# Af8EBTADAQH/MB8GA1UdIwQYMBaAFNX2VsuP6KJcYmjRPZSQW9fOmhjEMFYGA1Ud +# HwRPME0wS6BJoEeGRWh0dHA6Ly9jcmwubWljcm9zb2Z0LmNvbS9wa2kvY3JsL3By +# b2R1Y3RzL01pY1Jvb0NlckF1dF8yMDEwLTA2LTIzLmNybDBaBggrBgEFBQcBAQRO +# MEwwSgYIKwYBBQUHMAKGPmh0dHA6Ly93d3cubWljcm9zb2Z0LmNvbS9wa2kvY2Vy +# dHMvTWljUm9vQ2VyQXV0XzIwMTAtMDYtMjMuY3J0MA0GCSqGSIb3DQEBCwUAA4IC +# AQCdVX38Kq3hLB9nATEkW+Geckv8qW/qXBS2Pk5HZHixBpOXPTEztTnXwnE2P9pk +# bHzQdTltuw8x5MKP+2zRoZQYIu7pZmc6U03dmLq2HnjYNi6cqYJWAAOwBb6J6Gng +# ugnue99qb74py27YP0h1AdkY3m2CDPVtI1TkeFN1JFe53Z/zjj3G82jfZfakVqr3 +# lbYoVSfQJL1AoL8ZthISEV09J+BAljis9/kpicO8F7BUhUKz/AyeixmJ5/ALaoHC +# gRlCGVJ1ijbCHcNhcy4sa3tuPywJeBTpkbKpW99Jo3QMvOyRgNI95ko+ZjtPu4b6 +# MhrZlvSP9pEB9s7GdP32THJvEKt1MMU0sHrYUP4KWN1APMdUbZ1jdEgssU5HLcEU +# BHG/ZPkkvnNtyo4JvbMBV0lUZNlz138eW0QBjloZkWsNn6Qo3GcZKCS6OEuabvsh +# VGtqRRFHqfG3rsjoiV5PndLQTHa1V1QJsWkBRH58oWFsc/4Ku+xBZj1p/cvBQUl+ +# fpO+y/g75LcVv7TOPqUxUYS8vwLBgqJ7Fx0ViY1w/ue10CgaiQuPNtq6TPmb/wrp +# NPgkNWcr4A245oyZ1uEi6vAnQj0llOZ0dFtq0Z4+7X6gMTN9vMvpe784cETRkPHI +# qzqKOghif9lwY1NNje6CbaUFEMFxBmoQtB1VM1izoXBm8qGCAs4wggI3AgEBMIH4 +# oYHQpIHNMIHKMQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4G +# A1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSUw +# IwYDVQQLExxNaWNyb3NvZnQgQW1lcmljYSBPcGVyYXRpb25zMSYwJAYDVQQLEx1U +# aGFsZXMgVFNTIEVTTjoxMkJDLUUzQUUtNzRFQjElMCMGA1UEAxMcTWljcm9zb2Z0 +# IFRpbWUtU3RhbXAgU2VydmljZaIjCgEBMAcGBSsOAwIaAxUAG3F2jO4LEMVLwgKG +# XdYMN4FBgOCggYMwgYCkfjB8MQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGlu +# Z3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBv +# cmF0aW9uMSYwJAYDVQQDEx1NaWNyb3NvZnQgVGltZS1TdGFtcCBQQ0EgMjAxMDAN +# BgkqhkiG9w0BAQUFAAIFAOXvuD8wIhgPMjAyMjAzMzExMzE4NTVaGA8yMDIyMDQw +# MTEzMTg1NVowdzA9BgorBgEEAYRZCgQBMS8wLTAKAgUA5e+4PwIBADAKAgEAAgIP +# IwIB/zAHAgEAAgIRnzAKAgUA5fEJvwIBADA2BgorBgEEAYRZCgQCMSgwJjAMBgor +# BgEEAYRZCgMCoAowCAIBAAIDB6EgoQowCAIBAAIDAYagMA0GCSqGSIb3DQEBBQUA +# A4GBANc53MLryLt1FD+jkakQydkemUps4QiN8HJxJ36VPuc2XRhvcn0Fhp1Pi8Hk +# gg08sFJoJ2vT/9g5J39zdjQpnbNGMkfmEi+qT6hbGq0ta5rnt1wDG2pVMuMn7N2Q +# 8CytKi6ZynWVbiCNuQtxsuwdgM7bRwcf510Wwp7iQUeNjJZzMYIEDTCCBAkCAQEw +# gZMwfDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcT +# B1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEmMCQGA1UE +# AxMdTWljcm9zb2Z0IFRpbWUtU3RhbXAgUENBIDIwMTACEzMAAAGhAYVVmblUXYoA +# AQAAAaEwDQYJYIZIAWUDBAIBBQCgggFKMBoGCSqGSIb3DQEJAzENBgsqhkiG9w0B +# CRABBDAvBgkqhkiG9w0BCQQxIgQg7aLPwq2FhUC9oleuUeRc4uk9d+4UFLvls0ps +# 5tQU14wwgfoGCyqGSIb3DQEJEAIvMYHqMIHnMIHkMIG9BCDrCFTxOoGCaCCCjoRy +# Be1JSQrMJeCCTyErziiJ347QhDCBmDCBgKR+MHwxCzAJBgNVBAYTAlVTMRMwEQYD +# VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24xJjAkBgNVBAMTHU1pY3Jvc29mdCBUaW1lLVN0YW1w +# IFBDQSAyMDEwAhMzAAABoQGFVZm5VF2KAAEAAAGhMCIEIOKn52EgS+EFhqx/FxY8 +# xYD6qqUYqtVZ3iZ47g3sjJRaMA0GCSqGSIb3DQEBCwUABIICACJi4QGIi9yhn8uf +# NlWbdGQNP0UkTWxJRMnAe4eQUYbcHoOxPxguwy7r8VfTZOdKBxfy7/LKo5XGmAo2 +# hmZSsLHjtT0zzkZti2AFeCRmZ8DMVaGfR9sWBr0OwlRS3HMDigpWyI5jP/tD529k +# jh0/BYwKg2TGRk6ZmdFWXuQf0lVb/LytEUyFbziq4hoxhKc4IQ3oCcOm1xaVZzbe +# SgzPg3j4QfHAucYgfxJoIUP1lKTRclmUc2ERYmHchaUxeYIdiDHx5lpEdNsh0acm +# LgV307ncxLeN1Ih2E6By+Dknm8OppqVYOSvcjcjqHY+fU7ci/FuvyUVDQv6xe2ZS +# K6qCMCrPWtoOlE3ms+LE5kHVQ1JOs0v7mVVP8xfO+fkArk3RuUl/1gaGxi5Ljheg +# l+51jV5PMM4Vha9KoWfU2306ZLt/I1Rftq1sCOD5ysLnhTQuInQMRpfXlY/rvTPu +# 9jzQ4q4Ty7WPp004gh+9hLIm0s0nmZmM8jyTRUFrK1SfHglBOKgdrcuJfmEuPKxL +# foRg/LzuUjcXvdtO3oozIaVWsTxGx6laY2DkMPnqYaj/oBwla86bNyQT94YTTGWq +# 3mCwt0/H4E3Mn1OXLVIGO3NrzZwTFFN2uqRmcTQ0AKiXU3ar4b8F/ykpQOvTV6x/ +# U7Jz/JaISbEvO3mUarzheUPqVmWq +# SIG # End signature block diff --git a/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Az.Accounts.psm1 b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Az.Accounts.psm1 new file mode 100644 index 000000000000..67107181add7 --- /dev/null +++ b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Az.Accounts.psm1 @@ -0,0 +1,375 @@ +# +# Script module for module 'Az.Accounts' that is executed when 'Az.Accounts' is imported in a PowerShell session. +# +# Generated by: Microsoft Corporation +# +# Generated on: 03/31/2022 09:26:49 +# + +$PSDefaultParameterValues.Clear() +Set-StrictMode -Version Latest + +function Test-DotNet +{ + try + { + if ((Get-PSDrive 'HKLM' -ErrorAction Ignore) -and (-not (Get-ChildItem 'HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full\' -ErrorAction Stop | Get-ItemPropertyValue -ErrorAction Stop -Name Release | Where-Object { $_ -ge 461808 }))) + { + throw ".NET Framework versions lower than 4.7.2 are not supported in Az. Please upgrade to .NET Framework 4.7.2 or higher." + } + } + catch [System.Management.Automation.DriveNotFoundException] + { + Write-Verbose ".NET Framework version check failed." + } +} + +function Preload-Assembly { + param ( + [string] + $AssemblyDirectory + ) + if($PSEdition -eq 'Desktop' -and (Test-Path $AssemblyDirectory -ErrorAction Ignore)) + { + try + { + Get-ChildItem -ErrorAction Stop -Path $AssemblyDirectory -Filter "*.dll" | ForEach-Object { + try + { + Add-Type -Path $_.FullName -ErrorAction Ignore | Out-Null + } + catch { + Write-Verbose $_ + } + } + } + catch {} + } +} + +if ($true -and ($PSEdition -eq 'Desktop')) +{ + if ($PSVersionTable.PSVersion -lt [Version]'5.1') + { + throw "PowerShell versions lower than 5.1 are not supported in Az. Please upgrade to PowerShell 5.1 or higher." + } + + Test-DotNet +} + +if ($true -and ($PSEdition -eq 'Core')) +{ + if ($PSVersionTable.PSVersion -lt [Version]'6.2.4') + { + throw "Current Az version doesn't support PowerShell Core versions lower than 6.2.4. Please upgrade to PowerShell Core 6.2.4 or higher." + } + if ($PSVersionTable.PSVersion -lt [Version]'7.0.6') + { + Write-Warning "This version of Az.Accounts is only supported on Windows PowerShell 5.1 and PowerShell 7.0.6 or greater, open https://aka.ms/install-powershell to learn how to upgrade. For further information, go to https://aka.ms/azpslifecycle." + } +} + +if (Test-Path -Path "$PSScriptRoot\StartupScripts" -ErrorAction Ignore) +{ + Get-ChildItem "$PSScriptRoot\StartupScripts" -ErrorAction Stop | ForEach-Object { + . $_.FullName + } +} + +if (Get-Module AzureRM.profile -ErrorAction Ignore) +{ + Write-Warning ("AzureRM.Profile already loaded. Az and AzureRM modules cannot be imported in the same session or used in the same script or runbook. If you are running PowerShell in an environment you control you can use the 'Uninstall-AzureRm' cmdlet to remove all AzureRm modules from your machine. " + + "If you are running in Azure Automation, take care that none of your runbooks import both Az and AzureRM modules. More information can be found here: https://aka.ms/azps-migration-guide.") + throw ("AzureRM.Profile already loaded. Az and AzureRM modules cannot be imported in the same session or used in the same script or runbook. If you are running PowerShell in an environment you control you can use the 'Uninstall-AzureRm' cmdlet to remove all AzureRm modules from your machine. " + + "If you are running in Azure Automation, take care that none of your runbooks import both Az and AzureRM modules. More information can be found here: https://aka.ms/azps-migration-guide.") +} + +$preloadPath = (Join-Path $PSScriptRoot -ChildPath "PreloadAssemblies") +Preload-Assembly -AssemblyDirectory $preloadPath +$preloadPath = (Join-Path $PSScriptRoot -ChildPath "ModuleAlcAssemblies") +Preload-Assembly -AssemblyDirectory $preloadPath + +$netCorePath = (Join-Path $PSScriptRoot -ChildPath "NetCoreAssemblies") +if($PSEdition -eq 'Core' -and (Test-Path $netCorePath -ErrorAction Ignore)) +{ + try + { + $loadedAssemblies = ([System.AppDomain]::CurrentDomain.GetAssemblies() | ForEach-Object {New-Object -TypeName System.Reflection.AssemblyName -ArgumentList $_.FullName} ) + Get-ChildItem -ErrorAction Stop -Path $netCorePath -Filter "*.dll" | ForEach-Object { + $assemblyName = ([System.Reflection.AssemblyName]::GetAssemblyName($_.FullName)) + $matches = ($loadedAssemblies | Where-Object {$_.Name -eq $assemblyName.Name}) + if (-not $matches) + { + try + { + Add-Type -Path $_.FullName -ErrorAction Ignore | Out-Null + } + catch { + Write-Verbose $_ + } + } + } + } + catch {} +} + + +Import-Module (Join-Path -Path $PSScriptRoot -ChildPath Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll) + + +if (Test-Path -Path "$PSScriptRoot\PostImportScripts" -ErrorAction Ignore) +{ + Get-ChildItem "$PSScriptRoot\PostImportScripts" -ErrorAction Stop | ForEach-Object { + . $_.FullName + } +} + +$FilteredCommands = @() + +if ($Env:ACC_CLOUD -eq $null) +{ + $FilteredCommands | ForEach-Object { + + $existingDefault = $false + foreach ($key in $global:PSDefaultParameterValues.Keys) + { + if ($_ -like "$key") + { + $existingDefault = $true + } + } + + if (!$existingDefault) + { + $global:PSDefaultParameterValues.Add($_, + { + if ((Get-Command Get-AzContext -ErrorAction Ignore) -eq $null) + { + $context = Get-AzureRmContext + } + else + { + $context = Get-AzContext + } + if (($context -ne $null) -and $context.ExtendedProperties.ContainsKey("Default Resource Group")) { + $context.ExtendedProperties["Default Resource Group"] + } + }) + } + } +} + +# SIG # Begin signature block +# MIInugYJKoZIhvcNAQcCoIInqzCCJ6cCAQExDzANBglghkgBZQMEAgEFADB5Bgor +# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG +# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCBnXoRblwqGgp4a +# USzJaf5Wf+Tu+eUWmfecChJ7ENNasaCCDYEwggX/MIID56ADAgECAhMzAAACUosz +# qviV8znbAAAAAAJSMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD +# VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01pY3Jvc29mdCBDb2RlIFNpZ25p +# bmcgUENBIDIwMTEwHhcNMjEwOTAyMTgzMjU5WhcNMjIwOTAxMTgzMjU5WjB0MQsw +# CQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9u +# ZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMR4wHAYDVQQDExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB +# AQDQ5M+Ps/X7BNuv5B/0I6uoDwj0NJOo1KrVQqO7ggRXccklyTrWL4xMShjIou2I +# sbYnF67wXzVAq5Om4oe+LfzSDOzjcb6ms00gBo0OQaqwQ1BijyJ7NvDf80I1fW9O +# L76Kt0Wpc2zrGhzcHdb7upPrvxvSNNUvxK3sgw7YTt31410vpEp8yfBEl/hd8ZzA +# v47DCgJ5j1zm295s1RVZHNp6MoiQFVOECm4AwK2l28i+YER1JO4IplTH44uvzX9o +# RnJHaMvWzZEpozPy4jNO2DDqbcNs4zh7AWMhE1PWFVA+CHI/En5nASvCvLmuR/t8 +# q4bc8XR8QIZJQSp+2U6m2ldNAgMBAAGjggF+MIIBejAfBgNVHSUEGDAWBgorBgEE +# AYI3TAgBBggrBgEFBQcDAzAdBgNVHQ4EFgQUNZJaEUGL2Guwt7ZOAu4efEYXedEw +# UAYDVR0RBEkwR6RFMEMxKTAnBgNVBAsTIE1pY3Jvc29mdCBPcGVyYXRpb25zIFB1 +# ZXJ0byBSaWNvMRYwFAYDVQQFEw0yMzAwMTIrNDY3NTk3MB8GA1UdIwQYMBaAFEhu +# ZOVQBdOCqhc3NyK1bajKdQKVMFQGA1UdHwRNMEswSaBHoEWGQ2h0dHA6Ly93d3cu +# bWljcm9zb2Z0LmNvbS9wa2lvcHMvY3JsL01pY0NvZFNpZ1BDQTIwMTFfMjAxMS0w +# Ny0wOC5jcmwwYQYIKwYBBQUHAQEEVTBTMFEGCCsGAQUFBzAChkVodHRwOi8vd3d3 +# Lm1pY3Jvc29mdC5jb20vcGtpb3BzL2NlcnRzL01pY0NvZFNpZ1BDQTIwMTFfMjAx +# MS0wNy0wOC5jcnQwDAYDVR0TAQH/BAIwADANBgkqhkiG9w0BAQsFAAOCAgEAFkk3 +# uSxkTEBh1NtAl7BivIEsAWdgX1qZ+EdZMYbQKasY6IhSLXRMxF1B3OKdR9K/kccp +# kvNcGl8D7YyYS4mhCUMBR+VLrg3f8PUj38A9V5aiY2/Jok7WZFOAmjPRNNGnyeg7 +# l0lTiThFqE+2aOs6+heegqAdelGgNJKRHLWRuhGKuLIw5lkgx9Ky+QvZrn/Ddi8u +# TIgWKp+MGG8xY6PBvvjgt9jQShlnPrZ3UY8Bvwy6rynhXBaV0V0TTL0gEx7eh/K1 +# o8Miaru6s/7FyqOLeUS4vTHh9TgBL5DtxCYurXbSBVtL1Fj44+Od/6cmC9mmvrti +# yG709Y3Rd3YdJj2f3GJq7Y7KdWq0QYhatKhBeg4fxjhg0yut2g6aM1mxjNPrE48z +# 6HWCNGu9gMK5ZudldRw4a45Z06Aoktof0CqOyTErvq0YjoE4Xpa0+87T/PVUXNqf +# 7Y+qSU7+9LtLQuMYR4w3cSPjuNusvLf9gBnch5RqM7kaDtYWDgLyB42EfsxeMqwK +# WwA+TVi0HrWRqfSx2olbE56hJcEkMjOSKz3sRuupFCX3UroyYf52L+2iVTrda8XW +# esPG62Mnn3T8AuLfzeJFuAbfOSERx7IFZO92UPoXE1uEjL5skl1yTZB3MubgOA4F +# 8KoRNhviFAEST+nG8c8uIsbZeb08SeYQMqjVEmkwggd6MIIFYqADAgECAgphDpDS +# AAAAAAADMA0GCSqGSIb3DQEBCwUAMIGIMQswCQYDVQQGEwJVUzETMBEGA1UECBMK +# V2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0 +# IENvcnBvcmF0aW9uMTIwMAYDVQQDEylNaWNyb3NvZnQgUm9vdCBDZXJ0aWZpY2F0 +# ZSBBdXRob3JpdHkgMjAxMTAeFw0xMTA3MDgyMDU5MDlaFw0yNjA3MDgyMTA5MDla +# MH4xCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdS +# ZWRtb25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMT +# H01pY3Jvc29mdCBDb2RlIFNpZ25pbmcgUENBIDIwMTEwggIiMA0GCSqGSIb3DQEB +# AQUAA4ICDwAwggIKAoICAQCr8PpyEBwurdhuqoIQTTS68rZYIZ9CGypr6VpQqrgG +# OBoESbp/wwwe3TdrxhLYC/A4wpkGsMg51QEUMULTiQ15ZId+lGAkbK+eSZzpaF7S +# 35tTsgosw6/ZqSuuegmv15ZZymAaBelmdugyUiYSL+erCFDPs0S3XdjELgN1q2jz +# y23zOlyhFvRGuuA4ZKxuZDV4pqBjDy3TQJP4494HDdVceaVJKecNvqATd76UPe/7 +# 4ytaEB9NViiienLgEjq3SV7Y7e1DkYPZe7J7hhvZPrGMXeiJT4Qa8qEvWeSQOy2u +# M1jFtz7+MtOzAz2xsq+SOH7SnYAs9U5WkSE1JcM5bmR/U7qcD60ZI4TL9LoDho33 +# X/DQUr+MlIe8wCF0JV8YKLbMJyg4JZg5SjbPfLGSrhwjp6lm7GEfauEoSZ1fiOIl +# XdMhSz5SxLVXPyQD8NF6Wy/VI+NwXQ9RRnez+ADhvKwCgl/bwBWzvRvUVUvnOaEP +# 6SNJvBi4RHxF5MHDcnrgcuck379GmcXvwhxX24ON7E1JMKerjt/sW5+v/N2wZuLB +# l4F77dbtS+dJKacTKKanfWeA5opieF+yL4TXV5xcv3coKPHtbcMojyyPQDdPweGF +# RInECUzF1KVDL3SV9274eCBYLBNdYJWaPk8zhNqwiBfenk70lrC8RqBsmNLg1oiM +# CwIDAQABo4IB7TCCAekwEAYJKwYBBAGCNxUBBAMCAQAwHQYDVR0OBBYEFEhuZOVQ +# BdOCqhc3NyK1bajKdQKVMBkGCSsGAQQBgjcUAgQMHgoAUwB1AGIAQwBBMAsGA1Ud +# DwQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFHItOgIxkEO5FAVO +# 4eqnxzHRI4k0MFoGA1UdHwRTMFEwT6BNoEuGSWh0dHA6Ly9jcmwubWljcm9zb2Z0 +# LmNvbS9wa2kvY3JsL3Byb2R1Y3RzL01pY1Jvb0NlckF1dDIwMTFfMjAxMV8wM18y +# Mi5jcmwwXgYIKwYBBQUHAQEEUjBQME4GCCsGAQUFBzAChkJodHRwOi8vd3d3Lm1p +# Y3Jvc29mdC5jb20vcGtpL2NlcnRzL01pY1Jvb0NlckF1dDIwMTFfMjAxMV8wM18y +# Mi5jcnQwgZ8GA1UdIASBlzCBlDCBkQYJKwYBBAGCNy4DMIGDMD8GCCsGAQUFBwIB +# FjNodHRwOi8vd3d3Lm1pY3Jvc29mdC5jb20vcGtpb3BzL2RvY3MvcHJpbWFyeWNw +# cy5odG0wQAYIKwYBBQUHAgIwNB4yIB0ATABlAGcAYQBsAF8AcABvAGwAaQBjAHkA +# XwBzAHQAYQB0AGUAbQBlAG4AdAAuIB0wDQYJKoZIhvcNAQELBQADggIBAGfyhqWY +# 4FR5Gi7T2HRnIpsLlhHhY5KZQpZ90nkMkMFlXy4sPvjDctFtg/6+P+gKyju/R6mj +# 82nbY78iNaWXXWWEkH2LRlBV2AySfNIaSxzzPEKLUtCw/WvjPgcuKZvmPRul1LUd +# d5Q54ulkyUQ9eHoj8xN9ppB0g430yyYCRirCihC7pKkFDJvtaPpoLpWgKj8qa1hJ +# Yx8JaW5amJbkg/TAj/NGK978O9C9Ne9uJa7lryft0N3zDq+ZKJeYTQ49C/IIidYf +# wzIY4vDFLc5bnrRJOQrGCsLGra7lstnbFYhRRVg4MnEnGn+x9Cf43iw6IGmYslmJ +# aG5vp7d0w0AFBqYBKig+gj8TTWYLwLNN9eGPfxxvFX1Fp3blQCplo8NdUmKGwx1j +# NpeG39rz+PIWoZon4c2ll9DuXWNB41sHnIc+BncG0QaxdR8UvmFhtfDcxhsEvt9B +# xw4o7t5lL+yX9qFcltgA1qFGvVnzl6UJS0gQmYAf0AApxbGbpT9Fdx41xtKiop96 +# eiL6SJUfq/tHI4D1nvi/a7dLl+LrdXga7Oo3mXkYS//WsyNodeav+vyL6wuA6mk7 +# r/ww7QRMjt/fdW1jkT3RnVZOT7+AVyKheBEyIXrvQQqxP/uozKRdwaGIm1dxVk5I +# RcBCyZt2WwqASGv9eZ/BvW1taslScxMNelDNMYIZjzCCGYsCAQEwgZUwfjELMAkG +# A1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQx +# HjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEoMCYGA1UEAxMfTWljcm9z +# b2Z0IENvZGUgU2lnbmluZyBQQ0EgMjAxMQITMwAAAlKLM6r4lfM52wAAAAACUjAN +# BglghkgBZQMEAgEFAKCBrjAZBgkqhkiG9w0BCQMxDAYKKwYBBAGCNwIBBDAcBgor +# BgEEAYI3AgELMQ4wDAYKKwYBBAGCNwIBFTAvBgkqhkiG9w0BCQQxIgQgqwm8h/dw +# FED0y+xGCWSaD8Fc1mZMgPkryh2zfSvZwxIwQgYKKwYBBAGCNwIBDDE0MDKgFIAS +# AE0AaQBjAHIAbwBzAG8AZgB0oRqAGGh0dHA6Ly93d3cubWljcm9zb2Z0LmNvbTAN +# BgkqhkiG9w0BAQEFAASCAQBvXNrKAkE7o84rJI6+XFvnA65dqlWCZBeFhG6YGpde +# Nom1mPdcfauabmxLKg7N5GG1FBWXuYDu1aEyDhiXzPG6ET+/ikXTGfN9J0D9g5Wx +# a2SeSIJ0XfsllBKKwOKl4OhoY3y5Kjjk08Cw75aE5BR8Ux0FWciN8n+nztakOyN9 +# tf7I5nmgbrHvJC5az2N9aR5DejRvjPDcNCnRkepz3nnA+FQNFbXaKqjgJz9oRBgA +# K2SAZDQnnK3B3MAv7qJX6GyeUhen7kwXZC0OV2RjyPRC+f8SiV/OF/ZsaFe4nXps +# RJqg5f5sUjCHFS5g8yK9Zy6D7EZKJJA4yk8YgRpdxOiuoYIXGTCCFxUGCisGAQQB +# gjcDAwExghcFMIIXAQYJKoZIhvcNAQcCoIIW8jCCFu4CAQMxDzANBglghkgBZQME +# AgEFADCCAVkGCyqGSIb3DQEJEAEEoIIBSASCAUQwggFAAgEBBgorBgEEAYRZCgMB +# MDEwDQYJYIZIAWUDBAIBBQAEIAn/Ph2Du7oUABZfi9Z4pWXxedNUse800UpCJBeG +# +id6AgZiF5hUHpsYEzIwMjIwMzMxMTAwMDEyLjU2OFowBIACAfSggdikgdUwgdIx +# CzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRt +# b25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xLTArBgNVBAsTJE1p +# Y3Jvc29mdCBJcmVsYW5kIE9wZXJhdGlvbnMgTGltaXRlZDEmMCQGA1UECxMdVGhh +# bGVzIFRTUyBFU046RkM0MS00QkQ0LUQyMjAxJTAjBgNVBAMTHE1pY3Jvc29mdCBU +# aW1lLVN0YW1wIFNlcnZpY2WgghFoMIIHFDCCBPygAwIBAgITMwAAAY5Z20YAqBCU +# zAABAAABjjANBgkqhkiG9w0BAQsFADB8MQswCQYDVQQGEwJVUzETMBEGA1UECBMK +# V2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0 +# IENvcnBvcmF0aW9uMSYwJAYDVQQDEx1NaWNyb3NvZnQgVGltZS1TdGFtcCBQQ0Eg +# MjAxMDAeFw0yMTEwMjgxOTI3NDVaFw0yMzAxMjYxOTI3NDVaMIHSMQswCQYDVQQG +# EwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwG +# A1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMS0wKwYDVQQLEyRNaWNyb3NvZnQg +# SXJlbGFuZCBPcGVyYXRpb25zIExpbWl0ZWQxJjAkBgNVBAsTHVRoYWxlcyBUU1Mg +# RVNOOkZDNDEtNEJENC1EMjIwMSUwIwYDVQQDExxNaWNyb3NvZnQgVGltZS1TdGFt +# cCBTZXJ2aWNlMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAqiMCq6OM +# zLa5wrtcf7Bf9f1WXW9kpqbOBzgPJvaGLrZG7twgwqTRWf1FkjpJKBOG5QPIRy7a +# 6IFVAy0W+tBaFX4In4DbBf2tGubyY9+hRU+hRewPJH5CYOvpPh77FfGM63+OlwRX +# p5YER6tC0WRKn3mryWpt4CwADuGv0LD2QjnhhgtRVidsiDnn9+aLjMuNapUhstGq +# Cr7JcQZt0ZrPUHW/TqTJymeU1eqgNorEbTed6UQyLaTVAmhXNQXDChfa526nW7RQ +# 7L4tXX9Lc0oguiCSkPlu5drNA6NM8z+UXQOAHxVfIQXmi+Y3SV2hr2dcxby9nlTz +# Yvf4ZDr5Wpcwt7tTdRIJibXHsXWMKrmOziliGDToLx34a/ctZE4NOLnlrKQWN9ZG +# +Ox5zRarK1EhShahM0uQNhb6BJjp3+c0eNzMFJ2qLZqDp2/3Yl5Q+4k+MDHLTipP +# 6VBdxcdVfd4mgrVTx3afO5KNfgMngGGfhSawGraRW28EhrLOspmIxii92E7vjncJ +# 2tcjhLCjBArVpPh3cZG5g3ZVy5iiAaoDaswpNgnMFAK5Un1reK+MFhPi9iMnvUPw +# tTDDJt5YED5DAT3mBUxp5QH3t7RhZwAJNLWLtpTeGF7ub81sSKYv2ardazAe9XLS +# 10tV2oOPrcniGJzlXW7VPvxqQNxe8lCDA20CAwEAAaOCATYwggEyMB0GA1UdDgQW +# BBTsQfkz9gT44N/5G8vNHayep+aV5DAfBgNVHSMEGDAWgBSfpxVdAF5iXYP05dJl +# pxtTNRnpcjBfBgNVHR8EWDBWMFSgUqBQhk5odHRwOi8vd3d3Lm1pY3Jvc29mdC5j +# b20vcGtpb3BzL2NybC9NaWNyb3NvZnQlMjBUaW1lLVN0YW1wJTIwUENBJTIwMjAx +# MCgxKS5jcmwwbAYIKwYBBQUHAQEEYDBeMFwGCCsGAQUFBzAChlBodHRwOi8vd3d3 +# Lm1pY3Jvc29mdC5jb20vcGtpb3BzL2NlcnRzL01pY3Jvc29mdCUyMFRpbWUtU3Rh +# bXAlMjBQQ0ElMjAyMDEwKDEpLmNydDAMBgNVHRMBAf8EAjAAMBMGA1UdJQQMMAoG +# CCsGAQUFBwMIMA0GCSqGSIb3DQEBCwUAA4ICAQA1UK9xzIeTlKhSbLn0bekR5gYh +# 6bB1XQpluCqCA15skZ37UilaFJw8+GklDLzlNhSP2mOiOzVyCq8kkpqnfUc01ZaB +# ezQxg77qevj2iMyg39YJfeiCIhxYOFugwepYrPO8MlB/oue/VhIiDb1eNYTlPSmv +# 3palsgtkrb0oo0F0uWmX4EQVGKRo0UENtZetVIxa0J9DpUdjQWPeEh9cEM+RgE26 +# 5w5WAVb+WNx0iWiF4iTbCmrWaVEOX92dNqBm9bT1U7nGwN5CygpNAgEaYnrTMx1N +# 4AjxObACDN5DdvGlu/O0DfMWVc6qk6iKDFC6WpXQSkMlrlXII/Nhp+0+noU6tfEp +# HKLt7fYm9of5i/QomcCwo/ekiOCjYktp393ovoC1O2uLtbLnMVlE5raBLBNSbINZ +# 6QLxiA41lXnVVLIzDihUL8MU9CMvG4sdbhk2FX8zvrsP5PeBIw1faenMZuz0V3UX +# CtU5Okx5fmioWiiLZSCi1ljaxX+BEwQiinCi+vE59bTYI5FbuR8tDuGLiVu/JSpV +# FXrzWMP2Kn11sCLAGEjqJYUmO1tRY29Kd7HcIj2niSB0PQOCjYlnCnywnDinqS1C +# XvRsisjVlS1Rp4Tmuks+pGxiMGzF58zcb+hoFKyONuL3b+tgxTAz3sF3BVX9uk9M +# 5F+OEoeyLyGfLekNAjCCB3EwggVZoAMCAQICEzMAAAAVxedrngKbSZkAAAAAABUw +# DQYJKoZIhvcNAQELBQAwgYgxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5n +# dG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9y +# YXRpb24xMjAwBgNVBAMTKU1pY3Jvc29mdCBSb290IENlcnRpZmljYXRlIEF1dGhv +# cml0eSAyMDEwMB4XDTIxMDkzMDE4MjIyNVoXDTMwMDkzMDE4MzIyNVowfDELMAkG +# A1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQx +# HjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEmMCQGA1UEAxMdTWljcm9z +# b2Z0IFRpbWUtU3RhbXAgUENBIDIwMTAwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAw +# ggIKAoICAQDk4aZM57RyIQt5osvXJHm9DtWC0/3unAcH0qlsTnXIyjVX9gF/bErg +# 4r25PhdgM/9cT8dm95VTcVrifkpa/rg2Z4VGIwy1jRPPdzLAEBjoYH1qUoNEt6aO +# RmsHFPPFdvWGUNzBRMhxXFExN6AKOG6N7dcP2CZTfDlhAnrEqv1yaa8dq6z2Nr41 +# JmTamDu6GnszrYBbfowQHJ1S/rboYiXcag/PXfT+jlPP1uyFVk3v3byNpOORj7I5 +# LFGc6XBpDco2LXCOMcg1KL3jtIckw+DJj361VI/c+gVVmG1oO5pGve2krnopN6zL +# 64NF50ZuyjLVwIYwXE8s4mKyzbnijYjklqwBSru+cakXW2dg3viSkR4dPf0gz3N9 +# QZpGdc3EXzTdEonW/aUgfX782Z5F37ZyL9t9X4C626p+Nuw2TPYrbqgSUei/BQOj +# 0XOmTTd0lBw0gg/wEPK3Rxjtp+iZfD9M269ewvPV2HM9Q07BMzlMjgK8QmguEOqE +# UUbi0b1qGFphAXPKZ6Je1yh2AuIzGHLXpyDwwvoSCtdjbwzJNmSLW6CmgyFdXzB0 +# kZSU2LlQ+QuJYfM2BjUYhEfb3BvR/bLUHMVr9lxSUV0S2yW6r1AFemzFER1y7435 +# UsSFF5PAPBXbGjfHCBUYP3irRbb1Hode2o+eFnJpxq57t7c+auIurQIDAQABo4IB +# 3TCCAdkwEgYJKwYBBAGCNxUBBAUCAwEAATAjBgkrBgEEAYI3FQIEFgQUKqdS/mTE +# mr6CkTxGNSnPEP8vBO4wHQYDVR0OBBYEFJ+nFV0AXmJdg/Tl0mWnG1M1GelyMFwG +# A1UdIARVMFMwUQYMKwYBBAGCN0yDfQEBMEEwPwYIKwYBBQUHAgEWM2h0dHA6Ly93 +# d3cubWljcm9zb2Z0LmNvbS9wa2lvcHMvRG9jcy9SZXBvc2l0b3J5Lmh0bTATBgNV +# HSUEDDAKBggrBgEFBQcDCDAZBgkrBgEEAYI3FAIEDB4KAFMAdQBiAEMAQTALBgNV +# HQ8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAfBgNVHSMEGDAWgBTV9lbLj+iiXGJo +# 0T2UkFvXzpoYxDBWBgNVHR8ETzBNMEugSaBHhkVodHRwOi8vY3JsLm1pY3Jvc29m +# dC5jb20vcGtpL2NybC9wcm9kdWN0cy9NaWNSb29DZXJBdXRfMjAxMC0wNi0yMy5j +# cmwwWgYIKwYBBQUHAQEETjBMMEoGCCsGAQUFBzAChj5odHRwOi8vd3d3Lm1pY3Jv +# c29mdC5jb20vcGtpL2NlcnRzL01pY1Jvb0NlckF1dF8yMDEwLTA2LTIzLmNydDAN +# BgkqhkiG9w0BAQsFAAOCAgEAnVV9/Cqt4SwfZwExJFvhnnJL/Klv6lwUtj5OR2R4 +# sQaTlz0xM7U518JxNj/aZGx80HU5bbsPMeTCj/ts0aGUGCLu6WZnOlNN3Zi6th54 +# 2DYunKmCVgADsAW+iehp4LoJ7nvfam++Kctu2D9IdQHZGN5tggz1bSNU5HhTdSRX +# ud2f8449xvNo32X2pFaq95W2KFUn0CS9QKC/GbYSEhFdPSfgQJY4rPf5KYnDvBew +# VIVCs/wMnosZiefwC2qBwoEZQhlSdYo2wh3DYXMuLGt7bj8sCXgU6ZGyqVvfSaN0 +# DLzskYDSPeZKPmY7T7uG+jIa2Zb0j/aRAfbOxnT99kxybxCrdTDFNLB62FD+Cljd +# QDzHVG2dY3RILLFORy3BFARxv2T5JL5zbcqOCb2zAVdJVGTZc9d/HltEAY5aGZFr +# DZ+kKNxnGSgkujhLmm77IVRrakURR6nxt67I6IleT53S0Ex2tVdUCbFpAUR+fKFh +# bHP+CrvsQWY9af3LwUFJfn6Tvsv4O+S3Fb+0zj6lMVGEvL8CwYKiexcdFYmNcP7n +# tdAoGokLjzbaukz5m/8K6TT4JDVnK+ANuOaMmdbhIurwJ0I9JZTmdHRbatGePu1+ +# oDEzfbzL6Xu/OHBE0ZDxyKs6ijoIYn/ZcGNTTY3ugm2lBRDBcQZqELQdVTNYs6Fw +# ZvKhggLXMIICQAIBATCCAQChgdikgdUwgdIxCzAJBgNVBAYTAlVTMRMwEQYDVQQI +# EwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNyb3Nv +# ZnQgQ29ycG9yYXRpb24xLTArBgNVBAsTJE1pY3Jvc29mdCBJcmVsYW5kIE9wZXJh +# dGlvbnMgTGltaXRlZDEmMCQGA1UECxMdVGhhbGVzIFRTUyBFU046RkM0MS00QkQ0 +# LUQyMjAxJTAjBgNVBAMTHE1pY3Jvc29mdCBUaW1lLVN0YW1wIFNlcnZpY2WiIwoB +# ATAHBgUrDgMCGgMVAD1iK+pPThHqgpa5xsPmiYruWVuMoIGDMIGApH4wfDELMAkG +# A1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQx +# HjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEmMCQGA1UEAxMdTWljcm9z +# b2Z0IFRpbWUtU3RhbXAgUENBIDIwMTAwDQYJKoZIhvcNAQEFBQACBQDl75AOMCIY +# DzIwMjIwMzMxMTAyNzI2WhgPMjAyMjA0MDExMDI3MjZaMHcwPQYKKwYBBAGEWQoE +# ATEvMC0wCgIFAOXvkA4CAQAwCgIBAAICAYUCAf8wBwIBAAICEiowCgIFAOXw4Y4C +# AQAwNgYKKwYBBAGEWQoEAjEoMCYwDAYKKwYBBAGEWQoDAqAKMAgCAQACAwehIKEK +# MAgCAQACAwGGoDANBgkqhkiG9w0BAQUFAAOBgQCCQ+gyinUAzBfQG0tdRLTKoWAz +# 1F9XL8HUl1+DL/nO5fnfNT2fIwdNtkcnjXkY7J89nDVJ5orczCc/Jjd8FWrGsZYF +# R7jTDpEnctly2mdeOC54DPn8NfB2rKnTAZSMNZUA5+qwXYtBJ9/L+zBcWbLJGn17 +# Xdsy6ogPG2mqiNeJETGCBA0wggQJAgEBMIGTMHwxCzAJBgNVBAYTAlVTMRMwEQYD +# VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24xJjAkBgNVBAMTHU1pY3Jvc29mdCBUaW1lLVN0YW1w +# IFBDQSAyMDEwAhMzAAABjlnbRgCoEJTMAAEAAAGOMA0GCWCGSAFlAwQCAQUAoIIB +# SjAaBgkqhkiG9w0BCQMxDQYLKoZIhvcNAQkQAQQwLwYJKoZIhvcNAQkEMSIEIBdm +# /Yr/algho7Se4sS1u0RA1CsQ3avLfVkP9cSuIl4vMIH6BgsqhkiG9w0BCRACLzGB +# 6jCB5zCB5DCBvQQgvQWPITvigaUuV5+f/lWs3BXZwJ/l1mf+yelu5nXmxCUwgZgw +# gYCkfjB8MQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UE +# BxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSYwJAYD +# VQQDEx1NaWNyb3NvZnQgVGltZS1TdGFtcCBQQ0EgMjAxMAITMwAAAY5Z20YAqBCU +# zAABAAABjjAiBCDFYh4a5uyi794y1CHlKx3P8nxZO/8fomUMsnns7kvKmzANBgkq +# hkiG9w0BAQsFAASCAgCphAx90HI/vzWSwneRSNg3gV826YqxCNSVkzMDcu1Rkayq +# 3FhK466ELhIxyI9EL3hLCS/BIQYKH8AiVU85P07pmaLls+bUM2CPt3II0oZYY5T8 +# BN/MyqZ0vUS6QvNX8ZT8A82R5/meSt8qS8+8ppG1XumAYmdqv7vriD8ENBrhIyus +# 3Wjwt0rS2kovNj+6g3xMJBU+LnP+qzNv72aEr2LvKkU8/abYiNXN1FGlJPqHYrF/ +# zumVFsNkJMjJrlgRFlo/EROGu3iUiI37hM7mTm77aYrWoMbKrl/4nKfMpjR4KQqL +# Mhi9Cb1c11cugxCFnoc1IA6kQ+Xg1fYUchz5UmgzDTpwic3FVGGRlTv4Wf9PMjjj +# heZyL7BFkHZCpr5qpwpu/ZvpCSQpsP4Aa07qY5ffgRu/te0ip3gkzL3Ur7zNqf60 +# Dw9If1ECZOcx+GMgIHd0t+48+hsE4RrmvMvWrEBz2B/BJEOfrIQEClhFczLjDd4G +# nhh4y/vSlqbUUupH+/oJRtpla+ZQbAxsg8jTPsiGG7hmvSaNfV7+SgwCjO1HB/On +# DkzS+edyqivrfkuwjFYecbLcl9e9Pr3SPFvelW5kXiQw2KyWFrD0aznq7YT0x/Na +# /XaZDuLepRVe7YnvH4Ky7yk58zG3QYNy5EJ6Pf3ClNsX4BBAJsUrWMxicmpUDg== +# SIG # End signature block diff --git a/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Azure.Core.dll b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Azure.Core.dll new file mode 100644 index 000000000000..32652d6de4d0 Binary files /dev/null and b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Azure.Core.dll differ diff --git a/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Azure.Identity.dll b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Azure.Identity.dll new file mode 100644 index 000000000000..0d214db71cad Binary files /dev/null and b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Azure.Identity.dll differ diff --git a/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Microsoft.Bcl.AsyncInterfaces.dll b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Microsoft.Bcl.AsyncInterfaces.dll new file mode 100644 index 000000000000..f2955edfecb7 Binary files /dev/null and b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Microsoft.Bcl.AsyncInterfaces.dll differ diff --git a/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Microsoft.Identity.Client.Extensions.Msal.dll b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Microsoft.Identity.Client.Extensions.Msal.dll new file mode 100644 index 000000000000..81b736cc09da Binary files /dev/null and b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Microsoft.Identity.Client.Extensions.Msal.dll differ diff --git a/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Microsoft.Identity.Client.dll b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Microsoft.Identity.Client.dll new file mode 100644 index 000000000000..f656e5e42360 Binary files /dev/null and b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Microsoft.Identity.Client.dll differ diff --git a/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/System.Memory.Data.dll b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/System.Memory.Data.dll new file mode 100644 index 000000000000..6f2a3e0ad07f Binary files /dev/null and b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/System.Memory.Data.dll differ diff --git a/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/System.Text.Json.dll b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/System.Text.Json.dll new file mode 100644 index 000000000000..fe2154a3bf3a Binary files /dev/null and b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/System.Text.Json.dll differ diff --git a/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Hyak.Common.dll b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Hyak.Common.dll new file mode 100644 index 000000000000..18a53248894f Binary files /dev/null and b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Hyak.Common.dll differ diff --git a/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.ApplicationInsights.dll b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.ApplicationInsights.dll new file mode 100644 index 000000000000..92d06762d6a5 Binary files /dev/null and b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.ApplicationInsights.dll differ diff --git a/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.Common.dll b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.Common.dll new file mode 100644 index 000000000000..1c9d8e2a0ef5 Binary files /dev/null and b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.Common.dll differ diff --git a/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.Abstractions.dll b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.Abstractions.dll new file mode 100644 index 000000000000..8e791611cc1a Binary files /dev/null and b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.Abstractions.dll differ diff --git a/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.ResourceManager.deps.json b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.ResourceManager.deps.json new file mode 100644 index 000000000000..dde9337e5748 --- /dev/null +++ b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.ResourceManager.deps.json @@ -0,0 +1,2309 @@ +{ + "runtimeTarget": { + "name": ".NETStandard,Version=v2.0/", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETStandard,Version=v2.0": {}, + ".NETStandard,Version=v2.0/": { + "Microsoft.Azure.PowerShell.Authentication.ResourceManager/1.0.0": { + "dependencies": { + "Azure.Core": "1.22.0", + "Hyak.Common": "1.2.2", + "Microsoft.ApplicationInsights": "2.12.0", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Azure.PowerShell.Authentication": "1.0.0", + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Aks": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Authorization": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Compute": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Graph.Rbac": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.KeyVault": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Monitor": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Network": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.PolicyInsights": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.ResourceManager": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Storage.Management": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Websites": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common.Share": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Storage": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Strategies": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "NETStandard.Library": "2.0.3", + "Newtonsoft.Json": "10.0.3", + "PowerShellStandard.Library": "5.1.0" + }, + "runtime": { + "Microsoft.Azure.PowerShell.Authentication.ResourceManager.dll": {} + } + }, + "Azure.Core/1.22.0": { + "dependencies": { + "Microsoft.Bcl.AsyncInterfaces": "1.1.1", + "System.Diagnostics.DiagnosticSource": "4.6.0", + "System.Memory.Data": "1.0.2", + "System.Numerics.Vectors": "4.5.0", + "System.Text.Encodings.Web": "4.7.2", + "System.Text.Json": "4.7.2", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "runtime": { + "lib/netstandard2.0/Azure.Core.dll": { + "assemblyVersion": "1.22.0.0", + "fileVersion": "1.2200.22.6212" + } + } + }, + "Azure.Identity/1.5.0": { + "dependencies": { + "Azure.Core": "1.22.0", + "Microsoft.Identity.Client": "4.30.1", + "Microsoft.Identity.Client.Extensions.Msal": "2.18.4", + "System.Memory": "4.5.4", + "System.Security.Cryptography.ProtectedData": "4.5.0", + "System.Text.Json": "4.7.2", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "runtime": { + "lib/netstandard2.0/Azure.Identity.dll": { + "assemblyVersion": "1.5.0.0", + "fileVersion": "1.500.21.51401" + } + } + }, + "Hyak.Common/1.2.2": { + "dependencies": { + "NETStandard.Library": "2.0.3", + "Newtonsoft.Json": "10.0.3", + "System.Reflection": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.4/Hyak.Common.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.2.2.0" + } + } + }, + "Microsoft.ApplicationInsights/2.12.0": { + "dependencies": { + "System.Diagnostics.DiagnosticSource": "4.6.0", + "System.Runtime.InteropServices": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.ApplicationInsights.dll": { + "assemblyVersion": "2.12.0.21496", + "fileVersion": "2.12.0.21496" + } + } + }, + "Microsoft.Azure.Common/2.2.1": { + "dependencies": { + "Hyak.Common": "1.2.2", + "NETStandard.Library": "2.0.3" + }, + "runtime": { + "lib/netstandard1.4/Microsoft.Azure.Common.dll": { + "assemblyVersion": "2.0.0.0", + "fileVersion": "2.2.1.0" + } + } + }, + "Microsoft.Azure.PowerShell.Authentication.Abstractions/1.3.57-preview": { + "dependencies": { + "Hyak.Common": "1.2.2", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Authentication.Abstractions.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Aks/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Aks.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Authorization/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Authorization.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Compute/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Compute.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Graph.Rbac/1.3.57-preview": { + "dependencies": { + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.ResourceManager": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Graph.Rbac.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.KeyVault/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3", + "System.Collections.NonGeneric": "4.3.0", + "System.Collections.Specialized": "4.3.0", + "System.Reflection": "4.3.0", + "System.Security.SecureString": "4.3.0", + "System.Xml.XmlDocument": "4.3.0", + "System.Xml.XmlSerializer": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.KeyVault.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Monitor/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3", + "System.Collections.Specialized": "4.3.0", + "System.Reflection": "4.3.0", + "System.Security.SecureString": "4.3.0", + "System.Xml.XmlDocument": "4.3.0", + "System.Xml.XmlSerializer": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Monitor.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Network/1.3.57-preview": { + "dependencies": { + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Network.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.PolicyInsights/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.PolicyInsights.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.ResourceManager/1.3.57-preview": { + "dependencies": { + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.ResourceManager.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Storage.Management/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "System.Collections.NonGeneric": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Storage.Management.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Websites/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3", + "System.Collections.Specialized": "4.3.0", + "System.Reflection": "4.3.0", + "System.Security.SecureString": "4.3.0", + "System.Xml.XmlDocument": "4.3.0", + "System.Xml.XmlSerializer": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Websites.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Common/1.3.57-preview": { + "dependencies": { + "Hyak.Common": "1.2.2", + "Microsoft.ApplicationInsights": "2.12.0", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common.Share": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Common.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Common.Share/1.3.57-preview": { + "dependencies": { + "Hyak.Common": "1.2.2", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Common.Share.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Storage/1.3.57-preview": { + "dependencies": { + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Storage.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Strategies/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Strategies.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Bcl.AsyncInterfaces/1.1.1": { + "dependencies": { + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Bcl.AsyncInterfaces.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "4.700.20.21406" + } + } + }, + "Microsoft.CSharp/4.5.0": { + "runtime": { + "lib/netstandard2.0/Microsoft.CSharp.dll": { + "assemblyVersion": "4.0.4.0", + "fileVersion": "4.6.26515.6" + } + } + }, + "Microsoft.Identity.Client/4.30.1": { + "dependencies": { + "Microsoft.CSharp": "4.5.0", + "NETStandard.Library": "2.0.3", + "System.ComponentModel.TypeConverter": "4.3.0", + "System.Diagnostics.Process": "4.3.0", + "System.Dynamic.Runtime": "4.3.0", + "System.Private.Uri": "4.3.2", + "System.Runtime.Serialization.Formatters": "4.3.0", + "System.Runtime.Serialization.Json": "4.3.0", + "System.Runtime.Serialization.Primitives": "4.3.0", + "System.Security.Cryptography.X509Certificates": "4.3.0", + "System.Security.SecureString": "4.3.0", + "System.Xml.XDocument": "4.3.0", + "System.Xml.XmlDocument": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/Microsoft.Identity.Client.dll": { + "assemblyVersion": "4.30.1.0", + "fileVersion": "4.30.1.0" + } + } + }, + "Microsoft.Identity.Client.Extensions.Msal/2.18.4": { + "dependencies": { + "Microsoft.Identity.Client": "4.30.1", + "System.Security.Cryptography.ProtectedData": "4.5.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Identity.Client.Extensions.Msal.dll": { + "assemblyVersion": "2.18.4.0", + "fileVersion": "2.18.4.0" + } + } + }, + "Microsoft.NETCore.Platforms/1.1.1": {}, + "Microsoft.NETCore.Targets/1.1.3": {}, + "Microsoft.Rest.ClientRuntime/2.3.23": { + "dependencies": { + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Rest.ClientRuntime.dll": { + "assemblyVersion": "2.0.0.0", + "fileVersion": "2.3.23.0" + } + } + }, + "Microsoft.Rest.ClientRuntime.Azure/3.3.19": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Rest.ClientRuntime.Azure.dll": { + "assemblyVersion": "3.0.0.0", + "fileVersion": "3.3.18.0" + } + } + }, + "Microsoft.Win32.Primitives/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "Microsoft.Win32.Registry/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Collections": "4.3.0", + "System.Globalization": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0" + } + }, + "NETStandard.Library/2.0.3": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1" + } + }, + "Newtonsoft.Json/10.0.3": { + "dependencies": { + "Microsoft.CSharp": "4.5.0", + "NETStandard.Library": "2.0.3", + "System.ComponentModel.TypeConverter": "4.3.0", + "System.Runtime.Serialization.Formatters": "4.3.0", + "System.Runtime.Serialization.Primitives": "4.3.0", + "System.Xml.XmlDocument": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/Newtonsoft.Json.dll": { + "assemblyVersion": "10.0.0.0", + "fileVersion": "10.0.3.21018" + } + } + }, + "PowerShellStandard.Library/5.1.0": {}, + "runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.native.System/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3" + } + }, + "runtime.native.System.Net.Http/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3" + } + }, + "runtime.native.System.Security.Cryptography.Apple/4.3.0": { + "dependencies": { + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple": "4.3.0" + } + }, + "runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "dependencies": { + "runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" + } + }, + "runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple/4.3.0": {}, + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "System.Buffers/4.5.1": { + "runtime": { + "lib/netstandard2.0/System.Buffers.dll": { + "assemblyVersion": "4.0.3.0", + "fileVersion": "4.6.28619.1" + } + } + }, + "System.Collections/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Collections.Concurrent/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Diagnostics.Tracing": "4.3.0", + "System.Globalization": "4.3.0", + "System.Reflection": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0", + "System.Threading.Tasks": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Collections.Concurrent.dll": { + "assemblyVersion": "4.0.13.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Collections.NonGeneric/4.3.0": { + "dependencies": { + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Collections.NonGeneric.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Collections.Specialized/4.3.0": { + "dependencies": { + "System.Collections.NonGeneric": "4.3.0", + "System.Globalization": "4.3.0", + "System.Globalization.Extensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Collections.Specialized.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.ComponentModel/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.ComponentModel.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.ComponentModel.Primitives/4.3.0": { + "dependencies": { + "System.ComponentModel": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.0/System.ComponentModel.Primitives.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.ComponentModel.TypeConverter/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Collections.NonGeneric": "4.3.0", + "System.Collections.Specialized": "4.3.0", + "System.ComponentModel": "4.3.0", + "System.ComponentModel.Primitives": "4.3.0", + "System.Globalization": "4.3.0", + "System.Linq": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Extensions": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.5/System.ComponentModel.TypeConverter.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Diagnostics.Debug/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Diagnostics.DiagnosticSource/4.6.0": { + "dependencies": { + "System.Memory": "4.5.4" + }, + "runtime": { + "lib/netstandard1.3/System.Diagnostics.DiagnosticSource.dll": { + "assemblyVersion": "4.0.4.0", + "fileVersion": "4.700.19.46214" + } + } + }, + "System.Diagnostics.Process/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.Win32.Primitives": "4.3.0", + "Microsoft.Win32.Registry": "4.3.0", + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.IO.FileSystem": "4.3.0", + "System.IO.FileSystem.Primitives": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Text.Encoding.Extensions": "4.3.0", + "System.Threading": "4.3.0", + "System.Threading.Tasks": "4.3.0", + "System.Threading.Thread": "4.3.0", + "System.Threading.ThreadPool": "4.3.0", + "runtime.native.System": "4.3.0" + } + }, + "System.Diagnostics.Tools/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Diagnostics.Tracing/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Dynamic.Runtime/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Linq": "4.3.0", + "System.Linq.Expressions": "4.3.0", + "System.ObjectModel": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Dynamic.Runtime.dll": { + "assemblyVersion": "4.0.12.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Globalization/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Globalization.Calendars/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Globalization": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Globalization.Extensions/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Globalization": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.InteropServices": "4.3.0" + } + }, + "System.IO/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading.Tasks": "4.3.0" + } + }, + "System.IO.FileSystem/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.IO": "4.3.0", + "System.IO.FileSystem.Primitives": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading.Tasks": "4.3.0" + } + }, + "System.IO.FileSystem.Primitives/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.IO.FileSystem.Primitives.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Linq/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0" + }, + "runtime": { + "lib/netstandard1.6/System.Linq.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Linq.Expressions/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Linq": "4.3.0", + "System.ObjectModel": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Emit.Lightweight": "4.3.0", + "System.Reflection.Extensions": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.6/System.Linq.Expressions.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Memory/4.5.4": { + "dependencies": { + "System.Buffers": "4.5.1", + "System.Numerics.Vectors": "4.5.0", + "System.Runtime.CompilerServices.Unsafe": "4.7.1" + }, + "runtime": { + "lib/netstandard2.0/System.Memory.dll": { + "assemblyVersion": "4.0.1.1", + "fileVersion": "4.6.28619.1" + } + } + }, + "System.Memory.Data/1.0.2": { + "dependencies": { + "System.Text.Encodings.Web": "4.7.2", + "System.Text.Json": "4.7.2" + }, + "runtime": { + "lib/netstandard2.0/System.Memory.Data.dll": { + "assemblyVersion": "1.0.2.0", + "fileVersion": "1.0.221.20802" + } + } + }, + "System.Numerics.Vectors/4.5.0": { + "runtime": { + "lib/netstandard2.0/System.Numerics.Vectors.dll": { + "assemblyVersion": "4.1.4.0", + "fileVersion": "4.6.26515.6" + } + } + }, + "System.ObjectModel/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.ObjectModel.dll": { + "assemblyVersion": "4.0.13.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Private.DataContractSerialization/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Collections.Concurrent": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Linq": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Emit.Lightweight": "4.3.0", + "System.Reflection.Extensions": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Serialization.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Text.Encoding.Extensions": "4.3.0", + "System.Text.RegularExpressions": "4.3.0", + "System.Threading": "4.3.0", + "System.Threading.Tasks": "4.3.0", + "System.Xml.ReaderWriter": "4.3.0", + "System.Xml.XDocument": "4.3.0", + "System.Xml.XmlDocument": "4.3.0", + "System.Xml.XmlSerializer": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Private.DataContractSerialization.dll": { + "assemblyVersion": "4.1.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Private.Uri/4.3.2": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3" + } + }, + "System.Reflection/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.IO": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Reflection.Emit/4.3.0": { + "dependencies": { + "System.IO": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Reflection.Emit.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Reflection.Emit.ILGeneration/4.3.0": { + "dependencies": { + "System.Reflection": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Reflection.Emit.ILGeneration.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Reflection.Emit.Lightweight/4.3.0": { + "dependencies": { + "System.Reflection": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Reflection.Emit.Lightweight.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Reflection.Extensions/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Reflection": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Reflection.Primitives/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Reflection.TypeExtensions/4.3.0": { + "dependencies": { + "System.Reflection": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.5/System.Reflection.TypeExtensions.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Resources.ResourceManager/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Globalization": "4.3.0", + "System.Reflection": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Runtime/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3" + } + }, + "System.Runtime.CompilerServices.Unsafe/4.7.1": { + "runtime": { + "lib/netstandard2.0/System.Runtime.CompilerServices.Unsafe.dll": { + "assemblyVersion": "4.0.6.0", + "fileVersion": "4.700.20.12001" + } + } + }, + "System.Runtime.Extensions/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Runtime.Handles/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Runtime.InteropServices/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Reflection": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Handles": "4.3.0" + } + }, + "System.Runtime.Numerics/4.3.0": { + "dependencies": { + "System.Globalization": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Runtime.Numerics.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Runtime.Serialization.Formatters/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Reflection": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Serialization.Primitives": "4.3.0" + }, + "runtime": { + "lib/netstandard1.4/System.Runtime.Serialization.Formatters.dll": { + "assemblyVersion": "4.0.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Runtime.Serialization.Json/4.3.0": { + "dependencies": { + "System.IO": "4.3.0", + "System.Private.DataContractSerialization": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Runtime.Serialization.Json.dll": { + "assemblyVersion": "4.0.3.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Runtime.Serialization.Primitives/4.3.0": { + "dependencies": { + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Runtime.Serialization.Primitives.dll": { + "assemblyVersion": "4.1.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Security.Cryptography.Algorithms/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Collections": "4.3.0", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Runtime.Numerics": "4.3.0", + "System.Security.Cryptography.Encoding": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "runtime.native.System.Security.Cryptography.Apple": "4.3.0", + "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" + } + }, + "System.Security.Cryptography.Cng/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Security.Cryptography.Algorithms": "4.3.0", + "System.Security.Cryptography.Encoding": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0" + } + }, + "System.Security.Cryptography.Csp/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.IO": "4.3.0", + "System.Reflection": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Security.Cryptography.Algorithms": "4.3.0", + "System.Security.Cryptography.Encoding": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading": "4.3.0" + } + }, + "System.Security.Cryptography.Encoding/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Collections": "4.3.0", + "System.Collections.Concurrent": "4.3.0", + "System.Linq": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" + } + }, + "System.Security.Cryptography.OpenSsl/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Runtime.Numerics": "4.3.0", + "System.Security.Cryptography.Algorithms": "4.3.0", + "System.Security.Cryptography.Encoding": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" + }, + "runtime": { + "lib/netstandard1.6/System.Security.Cryptography.OpenSsl.dll": { + "assemblyVersion": "4.0.0.0", + "fileVersion": "1.0.24212.1" + } + } + }, + "System.Security.Cryptography.Primitives/4.3.0": { + "dependencies": { + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Threading": "4.3.0", + "System.Threading.Tasks": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Security.Cryptography.Primitives.dll": { + "assemblyVersion": "4.0.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Security.Cryptography.ProtectedData/4.5.0": { + "dependencies": { + "System.Memory": "4.5.4" + }, + "runtime": { + "lib/netstandard2.0/System.Security.Cryptography.ProtectedData.dll": { + "assemblyVersion": "4.0.3.0", + "fileVersion": "4.6.26515.6" + } + } + }, + "System.Security.Cryptography.X509Certificates/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.Globalization.Calendars": "4.3.0", + "System.IO": "4.3.0", + "System.IO.FileSystem": "4.3.0", + "System.IO.FileSystem.Primitives": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Runtime.Numerics": "4.3.0", + "System.Security.Cryptography.Algorithms": "4.3.0", + "System.Security.Cryptography.Cng": "4.3.0", + "System.Security.Cryptography.Csp": "4.3.0", + "System.Security.Cryptography.Encoding": "4.3.0", + "System.Security.Cryptography.OpenSsl": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading": "4.3.0", + "runtime.native.System": "4.3.0", + "runtime.native.System.Net.Http": "4.3.0", + "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" + } + }, + "System.Security.SecureString/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading": "4.3.0" + } + }, + "System.Text.Encoding/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Text.Encoding.Extensions/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0", + "System.Text.Encoding": "4.3.0" + } + }, + "System.Text.Encodings.Web/4.7.2": { + "dependencies": { + "System.Buffers": "4.5.1", + "System.Memory": "4.5.4" + }, + "runtime": { + "lib/netstandard2.0/System.Text.Encodings.Web.dll": { + "assemblyVersion": "4.0.5.1", + "fileVersion": "4.700.21.11602" + } + } + }, + "System.Text.Json/4.7.2": { + "dependencies": { + "Microsoft.Bcl.AsyncInterfaces": "1.1.1", + "System.Buffers": "4.5.1", + "System.Memory": "4.5.4", + "System.Numerics.Vectors": "4.5.0", + "System.Runtime.CompilerServices.Unsafe": "4.7.1", + "System.Text.Encodings.Web": "4.7.2", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "runtime": { + "lib/netstandard2.0/System.Text.Json.dll": { + "assemblyVersion": "4.0.1.2", + "fileVersion": "4.700.20.21406" + } + } + }, + "System.Text.RegularExpressions/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Globalization": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.6/System.Text.RegularExpressions.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Threading/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0", + "System.Threading.Tasks": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Threading.dll": { + "assemblyVersion": "4.0.12.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Threading.Tasks/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Threading.Tasks.Extensions/4.5.4": { + "dependencies": { + "System.Runtime.CompilerServices.Unsafe": "4.7.1" + }, + "runtime": { + "lib/netstandard2.0/System.Threading.Tasks.Extensions.dll": { + "assemblyVersion": "4.2.0.1", + "fileVersion": "4.6.28619.1" + } + } + }, + "System.Threading.Thread/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Threading.Thread.dll": { + "assemblyVersion": "4.0.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Threading.ThreadPool/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0", + "System.Runtime.Handles": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Threading.ThreadPool.dll": { + "assemblyVersion": "4.0.11.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Xml.ReaderWriter/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.IO.FileSystem": "4.3.0", + "System.IO.FileSystem.Primitives": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Text.Encoding.Extensions": "4.3.0", + "System.Text.RegularExpressions": "4.3.0", + "System.Threading.Tasks": "4.3.0", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "runtime": { + "lib/netstandard1.3/System.Xml.ReaderWriter.dll": { + "assemblyVersion": "4.1.0.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Xml.XDocument/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Diagnostics.Tools": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Reflection": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading": "4.3.0", + "System.Xml.ReaderWriter": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Xml.XDocument.dll": { + "assemblyVersion": "4.0.12.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Xml.XmlDocument/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading": "4.3.0", + "System.Xml.ReaderWriter": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Xml.XmlDocument.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Xml.XmlSerializer/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Linq": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Extensions": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Text.RegularExpressions": "4.3.0", + "System.Threading": "4.3.0", + "System.Xml.ReaderWriter": "4.3.0", + "System.Xml.XmlDocument": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Xml.XmlSerializer.dll": { + "assemblyVersion": "4.0.12.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "Microsoft.Azure.PowerShell.Authentication/1.0.0": { + "dependencies": { + "Azure.Core": "1.22.0", + "Azure.Identity": "1.5.0", + "Hyak.Common": "1.2.2", + "Microsoft.ApplicationInsights": "2.12.0", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Aks": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Authorization": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Compute": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Graph.Rbac": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.KeyVault": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Monitor": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Network": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.PolicyInsights": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.ResourceManager": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Storage.Management": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Websites": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common.Share": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Storage": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Strategies": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "Microsoft.Azure.PowerShell.Authentication.dll": {} + } + } + } + }, + "libraries": { + "Microsoft.Azure.PowerShell.Authentication.ResourceManager/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Azure.Core/1.22.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ze/xRCHSSDe5TIk5vBDbVrauW1EN7UIbnBvIBfMH8KSt/I9+/7yPAjTBDgNBk0IwG6WBV+BBHp4IUtS/PGAQwQ==", + "path": "azure.core/1.22.0", + "hashPath": "azure.core.1.22.0.nupkg.sha512" + }, + "Azure.Identity/1.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-VfF88dqrgKXZNOS/y4XrX/jmIfP3pkY+hBUzBNpoKml1nR+QshX6XlXWyToLtWV80TDQ1CmUVCJksktDg5+j1w==", + "path": "azure.identity/1.5.0", + "hashPath": "azure.identity.1.5.0.nupkg.sha512" + }, + "Hyak.Common/1.2.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-uZpnFn48nSQwHcO0/GSBZ7ExaO0sTXKv8KariXXEWLaB4Q3AeQoprYG4WpKsCT0ByW3YffETivgc5rcH5RRDvQ==", + "path": "hyak.common/1.2.2", + "hashPath": "hyak.common.1.2.2.nupkg.sha512" + }, + "Microsoft.ApplicationInsights/2.12.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-4vZcVaxywAzfLm5mAc2/llaZQTzbCqu9KirxxI/t49AkZH5Qxf7JxuAMUuv2/6JEdOOkGDzpvdrrIlf6LkFGcg==", + "path": "microsoft.applicationinsights/2.12.0", + "hashPath": "microsoft.applicationinsights.2.12.0.nupkg.sha512" + }, + "Microsoft.Azure.Common/2.2.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-abzRooh4ACKjzAKxRB6r+SHKW3d+IrLcgtVG81D+3kQU/OMjAZS1oDp9CDalhSbmxa84u0MHM5N+AKeTtKPoiw==", + "path": "microsoft.azure.common/2.2.1", + "hashPath": "microsoft.azure.common.2.2.1.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Authentication.Abstractions/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-bKDPidNeqBpTDikPnIuoMoGd26pD2PNE41cut0ASwL5exJwLNggYO55U+f/cJkgjCUMR8i5nqnlfpGHSS1I0vw==", + "path": "microsoft.azure.powershell.authentication.abstractions/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.authentication.abstractions.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Aks/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-sUGkvOvpqlEK5zdZ7HWaou3GY5bnlNrE0LuZ137+TsNfgx2E3+0Ika3a02i/9+niDDf60xj4LaNOYDSuK5zdJA==", + "path": "microsoft.azure.powershell.clients.aks/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.aks.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Authorization/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Q760F40/qfas2Al+GQhhE4gJt768pQPxlCjqrjjkukgVsq+X/M8IqpCeBzbRTiiyerhcjJoyNxqlGuZpUhqGxw==", + "path": "microsoft.azure.powershell.clients.authorization/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.authorization.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Compute/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-1fcsBdYMmEJPMPN8EAgJkaJ2WxxTKH3VcLECYdL2cfg2bgN8CKbbjSvarrXEezhyduE+LdYnL0e8Pigsnaj55Q==", + "path": "microsoft.azure.powershell.clients.compute/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.compute.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Graph.Rbac/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-BIMthJ1x2vQAN3iWChnNj8BfgrXvKXn+n06E0/h2MNurMXbAOn5eiPIfE8bnj2BO99uSh1ns09yEgOTPJIvZBQ==", + "path": "microsoft.azure.powershell.clients.graph.rbac/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.graph.rbac.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.KeyVault/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-MfvwM8ABj/EswmYu0Bf/8kyAO6kUv2zYSihVn384SVmypomVKUu69GN0VXKbmGaovPI8v3H41Ldp7DqbPRun5A==", + "path": "microsoft.azure.powershell.clients.keyvault/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.keyvault.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Monitor/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-UyCKG5BWVjYFRtH2JNx6f4KdccaSqww2y0OE2PYgib8VhLqkoPr/BQg6vKzaGsghLIerZ/egQ7ntPPw3PCtS3w==", + "path": "microsoft.azure.powershell.clients.monitor/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.monitor.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Network/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-YAAHxw+zzvkGNWAi668NSoTR+V/7vf+gRhu1oFa1O1/f2NGpz5XuqPrQyAPrri64hKqB/k3OMrM7sjlIv16dAg==", + "path": "microsoft.azure.powershell.clients.network/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.network.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.PolicyInsights/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-urRIwRVzzOwpk8HhKq/b785DiL/arnmGUHbN4HvRN6ZsBkE1PU431YwgUlofb9pfB3buLcl0XJFRPLBJ0yZJUw==", + "path": "microsoft.azure.powershell.clients.policyinsights/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.policyinsights.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.ResourceManager/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-juWnd63Z2Sp+6bvtOPOF0Gj1v2AfpxXcuyodd9+U7euBro2G7Yfo2UHmHo/uaYyQUbM3HaXJPvse7BLDKjhe6w==", + "path": "microsoft.azure.powershell.clients.resourcemanager/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.resourcemanager.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Storage.Management/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HPpTWIlN+5ALqJssL7+6BD/vYrWi3eWKQ3QpWYjCFk5c9HVLTNpP+M2dq9jbsxLsZj+5Pt6gC4FIS22Q13Uhag==", + "path": "microsoft.azure.powershell.clients.storage.management/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.storage.management.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Websites/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-b5yBD9FrY02r0kdNNgZ+uU0/QsW3AtmnCE/x1mUG5j8ka/V04AYUo+sDokQBzu+vnK6Y6OrVDtyWjmnKTDHpWA==", + "path": "microsoft.azure.powershell.clients.websites/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.websites.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Common/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-9jZYZ9LKbx16r69y7cO9d7bDjpE0/HgeBU386Y/O6q05VRaq2wAsB2rbQ9AjxcPGHfwS0+2US/RImSSqjVABRQ==", + "path": "microsoft.azure.powershell.common/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.common.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Common.Share/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-4mJSjnwZVLQYWhP47eDzdt0yaLIf2I4pqaEIqcfAjkjdbKpnCXCnJUEFRId061yuKpq1LtfBZkHDRi68I5CJxg==", + "path": "microsoft.azure.powershell.common.share/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.common.share.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Storage/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-fObXEcuhk1JUoQ0fiCV4nK4NJWqvsfsKCzapF7SFEQ87X6AasL6m5KGT8JQSnHmc849xxxaixPTxyWaf9BBlpw==", + "path": "microsoft.azure.powershell.storage/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.storage.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Strategies/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HwyxUwDHCmY6Zdxg2xpFC9Gqmu92Xr0cAr4ElWYwz8Z7PE9uYVkTpKMIKd7oIJJgsIANTfqEU1HKoeI3FXPLqw==", + "path": "microsoft.azure.powershell.strategies/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.strategies.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Bcl.AsyncInterfaces/1.1.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-yuvf07qFWFqtK3P/MRkEKLhn5r2UbSpVueRziSqj0yJQIKFwG1pq9mOayK3zE5qZCTs0CbrwL9M6R8VwqyGy2w==", + "path": "microsoft.bcl.asyncinterfaces/1.1.1", + "hashPath": "microsoft.bcl.asyncinterfaces.1.1.1.nupkg.sha512" + }, + "Microsoft.CSharp/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-kaj6Wb4qoMuH3HySFJhxwQfe8R/sJsNJnANrvv8WdFPMoNbKY5htfNscv+LHCu5ipz+49m2e+WQXpLXr9XYemQ==", + "path": "microsoft.csharp/4.5.0", + "hashPath": "microsoft.csharp.4.5.0.nupkg.sha512" + }, + "Microsoft.Identity.Client/4.30.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-xk8tJeGfB2yD3+d7a0DXyV7/HYyEG10IofUHYHoPYKmDbroi/j9t1BqSHgbq1nARDjg7m8Ki6e21AyNU7e/R4Q==", + "path": "microsoft.identity.client/4.30.1", + "hashPath": "microsoft.identity.client.4.30.1.nupkg.sha512" + }, + "Microsoft.Identity.Client.Extensions.Msal/2.18.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HpG4oLwhQsy0ce7OWq9iDdLtJKOvKRStIKoSEOeBMKuohfuOWNDyhg8fMAJkpG/kFeoe4J329fiMHcJmmB+FPw==", + "path": "microsoft.identity.client.extensions.msal/2.18.4", + "hashPath": "microsoft.identity.client.extensions.msal.2.18.4.nupkg.sha512" + }, + "Microsoft.NETCore.Platforms/1.1.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-TMBuzAHpTenGbGgk0SMTwyEkyijY/Eae4ZGsFNYJvAr/LDn1ku3Etp3FPxChmDp5HHF3kzJuoaa08N0xjqAJfQ==", + "path": "microsoft.netcore.platforms/1.1.1", + "hashPath": "microsoft.netcore.platforms.1.1.1.nupkg.sha512" + }, + "Microsoft.NETCore.Targets/1.1.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3Wrmi0kJDzClwAC+iBdUBpEKmEle8FQNsCs77fkiOIw/9oYA07bL1EZNX0kQ2OMN3xpwvl0vAtOCYY3ndDNlhQ==", + "path": "microsoft.netcore.targets/1.1.3", + "hashPath": "microsoft.netcore.targets.1.1.3.nupkg.sha512" + }, + "Microsoft.Rest.ClientRuntime/2.3.23": { + "type": "package", + "serviceable": true, + "sha512": "sha512-92kNTi1N7zI5wwI2ZXswBRnk61OUYnuYJXrlgOhes5IsAqGmgw9DPGmhUzeY8OaZ8TTrQdDzvgXFnbCHwLzSVA==", + "path": "microsoft.rest.clientruntime/2.3.23", + "hashPath": "microsoft.rest.clientruntime.2.3.23.nupkg.sha512" + }, + "Microsoft.Rest.ClientRuntime.Azure/3.3.19": { + "type": "package", + "serviceable": true, + "sha512": "sha512-+NVBWvRXNwaAPTZUxjUlQggsrf3X0GbiRoxYfgc3kG9E55ZxZxvZPT3nIfC4DNqzGSXUEvmLbckdXgBBzGdUaA==", + "path": "microsoft.rest.clientruntime.azure/3.3.19", + "hashPath": "microsoft.rest.clientruntime.azure.3.3.19.nupkg.sha512" + }, + "Microsoft.Win32.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-9ZQKCWxH7Ijp9BfahvL2Zyf1cJIk8XYLF6Yjzr2yi0b2cOut/HQ31qf1ThHAgCc3WiZMdnWcfJCgN82/0UunxA==", + "path": "microsoft.win32.primitives/4.3.0", + "hashPath": "microsoft.win32.primitives.4.3.0.nupkg.sha512" + }, + "Microsoft.Win32.Registry/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Lw1/VwLH1yxz6SfFEjVRCN0pnflLEsWgnV4qsdJ512/HhTwnKXUG+zDQ4yTO3K/EJQemGoNaBHX5InISNKTzUQ==", + "path": "microsoft.win32.registry/4.3.0", + "hashPath": "microsoft.win32.registry.4.3.0.nupkg.sha512" + }, + "NETStandard.Library/2.0.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-st47PosZSHrjECdjeIzZQbzivYBJFv6P2nv4cj2ypdI204DO+vZ7l5raGMiX4eXMJ53RfOIg+/s4DHVZ54Nu2A==", + "path": "netstandard.library/2.0.3", + "hashPath": "netstandard.library.2.0.3.nupkg.sha512" + }, + "Newtonsoft.Json/10.0.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-hSXaFmh7hNCuEoC4XNY5DrRkLDzYHqPx/Ik23R4J86Z7PE/Y6YidhG602dFVdLBRSdG6xp9NabH3dXpcoxWvww==", + "path": "newtonsoft.json/10.0.3", + "hashPath": "newtonsoft.json.10.0.3.nupkg.sha512" + }, + "PowerShellStandard.Library/5.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-iYaRvQsM1fow9h3uEmio+2m2VXfulgI16AYHaTZ8Sf7erGe27Qc8w/h6QL5UPuwv1aXR40QfzMEwcCeiYJp2cw==", + "path": "powershellstandard.library/5.1.0", + "hashPath": "powershellstandard.library.5.1.0.nupkg.sha512" + }, + "runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HdSSp5MnJSsg08KMfZThpuLPJpPwE5hBXvHwoKWosyHHfe8Mh5WKT0ylEOf6yNzX6Ngjxe4Whkafh5q7Ymac4Q==", + "path": "runtime.debian.8-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.debian.8-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-+yH1a49wJMy8Zt4yx5RhJrxO/DBDByAiCzNwiETI+1S4mPdCu0OY4djdciC7Vssk0l22wQaDLrXxXkp+3+7bVA==", + "path": "runtime.fedora.23-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.fedora.23-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-c3YNH1GQJbfIPJeCnr4avseugSqPrxwIqzthYyZDN6EuOyNOzq+y2KSUfRcXauya1sF4foESTgwM5e1A8arAKw==", + "path": "runtime.fedora.24-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.fedora.24-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.native.System/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-c/qWt2LieNZIj1jGnVNsE2Kl23Ya2aSTBuXMD6V7k9KWr6l16Tqdwq+hJScEpWER9753NWC8h96PaVNY5Ld7Jw==", + "path": "runtime.native.system/4.3.0", + "hashPath": "runtime.native.system.4.3.0.nupkg.sha512" + }, + "runtime.native.System.Net.Http/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ZVuZJqnnegJhd2k/PtAbbIcZ3aZeITq3sj06oKfMBSfphW3HDmk/t4ObvbOk/JA/swGR0LNqMksAh/f7gpTROg==", + "path": "runtime.native.system.net.http/4.3.0", + "hashPath": "runtime.native.system.net.http.4.3.0.nupkg.sha512" + }, + "runtime.native.System.Security.Cryptography.Apple/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-DloMk88juo0OuOWr56QG7MNchmafTLYWvABy36izkrLI5VledI0rq28KGs1i9wbpeT9NPQrx/wTf8U2vazqQ3Q==", + "path": "runtime.native.system.security.cryptography.apple/4.3.0", + "hashPath": "runtime.native.system.security.cryptography.apple.4.3.0.nupkg.sha512" + }, + "runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-NS1U+700m4KFRHR5o4vo9DSlTmlCKu/u7dtE5sUHVIPB+xpXxYQvgBgA6wEIeCz6Yfn0Z52/72WYsToCEPJnrw==", + "path": "runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-b3pthNgxxFcD+Pc0WSEoC0+md3MyhRS6aCEeenvNE3Fdw1HyJ18ZhRFVJJzIeR/O/jpxPboB805Ho0T3Ul7w8A==", + "path": "runtime.opensuse.13.2-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.opensuse.13.2-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-KeLz4HClKf+nFS7p/6Fi/CqyLXh81FpiGzcmuS8DGi9lUqSnZ6Es23/gv2O+1XVGfrbNmviF7CckBpavkBoIFQ==", + "path": "runtime.opensuse.42.1-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.opensuse.42.1-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-kVXCuMTrTlxq4XOOMAysuNwsXWpYeboGddNGpIgNSZmv1b6r/s/DPk0fYMB7Q5Qo4bY68o48jt4T4y5BVecbCQ==", + "path": "runtime.osx.10.10-x64.runtime.native.system.security.cryptography.apple/4.3.0", + "hashPath": "runtime.osx.10.10-x64.runtime.native.system.security.cryptography.apple.4.3.0.nupkg.sha512" + }, + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-X7IdhILzr4ROXd8mI1BUCQMSHSQwelUlBjF1JyTKCjXaOGn2fB4EKBxQbCK2VjO3WaWIdlXZL3W6TiIVnrhX4g==", + "path": "runtime.osx.10.10-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.osx.10.10-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-nyFNiCk/r+VOiIqreLix8yN+q3Wga9+SE8BCgkf+2BwEKiNx6DyvFjCgkfV743/grxv8jHJ8gUK4XEQw7yzRYg==", + "path": "runtime.rhel.7-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.rhel.7-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ytoewC6wGorL7KoCAvRfsgoJPJbNq+64k2SqW6JcOAebWsFUvCCYgfzQMrnpvPiEl4OrblUlhF2ji+Q1+SVLrQ==", + "path": "runtime.ubuntu.14.04-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.ubuntu.14.04-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-I8bKw2I8k58Wx7fMKQJn2R8lamboCAiHfHeV/pS65ScKWMMI0+wJkLYlEKvgW1D/XvSl/221clBoR2q9QNNM7A==", + "path": "runtime.ubuntu.16.04-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.ubuntu.16.04-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-VB5cn/7OzUfzdnC8tqAIMQciVLiq2epm2NrAm1E9OjNRyG4lVhfR61SMcLizejzQP8R8Uf/0l5qOIbUEi+RdEg==", + "path": "runtime.ubuntu.16.10-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.ubuntu.16.10-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "System.Buffers/4.5.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg==", + "path": "system.buffers/4.5.1", + "hashPath": "system.buffers.4.5.1.nupkg.sha512" + }, + "System.Collections/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3Dcj85/TBdVpL5Zr+gEEBUuFe2icOnLalmEh9hfck1PTYbbyWuZgh4fmm2ysCLTrqLQw6t3TgTyJ+VLp+Qb+Lw==", + "path": "system.collections/4.3.0", + "hashPath": "system.collections.4.3.0.nupkg.sha512" + }, + "System.Collections.Concurrent/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ztl69Xp0Y/UXCL+3v3tEU+lIy+bvjKNUmopn1wep/a291pVPK7dxBd6T7WnlQqRog+d1a/hSsgRsmFnIBKTPLQ==", + "path": "system.collections.concurrent/4.3.0", + "hashPath": "system.collections.concurrent.4.3.0.nupkg.sha512" + }, + "System.Collections.NonGeneric/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-prtjIEMhGUnQq6RnPEYLpFt8AtLbp9yq2zxOSrY7KJJZrw25Fi97IzBqY7iqssbM61Ek5b8f3MG/sG1N2sN5KA==", + "path": "system.collections.nongeneric/4.3.0", + "hashPath": "system.collections.nongeneric.4.3.0.nupkg.sha512" + }, + "System.Collections.Specialized/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Epx8PoVZR0iuOnJJDzp7pWvdfMMOAvpUo95pC4ScH2mJuXkKA2Y4aR3cG9qt2klHgSons1WFh4kcGW7cSXvrxg==", + "path": "system.collections.specialized/4.3.0", + "hashPath": "system.collections.specialized.4.3.0.nupkg.sha512" + }, + "System.ComponentModel/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-VyGn1jGRZVfxnh8EdvDCi71v3bMXrsu8aYJOwoV7SNDLVhiEqwP86pPMyRGsDsxhXAm2b3o9OIqeETfN5qfezw==", + "path": "system.componentmodel/4.3.0", + "hashPath": "system.componentmodel.4.3.0.nupkg.sha512" + }, + "System.ComponentModel.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-j8GUkCpM8V4d4vhLIIoBLGey2Z5bCkMVNjEZseyAlm4n5arcsJOeI3zkUP+zvZgzsbLTYh4lYeP/ZD/gdIAPrw==", + "path": "system.componentmodel.primitives/4.3.0", + "hashPath": "system.componentmodel.primitives.4.3.0.nupkg.sha512" + }, + "System.ComponentModel.TypeConverter/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-16pQ6P+EdhcXzPiEK4kbA953Fu0MNG2ovxTZU81/qsCd1zPRsKc3uif5NgvllCY598k6bI0KUyKW8fanlfaDQg==", + "path": "system.componentmodel.typeconverter/4.3.0", + "hashPath": "system.componentmodel.typeconverter.4.3.0.nupkg.sha512" + }, + "System.Diagnostics.Debug/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ZUhUOdqmaG5Jk3Xdb8xi5kIyQYAA4PnTNlHx1mu9ZY3qv4ELIdKbnL/akbGaKi2RnNUWaZsAs31rvzFdewTj2g==", + "path": "system.diagnostics.debug/4.3.0", + "hashPath": "system.diagnostics.debug.4.3.0.nupkg.sha512" + }, + "System.Diagnostics.DiagnosticSource/4.6.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-mbBgoR0rRfl2uimsZ2avZY8g7Xnh1Mza0rJZLPcxqiMWlkGukjmRkuMJ/er+AhQuiRIh80CR/Hpeztr80seV5g==", + "path": "system.diagnostics.diagnosticsource/4.6.0", + "hashPath": "system.diagnostics.diagnosticsource.4.6.0.nupkg.sha512" + }, + "System.Diagnostics.Process/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-J0wOX07+QASQblsfxmIMFc9Iq7KTXYL3zs2G/Xc704Ylv3NpuVdo6gij6V3PGiptTxqsK0K7CdXenRvKUnkA2g==", + "path": "system.diagnostics.process/4.3.0", + "hashPath": "system.diagnostics.process.4.3.0.nupkg.sha512" + }, + "System.Diagnostics.Tools/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-UUvkJfSYJMM6x527dJg2VyWPSRqIVB0Z7dbjHst1zmwTXz5CcXSYJFWRpuigfbO1Lf7yfZiIaEUesfnl/g5EyA==", + "path": "system.diagnostics.tools/4.3.0", + "hashPath": "system.diagnostics.tools.4.3.0.nupkg.sha512" + }, + "System.Diagnostics.Tracing/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-rswfv0f/Cqkh78rA5S8eN8Neocz234+emGCtTF3lxPY96F+mmmUen6tbn0glN6PMvlKQb9bPAY5e9u7fgPTkKw==", + "path": "system.diagnostics.tracing/4.3.0", + "hashPath": "system.diagnostics.tracing.4.3.0.nupkg.sha512" + }, + "System.Dynamic.Runtime/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-SNVi1E/vfWUAs/WYKhE9+qlS6KqK0YVhnlT0HQtr8pMIA8YX3lwy3uPMownDwdYISBdmAF/2holEIldVp85Wag==", + "path": "system.dynamic.runtime/4.3.0", + "hashPath": "system.dynamic.runtime.4.3.0.nupkg.sha512" + }, + "System.Globalization/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-kYdVd2f2PAdFGblzFswE4hkNANJBKRmsfa2X5LG2AcWE1c7/4t0pYae1L8vfZ5xvE2nK/R9JprtToA61OSHWIg==", + "path": "system.globalization/4.3.0", + "hashPath": "system.globalization.4.3.0.nupkg.sha512" + }, + "System.Globalization.Calendars/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-GUlBtdOWT4LTV3I+9/PJW+56AnnChTaOqqTLFtdmype/L500M2LIyXgmtd9X2P2VOkmJd5c67H5SaC2QcL1bFA==", + "path": "system.globalization.calendars/4.3.0", + "hashPath": "system.globalization.calendars.4.3.0.nupkg.sha512" + }, + "System.Globalization.Extensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-FhKmdR6MPG+pxow6wGtNAWdZh7noIOpdD5TwQ3CprzgIE1bBBoim0vbR1+AWsWjQmU7zXHgQo4TWSP6lCeiWcQ==", + "path": "system.globalization.extensions/4.3.0", + "hashPath": "system.globalization.extensions.4.3.0.nupkg.sha512" + }, + "System.IO/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3qjaHvxQPDpSOYICjUoTsmoq5u6QJAFRUITgeT/4gqkF1bajbSmb1kwSxEA8AHlofqgcKJcM8udgieRNhaJ5Cg==", + "path": "system.io/4.3.0", + "hashPath": "system.io.4.3.0.nupkg.sha512" + }, + "System.IO.FileSystem/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3wEMARTnuio+ulnvi+hkRNROYwa1kylvYahhcLk4HSoVdl+xxTFVeVlYOfLwrDPImGls0mDqbMhrza8qnWPTdA==", + "path": "system.io.filesystem/4.3.0", + "hashPath": "system.io.filesystem.4.3.0.nupkg.sha512" + }, + "System.IO.FileSystem.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-6QOb2XFLch7bEc4lIcJH49nJN2HV+OC3fHDgsLVsBVBk3Y4hFAnOBGzJ2lUu7CyDDFo9IBWkSsnbkT6IBwwiMw==", + "path": "system.io.filesystem.primitives/4.3.0", + "hashPath": "system.io.filesystem.primitives.4.3.0.nupkg.sha512" + }, + "System.Linq/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-5DbqIUpsDp0dFftytzuMmc0oeMdQwjcP/EWxsksIz/w1TcFRkZ3yKKz0PqiYFMmEwPSWw+qNVqD7PJ889JzHbw==", + "path": "system.linq/4.3.0", + "hashPath": "system.linq.4.3.0.nupkg.sha512" + }, + "System.Linq.Expressions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-PGKkrd2khG4CnlyJwxwwaWWiSiWFNBGlgXvJpeO0xCXrZ89ODrQ6tjEWS/kOqZ8GwEOUATtKtzp1eRgmYNfclg==", + "path": "system.linq.expressions/4.3.0", + "hashPath": "system.linq.expressions.4.3.0.nupkg.sha512" + }, + "System.Memory/4.5.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-1MbJTHS1lZ4bS4FmsJjnuGJOu88ZzTT2rLvrhW7Ygic+pC0NWA+3hgAen0HRdsocuQXCkUTdFn9yHJJhsijDXw==", + "path": "system.memory/4.5.4", + "hashPath": "system.memory.4.5.4.nupkg.sha512" + }, + "System.Memory.Data/1.0.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-JGkzeqgBsiZwKJZ1IxPNsDFZDhUvuEdX8L8BDC8N3KOj+6zMcNU28CNN59TpZE/VJYy9cP+5M+sbxtWJx3/xtw==", + "path": "system.memory.data/1.0.2", + "hashPath": "system.memory.data.1.0.2.nupkg.sha512" + }, + "System.Numerics.Vectors/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-QQTlPTl06J/iiDbJCiepZ4H//BVraReU4O4EoRw1U02H5TLUIT7xn3GnDp9AXPSlJUDyFs4uWjWafNX6WrAojQ==", + "path": "system.numerics.vectors/4.5.0", + "hashPath": "system.numerics.vectors.4.5.0.nupkg.sha512" + }, + "System.ObjectModel/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-bdX+80eKv9bN6K4N+d77OankKHGn6CH711a6fcOpMQu2Fckp/Ft4L/kW9WznHpyR0NRAvJutzOMHNNlBGvxQzQ==", + "path": "system.objectmodel/4.3.0", + "hashPath": "system.objectmodel.4.3.0.nupkg.sha512" + }, + "System.Private.DataContractSerialization/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-yDaJ2x3mMmjdZEDB4IbezSnCsnjQ4BxinKhRAaP6kEgL6Bb6jANWphs5SzyD8imqeC/3FxgsuXT6ykkiH1uUmA==", + "path": "system.private.datacontractserialization/4.3.0", + "hashPath": "system.private.datacontractserialization.4.3.0.nupkg.sha512" + }, + "System.Private.Uri/4.3.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-o1+7RJnu3Ik3PazR7Z7tJhjPdE000Eq2KGLLWhqJJKXj04wrS8lwb1OFtDF9jzXXADhUuZNJZlPc98uwwqmpFA==", + "path": "system.private.uri/4.3.2", + "hashPath": "system.private.uri.4.3.2.nupkg.sha512" + }, + "System.Reflection/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-KMiAFoW7MfJGa9nDFNcfu+FpEdiHpWgTcS2HdMpDvt9saK3y/G4GwprPyzqjFH9NTaGPQeWNHU+iDlDILj96aQ==", + "path": "system.reflection/4.3.0", + "hashPath": "system.reflection.4.3.0.nupkg.sha512" + }, + "System.Reflection.Emit/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-228FG0jLcIwTVJyz8CLFKueVqQK36ANazUManGaJHkO0icjiIypKW7YLWLIWahyIkdh5M7mV2dJepllLyA1SKg==", + "path": "system.reflection.emit/4.3.0", + "hashPath": "system.reflection.emit.4.3.0.nupkg.sha512" + }, + "System.Reflection.Emit.ILGeneration/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-59tBslAk9733NXLrUJrwNZEzbMAcu8k344OYo+wfSVygcgZ9lgBdGIzH/nrg3LYhXceynyvTc8t5/GD4Ri0/ng==", + "path": "system.reflection.emit.ilgeneration/4.3.0", + "hashPath": "system.reflection.emit.ilgeneration.4.3.0.nupkg.sha512" + }, + "System.Reflection.Emit.Lightweight/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-oadVHGSMsTmZsAF864QYN1t1QzZjIcuKU3l2S9cZOwDdDueNTrqq1yRj7koFfIGEnKpt6NjpL3rOzRhs4ryOgA==", + "path": "system.reflection.emit.lightweight/4.3.0", + "hashPath": "system.reflection.emit.lightweight.4.3.0.nupkg.sha512" + }, + "System.Reflection.Extensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-rJkrJD3kBI5B712aRu4DpSIiHRtr6QlfZSQsb0hYHrDCZORXCFjQfoipo2LaMUHoT9i1B7j7MnfaEKWDFmFQNQ==", + "path": "system.reflection.extensions/4.3.0", + "hashPath": "system.reflection.extensions.4.3.0.nupkg.sha512" + }, + "System.Reflection.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-5RXItQz5As4xN2/YUDxdpsEkMhvw3e6aNveFXUn4Hl/udNTCNhnKp8lT9fnc3MhvGKh1baak5CovpuQUXHAlIA==", + "path": "system.reflection.primitives/4.3.0", + "hashPath": "system.reflection.primitives.4.3.0.nupkg.sha512" + }, + "System.Reflection.TypeExtensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-7u6ulLcZbyxB5Gq0nMkQttcdBTx57ibzw+4IOXEfR+sXYQoHvjW5LTLyNr8O22UIMrqYbchJQJnos4eooYzYJA==", + "path": "system.reflection.typeextensions/4.3.0", + "hashPath": "system.reflection.typeextensions.4.3.0.nupkg.sha512" + }, + "System.Resources.ResourceManager/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-/zrcPkkWdZmI4F92gL/TPumP98AVDu/Wxr3CSJGQQ+XN6wbRZcyfSKVoPo17ilb3iOr0cCRqJInGwNMolqhS8A==", + "path": "system.resources.resourcemanager/4.3.0", + "hashPath": "system.resources.resourcemanager.4.3.0.nupkg.sha512" + }, + "System.Runtime/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-JufQi0vPQ0xGnAczR13AUFglDyVYt4Kqnz1AZaiKZ5+GICq0/1MH/mO/eAJHt/mHW1zjKBJd7kV26SrxddAhiw==", + "path": "system.runtime/4.3.0", + "hashPath": "system.runtime.4.3.0.nupkg.sha512" + }, + "System.Runtime.CompilerServices.Unsafe/4.7.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-zOHkQmzPCn5zm/BH+cxC1XbUS3P4Yoi3xzW7eRgVpDR2tPGSzyMZ17Ig1iRkfJuY0nhxkQQde8pgePNiA7z7TQ==", + "path": "system.runtime.compilerservices.unsafe/4.7.1", + "hashPath": "system.runtime.compilerservices.unsafe.4.7.1.nupkg.sha512" + }, + "System.Runtime.Extensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-guW0uK0fn5fcJJ1tJVXYd7/1h5F+pea1r7FLSOz/f8vPEqbR2ZAknuRDvTQ8PzAilDveOxNjSfr0CHfIQfFk8g==", + "path": "system.runtime.extensions/4.3.0", + "hashPath": "system.runtime.extensions.4.3.0.nupkg.sha512" + }, + "System.Runtime.Handles/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-OKiSUN7DmTWeYb3l51A7EYaeNMnvxwE249YtZz7yooT4gOZhmTjIn48KgSsw2k2lYdLgTKNJw/ZIfSElwDRVgg==", + "path": "system.runtime.handles/4.3.0", + "hashPath": "system.runtime.handles.4.3.0.nupkg.sha512" + }, + "System.Runtime.InteropServices/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-uv1ynXqiMK8mp1GM3jDqPCFN66eJ5w5XNomaK2XD+TuCroNTLFGeZ+WCmBMcBDyTFKou3P6cR6J/QsaqDp7fGQ==", + "path": "system.runtime.interopservices/4.3.0", + "hashPath": "system.runtime.interopservices.4.3.0.nupkg.sha512" + }, + "System.Runtime.Numerics/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-yMH+MfdzHjy17l2KESnPiF2dwq7T+xLnSJar7slyimAkUh/gTrS9/UQOtv7xarskJ2/XDSNvfLGOBQPjL7PaHQ==", + "path": "system.runtime.numerics/4.3.0", + "hashPath": "system.runtime.numerics.4.3.0.nupkg.sha512" + }, + "System.Runtime.Serialization.Formatters/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-KT591AkTNFOTbhZlaeMVvfax3RqhH1EJlcwF50Wm7sfnBLuHiOeZRRKrr1ns3NESkM20KPZ5Ol/ueMq5vg4QoQ==", + "path": "system.runtime.serialization.formatters/4.3.0", + "hashPath": "system.runtime.serialization.formatters.4.3.0.nupkg.sha512" + }, + "System.Runtime.Serialization.Json/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-CpVfOH0M/uZ5PH+M9+Gu56K0j9lJw3M+PKRegTkcrY/stOIvRUeonggxNrfBYLA5WOHL2j15KNJuTuld3x4o9w==", + "path": "system.runtime.serialization.json/4.3.0", + "hashPath": "system.runtime.serialization.json.4.3.0.nupkg.sha512" + }, + "System.Runtime.Serialization.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Wz+0KOukJGAlXjtKr+5Xpuxf8+c8739RI1C+A2BoQZT+wMCCoMDDdO8/4IRHfaVINqL78GO8dW8G2lW/e45Mcw==", + "path": "system.runtime.serialization.primitives/4.3.0", + "hashPath": "system.runtime.serialization.primitives.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.Algorithms/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-W1kd2Y8mYSCgc3ULTAZ0hOP2dSdG5YauTb1089T0/kRcN2MpSAW1izOFROrJgxSlMn3ArsgHXagigyi+ibhevg==", + "path": "system.security.cryptography.algorithms/4.3.0", + "hashPath": "system.security.cryptography.algorithms.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.Cng/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-03idZOqFlsKRL4W+LuCpJ6dBYDUWReug6lZjBa3uJWnk5sPCUXckocevTaUA8iT/MFSrY/2HXkOt753xQ/cf8g==", + "path": "system.security.cryptography.cng/4.3.0", + "hashPath": "system.security.cryptography.cng.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.Csp/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-X4s/FCkEUnRGnwR3aSfVIkldBmtURMhmexALNTwpjklzxWU7yjMk7GHLKOZTNkgnWnE0q7+BCf9N2LVRWxewaA==", + "path": "system.security.cryptography.csp/4.3.0", + "hashPath": "system.security.cryptography.csp.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.Encoding/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-1DEWjZZly9ae9C79vFwqaO5kaOlI5q+3/55ohmq/7dpDyDfc8lYe7YVxJUZ5MF/NtbkRjwFRo14yM4OEo9EmDw==", + "path": "system.security.cryptography.encoding/4.3.0", + "hashPath": "system.security.cryptography.encoding.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-h4CEgOgv5PKVF/HwaHzJRiVboL2THYCou97zpmhjghx5frc7fIvlkY1jL+lnIQyChrJDMNEXS6r7byGif8Cy4w==", + "path": "system.security.cryptography.openssl/4.3.0", + "hashPath": "system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-7bDIyVFNL/xKeFHjhobUAQqSpJq9YTOpbEs6mR233Et01STBMXNAc/V+BM6dwYGc95gVh/Zf+iVXWzj3mE8DWg==", + "path": "system.security.cryptography.primitives/4.3.0", + "hashPath": "system.security.cryptography.primitives.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.ProtectedData/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-wLBKzFnDCxP12VL9ANydSYhk59fC4cvOr9ypYQLPnAj48NQIhqnjdD2yhP8yEKyBJEjERWS9DisKL7rX5eU25Q==", + "path": "system.security.cryptography.protecteddata/4.5.0", + "hashPath": "system.security.cryptography.protecteddata.4.5.0.nupkg.sha512" + }, + "System.Security.Cryptography.X509Certificates/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-t2Tmu6Y2NtJ2um0RtcuhP7ZdNNxXEgUm2JeoA/0NvlMjAhKCnM1NX07TDl3244mVp3QU6LPEhT3HTtH1uF7IYw==", + "path": "system.security.cryptography.x509certificates/4.3.0", + "hashPath": "system.security.cryptography.x509certificates.4.3.0.nupkg.sha512" + }, + "System.Security.SecureString/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-PnXp38O9q/2Oe4iZHMH60kinScv6QiiL2XH54Pj2t0Y6c2zKPEiAZsM/M3wBOHLNTBDFP0zfy13WN2M0qFz5jg==", + "path": "system.security.securestring/4.3.0", + "hashPath": "system.security.securestring.4.3.0.nupkg.sha512" + }, + "System.Text.Encoding/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-BiIg+KWaSDOITze6jGQynxg64naAPtqGHBwDrLaCtixsa5bKiR8dpPOHA7ge3C0JJQizJE+sfkz1wV+BAKAYZw==", + "path": "system.text.encoding/4.3.0", + "hashPath": "system.text.encoding.4.3.0.nupkg.sha512" + }, + "System.Text.Encoding.Extensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-YVMK0Bt/A43RmwizJoZ22ei2nmrhobgeiYwFzC4YAN+nue8RF6djXDMog0UCn+brerQoYVyaS+ghy9P/MUVcmw==", + "path": "system.text.encoding.extensions/4.3.0", + "hashPath": "system.text.encoding.extensions.4.3.0.nupkg.sha512" + }, + "System.Text.Encodings.Web/4.7.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-iTUgB/WtrZ1sWZs84F2hwyQhiRH6QNjQv2DkwrH+WP6RoFga2Q1m3f9/Q7FG8cck8AdHitQkmkXSY8qylcDmuA==", + "path": "system.text.encodings.web/4.7.2", + "hashPath": "system.text.encodings.web.4.7.2.nupkg.sha512" + }, + "System.Text.Json/4.7.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-TcMd95wcrubm9nHvJEQs70rC0H/8omiSGGpU4FQ/ZA1URIqD4pjmFJh2Mfv1yH1eHgJDWTi2hMDXwTET+zOOyg==", + "path": "system.text.json/4.7.2", + "hashPath": "system.text.json.4.7.2.nupkg.sha512" + }, + "System.Text.RegularExpressions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-RpT2DA+L660cBt1FssIE9CAGpLFdFPuheB7pLpKpn6ZXNby7jDERe8Ua/Ne2xGiwLVG2JOqziiaVCGDon5sKFA==", + "path": "system.text.regularexpressions/4.3.0", + "hashPath": "system.text.regularexpressions.4.3.0.nupkg.sha512" + }, + "System.Threading/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-VkUS0kOBcUf3Wwm0TSbrevDDZ6BlM+b/HRiapRFWjM5O0NS0LviG0glKmFK+hhPDd1XFeSdU1GmlLhb2CoVpIw==", + "path": "system.threading/4.3.0", + "hashPath": "system.threading.4.3.0.nupkg.sha512" + }, + "System.Threading.Tasks/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-LbSxKEdOUhVe8BezB/9uOGGppt+nZf6e1VFyw6v3DN6lqitm0OSn2uXMOdtP0M3W4iMcqcivm2J6UgqiwwnXiA==", + "path": "system.threading.tasks/4.3.0", + "hashPath": "system.threading.tasks.4.3.0.nupkg.sha512" + }, + "System.Threading.Tasks.Extensions/4.5.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-zteT+G8xuGu6mS+mzDzYXbzS7rd3K6Fjb9RiZlYlJPam2/hU7JCBZBVEcywNuR+oZ1ncTvc/cq0faRr3P01OVg==", + "path": "system.threading.tasks.extensions/4.5.4", + "hashPath": "system.threading.tasks.extensions.4.5.4.nupkg.sha512" + }, + "System.Threading.Thread/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-OHmbT+Zz065NKII/ZHcH9XO1dEuLGI1L2k7uYss+9C1jLxTC9kTZZuzUOyXHayRk+dft9CiDf3I/QZ0t8JKyBQ==", + "path": "system.threading.thread/4.3.0", + "hashPath": "system.threading.thread.4.3.0.nupkg.sha512" + }, + "System.Threading.ThreadPool/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-k/+g4b7vjdd4aix83sTgC9VG6oXYKAktSfNIJUNGxPEj7ryEOfzHHhfnmsZvjxawwcD9HyWXKCXmPjX8U4zeSw==", + "path": "system.threading.threadpool/4.3.0", + "hashPath": "system.threading.threadpool.4.3.0.nupkg.sha512" + }, + "System.Xml.ReaderWriter/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-GrprA+Z0RUXaR4N7/eW71j1rgMnEnEVlgii49GZyAjTH7uliMnrOU3HNFBr6fEDBCJCIdlVNq9hHbaDR621XBA==", + "path": "system.xml.readerwriter/4.3.0", + "hashPath": "system.xml.readerwriter.4.3.0.nupkg.sha512" + }, + "System.Xml.XDocument/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-5zJ0XDxAIg8iy+t4aMnQAu0MqVbqyvfoUVl1yDV61xdo3Vth45oA2FoY4pPkxYAH5f8ixpmTqXeEIya95x0aCQ==", + "path": "system.xml.xdocument/4.3.0", + "hashPath": "system.xml.xdocument.4.3.0.nupkg.sha512" + }, + "System.Xml.XmlDocument/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-lJ8AxvkX7GQxpC6GFCeBj8ThYVyQczx2+f/cWHJU8tjS7YfI6Cv6bon70jVEgs2CiFbmmM8b9j1oZVx0dSI2Ww==", + "path": "system.xml.xmldocument/4.3.0", + "hashPath": "system.xml.xmldocument.4.3.0.nupkg.sha512" + }, + "System.Xml.XmlSerializer/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-MYoTCP7EZ98RrANESW05J5ZwskKDoN0AuZ06ZflnowE50LTpbR5yRg3tHckTVm5j/m47stuGgCrCHWePyHS70Q==", + "path": "system.xml.xmlserializer/4.3.0", + "hashPath": "system.xml.xmlserializer.4.3.0.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Authentication/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.ResourceManager.dll b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.ResourceManager.dll new file mode 100644 index 000000000000..fcc5eb26eb20 Binary files /dev/null and b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.ResourceManager.dll differ diff --git a/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.deps.json b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.deps.json new file mode 100644 index 000000000000..7828816a6777 --- /dev/null +++ b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.deps.json @@ -0,0 +1,2273 @@ +{ + "runtimeTarget": { + "name": ".NETStandard,Version=v2.0/", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETStandard,Version=v2.0": {}, + ".NETStandard,Version=v2.0/": { + "Microsoft.Azure.PowerShell.Authentication/1.0.0": { + "dependencies": { + "Azure.Core": "1.22.0", + "Azure.Identity": "1.5.0", + "Hyak.Common": "1.2.2", + "Microsoft.ApplicationInsights": "2.12.0", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Aks": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Authorization": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Compute": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Graph.Rbac": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.KeyVault": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Monitor": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Network": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.PolicyInsights": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.ResourceManager": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Storage.Management": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Websites": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common.Share": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Storage": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Strategies": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "NETStandard.Library": "2.0.3", + "Newtonsoft.Json": "10.0.3", + "PowerShellStandard.Library": "5.1.0" + }, + "runtime": { + "Microsoft.Azure.PowerShell.Authentication.dll": {} + } + }, + "Azure.Core/1.22.0": { + "dependencies": { + "Microsoft.Bcl.AsyncInterfaces": "1.1.1", + "System.Diagnostics.DiagnosticSource": "4.6.0", + "System.Memory.Data": "1.0.2", + "System.Numerics.Vectors": "4.5.0", + "System.Text.Encodings.Web": "4.7.2", + "System.Text.Json": "4.7.2", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "runtime": { + "lib/netstandard2.0/Azure.Core.dll": { + "assemblyVersion": "1.22.0.0", + "fileVersion": "1.2200.22.6212" + } + } + }, + "Azure.Identity/1.5.0": { + "dependencies": { + "Azure.Core": "1.22.0", + "Microsoft.Identity.Client": "4.30.1", + "Microsoft.Identity.Client.Extensions.Msal": "2.18.4", + "System.Memory": "4.5.4", + "System.Security.Cryptography.ProtectedData": "4.5.0", + "System.Text.Json": "4.7.2", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "runtime": { + "lib/netstandard2.0/Azure.Identity.dll": { + "assemblyVersion": "1.5.0.0", + "fileVersion": "1.500.21.51401" + } + } + }, + "Hyak.Common/1.2.2": { + "dependencies": { + "NETStandard.Library": "2.0.3", + "Newtonsoft.Json": "10.0.3", + "System.Reflection": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.4/Hyak.Common.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.2.2.0" + } + } + }, + "Microsoft.ApplicationInsights/2.12.0": { + "dependencies": { + "System.Diagnostics.DiagnosticSource": "4.6.0", + "System.Runtime.InteropServices": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.ApplicationInsights.dll": { + "assemblyVersion": "2.12.0.21496", + "fileVersion": "2.12.0.21496" + } + } + }, + "Microsoft.Azure.Common/2.2.1": { + "dependencies": { + "Hyak.Common": "1.2.2", + "NETStandard.Library": "2.0.3" + }, + "runtime": { + "lib/netstandard1.4/Microsoft.Azure.Common.dll": { + "assemblyVersion": "2.0.0.0", + "fileVersion": "2.2.1.0" + } + } + }, + "Microsoft.Azure.PowerShell.Authentication.Abstractions/1.3.57-preview": { + "dependencies": { + "Hyak.Common": "1.2.2", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Authentication.Abstractions.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Aks/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Aks.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Authorization/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Authorization.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Compute/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Compute.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Graph.Rbac/1.3.57-preview": { + "dependencies": { + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.ResourceManager": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Graph.Rbac.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.KeyVault/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3", + "System.Collections.NonGeneric": "4.3.0", + "System.Collections.Specialized": "4.3.0", + "System.Reflection": "4.3.0", + "System.Security.SecureString": "4.3.0", + "System.Xml.XmlDocument": "4.3.0", + "System.Xml.XmlSerializer": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.KeyVault.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Monitor/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3", + "System.Collections.Specialized": "4.3.0", + "System.Reflection": "4.3.0", + "System.Security.SecureString": "4.3.0", + "System.Xml.XmlDocument": "4.3.0", + "System.Xml.XmlSerializer": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Monitor.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Network/1.3.57-preview": { + "dependencies": { + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Network.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.PolicyInsights/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.PolicyInsights.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.ResourceManager/1.3.57-preview": { + "dependencies": { + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.ResourceManager.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Storage.Management/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "System.Collections.NonGeneric": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Storage.Management.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Websites/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3", + "System.Collections.Specialized": "4.3.0", + "System.Reflection": "4.3.0", + "System.Security.SecureString": "4.3.0", + "System.Xml.XmlDocument": "4.3.0", + "System.Xml.XmlSerializer": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Websites.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Common/1.3.57-preview": { + "dependencies": { + "Hyak.Common": "1.2.2", + "Microsoft.ApplicationInsights": "2.12.0", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common.Share": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Common.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Common.Share/1.3.57-preview": { + "dependencies": { + "Hyak.Common": "1.2.2", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Common.Share.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Storage/1.3.57-preview": { + "dependencies": { + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Storage.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Strategies/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Strategies.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Bcl.AsyncInterfaces/1.1.1": { + "dependencies": { + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Bcl.AsyncInterfaces.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "4.700.20.21406" + } + } + }, + "Microsoft.CSharp/4.5.0": { + "runtime": { + "lib/netstandard2.0/Microsoft.CSharp.dll": { + "assemblyVersion": "4.0.4.0", + "fileVersion": "4.6.26515.6" + } + } + }, + "Microsoft.Identity.Client/4.30.1": { + "dependencies": { + "Microsoft.CSharp": "4.5.0", + "NETStandard.Library": "2.0.3", + "System.ComponentModel.TypeConverter": "4.3.0", + "System.Diagnostics.Process": "4.3.0", + "System.Dynamic.Runtime": "4.3.0", + "System.Private.Uri": "4.3.2", + "System.Runtime.Serialization.Formatters": "4.3.0", + "System.Runtime.Serialization.Json": "4.3.0", + "System.Runtime.Serialization.Primitives": "4.3.0", + "System.Security.Cryptography.X509Certificates": "4.3.0", + "System.Security.SecureString": "4.3.0", + "System.Xml.XDocument": "4.3.0", + "System.Xml.XmlDocument": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/Microsoft.Identity.Client.dll": { + "assemblyVersion": "4.30.1.0", + "fileVersion": "4.30.1.0" + } + } + }, + "Microsoft.Identity.Client.Extensions.Msal/2.18.4": { + "dependencies": { + "Microsoft.Identity.Client": "4.30.1", + "System.Security.Cryptography.ProtectedData": "4.5.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Identity.Client.Extensions.Msal.dll": { + "assemblyVersion": "2.18.4.0", + "fileVersion": "2.18.4.0" + } + } + }, + "Microsoft.NETCore.Platforms/1.1.1": {}, + "Microsoft.NETCore.Targets/1.1.3": {}, + "Microsoft.Rest.ClientRuntime/2.3.23": { + "dependencies": { + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Rest.ClientRuntime.dll": { + "assemblyVersion": "2.0.0.0", + "fileVersion": "2.3.23.0" + } + } + }, + "Microsoft.Rest.ClientRuntime.Azure/3.3.19": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Rest.ClientRuntime.Azure.dll": { + "assemblyVersion": "3.0.0.0", + "fileVersion": "3.3.18.0" + } + } + }, + "Microsoft.Win32.Primitives/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "Microsoft.Win32.Registry/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Collections": "4.3.0", + "System.Globalization": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0" + } + }, + "NETStandard.Library/2.0.3": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1" + } + }, + "Newtonsoft.Json/10.0.3": { + "dependencies": { + "Microsoft.CSharp": "4.5.0", + "NETStandard.Library": "2.0.3", + "System.ComponentModel.TypeConverter": "4.3.0", + "System.Runtime.Serialization.Formatters": "4.3.0", + "System.Runtime.Serialization.Primitives": "4.3.0", + "System.Xml.XmlDocument": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/Newtonsoft.Json.dll": { + "assemblyVersion": "10.0.0.0", + "fileVersion": "10.0.3.21018" + } + } + }, + "PowerShellStandard.Library/5.1.0": {}, + "runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.native.System/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3" + } + }, + "runtime.native.System.Net.Http/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3" + } + }, + "runtime.native.System.Security.Cryptography.Apple/4.3.0": { + "dependencies": { + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple": "4.3.0" + } + }, + "runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "dependencies": { + "runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" + } + }, + "runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple/4.3.0": {}, + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "System.Buffers/4.5.1": { + "runtime": { + "lib/netstandard2.0/System.Buffers.dll": { + "assemblyVersion": "4.0.3.0", + "fileVersion": "4.6.28619.1" + } + } + }, + "System.Collections/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Collections.Concurrent/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Diagnostics.Tracing": "4.3.0", + "System.Globalization": "4.3.0", + "System.Reflection": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0", + "System.Threading.Tasks": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Collections.Concurrent.dll": { + "assemblyVersion": "4.0.13.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Collections.NonGeneric/4.3.0": { + "dependencies": { + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Collections.NonGeneric.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Collections.Specialized/4.3.0": { + "dependencies": { + "System.Collections.NonGeneric": "4.3.0", + "System.Globalization": "4.3.0", + "System.Globalization.Extensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Collections.Specialized.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.ComponentModel/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.ComponentModel.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.ComponentModel.Primitives/4.3.0": { + "dependencies": { + "System.ComponentModel": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.0/System.ComponentModel.Primitives.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.ComponentModel.TypeConverter/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Collections.NonGeneric": "4.3.0", + "System.Collections.Specialized": "4.3.0", + "System.ComponentModel": "4.3.0", + "System.ComponentModel.Primitives": "4.3.0", + "System.Globalization": "4.3.0", + "System.Linq": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Extensions": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.5/System.ComponentModel.TypeConverter.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Diagnostics.Debug/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Diagnostics.DiagnosticSource/4.6.0": { + "dependencies": { + "System.Memory": "4.5.4" + }, + "runtime": { + "lib/netstandard1.3/System.Diagnostics.DiagnosticSource.dll": { + "assemblyVersion": "4.0.4.0", + "fileVersion": "4.700.19.46214" + } + } + }, + "System.Diagnostics.Process/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.Win32.Primitives": "4.3.0", + "Microsoft.Win32.Registry": "4.3.0", + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.IO.FileSystem": "4.3.0", + "System.IO.FileSystem.Primitives": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Text.Encoding.Extensions": "4.3.0", + "System.Threading": "4.3.0", + "System.Threading.Tasks": "4.3.0", + "System.Threading.Thread": "4.3.0", + "System.Threading.ThreadPool": "4.3.0", + "runtime.native.System": "4.3.0" + } + }, + "System.Diagnostics.Tools/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Diagnostics.Tracing/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Dynamic.Runtime/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Linq": "4.3.0", + "System.Linq.Expressions": "4.3.0", + "System.ObjectModel": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Dynamic.Runtime.dll": { + "assemblyVersion": "4.0.12.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Globalization/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Globalization.Calendars/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Globalization": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Globalization.Extensions/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Globalization": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.InteropServices": "4.3.0" + } + }, + "System.IO/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading.Tasks": "4.3.0" + } + }, + "System.IO.FileSystem/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.IO": "4.3.0", + "System.IO.FileSystem.Primitives": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading.Tasks": "4.3.0" + } + }, + "System.IO.FileSystem.Primitives/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.IO.FileSystem.Primitives.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Linq/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0" + }, + "runtime": { + "lib/netstandard1.6/System.Linq.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Linq.Expressions/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Linq": "4.3.0", + "System.ObjectModel": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Emit.Lightweight": "4.3.0", + "System.Reflection.Extensions": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.6/System.Linq.Expressions.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Memory/4.5.4": { + "dependencies": { + "System.Buffers": "4.5.1", + "System.Numerics.Vectors": "4.5.0", + "System.Runtime.CompilerServices.Unsafe": "4.7.1" + }, + "runtime": { + "lib/netstandard2.0/System.Memory.dll": { + "assemblyVersion": "4.0.1.1", + "fileVersion": "4.6.28619.1" + } + } + }, + "System.Memory.Data/1.0.2": { + "dependencies": { + "System.Text.Encodings.Web": "4.7.2", + "System.Text.Json": "4.7.2" + }, + "runtime": { + "lib/netstandard2.0/System.Memory.Data.dll": { + "assemblyVersion": "1.0.2.0", + "fileVersion": "1.0.221.20802" + } + } + }, + "System.Numerics.Vectors/4.5.0": { + "runtime": { + "lib/netstandard2.0/System.Numerics.Vectors.dll": { + "assemblyVersion": "4.1.4.0", + "fileVersion": "4.6.26515.6" + } + } + }, + "System.ObjectModel/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.ObjectModel.dll": { + "assemblyVersion": "4.0.13.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Private.DataContractSerialization/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Collections.Concurrent": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Linq": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Emit.Lightweight": "4.3.0", + "System.Reflection.Extensions": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Serialization.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Text.Encoding.Extensions": "4.3.0", + "System.Text.RegularExpressions": "4.3.0", + "System.Threading": "4.3.0", + "System.Threading.Tasks": "4.3.0", + "System.Xml.ReaderWriter": "4.3.0", + "System.Xml.XDocument": "4.3.0", + "System.Xml.XmlDocument": "4.3.0", + "System.Xml.XmlSerializer": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Private.DataContractSerialization.dll": { + "assemblyVersion": "4.1.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Private.Uri/4.3.2": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3" + } + }, + "System.Reflection/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.IO": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Reflection.Emit/4.3.0": { + "dependencies": { + "System.IO": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Reflection.Emit.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Reflection.Emit.ILGeneration/4.3.0": { + "dependencies": { + "System.Reflection": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Reflection.Emit.ILGeneration.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Reflection.Emit.Lightweight/4.3.0": { + "dependencies": { + "System.Reflection": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Reflection.Emit.Lightweight.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Reflection.Extensions/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Reflection": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Reflection.Primitives/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Reflection.TypeExtensions/4.3.0": { + "dependencies": { + "System.Reflection": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.5/System.Reflection.TypeExtensions.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Resources.ResourceManager/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Globalization": "4.3.0", + "System.Reflection": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Runtime/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3" + } + }, + "System.Runtime.CompilerServices.Unsafe/4.7.1": { + "runtime": { + "lib/netstandard2.0/System.Runtime.CompilerServices.Unsafe.dll": { + "assemblyVersion": "4.0.6.0", + "fileVersion": "4.700.20.12001" + } + } + }, + "System.Runtime.Extensions/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Runtime.Handles/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Runtime.InteropServices/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Reflection": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Handles": "4.3.0" + } + }, + "System.Runtime.Numerics/4.3.0": { + "dependencies": { + "System.Globalization": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Runtime.Numerics.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Runtime.Serialization.Formatters/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Reflection": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Serialization.Primitives": "4.3.0" + }, + "runtime": { + "lib/netstandard1.4/System.Runtime.Serialization.Formatters.dll": { + "assemblyVersion": "4.0.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Runtime.Serialization.Json/4.3.0": { + "dependencies": { + "System.IO": "4.3.0", + "System.Private.DataContractSerialization": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Runtime.Serialization.Json.dll": { + "assemblyVersion": "4.0.3.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Runtime.Serialization.Primitives/4.3.0": { + "dependencies": { + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Runtime.Serialization.Primitives.dll": { + "assemblyVersion": "4.1.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Security.Cryptography.Algorithms/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Collections": "4.3.0", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Runtime.Numerics": "4.3.0", + "System.Security.Cryptography.Encoding": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "runtime.native.System.Security.Cryptography.Apple": "4.3.0", + "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" + } + }, + "System.Security.Cryptography.Cng/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Security.Cryptography.Algorithms": "4.3.0", + "System.Security.Cryptography.Encoding": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0" + } + }, + "System.Security.Cryptography.Csp/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.IO": "4.3.0", + "System.Reflection": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Security.Cryptography.Algorithms": "4.3.0", + "System.Security.Cryptography.Encoding": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading": "4.3.0" + } + }, + "System.Security.Cryptography.Encoding/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Collections": "4.3.0", + "System.Collections.Concurrent": "4.3.0", + "System.Linq": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" + } + }, + "System.Security.Cryptography.OpenSsl/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Runtime.Numerics": "4.3.0", + "System.Security.Cryptography.Algorithms": "4.3.0", + "System.Security.Cryptography.Encoding": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" + }, + "runtime": { + "lib/netstandard1.6/System.Security.Cryptography.OpenSsl.dll": { + "assemblyVersion": "4.0.0.0", + "fileVersion": "1.0.24212.1" + } + } + }, + "System.Security.Cryptography.Primitives/4.3.0": { + "dependencies": { + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Threading": "4.3.0", + "System.Threading.Tasks": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Security.Cryptography.Primitives.dll": { + "assemblyVersion": "4.0.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Security.Cryptography.ProtectedData/4.5.0": { + "dependencies": { + "System.Memory": "4.5.4" + }, + "runtime": { + "lib/netstandard2.0/System.Security.Cryptography.ProtectedData.dll": { + "assemblyVersion": "4.0.3.0", + "fileVersion": "4.6.26515.6" + } + } + }, + "System.Security.Cryptography.X509Certificates/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.Globalization.Calendars": "4.3.0", + "System.IO": "4.3.0", + "System.IO.FileSystem": "4.3.0", + "System.IO.FileSystem.Primitives": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Runtime.Numerics": "4.3.0", + "System.Security.Cryptography.Algorithms": "4.3.0", + "System.Security.Cryptography.Cng": "4.3.0", + "System.Security.Cryptography.Csp": "4.3.0", + "System.Security.Cryptography.Encoding": "4.3.0", + "System.Security.Cryptography.OpenSsl": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading": "4.3.0", + "runtime.native.System": "4.3.0", + "runtime.native.System.Net.Http": "4.3.0", + "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" + } + }, + "System.Security.SecureString/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading": "4.3.0" + } + }, + "System.Text.Encoding/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Text.Encoding.Extensions/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0", + "System.Text.Encoding": "4.3.0" + } + }, + "System.Text.Encodings.Web/4.7.2": { + "dependencies": { + "System.Buffers": "4.5.1", + "System.Memory": "4.5.4" + }, + "runtime": { + "lib/netstandard2.0/System.Text.Encodings.Web.dll": { + "assemblyVersion": "4.0.5.1", + "fileVersion": "4.700.21.11602" + } + } + }, + "System.Text.Json/4.7.2": { + "dependencies": { + "Microsoft.Bcl.AsyncInterfaces": "1.1.1", + "System.Buffers": "4.5.1", + "System.Memory": "4.5.4", + "System.Numerics.Vectors": "4.5.0", + "System.Runtime.CompilerServices.Unsafe": "4.7.1", + "System.Text.Encodings.Web": "4.7.2", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "runtime": { + "lib/netstandard2.0/System.Text.Json.dll": { + "assemblyVersion": "4.0.1.2", + "fileVersion": "4.700.20.21406" + } + } + }, + "System.Text.RegularExpressions/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Globalization": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.6/System.Text.RegularExpressions.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Threading/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0", + "System.Threading.Tasks": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Threading.dll": { + "assemblyVersion": "4.0.12.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Threading.Tasks/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Threading.Tasks.Extensions/4.5.4": { + "dependencies": { + "System.Runtime.CompilerServices.Unsafe": "4.7.1" + }, + "runtime": { + "lib/netstandard2.0/System.Threading.Tasks.Extensions.dll": { + "assemblyVersion": "4.2.0.1", + "fileVersion": "4.6.28619.1" + } + } + }, + "System.Threading.Thread/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Threading.Thread.dll": { + "assemblyVersion": "4.0.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Threading.ThreadPool/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0", + "System.Runtime.Handles": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Threading.ThreadPool.dll": { + "assemblyVersion": "4.0.11.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Xml.ReaderWriter/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.IO.FileSystem": "4.3.0", + "System.IO.FileSystem.Primitives": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Text.Encoding.Extensions": "4.3.0", + "System.Text.RegularExpressions": "4.3.0", + "System.Threading.Tasks": "4.3.0", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "runtime": { + "lib/netstandard1.3/System.Xml.ReaderWriter.dll": { + "assemblyVersion": "4.1.0.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Xml.XDocument/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Diagnostics.Tools": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Reflection": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading": "4.3.0", + "System.Xml.ReaderWriter": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Xml.XDocument.dll": { + "assemblyVersion": "4.0.12.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Xml.XmlDocument/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading": "4.3.0", + "System.Xml.ReaderWriter": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Xml.XmlDocument.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Xml.XmlSerializer/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Linq": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Extensions": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Text.RegularExpressions": "4.3.0", + "System.Threading": "4.3.0", + "System.Xml.ReaderWriter": "4.3.0", + "System.Xml.XmlDocument": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Xml.XmlSerializer.dll": { + "assemblyVersion": "4.0.12.0", + "fileVersion": "4.6.24705.1" + } + } + } + } + }, + "libraries": { + "Microsoft.Azure.PowerShell.Authentication/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Azure.Core/1.22.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ze/xRCHSSDe5TIk5vBDbVrauW1EN7UIbnBvIBfMH8KSt/I9+/7yPAjTBDgNBk0IwG6WBV+BBHp4IUtS/PGAQwQ==", + "path": "azure.core/1.22.0", + "hashPath": "azure.core.1.22.0.nupkg.sha512" + }, + "Azure.Identity/1.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-VfF88dqrgKXZNOS/y4XrX/jmIfP3pkY+hBUzBNpoKml1nR+QshX6XlXWyToLtWV80TDQ1CmUVCJksktDg5+j1w==", + "path": "azure.identity/1.5.0", + "hashPath": "azure.identity.1.5.0.nupkg.sha512" + }, + "Hyak.Common/1.2.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-uZpnFn48nSQwHcO0/GSBZ7ExaO0sTXKv8KariXXEWLaB4Q3AeQoprYG4WpKsCT0ByW3YffETivgc5rcH5RRDvQ==", + "path": "hyak.common/1.2.2", + "hashPath": "hyak.common.1.2.2.nupkg.sha512" + }, + "Microsoft.ApplicationInsights/2.12.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-4vZcVaxywAzfLm5mAc2/llaZQTzbCqu9KirxxI/t49AkZH5Qxf7JxuAMUuv2/6JEdOOkGDzpvdrrIlf6LkFGcg==", + "path": "microsoft.applicationinsights/2.12.0", + "hashPath": "microsoft.applicationinsights.2.12.0.nupkg.sha512" + }, + "Microsoft.Azure.Common/2.2.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-abzRooh4ACKjzAKxRB6r+SHKW3d+IrLcgtVG81D+3kQU/OMjAZS1oDp9CDalhSbmxa84u0MHM5N+AKeTtKPoiw==", + "path": "microsoft.azure.common/2.2.1", + "hashPath": "microsoft.azure.common.2.2.1.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Authentication.Abstractions/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-bKDPidNeqBpTDikPnIuoMoGd26pD2PNE41cut0ASwL5exJwLNggYO55U+f/cJkgjCUMR8i5nqnlfpGHSS1I0vw==", + "path": "microsoft.azure.powershell.authentication.abstractions/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.authentication.abstractions.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Aks/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-sUGkvOvpqlEK5zdZ7HWaou3GY5bnlNrE0LuZ137+TsNfgx2E3+0Ika3a02i/9+niDDf60xj4LaNOYDSuK5zdJA==", + "path": "microsoft.azure.powershell.clients.aks/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.aks.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Authorization/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Q760F40/qfas2Al+GQhhE4gJt768pQPxlCjqrjjkukgVsq+X/M8IqpCeBzbRTiiyerhcjJoyNxqlGuZpUhqGxw==", + "path": "microsoft.azure.powershell.clients.authorization/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.authorization.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Compute/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-1fcsBdYMmEJPMPN8EAgJkaJ2WxxTKH3VcLECYdL2cfg2bgN8CKbbjSvarrXEezhyduE+LdYnL0e8Pigsnaj55Q==", + "path": "microsoft.azure.powershell.clients.compute/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.compute.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Graph.Rbac/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-BIMthJ1x2vQAN3iWChnNj8BfgrXvKXn+n06E0/h2MNurMXbAOn5eiPIfE8bnj2BO99uSh1ns09yEgOTPJIvZBQ==", + "path": "microsoft.azure.powershell.clients.graph.rbac/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.graph.rbac.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.KeyVault/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-MfvwM8ABj/EswmYu0Bf/8kyAO6kUv2zYSihVn384SVmypomVKUu69GN0VXKbmGaovPI8v3H41Ldp7DqbPRun5A==", + "path": "microsoft.azure.powershell.clients.keyvault/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.keyvault.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Monitor/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-UyCKG5BWVjYFRtH2JNx6f4KdccaSqww2y0OE2PYgib8VhLqkoPr/BQg6vKzaGsghLIerZ/egQ7ntPPw3PCtS3w==", + "path": "microsoft.azure.powershell.clients.monitor/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.monitor.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Network/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-YAAHxw+zzvkGNWAi668NSoTR+V/7vf+gRhu1oFa1O1/f2NGpz5XuqPrQyAPrri64hKqB/k3OMrM7sjlIv16dAg==", + "path": "microsoft.azure.powershell.clients.network/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.network.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.PolicyInsights/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-urRIwRVzzOwpk8HhKq/b785DiL/arnmGUHbN4HvRN6ZsBkE1PU431YwgUlofb9pfB3buLcl0XJFRPLBJ0yZJUw==", + "path": "microsoft.azure.powershell.clients.policyinsights/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.policyinsights.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.ResourceManager/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-juWnd63Z2Sp+6bvtOPOF0Gj1v2AfpxXcuyodd9+U7euBro2G7Yfo2UHmHo/uaYyQUbM3HaXJPvse7BLDKjhe6w==", + "path": "microsoft.azure.powershell.clients.resourcemanager/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.resourcemanager.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Storage.Management/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HPpTWIlN+5ALqJssL7+6BD/vYrWi3eWKQ3QpWYjCFk5c9HVLTNpP+M2dq9jbsxLsZj+5Pt6gC4FIS22Q13Uhag==", + "path": "microsoft.azure.powershell.clients.storage.management/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.storage.management.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Websites/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-b5yBD9FrY02r0kdNNgZ+uU0/QsW3AtmnCE/x1mUG5j8ka/V04AYUo+sDokQBzu+vnK6Y6OrVDtyWjmnKTDHpWA==", + "path": "microsoft.azure.powershell.clients.websites/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.websites.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Common/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-9jZYZ9LKbx16r69y7cO9d7bDjpE0/HgeBU386Y/O6q05VRaq2wAsB2rbQ9AjxcPGHfwS0+2US/RImSSqjVABRQ==", + "path": "microsoft.azure.powershell.common/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.common.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Common.Share/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-4mJSjnwZVLQYWhP47eDzdt0yaLIf2I4pqaEIqcfAjkjdbKpnCXCnJUEFRId061yuKpq1LtfBZkHDRi68I5CJxg==", + "path": "microsoft.azure.powershell.common.share/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.common.share.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Storage/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-fObXEcuhk1JUoQ0fiCV4nK4NJWqvsfsKCzapF7SFEQ87X6AasL6m5KGT8JQSnHmc849xxxaixPTxyWaf9BBlpw==", + "path": "microsoft.azure.powershell.storage/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.storage.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Strategies/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HwyxUwDHCmY6Zdxg2xpFC9Gqmu92Xr0cAr4ElWYwz8Z7PE9uYVkTpKMIKd7oIJJgsIANTfqEU1HKoeI3FXPLqw==", + "path": "microsoft.azure.powershell.strategies/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.strategies.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Bcl.AsyncInterfaces/1.1.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-yuvf07qFWFqtK3P/MRkEKLhn5r2UbSpVueRziSqj0yJQIKFwG1pq9mOayK3zE5qZCTs0CbrwL9M6R8VwqyGy2w==", + "path": "microsoft.bcl.asyncinterfaces/1.1.1", + "hashPath": "microsoft.bcl.asyncinterfaces.1.1.1.nupkg.sha512" + }, + "Microsoft.CSharp/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-kaj6Wb4qoMuH3HySFJhxwQfe8R/sJsNJnANrvv8WdFPMoNbKY5htfNscv+LHCu5ipz+49m2e+WQXpLXr9XYemQ==", + "path": "microsoft.csharp/4.5.0", + "hashPath": "microsoft.csharp.4.5.0.nupkg.sha512" + }, + "Microsoft.Identity.Client/4.30.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-xk8tJeGfB2yD3+d7a0DXyV7/HYyEG10IofUHYHoPYKmDbroi/j9t1BqSHgbq1nARDjg7m8Ki6e21AyNU7e/R4Q==", + "path": "microsoft.identity.client/4.30.1", + "hashPath": "microsoft.identity.client.4.30.1.nupkg.sha512" + }, + "Microsoft.Identity.Client.Extensions.Msal/2.18.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HpG4oLwhQsy0ce7OWq9iDdLtJKOvKRStIKoSEOeBMKuohfuOWNDyhg8fMAJkpG/kFeoe4J329fiMHcJmmB+FPw==", + "path": "microsoft.identity.client.extensions.msal/2.18.4", + "hashPath": "microsoft.identity.client.extensions.msal.2.18.4.nupkg.sha512" + }, + "Microsoft.NETCore.Platforms/1.1.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-TMBuzAHpTenGbGgk0SMTwyEkyijY/Eae4ZGsFNYJvAr/LDn1ku3Etp3FPxChmDp5HHF3kzJuoaa08N0xjqAJfQ==", + "path": "microsoft.netcore.platforms/1.1.1", + "hashPath": "microsoft.netcore.platforms.1.1.1.nupkg.sha512" + }, + "Microsoft.NETCore.Targets/1.1.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3Wrmi0kJDzClwAC+iBdUBpEKmEle8FQNsCs77fkiOIw/9oYA07bL1EZNX0kQ2OMN3xpwvl0vAtOCYY3ndDNlhQ==", + "path": "microsoft.netcore.targets/1.1.3", + "hashPath": "microsoft.netcore.targets.1.1.3.nupkg.sha512" + }, + "Microsoft.Rest.ClientRuntime/2.3.23": { + "type": "package", + "serviceable": true, + "sha512": "sha512-92kNTi1N7zI5wwI2ZXswBRnk61OUYnuYJXrlgOhes5IsAqGmgw9DPGmhUzeY8OaZ8TTrQdDzvgXFnbCHwLzSVA==", + "path": "microsoft.rest.clientruntime/2.3.23", + "hashPath": "microsoft.rest.clientruntime.2.3.23.nupkg.sha512" + }, + "Microsoft.Rest.ClientRuntime.Azure/3.3.19": { + "type": "package", + "serviceable": true, + "sha512": "sha512-+NVBWvRXNwaAPTZUxjUlQggsrf3X0GbiRoxYfgc3kG9E55ZxZxvZPT3nIfC4DNqzGSXUEvmLbckdXgBBzGdUaA==", + "path": "microsoft.rest.clientruntime.azure/3.3.19", + "hashPath": "microsoft.rest.clientruntime.azure.3.3.19.nupkg.sha512" + }, + "Microsoft.Win32.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-9ZQKCWxH7Ijp9BfahvL2Zyf1cJIk8XYLF6Yjzr2yi0b2cOut/HQ31qf1ThHAgCc3WiZMdnWcfJCgN82/0UunxA==", + "path": "microsoft.win32.primitives/4.3.0", + "hashPath": "microsoft.win32.primitives.4.3.0.nupkg.sha512" + }, + "Microsoft.Win32.Registry/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Lw1/VwLH1yxz6SfFEjVRCN0pnflLEsWgnV4qsdJ512/HhTwnKXUG+zDQ4yTO3K/EJQemGoNaBHX5InISNKTzUQ==", + "path": "microsoft.win32.registry/4.3.0", + "hashPath": "microsoft.win32.registry.4.3.0.nupkg.sha512" + }, + "NETStandard.Library/2.0.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-st47PosZSHrjECdjeIzZQbzivYBJFv6P2nv4cj2ypdI204DO+vZ7l5raGMiX4eXMJ53RfOIg+/s4DHVZ54Nu2A==", + "path": "netstandard.library/2.0.3", + "hashPath": "netstandard.library.2.0.3.nupkg.sha512" + }, + "Newtonsoft.Json/10.0.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-hSXaFmh7hNCuEoC4XNY5DrRkLDzYHqPx/Ik23R4J86Z7PE/Y6YidhG602dFVdLBRSdG6xp9NabH3dXpcoxWvww==", + "path": "newtonsoft.json/10.0.3", + "hashPath": "newtonsoft.json.10.0.3.nupkg.sha512" + }, + "PowerShellStandard.Library/5.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-iYaRvQsM1fow9h3uEmio+2m2VXfulgI16AYHaTZ8Sf7erGe27Qc8w/h6QL5UPuwv1aXR40QfzMEwcCeiYJp2cw==", + "path": "powershellstandard.library/5.1.0", + "hashPath": "powershellstandard.library.5.1.0.nupkg.sha512" + }, + "runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HdSSp5MnJSsg08KMfZThpuLPJpPwE5hBXvHwoKWosyHHfe8Mh5WKT0ylEOf6yNzX6Ngjxe4Whkafh5q7Ymac4Q==", + "path": "runtime.debian.8-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.debian.8-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-+yH1a49wJMy8Zt4yx5RhJrxO/DBDByAiCzNwiETI+1S4mPdCu0OY4djdciC7Vssk0l22wQaDLrXxXkp+3+7bVA==", + "path": "runtime.fedora.23-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.fedora.23-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-c3YNH1GQJbfIPJeCnr4avseugSqPrxwIqzthYyZDN6EuOyNOzq+y2KSUfRcXauya1sF4foESTgwM5e1A8arAKw==", + "path": "runtime.fedora.24-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.fedora.24-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.native.System/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-c/qWt2LieNZIj1jGnVNsE2Kl23Ya2aSTBuXMD6V7k9KWr6l16Tqdwq+hJScEpWER9753NWC8h96PaVNY5Ld7Jw==", + "path": "runtime.native.system/4.3.0", + "hashPath": "runtime.native.system.4.3.0.nupkg.sha512" + }, + "runtime.native.System.Net.Http/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ZVuZJqnnegJhd2k/PtAbbIcZ3aZeITq3sj06oKfMBSfphW3HDmk/t4ObvbOk/JA/swGR0LNqMksAh/f7gpTROg==", + "path": "runtime.native.system.net.http/4.3.0", + "hashPath": "runtime.native.system.net.http.4.3.0.nupkg.sha512" + }, + "runtime.native.System.Security.Cryptography.Apple/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-DloMk88juo0OuOWr56QG7MNchmafTLYWvABy36izkrLI5VledI0rq28KGs1i9wbpeT9NPQrx/wTf8U2vazqQ3Q==", + "path": "runtime.native.system.security.cryptography.apple/4.3.0", + "hashPath": "runtime.native.system.security.cryptography.apple.4.3.0.nupkg.sha512" + }, + "runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-NS1U+700m4KFRHR5o4vo9DSlTmlCKu/u7dtE5sUHVIPB+xpXxYQvgBgA6wEIeCz6Yfn0Z52/72WYsToCEPJnrw==", + "path": "runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-b3pthNgxxFcD+Pc0WSEoC0+md3MyhRS6aCEeenvNE3Fdw1HyJ18ZhRFVJJzIeR/O/jpxPboB805Ho0T3Ul7w8A==", + "path": "runtime.opensuse.13.2-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.opensuse.13.2-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-KeLz4HClKf+nFS7p/6Fi/CqyLXh81FpiGzcmuS8DGi9lUqSnZ6Es23/gv2O+1XVGfrbNmviF7CckBpavkBoIFQ==", + "path": "runtime.opensuse.42.1-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.opensuse.42.1-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-kVXCuMTrTlxq4XOOMAysuNwsXWpYeboGddNGpIgNSZmv1b6r/s/DPk0fYMB7Q5Qo4bY68o48jt4T4y5BVecbCQ==", + "path": "runtime.osx.10.10-x64.runtime.native.system.security.cryptography.apple/4.3.0", + "hashPath": "runtime.osx.10.10-x64.runtime.native.system.security.cryptography.apple.4.3.0.nupkg.sha512" + }, + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-X7IdhILzr4ROXd8mI1BUCQMSHSQwelUlBjF1JyTKCjXaOGn2fB4EKBxQbCK2VjO3WaWIdlXZL3W6TiIVnrhX4g==", + "path": "runtime.osx.10.10-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.osx.10.10-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-nyFNiCk/r+VOiIqreLix8yN+q3Wga9+SE8BCgkf+2BwEKiNx6DyvFjCgkfV743/grxv8jHJ8gUK4XEQw7yzRYg==", + "path": "runtime.rhel.7-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.rhel.7-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ytoewC6wGorL7KoCAvRfsgoJPJbNq+64k2SqW6JcOAebWsFUvCCYgfzQMrnpvPiEl4OrblUlhF2ji+Q1+SVLrQ==", + "path": "runtime.ubuntu.14.04-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.ubuntu.14.04-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-I8bKw2I8k58Wx7fMKQJn2R8lamboCAiHfHeV/pS65ScKWMMI0+wJkLYlEKvgW1D/XvSl/221clBoR2q9QNNM7A==", + "path": "runtime.ubuntu.16.04-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.ubuntu.16.04-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-VB5cn/7OzUfzdnC8tqAIMQciVLiq2epm2NrAm1E9OjNRyG4lVhfR61SMcLizejzQP8R8Uf/0l5qOIbUEi+RdEg==", + "path": "runtime.ubuntu.16.10-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.ubuntu.16.10-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "System.Buffers/4.5.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg==", + "path": "system.buffers/4.5.1", + "hashPath": "system.buffers.4.5.1.nupkg.sha512" + }, + "System.Collections/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3Dcj85/TBdVpL5Zr+gEEBUuFe2icOnLalmEh9hfck1PTYbbyWuZgh4fmm2ysCLTrqLQw6t3TgTyJ+VLp+Qb+Lw==", + "path": "system.collections/4.3.0", + "hashPath": "system.collections.4.3.0.nupkg.sha512" + }, + "System.Collections.Concurrent/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ztl69Xp0Y/UXCL+3v3tEU+lIy+bvjKNUmopn1wep/a291pVPK7dxBd6T7WnlQqRog+d1a/hSsgRsmFnIBKTPLQ==", + "path": "system.collections.concurrent/4.3.0", + "hashPath": "system.collections.concurrent.4.3.0.nupkg.sha512" + }, + "System.Collections.NonGeneric/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-prtjIEMhGUnQq6RnPEYLpFt8AtLbp9yq2zxOSrY7KJJZrw25Fi97IzBqY7iqssbM61Ek5b8f3MG/sG1N2sN5KA==", + "path": "system.collections.nongeneric/4.3.0", + "hashPath": "system.collections.nongeneric.4.3.0.nupkg.sha512" + }, + "System.Collections.Specialized/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Epx8PoVZR0iuOnJJDzp7pWvdfMMOAvpUo95pC4ScH2mJuXkKA2Y4aR3cG9qt2klHgSons1WFh4kcGW7cSXvrxg==", + "path": "system.collections.specialized/4.3.0", + "hashPath": "system.collections.specialized.4.3.0.nupkg.sha512" + }, + "System.ComponentModel/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-VyGn1jGRZVfxnh8EdvDCi71v3bMXrsu8aYJOwoV7SNDLVhiEqwP86pPMyRGsDsxhXAm2b3o9OIqeETfN5qfezw==", + "path": "system.componentmodel/4.3.0", + "hashPath": "system.componentmodel.4.3.0.nupkg.sha512" + }, + "System.ComponentModel.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-j8GUkCpM8V4d4vhLIIoBLGey2Z5bCkMVNjEZseyAlm4n5arcsJOeI3zkUP+zvZgzsbLTYh4lYeP/ZD/gdIAPrw==", + "path": "system.componentmodel.primitives/4.3.0", + "hashPath": "system.componentmodel.primitives.4.3.0.nupkg.sha512" + }, + "System.ComponentModel.TypeConverter/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-16pQ6P+EdhcXzPiEK4kbA953Fu0MNG2ovxTZU81/qsCd1zPRsKc3uif5NgvllCY598k6bI0KUyKW8fanlfaDQg==", + "path": "system.componentmodel.typeconverter/4.3.0", + "hashPath": "system.componentmodel.typeconverter.4.3.0.nupkg.sha512" + }, + "System.Diagnostics.Debug/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ZUhUOdqmaG5Jk3Xdb8xi5kIyQYAA4PnTNlHx1mu9ZY3qv4ELIdKbnL/akbGaKi2RnNUWaZsAs31rvzFdewTj2g==", + "path": "system.diagnostics.debug/4.3.0", + "hashPath": "system.diagnostics.debug.4.3.0.nupkg.sha512" + }, + "System.Diagnostics.DiagnosticSource/4.6.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-mbBgoR0rRfl2uimsZ2avZY8g7Xnh1Mza0rJZLPcxqiMWlkGukjmRkuMJ/er+AhQuiRIh80CR/Hpeztr80seV5g==", + "path": "system.diagnostics.diagnosticsource/4.6.0", + "hashPath": "system.diagnostics.diagnosticsource.4.6.0.nupkg.sha512" + }, + "System.Diagnostics.Process/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-J0wOX07+QASQblsfxmIMFc9Iq7KTXYL3zs2G/Xc704Ylv3NpuVdo6gij6V3PGiptTxqsK0K7CdXenRvKUnkA2g==", + "path": "system.diagnostics.process/4.3.0", + "hashPath": "system.diagnostics.process.4.3.0.nupkg.sha512" + }, + "System.Diagnostics.Tools/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-UUvkJfSYJMM6x527dJg2VyWPSRqIVB0Z7dbjHst1zmwTXz5CcXSYJFWRpuigfbO1Lf7yfZiIaEUesfnl/g5EyA==", + "path": "system.diagnostics.tools/4.3.0", + "hashPath": "system.diagnostics.tools.4.3.0.nupkg.sha512" + }, + "System.Diagnostics.Tracing/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-rswfv0f/Cqkh78rA5S8eN8Neocz234+emGCtTF3lxPY96F+mmmUen6tbn0glN6PMvlKQb9bPAY5e9u7fgPTkKw==", + "path": "system.diagnostics.tracing/4.3.0", + "hashPath": "system.diagnostics.tracing.4.3.0.nupkg.sha512" + }, + "System.Dynamic.Runtime/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-SNVi1E/vfWUAs/WYKhE9+qlS6KqK0YVhnlT0HQtr8pMIA8YX3lwy3uPMownDwdYISBdmAF/2holEIldVp85Wag==", + "path": "system.dynamic.runtime/4.3.0", + "hashPath": "system.dynamic.runtime.4.3.0.nupkg.sha512" + }, + "System.Globalization/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-kYdVd2f2PAdFGblzFswE4hkNANJBKRmsfa2X5LG2AcWE1c7/4t0pYae1L8vfZ5xvE2nK/R9JprtToA61OSHWIg==", + "path": "system.globalization/4.3.0", + "hashPath": "system.globalization.4.3.0.nupkg.sha512" + }, + "System.Globalization.Calendars/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-GUlBtdOWT4LTV3I+9/PJW+56AnnChTaOqqTLFtdmype/L500M2LIyXgmtd9X2P2VOkmJd5c67H5SaC2QcL1bFA==", + "path": "system.globalization.calendars/4.3.0", + "hashPath": "system.globalization.calendars.4.3.0.nupkg.sha512" + }, + "System.Globalization.Extensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-FhKmdR6MPG+pxow6wGtNAWdZh7noIOpdD5TwQ3CprzgIE1bBBoim0vbR1+AWsWjQmU7zXHgQo4TWSP6lCeiWcQ==", + "path": "system.globalization.extensions/4.3.0", + "hashPath": "system.globalization.extensions.4.3.0.nupkg.sha512" + }, + "System.IO/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3qjaHvxQPDpSOYICjUoTsmoq5u6QJAFRUITgeT/4gqkF1bajbSmb1kwSxEA8AHlofqgcKJcM8udgieRNhaJ5Cg==", + "path": "system.io/4.3.0", + "hashPath": "system.io.4.3.0.nupkg.sha512" + }, + "System.IO.FileSystem/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3wEMARTnuio+ulnvi+hkRNROYwa1kylvYahhcLk4HSoVdl+xxTFVeVlYOfLwrDPImGls0mDqbMhrza8qnWPTdA==", + "path": "system.io.filesystem/4.3.0", + "hashPath": "system.io.filesystem.4.3.0.nupkg.sha512" + }, + "System.IO.FileSystem.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-6QOb2XFLch7bEc4lIcJH49nJN2HV+OC3fHDgsLVsBVBk3Y4hFAnOBGzJ2lUu7CyDDFo9IBWkSsnbkT6IBwwiMw==", + "path": "system.io.filesystem.primitives/4.3.0", + "hashPath": "system.io.filesystem.primitives.4.3.0.nupkg.sha512" + }, + "System.Linq/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-5DbqIUpsDp0dFftytzuMmc0oeMdQwjcP/EWxsksIz/w1TcFRkZ3yKKz0PqiYFMmEwPSWw+qNVqD7PJ889JzHbw==", + "path": "system.linq/4.3.0", + "hashPath": "system.linq.4.3.0.nupkg.sha512" + }, + "System.Linq.Expressions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-PGKkrd2khG4CnlyJwxwwaWWiSiWFNBGlgXvJpeO0xCXrZ89ODrQ6tjEWS/kOqZ8GwEOUATtKtzp1eRgmYNfclg==", + "path": "system.linq.expressions/4.3.0", + "hashPath": "system.linq.expressions.4.3.0.nupkg.sha512" + }, + "System.Memory/4.5.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-1MbJTHS1lZ4bS4FmsJjnuGJOu88ZzTT2rLvrhW7Ygic+pC0NWA+3hgAen0HRdsocuQXCkUTdFn9yHJJhsijDXw==", + "path": "system.memory/4.5.4", + "hashPath": "system.memory.4.5.4.nupkg.sha512" + }, + "System.Memory.Data/1.0.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-JGkzeqgBsiZwKJZ1IxPNsDFZDhUvuEdX8L8BDC8N3KOj+6zMcNU28CNN59TpZE/VJYy9cP+5M+sbxtWJx3/xtw==", + "path": "system.memory.data/1.0.2", + "hashPath": "system.memory.data.1.0.2.nupkg.sha512" + }, + "System.Numerics.Vectors/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-QQTlPTl06J/iiDbJCiepZ4H//BVraReU4O4EoRw1U02H5TLUIT7xn3GnDp9AXPSlJUDyFs4uWjWafNX6WrAojQ==", + "path": "system.numerics.vectors/4.5.0", + "hashPath": "system.numerics.vectors.4.5.0.nupkg.sha512" + }, + "System.ObjectModel/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-bdX+80eKv9bN6K4N+d77OankKHGn6CH711a6fcOpMQu2Fckp/Ft4L/kW9WznHpyR0NRAvJutzOMHNNlBGvxQzQ==", + "path": "system.objectmodel/4.3.0", + "hashPath": "system.objectmodel.4.3.0.nupkg.sha512" + }, + "System.Private.DataContractSerialization/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-yDaJ2x3mMmjdZEDB4IbezSnCsnjQ4BxinKhRAaP6kEgL6Bb6jANWphs5SzyD8imqeC/3FxgsuXT6ykkiH1uUmA==", + "path": "system.private.datacontractserialization/4.3.0", + "hashPath": "system.private.datacontractserialization.4.3.0.nupkg.sha512" + }, + "System.Private.Uri/4.3.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-o1+7RJnu3Ik3PazR7Z7tJhjPdE000Eq2KGLLWhqJJKXj04wrS8lwb1OFtDF9jzXXADhUuZNJZlPc98uwwqmpFA==", + "path": "system.private.uri/4.3.2", + "hashPath": "system.private.uri.4.3.2.nupkg.sha512" + }, + "System.Reflection/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-KMiAFoW7MfJGa9nDFNcfu+FpEdiHpWgTcS2HdMpDvt9saK3y/G4GwprPyzqjFH9NTaGPQeWNHU+iDlDILj96aQ==", + "path": "system.reflection/4.3.0", + "hashPath": "system.reflection.4.3.0.nupkg.sha512" + }, + "System.Reflection.Emit/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-228FG0jLcIwTVJyz8CLFKueVqQK36ANazUManGaJHkO0icjiIypKW7YLWLIWahyIkdh5M7mV2dJepllLyA1SKg==", + "path": "system.reflection.emit/4.3.0", + "hashPath": "system.reflection.emit.4.3.0.nupkg.sha512" + }, + "System.Reflection.Emit.ILGeneration/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-59tBslAk9733NXLrUJrwNZEzbMAcu8k344OYo+wfSVygcgZ9lgBdGIzH/nrg3LYhXceynyvTc8t5/GD4Ri0/ng==", + "path": "system.reflection.emit.ilgeneration/4.3.0", + "hashPath": "system.reflection.emit.ilgeneration.4.3.0.nupkg.sha512" + }, + "System.Reflection.Emit.Lightweight/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-oadVHGSMsTmZsAF864QYN1t1QzZjIcuKU3l2S9cZOwDdDueNTrqq1yRj7koFfIGEnKpt6NjpL3rOzRhs4ryOgA==", + "path": "system.reflection.emit.lightweight/4.3.0", + "hashPath": "system.reflection.emit.lightweight.4.3.0.nupkg.sha512" + }, + "System.Reflection.Extensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-rJkrJD3kBI5B712aRu4DpSIiHRtr6QlfZSQsb0hYHrDCZORXCFjQfoipo2LaMUHoT9i1B7j7MnfaEKWDFmFQNQ==", + "path": "system.reflection.extensions/4.3.0", + "hashPath": "system.reflection.extensions.4.3.0.nupkg.sha512" + }, + "System.Reflection.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-5RXItQz5As4xN2/YUDxdpsEkMhvw3e6aNveFXUn4Hl/udNTCNhnKp8lT9fnc3MhvGKh1baak5CovpuQUXHAlIA==", + "path": "system.reflection.primitives/4.3.0", + "hashPath": "system.reflection.primitives.4.3.0.nupkg.sha512" + }, + "System.Reflection.TypeExtensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-7u6ulLcZbyxB5Gq0nMkQttcdBTx57ibzw+4IOXEfR+sXYQoHvjW5LTLyNr8O22UIMrqYbchJQJnos4eooYzYJA==", + "path": "system.reflection.typeextensions/4.3.0", + "hashPath": "system.reflection.typeextensions.4.3.0.nupkg.sha512" + }, + "System.Resources.ResourceManager/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-/zrcPkkWdZmI4F92gL/TPumP98AVDu/Wxr3CSJGQQ+XN6wbRZcyfSKVoPo17ilb3iOr0cCRqJInGwNMolqhS8A==", + "path": "system.resources.resourcemanager/4.3.0", + "hashPath": "system.resources.resourcemanager.4.3.0.nupkg.sha512" + }, + "System.Runtime/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-JufQi0vPQ0xGnAczR13AUFglDyVYt4Kqnz1AZaiKZ5+GICq0/1MH/mO/eAJHt/mHW1zjKBJd7kV26SrxddAhiw==", + "path": "system.runtime/4.3.0", + "hashPath": "system.runtime.4.3.0.nupkg.sha512" + }, + "System.Runtime.CompilerServices.Unsafe/4.7.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-zOHkQmzPCn5zm/BH+cxC1XbUS3P4Yoi3xzW7eRgVpDR2tPGSzyMZ17Ig1iRkfJuY0nhxkQQde8pgePNiA7z7TQ==", + "path": "system.runtime.compilerservices.unsafe/4.7.1", + "hashPath": "system.runtime.compilerservices.unsafe.4.7.1.nupkg.sha512" + }, + "System.Runtime.Extensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-guW0uK0fn5fcJJ1tJVXYd7/1h5F+pea1r7FLSOz/f8vPEqbR2ZAknuRDvTQ8PzAilDveOxNjSfr0CHfIQfFk8g==", + "path": "system.runtime.extensions/4.3.0", + "hashPath": "system.runtime.extensions.4.3.0.nupkg.sha512" + }, + "System.Runtime.Handles/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-OKiSUN7DmTWeYb3l51A7EYaeNMnvxwE249YtZz7yooT4gOZhmTjIn48KgSsw2k2lYdLgTKNJw/ZIfSElwDRVgg==", + "path": "system.runtime.handles/4.3.0", + "hashPath": "system.runtime.handles.4.3.0.nupkg.sha512" + }, + "System.Runtime.InteropServices/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-uv1ynXqiMK8mp1GM3jDqPCFN66eJ5w5XNomaK2XD+TuCroNTLFGeZ+WCmBMcBDyTFKou3P6cR6J/QsaqDp7fGQ==", + "path": "system.runtime.interopservices/4.3.0", + "hashPath": "system.runtime.interopservices.4.3.0.nupkg.sha512" + }, + "System.Runtime.Numerics/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-yMH+MfdzHjy17l2KESnPiF2dwq7T+xLnSJar7slyimAkUh/gTrS9/UQOtv7xarskJ2/XDSNvfLGOBQPjL7PaHQ==", + "path": "system.runtime.numerics/4.3.0", + "hashPath": "system.runtime.numerics.4.3.0.nupkg.sha512" + }, + "System.Runtime.Serialization.Formatters/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-KT591AkTNFOTbhZlaeMVvfax3RqhH1EJlcwF50Wm7sfnBLuHiOeZRRKrr1ns3NESkM20KPZ5Ol/ueMq5vg4QoQ==", + "path": "system.runtime.serialization.formatters/4.3.0", + "hashPath": "system.runtime.serialization.formatters.4.3.0.nupkg.sha512" + }, + "System.Runtime.Serialization.Json/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-CpVfOH0M/uZ5PH+M9+Gu56K0j9lJw3M+PKRegTkcrY/stOIvRUeonggxNrfBYLA5WOHL2j15KNJuTuld3x4o9w==", + "path": "system.runtime.serialization.json/4.3.0", + "hashPath": "system.runtime.serialization.json.4.3.0.nupkg.sha512" + }, + "System.Runtime.Serialization.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Wz+0KOukJGAlXjtKr+5Xpuxf8+c8739RI1C+A2BoQZT+wMCCoMDDdO8/4IRHfaVINqL78GO8dW8G2lW/e45Mcw==", + "path": "system.runtime.serialization.primitives/4.3.0", + "hashPath": "system.runtime.serialization.primitives.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.Algorithms/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-W1kd2Y8mYSCgc3ULTAZ0hOP2dSdG5YauTb1089T0/kRcN2MpSAW1izOFROrJgxSlMn3ArsgHXagigyi+ibhevg==", + "path": "system.security.cryptography.algorithms/4.3.0", + "hashPath": "system.security.cryptography.algorithms.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.Cng/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-03idZOqFlsKRL4W+LuCpJ6dBYDUWReug6lZjBa3uJWnk5sPCUXckocevTaUA8iT/MFSrY/2HXkOt753xQ/cf8g==", + "path": "system.security.cryptography.cng/4.3.0", + "hashPath": "system.security.cryptography.cng.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.Csp/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-X4s/FCkEUnRGnwR3aSfVIkldBmtURMhmexALNTwpjklzxWU7yjMk7GHLKOZTNkgnWnE0q7+BCf9N2LVRWxewaA==", + "path": "system.security.cryptography.csp/4.3.0", + "hashPath": "system.security.cryptography.csp.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.Encoding/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-1DEWjZZly9ae9C79vFwqaO5kaOlI5q+3/55ohmq/7dpDyDfc8lYe7YVxJUZ5MF/NtbkRjwFRo14yM4OEo9EmDw==", + "path": "system.security.cryptography.encoding/4.3.0", + "hashPath": "system.security.cryptography.encoding.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-h4CEgOgv5PKVF/HwaHzJRiVboL2THYCou97zpmhjghx5frc7fIvlkY1jL+lnIQyChrJDMNEXS6r7byGif8Cy4w==", + "path": "system.security.cryptography.openssl/4.3.0", + "hashPath": "system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-7bDIyVFNL/xKeFHjhobUAQqSpJq9YTOpbEs6mR233Et01STBMXNAc/V+BM6dwYGc95gVh/Zf+iVXWzj3mE8DWg==", + "path": "system.security.cryptography.primitives/4.3.0", + "hashPath": "system.security.cryptography.primitives.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.ProtectedData/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-wLBKzFnDCxP12VL9ANydSYhk59fC4cvOr9ypYQLPnAj48NQIhqnjdD2yhP8yEKyBJEjERWS9DisKL7rX5eU25Q==", + "path": "system.security.cryptography.protecteddata/4.5.0", + "hashPath": "system.security.cryptography.protecteddata.4.5.0.nupkg.sha512" + }, + "System.Security.Cryptography.X509Certificates/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-t2Tmu6Y2NtJ2um0RtcuhP7ZdNNxXEgUm2JeoA/0NvlMjAhKCnM1NX07TDl3244mVp3QU6LPEhT3HTtH1uF7IYw==", + "path": "system.security.cryptography.x509certificates/4.3.0", + "hashPath": "system.security.cryptography.x509certificates.4.3.0.nupkg.sha512" + }, + "System.Security.SecureString/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-PnXp38O9q/2Oe4iZHMH60kinScv6QiiL2XH54Pj2t0Y6c2zKPEiAZsM/M3wBOHLNTBDFP0zfy13WN2M0qFz5jg==", + "path": "system.security.securestring/4.3.0", + "hashPath": "system.security.securestring.4.3.0.nupkg.sha512" + }, + "System.Text.Encoding/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-BiIg+KWaSDOITze6jGQynxg64naAPtqGHBwDrLaCtixsa5bKiR8dpPOHA7ge3C0JJQizJE+sfkz1wV+BAKAYZw==", + "path": "system.text.encoding/4.3.0", + "hashPath": "system.text.encoding.4.3.0.nupkg.sha512" + }, + "System.Text.Encoding.Extensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-YVMK0Bt/A43RmwizJoZ22ei2nmrhobgeiYwFzC4YAN+nue8RF6djXDMog0UCn+brerQoYVyaS+ghy9P/MUVcmw==", + "path": "system.text.encoding.extensions/4.3.0", + "hashPath": "system.text.encoding.extensions.4.3.0.nupkg.sha512" + }, + "System.Text.Encodings.Web/4.7.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-iTUgB/WtrZ1sWZs84F2hwyQhiRH6QNjQv2DkwrH+WP6RoFga2Q1m3f9/Q7FG8cck8AdHitQkmkXSY8qylcDmuA==", + "path": "system.text.encodings.web/4.7.2", + "hashPath": "system.text.encodings.web.4.7.2.nupkg.sha512" + }, + "System.Text.Json/4.7.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-TcMd95wcrubm9nHvJEQs70rC0H/8omiSGGpU4FQ/ZA1URIqD4pjmFJh2Mfv1yH1eHgJDWTi2hMDXwTET+zOOyg==", + "path": "system.text.json/4.7.2", + "hashPath": "system.text.json.4.7.2.nupkg.sha512" + }, + "System.Text.RegularExpressions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-RpT2DA+L660cBt1FssIE9CAGpLFdFPuheB7pLpKpn6ZXNby7jDERe8Ua/Ne2xGiwLVG2JOqziiaVCGDon5sKFA==", + "path": "system.text.regularexpressions/4.3.0", + "hashPath": "system.text.regularexpressions.4.3.0.nupkg.sha512" + }, + "System.Threading/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-VkUS0kOBcUf3Wwm0TSbrevDDZ6BlM+b/HRiapRFWjM5O0NS0LviG0glKmFK+hhPDd1XFeSdU1GmlLhb2CoVpIw==", + "path": "system.threading/4.3.0", + "hashPath": "system.threading.4.3.0.nupkg.sha512" + }, + "System.Threading.Tasks/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-LbSxKEdOUhVe8BezB/9uOGGppt+nZf6e1VFyw6v3DN6lqitm0OSn2uXMOdtP0M3W4iMcqcivm2J6UgqiwwnXiA==", + "path": "system.threading.tasks/4.3.0", + "hashPath": "system.threading.tasks.4.3.0.nupkg.sha512" + }, + "System.Threading.Tasks.Extensions/4.5.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-zteT+G8xuGu6mS+mzDzYXbzS7rd3K6Fjb9RiZlYlJPam2/hU7JCBZBVEcywNuR+oZ1ncTvc/cq0faRr3P01OVg==", + "path": "system.threading.tasks.extensions/4.5.4", + "hashPath": "system.threading.tasks.extensions.4.5.4.nupkg.sha512" + }, + "System.Threading.Thread/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-OHmbT+Zz065NKII/ZHcH9XO1dEuLGI1L2k7uYss+9C1jLxTC9kTZZuzUOyXHayRk+dft9CiDf3I/QZ0t8JKyBQ==", + "path": "system.threading.thread/4.3.0", + "hashPath": "system.threading.thread.4.3.0.nupkg.sha512" + }, + "System.Threading.ThreadPool/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-k/+g4b7vjdd4aix83sTgC9VG6oXYKAktSfNIJUNGxPEj7ryEOfzHHhfnmsZvjxawwcD9HyWXKCXmPjX8U4zeSw==", + "path": "system.threading.threadpool/4.3.0", + "hashPath": "system.threading.threadpool.4.3.0.nupkg.sha512" + }, + "System.Xml.ReaderWriter/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-GrprA+Z0RUXaR4N7/eW71j1rgMnEnEVlgii49GZyAjTH7uliMnrOU3HNFBr6fEDBCJCIdlVNq9hHbaDR621XBA==", + "path": "system.xml.readerwriter/4.3.0", + "hashPath": "system.xml.readerwriter.4.3.0.nupkg.sha512" + }, + "System.Xml.XDocument/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-5zJ0XDxAIg8iy+t4aMnQAu0MqVbqyvfoUVl1yDV61xdo3Vth45oA2FoY4pPkxYAH5f8ixpmTqXeEIya95x0aCQ==", + "path": "system.xml.xdocument/4.3.0", + "hashPath": "system.xml.xdocument.4.3.0.nupkg.sha512" + }, + "System.Xml.XmlDocument/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-lJ8AxvkX7GQxpC6GFCeBj8ThYVyQczx2+f/cWHJU8tjS7YfI6Cv6bon70jVEgs2CiFbmmM8b9j1oZVx0dSI2Ww==", + "path": "system.xml.xmldocument/4.3.0", + "hashPath": "system.xml.xmldocument.4.3.0.nupkg.sha512" + }, + "System.Xml.XmlSerializer/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-MYoTCP7EZ98RrANESW05J5ZwskKDoN0AuZ06ZflnowE50LTpbR5yRg3tHckTVm5j/m47stuGgCrCHWePyHS70Q==", + "path": "system.xml.xmlserializer/4.3.0", + "hashPath": "system.xml.xmlserializer.4.3.0.nupkg.sha512" + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.dll b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.dll new file mode 100644 index 000000000000..511cf6f6e630 Binary files /dev/null and b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.dll differ diff --git a/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.deps.json b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.deps.json new file mode 100644 index 000000000000..ce563dfdebbe --- /dev/null +++ b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.deps.json @@ -0,0 +1,1316 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v2.1", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v2.1": { + "Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext/1.0.0": { + "dependencies": { + "Azure.Core": "1.22.0", + "Hyak.Common": "1.2.2", + "Microsoft.ApplicationInsights": "2.12.0", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Aks": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Authorization": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Compute": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Graph.Rbac": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.KeyVault": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Monitor": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Network": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.PolicyInsights": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.ResourceManager": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Storage.Management": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Websites": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common.Share": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Storage": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Strategies": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3", + "PowerShellStandard.Library": "5.1.0" + }, + "runtime": { + "Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.dll": {} + } + }, + "Azure.Core/1.22.0": { + "dependencies": { + "Microsoft.Bcl.AsyncInterfaces": "1.1.1", + "System.Diagnostics.DiagnosticSource": "4.6.0", + "System.Memory.Data": "1.0.2", + "System.Numerics.Vectors": "4.5.0", + "System.Text.Encodings.Web": "4.7.2", + "System.Text.Json": "4.7.2", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "runtime": { + "lib/netcoreapp2.1/Azure.Core.dll": { + "assemblyVersion": "1.22.0.0", + "fileVersion": "1.2200.22.6212" + } + } + }, + "Hyak.Common/1.2.2": { + "dependencies": { + "Newtonsoft.Json": "10.0.3", + "System.Reflection": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.4/Hyak.Common.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.2.2.0" + } + } + }, + "Microsoft.ApplicationInsights/2.12.0": { + "dependencies": { + "System.Diagnostics.DiagnosticSource": "4.6.0", + "System.Runtime.InteropServices": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.ApplicationInsights.dll": { + "assemblyVersion": "2.12.0.21496", + "fileVersion": "2.12.0.21496" + } + } + }, + "Microsoft.Azure.Common/2.2.1": { + "dependencies": { + "Hyak.Common": "1.2.2" + }, + "runtime": { + "lib/netstandard1.4/Microsoft.Azure.Common.dll": { + "assemblyVersion": "2.0.0.0", + "fileVersion": "2.2.1.0" + } + } + }, + "Microsoft.Azure.PowerShell.Authentication.Abstractions/1.3.57-preview": { + "dependencies": { + "Hyak.Common": "1.2.2", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Authentication.Abstractions.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Aks/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Aks.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Authorization/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Authorization.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Compute/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Compute.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Graph.Rbac/1.3.57-preview": { + "dependencies": { + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.ResourceManager": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Graph.Rbac.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.KeyVault/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3", + "System.Collections.NonGeneric": "4.3.0", + "System.Collections.Specialized": "4.3.0", + "System.Reflection": "4.3.0", + "System.Security.SecureString": "4.3.0", + "System.Xml.XmlDocument": "4.3.0", + "System.Xml.XmlSerializer": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.KeyVault.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Monitor/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3", + "System.Collections.Specialized": "4.3.0", + "System.Reflection": "4.3.0", + "System.Security.SecureString": "4.3.0", + "System.Xml.XmlDocument": "4.3.0", + "System.Xml.XmlSerializer": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Monitor.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Network/1.3.57-preview": { + "dependencies": { + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Network.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.PolicyInsights/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.PolicyInsights.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.ResourceManager/1.3.57-preview": { + "dependencies": { + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.ResourceManager.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Storage.Management/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "System.Collections.NonGeneric": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Storage.Management.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Websites/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3", + "System.Collections.Specialized": "4.3.0", + "System.Reflection": "4.3.0", + "System.Security.SecureString": "4.3.0", + "System.Xml.XmlDocument": "4.3.0", + "System.Xml.XmlSerializer": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Websites.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Common/1.3.57-preview": { + "dependencies": { + "Hyak.Common": "1.2.2", + "Microsoft.ApplicationInsights": "2.12.0", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common.Share": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Common.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Common.Share/1.3.57-preview": { + "dependencies": { + "Hyak.Common": "1.2.2", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Common.Share.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Storage/1.3.57-preview": { + "dependencies": { + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Storage.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Strategies/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Strategies.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Bcl.AsyncInterfaces/1.1.1": { + "runtime": { + "lib/netstandard2.0/Microsoft.Bcl.AsyncInterfaces.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "4.700.20.21406" + } + } + }, + "Microsoft.CSharp/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Dynamic.Runtime": "4.3.0", + "System.Globalization": "4.3.0", + "System.Linq": "4.3.0", + "System.Linq.Expressions": "4.3.0", + "System.ObjectModel": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Extensions": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Threading": "4.3.0" + } + }, + "Microsoft.Rest.ClientRuntime/2.3.23": { + "dependencies": { + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Rest.ClientRuntime.dll": { + "assemblyVersion": "2.0.0.0", + "fileVersion": "2.3.23.0" + } + } + }, + "Microsoft.Rest.ClientRuntime.Azure/3.3.19": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Rest.ClientRuntime.Azure.dll": { + "assemblyVersion": "3.0.0.0", + "fileVersion": "3.3.18.0" + } + } + }, + "Newtonsoft.Json/10.0.3": { + "dependencies": { + "Microsoft.CSharp": "4.3.0", + "System.ComponentModel.TypeConverter": "4.3.0", + "System.Runtime.Serialization.Formatters": "4.3.0", + "System.Runtime.Serialization.Primitives": "4.3.0", + "System.Xml.XmlDocument": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/Newtonsoft.Json.dll": { + "assemblyVersion": "10.0.0.0", + "fileVersion": "10.0.3.21018" + } + } + }, + "PowerShellStandard.Library/5.1.0": {}, + "System.Collections/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + } + }, + "System.Collections.NonGeneric/4.3.0": { + "dependencies": { + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + } + }, + "System.Collections.Specialized/4.3.0": { + "dependencies": { + "System.Collections.NonGeneric": "4.3.0", + "System.Globalization": "4.3.0", + "System.Globalization.Extensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + } + }, + "System.ComponentModel/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + } + }, + "System.ComponentModel.Primitives/4.3.0": { + "dependencies": { + "System.ComponentModel": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.ComponentModel.TypeConverter/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Collections.NonGeneric": "4.3.0", + "System.Collections.Specialized": "4.3.0", + "System.ComponentModel": "4.3.0", + "System.ComponentModel.Primitives": "4.3.0", + "System.Globalization": "4.3.0", + "System.Linq": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Extensions": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + } + }, + "System.Diagnostics.Debug/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + } + }, + "System.Diagnostics.DiagnosticSource/4.6.0": { + "runtime": { + "lib/netstandard1.3/System.Diagnostics.DiagnosticSource.dll": { + "assemblyVersion": "4.0.4.0", + "fileVersion": "4.700.19.46214" + } + } + }, + "System.Dynamic.Runtime/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Linq": "4.3.0", + "System.Linq.Expressions": "4.3.0", + "System.ObjectModel": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + } + }, + "System.Globalization/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + } + }, + "System.Globalization.Extensions/4.3.0": { + "dependencies": { + "System.Globalization": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.InteropServices": "4.3.0" + } + }, + "System.IO/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading.Tasks": "4.3.0" + } + }, + "System.IO.FileSystem/4.3.0": { + "dependencies": { + "System.IO": "4.3.0", + "System.IO.FileSystem.Primitives": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading.Tasks": "4.3.0" + } + }, + "System.IO.FileSystem.Primitives/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + } + }, + "System.Linq/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0" + } + }, + "System.Linq.Expressions/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Linq": "4.3.0", + "System.ObjectModel": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Emit.Lightweight": "4.3.0", + "System.Reflection.Extensions": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + } + }, + "System.Memory.Data/1.0.2": { + "dependencies": { + "System.Text.Encodings.Web": "4.7.2", + "System.Text.Json": "4.7.2" + }, + "runtime": { + "lib/netstandard2.0/System.Memory.Data.dll": { + "assemblyVersion": "1.0.2.0", + "fileVersion": "1.0.221.20802" + } + } + }, + "System.Numerics.Vectors/4.5.0": {}, + "System.ObjectModel/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Threading": "4.3.0" + } + }, + "System.Reflection/4.3.0": { + "dependencies": { + "System.IO": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Reflection.Emit/4.3.0": { + "dependencies": { + "System.IO": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Reflection.Emit.ILGeneration/4.3.0": { + "dependencies": { + "System.Reflection": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Reflection.Emit.Lightweight/4.3.0": { + "dependencies": { + "System.Reflection": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Reflection.Extensions/4.3.0": { + "dependencies": { + "System.Reflection": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Reflection.Primitives/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + } + }, + "System.Reflection.TypeExtensions/4.3.0": { + "dependencies": { + "System.Reflection": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Resources.ResourceManager/4.3.0": { + "dependencies": { + "System.Globalization": "4.3.0", + "System.Reflection": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Runtime/4.3.0": {}, + "System.Runtime.CompilerServices.Unsafe/4.7.1": { + "runtime": { + "lib/netcoreapp2.0/System.Runtime.CompilerServices.Unsafe.dll": { + "assemblyVersion": "4.0.6.0", + "fileVersion": "4.700.20.12001" + } + } + }, + "System.Runtime.Extensions/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + } + }, + "System.Runtime.Handles/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + } + }, + "System.Runtime.InteropServices/4.3.0": { + "dependencies": { + "System.Reflection": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Handles": "4.3.0" + } + }, + "System.Runtime.Serialization.Formatters/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Reflection": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Serialization.Primitives": "4.3.0" + } + }, + "System.Runtime.Serialization.Primitives/4.3.0": { + "dependencies": { + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Security.Cryptography.Primitives/4.3.0": { + "dependencies": { + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Threading": "4.3.0", + "System.Threading.Tasks": "4.3.0" + } + }, + "System.Security.SecureString/4.3.0": { + "dependencies": { + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading": "4.3.0" + } + }, + "System.Text.Encoding/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + } + }, + "System.Text.Encoding.Extensions/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0", + "System.Text.Encoding": "4.3.0" + } + }, + "System.Text.Encodings.Web/4.7.2": { + "runtime": { + "lib/netstandard2.0/System.Text.Encodings.Web.dll": { + "assemblyVersion": "4.0.5.1", + "fileVersion": "4.700.21.11602" + } + } + }, + "System.Text.Json/4.7.2": { + "dependencies": { + "Microsoft.Bcl.AsyncInterfaces": "1.1.1", + "System.Runtime.CompilerServices.Unsafe": "4.7.1", + "System.Text.Encodings.Web": "4.7.2" + }, + "runtime": { + "lib/netstandard2.0/System.Text.Json.dll": { + "assemblyVersion": "4.0.1.2", + "fileVersion": "4.700.20.21406" + } + } + }, + "System.Text.RegularExpressions/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + } + }, + "System.Threading/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0", + "System.Threading.Tasks": "4.3.0" + } + }, + "System.Threading.Tasks/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + } + }, + "System.Threading.Tasks.Extensions/4.5.4": {}, + "System.Xml.ReaderWriter/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.IO.FileSystem": "4.3.0", + "System.IO.FileSystem.Primitives": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Text.Encoding.Extensions": "4.3.0", + "System.Text.RegularExpressions": "4.3.0", + "System.Threading.Tasks": "4.3.0", + "System.Threading.Tasks.Extensions": "4.5.4" + } + }, + "System.Xml.XmlDocument/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading": "4.3.0", + "System.Xml.ReaderWriter": "4.3.0" + } + }, + "System.Xml.XmlSerializer/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Linq": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Extensions": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Text.RegularExpressions": "4.3.0", + "System.Threading": "4.3.0", + "System.Xml.ReaderWriter": "4.3.0", + "System.Xml.XmlDocument": "4.3.0" + } + } + } + }, + "libraries": { + "Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Azure.Core/1.22.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ze/xRCHSSDe5TIk5vBDbVrauW1EN7UIbnBvIBfMH8KSt/I9+/7yPAjTBDgNBk0IwG6WBV+BBHp4IUtS/PGAQwQ==", + "path": "azure.core/1.22.0", + "hashPath": "azure.core.1.22.0.nupkg.sha512" + }, + "Hyak.Common/1.2.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-uZpnFn48nSQwHcO0/GSBZ7ExaO0sTXKv8KariXXEWLaB4Q3AeQoprYG4WpKsCT0ByW3YffETivgc5rcH5RRDvQ==", + "path": "hyak.common/1.2.2", + "hashPath": "hyak.common.1.2.2.nupkg.sha512" + }, + "Microsoft.ApplicationInsights/2.12.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-4vZcVaxywAzfLm5mAc2/llaZQTzbCqu9KirxxI/t49AkZH5Qxf7JxuAMUuv2/6JEdOOkGDzpvdrrIlf6LkFGcg==", + "path": "microsoft.applicationinsights/2.12.0", + "hashPath": "microsoft.applicationinsights.2.12.0.nupkg.sha512" + }, + "Microsoft.Azure.Common/2.2.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-abzRooh4ACKjzAKxRB6r+SHKW3d+IrLcgtVG81D+3kQU/OMjAZS1oDp9CDalhSbmxa84u0MHM5N+AKeTtKPoiw==", + "path": "microsoft.azure.common/2.2.1", + "hashPath": "microsoft.azure.common.2.2.1.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Authentication.Abstractions/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-bKDPidNeqBpTDikPnIuoMoGd26pD2PNE41cut0ASwL5exJwLNggYO55U+f/cJkgjCUMR8i5nqnlfpGHSS1I0vw==", + "path": "microsoft.azure.powershell.authentication.abstractions/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.authentication.abstractions.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Aks/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-sUGkvOvpqlEK5zdZ7HWaou3GY5bnlNrE0LuZ137+TsNfgx2E3+0Ika3a02i/9+niDDf60xj4LaNOYDSuK5zdJA==", + "path": "microsoft.azure.powershell.clients.aks/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.aks.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Authorization/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Q760F40/qfas2Al+GQhhE4gJt768pQPxlCjqrjjkukgVsq+X/M8IqpCeBzbRTiiyerhcjJoyNxqlGuZpUhqGxw==", + "path": "microsoft.azure.powershell.clients.authorization/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.authorization.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Compute/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-1fcsBdYMmEJPMPN8EAgJkaJ2WxxTKH3VcLECYdL2cfg2bgN8CKbbjSvarrXEezhyduE+LdYnL0e8Pigsnaj55Q==", + "path": "microsoft.azure.powershell.clients.compute/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.compute.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Graph.Rbac/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-BIMthJ1x2vQAN3iWChnNj8BfgrXvKXn+n06E0/h2MNurMXbAOn5eiPIfE8bnj2BO99uSh1ns09yEgOTPJIvZBQ==", + "path": "microsoft.azure.powershell.clients.graph.rbac/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.graph.rbac.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.KeyVault/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-MfvwM8ABj/EswmYu0Bf/8kyAO6kUv2zYSihVn384SVmypomVKUu69GN0VXKbmGaovPI8v3H41Ldp7DqbPRun5A==", + "path": "microsoft.azure.powershell.clients.keyvault/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.keyvault.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Monitor/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-UyCKG5BWVjYFRtH2JNx6f4KdccaSqww2y0OE2PYgib8VhLqkoPr/BQg6vKzaGsghLIerZ/egQ7ntPPw3PCtS3w==", + "path": "microsoft.azure.powershell.clients.monitor/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.monitor.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Network/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-YAAHxw+zzvkGNWAi668NSoTR+V/7vf+gRhu1oFa1O1/f2NGpz5XuqPrQyAPrri64hKqB/k3OMrM7sjlIv16dAg==", + "path": "microsoft.azure.powershell.clients.network/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.network.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.PolicyInsights/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-urRIwRVzzOwpk8HhKq/b785DiL/arnmGUHbN4HvRN6ZsBkE1PU431YwgUlofb9pfB3buLcl0XJFRPLBJ0yZJUw==", + "path": "microsoft.azure.powershell.clients.policyinsights/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.policyinsights.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.ResourceManager/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-juWnd63Z2Sp+6bvtOPOF0Gj1v2AfpxXcuyodd9+U7euBro2G7Yfo2UHmHo/uaYyQUbM3HaXJPvse7BLDKjhe6w==", + "path": "microsoft.azure.powershell.clients.resourcemanager/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.resourcemanager.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Storage.Management/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HPpTWIlN+5ALqJssL7+6BD/vYrWi3eWKQ3QpWYjCFk5c9HVLTNpP+M2dq9jbsxLsZj+5Pt6gC4FIS22Q13Uhag==", + "path": "microsoft.azure.powershell.clients.storage.management/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.storage.management.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Websites/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-b5yBD9FrY02r0kdNNgZ+uU0/QsW3AtmnCE/x1mUG5j8ka/V04AYUo+sDokQBzu+vnK6Y6OrVDtyWjmnKTDHpWA==", + "path": "microsoft.azure.powershell.clients.websites/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.websites.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Common/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-9jZYZ9LKbx16r69y7cO9d7bDjpE0/HgeBU386Y/O6q05VRaq2wAsB2rbQ9AjxcPGHfwS0+2US/RImSSqjVABRQ==", + "path": "microsoft.azure.powershell.common/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.common.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Common.Share/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-4mJSjnwZVLQYWhP47eDzdt0yaLIf2I4pqaEIqcfAjkjdbKpnCXCnJUEFRId061yuKpq1LtfBZkHDRi68I5CJxg==", + "path": "microsoft.azure.powershell.common.share/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.common.share.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Storage/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-fObXEcuhk1JUoQ0fiCV4nK4NJWqvsfsKCzapF7SFEQ87X6AasL6m5KGT8JQSnHmc849xxxaixPTxyWaf9BBlpw==", + "path": "microsoft.azure.powershell.storage/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.storage.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Strategies/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HwyxUwDHCmY6Zdxg2xpFC9Gqmu92Xr0cAr4ElWYwz8Z7PE9uYVkTpKMIKd7oIJJgsIANTfqEU1HKoeI3FXPLqw==", + "path": "microsoft.azure.powershell.strategies/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.strategies.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Bcl.AsyncInterfaces/1.1.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-yuvf07qFWFqtK3P/MRkEKLhn5r2UbSpVueRziSqj0yJQIKFwG1pq9mOayK3zE5qZCTs0CbrwL9M6R8VwqyGy2w==", + "path": "microsoft.bcl.asyncinterfaces/1.1.1", + "hashPath": "microsoft.bcl.asyncinterfaces.1.1.1.nupkg.sha512" + }, + "Microsoft.CSharp/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-P+MBhIM0YX+JqROuf7i306ZLJEjQYA9uUyRDE+OqwUI5sh41e2ZbPQV3LfAPh+29cmceE1pUffXsGfR4eMY3KA==", + "path": "microsoft.csharp/4.3.0", + "hashPath": "microsoft.csharp.4.3.0.nupkg.sha512" + }, + "Microsoft.Rest.ClientRuntime/2.3.23": { + "type": "package", + "serviceable": true, + "sha512": "sha512-92kNTi1N7zI5wwI2ZXswBRnk61OUYnuYJXrlgOhes5IsAqGmgw9DPGmhUzeY8OaZ8TTrQdDzvgXFnbCHwLzSVA==", + "path": "microsoft.rest.clientruntime/2.3.23", + "hashPath": "microsoft.rest.clientruntime.2.3.23.nupkg.sha512" + }, + "Microsoft.Rest.ClientRuntime.Azure/3.3.19": { + "type": "package", + "serviceable": true, + "sha512": "sha512-+NVBWvRXNwaAPTZUxjUlQggsrf3X0GbiRoxYfgc3kG9E55ZxZxvZPT3nIfC4DNqzGSXUEvmLbckdXgBBzGdUaA==", + "path": "microsoft.rest.clientruntime.azure/3.3.19", + "hashPath": "microsoft.rest.clientruntime.azure.3.3.19.nupkg.sha512" + }, + "Newtonsoft.Json/10.0.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-hSXaFmh7hNCuEoC4XNY5DrRkLDzYHqPx/Ik23R4J86Z7PE/Y6YidhG602dFVdLBRSdG6xp9NabH3dXpcoxWvww==", + "path": "newtonsoft.json/10.0.3", + "hashPath": "newtonsoft.json.10.0.3.nupkg.sha512" + }, + "PowerShellStandard.Library/5.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-iYaRvQsM1fow9h3uEmio+2m2VXfulgI16AYHaTZ8Sf7erGe27Qc8w/h6QL5UPuwv1aXR40QfzMEwcCeiYJp2cw==", + "path": "powershellstandard.library/5.1.0", + "hashPath": "powershellstandard.library.5.1.0.nupkg.sha512" + }, + "System.Collections/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3Dcj85/TBdVpL5Zr+gEEBUuFe2icOnLalmEh9hfck1PTYbbyWuZgh4fmm2ysCLTrqLQw6t3TgTyJ+VLp+Qb+Lw==", + "path": "system.collections/4.3.0", + "hashPath": "system.collections.4.3.0.nupkg.sha512" + }, + "System.Collections.NonGeneric/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-prtjIEMhGUnQq6RnPEYLpFt8AtLbp9yq2zxOSrY7KJJZrw25Fi97IzBqY7iqssbM61Ek5b8f3MG/sG1N2sN5KA==", + "path": "system.collections.nongeneric/4.3.0", + "hashPath": "system.collections.nongeneric.4.3.0.nupkg.sha512" + }, + "System.Collections.Specialized/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Epx8PoVZR0iuOnJJDzp7pWvdfMMOAvpUo95pC4ScH2mJuXkKA2Y4aR3cG9qt2klHgSons1WFh4kcGW7cSXvrxg==", + "path": "system.collections.specialized/4.3.0", + "hashPath": "system.collections.specialized.4.3.0.nupkg.sha512" + }, + "System.ComponentModel/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-VyGn1jGRZVfxnh8EdvDCi71v3bMXrsu8aYJOwoV7SNDLVhiEqwP86pPMyRGsDsxhXAm2b3o9OIqeETfN5qfezw==", + "path": "system.componentmodel/4.3.0", + "hashPath": "system.componentmodel.4.3.0.nupkg.sha512" + }, + "System.ComponentModel.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-j8GUkCpM8V4d4vhLIIoBLGey2Z5bCkMVNjEZseyAlm4n5arcsJOeI3zkUP+zvZgzsbLTYh4lYeP/ZD/gdIAPrw==", + "path": "system.componentmodel.primitives/4.3.0", + "hashPath": "system.componentmodel.primitives.4.3.0.nupkg.sha512" + }, + "System.ComponentModel.TypeConverter/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-16pQ6P+EdhcXzPiEK4kbA953Fu0MNG2ovxTZU81/qsCd1zPRsKc3uif5NgvllCY598k6bI0KUyKW8fanlfaDQg==", + "path": "system.componentmodel.typeconverter/4.3.0", + "hashPath": "system.componentmodel.typeconverter.4.3.0.nupkg.sha512" + }, + "System.Diagnostics.Debug/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ZUhUOdqmaG5Jk3Xdb8xi5kIyQYAA4PnTNlHx1mu9ZY3qv4ELIdKbnL/akbGaKi2RnNUWaZsAs31rvzFdewTj2g==", + "path": "system.diagnostics.debug/4.3.0", + "hashPath": "system.diagnostics.debug.4.3.0.nupkg.sha512" + }, + "System.Diagnostics.DiagnosticSource/4.6.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-mbBgoR0rRfl2uimsZ2avZY8g7Xnh1Mza0rJZLPcxqiMWlkGukjmRkuMJ/er+AhQuiRIh80CR/Hpeztr80seV5g==", + "path": "system.diagnostics.diagnosticsource/4.6.0", + "hashPath": "system.diagnostics.diagnosticsource.4.6.0.nupkg.sha512" + }, + "System.Dynamic.Runtime/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-SNVi1E/vfWUAs/WYKhE9+qlS6KqK0YVhnlT0HQtr8pMIA8YX3lwy3uPMownDwdYISBdmAF/2holEIldVp85Wag==", + "path": "system.dynamic.runtime/4.3.0", + "hashPath": "system.dynamic.runtime.4.3.0.nupkg.sha512" + }, + "System.Globalization/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-kYdVd2f2PAdFGblzFswE4hkNANJBKRmsfa2X5LG2AcWE1c7/4t0pYae1L8vfZ5xvE2nK/R9JprtToA61OSHWIg==", + "path": "system.globalization/4.3.0", + "hashPath": "system.globalization.4.3.0.nupkg.sha512" + }, + "System.Globalization.Extensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-FhKmdR6MPG+pxow6wGtNAWdZh7noIOpdD5TwQ3CprzgIE1bBBoim0vbR1+AWsWjQmU7zXHgQo4TWSP6lCeiWcQ==", + "path": "system.globalization.extensions/4.3.0", + "hashPath": "system.globalization.extensions.4.3.0.nupkg.sha512" + }, + "System.IO/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3qjaHvxQPDpSOYICjUoTsmoq5u6QJAFRUITgeT/4gqkF1bajbSmb1kwSxEA8AHlofqgcKJcM8udgieRNhaJ5Cg==", + "path": "system.io/4.3.0", + "hashPath": "system.io.4.3.0.nupkg.sha512" + }, + "System.IO.FileSystem/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3wEMARTnuio+ulnvi+hkRNROYwa1kylvYahhcLk4HSoVdl+xxTFVeVlYOfLwrDPImGls0mDqbMhrza8qnWPTdA==", + "path": "system.io.filesystem/4.3.0", + "hashPath": "system.io.filesystem.4.3.0.nupkg.sha512" + }, + "System.IO.FileSystem.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-6QOb2XFLch7bEc4lIcJH49nJN2HV+OC3fHDgsLVsBVBk3Y4hFAnOBGzJ2lUu7CyDDFo9IBWkSsnbkT6IBwwiMw==", + "path": "system.io.filesystem.primitives/4.3.0", + "hashPath": "system.io.filesystem.primitives.4.3.0.nupkg.sha512" + }, + "System.Linq/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-5DbqIUpsDp0dFftytzuMmc0oeMdQwjcP/EWxsksIz/w1TcFRkZ3yKKz0PqiYFMmEwPSWw+qNVqD7PJ889JzHbw==", + "path": "system.linq/4.3.0", + "hashPath": "system.linq.4.3.0.nupkg.sha512" + }, + "System.Linq.Expressions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-PGKkrd2khG4CnlyJwxwwaWWiSiWFNBGlgXvJpeO0xCXrZ89ODrQ6tjEWS/kOqZ8GwEOUATtKtzp1eRgmYNfclg==", + "path": "system.linq.expressions/4.3.0", + "hashPath": "system.linq.expressions.4.3.0.nupkg.sha512" + }, + "System.Memory.Data/1.0.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-JGkzeqgBsiZwKJZ1IxPNsDFZDhUvuEdX8L8BDC8N3KOj+6zMcNU28CNN59TpZE/VJYy9cP+5M+sbxtWJx3/xtw==", + "path": "system.memory.data/1.0.2", + "hashPath": "system.memory.data.1.0.2.nupkg.sha512" + }, + "System.Numerics.Vectors/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-QQTlPTl06J/iiDbJCiepZ4H//BVraReU4O4EoRw1U02H5TLUIT7xn3GnDp9AXPSlJUDyFs4uWjWafNX6WrAojQ==", + "path": "system.numerics.vectors/4.5.0", + "hashPath": "system.numerics.vectors.4.5.0.nupkg.sha512" + }, + "System.ObjectModel/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-bdX+80eKv9bN6K4N+d77OankKHGn6CH711a6fcOpMQu2Fckp/Ft4L/kW9WznHpyR0NRAvJutzOMHNNlBGvxQzQ==", + "path": "system.objectmodel/4.3.0", + "hashPath": "system.objectmodel.4.3.0.nupkg.sha512" + }, + "System.Reflection/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-KMiAFoW7MfJGa9nDFNcfu+FpEdiHpWgTcS2HdMpDvt9saK3y/G4GwprPyzqjFH9NTaGPQeWNHU+iDlDILj96aQ==", + "path": "system.reflection/4.3.0", + "hashPath": "system.reflection.4.3.0.nupkg.sha512" + }, + "System.Reflection.Emit/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-228FG0jLcIwTVJyz8CLFKueVqQK36ANazUManGaJHkO0icjiIypKW7YLWLIWahyIkdh5M7mV2dJepllLyA1SKg==", + "path": "system.reflection.emit/4.3.0", + "hashPath": "system.reflection.emit.4.3.0.nupkg.sha512" + }, + "System.Reflection.Emit.ILGeneration/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-59tBslAk9733NXLrUJrwNZEzbMAcu8k344OYo+wfSVygcgZ9lgBdGIzH/nrg3LYhXceynyvTc8t5/GD4Ri0/ng==", + "path": "system.reflection.emit.ilgeneration/4.3.0", + "hashPath": "system.reflection.emit.ilgeneration.4.3.0.nupkg.sha512" + }, + "System.Reflection.Emit.Lightweight/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-oadVHGSMsTmZsAF864QYN1t1QzZjIcuKU3l2S9cZOwDdDueNTrqq1yRj7koFfIGEnKpt6NjpL3rOzRhs4ryOgA==", + "path": "system.reflection.emit.lightweight/4.3.0", + "hashPath": "system.reflection.emit.lightweight.4.3.0.nupkg.sha512" + }, + "System.Reflection.Extensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-rJkrJD3kBI5B712aRu4DpSIiHRtr6QlfZSQsb0hYHrDCZORXCFjQfoipo2LaMUHoT9i1B7j7MnfaEKWDFmFQNQ==", + "path": "system.reflection.extensions/4.3.0", + "hashPath": "system.reflection.extensions.4.3.0.nupkg.sha512" + }, + "System.Reflection.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-5RXItQz5As4xN2/YUDxdpsEkMhvw3e6aNveFXUn4Hl/udNTCNhnKp8lT9fnc3MhvGKh1baak5CovpuQUXHAlIA==", + "path": "system.reflection.primitives/4.3.0", + "hashPath": "system.reflection.primitives.4.3.0.nupkg.sha512" + }, + "System.Reflection.TypeExtensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-7u6ulLcZbyxB5Gq0nMkQttcdBTx57ibzw+4IOXEfR+sXYQoHvjW5LTLyNr8O22UIMrqYbchJQJnos4eooYzYJA==", + "path": "system.reflection.typeextensions/4.3.0", + "hashPath": "system.reflection.typeextensions.4.3.0.nupkg.sha512" + }, + "System.Resources.ResourceManager/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-/zrcPkkWdZmI4F92gL/TPumP98AVDu/Wxr3CSJGQQ+XN6wbRZcyfSKVoPo17ilb3iOr0cCRqJInGwNMolqhS8A==", + "path": "system.resources.resourcemanager/4.3.0", + "hashPath": "system.resources.resourcemanager.4.3.0.nupkg.sha512" + }, + "System.Runtime/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-JufQi0vPQ0xGnAczR13AUFglDyVYt4Kqnz1AZaiKZ5+GICq0/1MH/mO/eAJHt/mHW1zjKBJd7kV26SrxddAhiw==", + "path": "system.runtime/4.3.0", + "hashPath": "system.runtime.4.3.0.nupkg.sha512" + }, + "System.Runtime.CompilerServices.Unsafe/4.7.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-zOHkQmzPCn5zm/BH+cxC1XbUS3P4Yoi3xzW7eRgVpDR2tPGSzyMZ17Ig1iRkfJuY0nhxkQQde8pgePNiA7z7TQ==", + "path": "system.runtime.compilerservices.unsafe/4.7.1", + "hashPath": "system.runtime.compilerservices.unsafe.4.7.1.nupkg.sha512" + }, + "System.Runtime.Extensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-guW0uK0fn5fcJJ1tJVXYd7/1h5F+pea1r7FLSOz/f8vPEqbR2ZAknuRDvTQ8PzAilDveOxNjSfr0CHfIQfFk8g==", + "path": "system.runtime.extensions/4.3.0", + "hashPath": "system.runtime.extensions.4.3.0.nupkg.sha512" + }, + "System.Runtime.Handles/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-OKiSUN7DmTWeYb3l51A7EYaeNMnvxwE249YtZz7yooT4gOZhmTjIn48KgSsw2k2lYdLgTKNJw/ZIfSElwDRVgg==", + "path": "system.runtime.handles/4.3.0", + "hashPath": "system.runtime.handles.4.3.0.nupkg.sha512" + }, + "System.Runtime.InteropServices/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-uv1ynXqiMK8mp1GM3jDqPCFN66eJ5w5XNomaK2XD+TuCroNTLFGeZ+WCmBMcBDyTFKou3P6cR6J/QsaqDp7fGQ==", + "path": "system.runtime.interopservices/4.3.0", + "hashPath": "system.runtime.interopservices.4.3.0.nupkg.sha512" + }, + "System.Runtime.Serialization.Formatters/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-KT591AkTNFOTbhZlaeMVvfax3RqhH1EJlcwF50Wm7sfnBLuHiOeZRRKrr1ns3NESkM20KPZ5Ol/ueMq5vg4QoQ==", + "path": "system.runtime.serialization.formatters/4.3.0", + "hashPath": "system.runtime.serialization.formatters.4.3.0.nupkg.sha512" + }, + "System.Runtime.Serialization.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Wz+0KOukJGAlXjtKr+5Xpuxf8+c8739RI1C+A2BoQZT+wMCCoMDDdO8/4IRHfaVINqL78GO8dW8G2lW/e45Mcw==", + "path": "system.runtime.serialization.primitives/4.3.0", + "hashPath": "system.runtime.serialization.primitives.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-7bDIyVFNL/xKeFHjhobUAQqSpJq9YTOpbEs6mR233Et01STBMXNAc/V+BM6dwYGc95gVh/Zf+iVXWzj3mE8DWg==", + "path": "system.security.cryptography.primitives/4.3.0", + "hashPath": "system.security.cryptography.primitives.4.3.0.nupkg.sha512" + }, + "System.Security.SecureString/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-PnXp38O9q/2Oe4iZHMH60kinScv6QiiL2XH54Pj2t0Y6c2zKPEiAZsM/M3wBOHLNTBDFP0zfy13WN2M0qFz5jg==", + "path": "system.security.securestring/4.3.0", + "hashPath": "system.security.securestring.4.3.0.nupkg.sha512" + }, + "System.Text.Encoding/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-BiIg+KWaSDOITze6jGQynxg64naAPtqGHBwDrLaCtixsa5bKiR8dpPOHA7ge3C0JJQizJE+sfkz1wV+BAKAYZw==", + "path": "system.text.encoding/4.3.0", + "hashPath": "system.text.encoding.4.3.0.nupkg.sha512" + }, + "System.Text.Encoding.Extensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-YVMK0Bt/A43RmwizJoZ22ei2nmrhobgeiYwFzC4YAN+nue8RF6djXDMog0UCn+brerQoYVyaS+ghy9P/MUVcmw==", + "path": "system.text.encoding.extensions/4.3.0", + "hashPath": "system.text.encoding.extensions.4.3.0.nupkg.sha512" + }, + "System.Text.Encodings.Web/4.7.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-iTUgB/WtrZ1sWZs84F2hwyQhiRH6QNjQv2DkwrH+WP6RoFga2Q1m3f9/Q7FG8cck8AdHitQkmkXSY8qylcDmuA==", + "path": "system.text.encodings.web/4.7.2", + "hashPath": "system.text.encodings.web.4.7.2.nupkg.sha512" + }, + "System.Text.Json/4.7.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-TcMd95wcrubm9nHvJEQs70rC0H/8omiSGGpU4FQ/ZA1URIqD4pjmFJh2Mfv1yH1eHgJDWTi2hMDXwTET+zOOyg==", + "path": "system.text.json/4.7.2", + "hashPath": "system.text.json.4.7.2.nupkg.sha512" + }, + "System.Text.RegularExpressions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-RpT2DA+L660cBt1FssIE9CAGpLFdFPuheB7pLpKpn6ZXNby7jDERe8Ua/Ne2xGiwLVG2JOqziiaVCGDon5sKFA==", + "path": "system.text.regularexpressions/4.3.0", + "hashPath": "system.text.regularexpressions.4.3.0.nupkg.sha512" + }, + "System.Threading/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-VkUS0kOBcUf3Wwm0TSbrevDDZ6BlM+b/HRiapRFWjM5O0NS0LviG0glKmFK+hhPDd1XFeSdU1GmlLhb2CoVpIw==", + "path": "system.threading/4.3.0", + "hashPath": "system.threading.4.3.0.nupkg.sha512" + }, + "System.Threading.Tasks/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-LbSxKEdOUhVe8BezB/9uOGGppt+nZf6e1VFyw6v3DN6lqitm0OSn2uXMOdtP0M3W4iMcqcivm2J6UgqiwwnXiA==", + "path": "system.threading.tasks/4.3.0", + "hashPath": "system.threading.tasks.4.3.0.nupkg.sha512" + }, + "System.Threading.Tasks.Extensions/4.5.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-zteT+G8xuGu6mS+mzDzYXbzS7rd3K6Fjb9RiZlYlJPam2/hU7JCBZBVEcywNuR+oZ1ncTvc/cq0faRr3P01OVg==", + "path": "system.threading.tasks.extensions/4.5.4", + "hashPath": "system.threading.tasks.extensions.4.5.4.nupkg.sha512" + }, + "System.Xml.ReaderWriter/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-GrprA+Z0RUXaR4N7/eW71j1rgMnEnEVlgii49GZyAjTH7uliMnrOU3HNFBr6fEDBCJCIdlVNq9hHbaDR621XBA==", + "path": "system.xml.readerwriter/4.3.0", + "hashPath": "system.xml.readerwriter.4.3.0.nupkg.sha512" + }, + "System.Xml.XmlDocument/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-lJ8AxvkX7GQxpC6GFCeBj8ThYVyQczx2+f/cWHJU8tjS7YfI6Cv6bon70jVEgs2CiFbmmM8b9j1oZVx0dSI2Ww==", + "path": "system.xml.xmldocument/4.3.0", + "hashPath": "system.xml.xmldocument.4.3.0.nupkg.sha512" + }, + "System.Xml.XmlSerializer/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-MYoTCP7EZ98RrANESW05J5ZwskKDoN0AuZ06ZflnowE50LTpbR5yRg3tHckTVm5j/m47stuGgCrCHWePyHS70Q==", + "path": "system.xml.xmlserializer/4.3.0", + "hashPath": "system.xml.xmlserializer.4.3.0.nupkg.sha512" + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.dll b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.dll new file mode 100644 index 000000000000..239999aa2f3c Binary files /dev/null and b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.dll differ diff --git a/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authenticators.dll b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authenticators.dll new file mode 100644 index 000000000000..2b2e59f4a657 Binary files /dev/null and b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authenticators.dll differ diff --git a/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Aks.dll b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Aks.dll new file mode 100644 index 000000000000..d966f6c302c5 Binary files /dev/null and b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Aks.dll differ diff --git a/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Authorization.dll b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Authorization.dll new file mode 100644 index 000000000000..2667669dd3f4 Binary files /dev/null and b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Authorization.dll differ diff --git a/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Compute.dll b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Compute.dll new file mode 100644 index 000000000000..a11687928f60 Binary files /dev/null and b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Compute.dll differ diff --git a/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Graph.Rbac.dll b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Graph.Rbac.dll new file mode 100644 index 000000000000..78fd60ad7aeb Binary files /dev/null and b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Graph.Rbac.dll differ diff --git a/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.KeyVault.dll b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.KeyVault.dll new file mode 100644 index 000000000000..b33058d94c53 Binary files /dev/null and b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.KeyVault.dll differ diff --git a/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Monitor.dll b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Monitor.dll new file mode 100644 index 000000000000..e07270d24805 Binary files /dev/null and b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Monitor.dll differ diff --git a/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Network.dll b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Network.dll new file mode 100644 index 000000000000..6f489252bcac Binary files /dev/null and b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Network.dll differ diff --git a/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.PolicyInsights.dll b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.PolicyInsights.dll new file mode 100644 index 000000000000..c19efdb8e00b Binary files /dev/null and b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.PolicyInsights.dll differ diff --git a/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.ResourceManager.dll b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.ResourceManager.dll new file mode 100644 index 000000000000..0d443a2ecaaa Binary files /dev/null and b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.ResourceManager.dll differ diff --git a/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Storage.Management.dll b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Storage.Management.dll new file mode 100644 index 000000000000..482ccf22b352 Binary files /dev/null and b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Storage.Management.dll differ diff --git a/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Websites.dll b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Websites.dll new file mode 100644 index 000000000000..4bf3ee9bd78d Binary files /dev/null and b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Websites.dll differ diff --git a/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Cmdlets.Accounts.deps.json b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Cmdlets.Accounts.deps.json new file mode 100644 index 000000000000..54274e52ee76 --- /dev/null +++ b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Cmdlets.Accounts.deps.json @@ -0,0 +1,2413 @@ +{ + "runtimeTarget": { + "name": ".NETStandard,Version=v2.0/", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETStandard,Version=v2.0": {}, + ".NETStandard,Version=v2.0/": { + "Microsoft.Azure.PowerShell.Cmdlets.Accounts/1.0.0": { + "dependencies": { + "Azure.Core": "1.22.0", + "Hyak.Common": "1.2.2", + "Microsoft.ApplicationInsights": "2.12.0", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Azure.PowerShell.Authentication": "1.0.0", + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Authentication.ResourceManager": "1.0.0", + "Microsoft.Azure.PowerShell.Authenticators": "1.0.0", + "Microsoft.Azure.PowerShell.Clients.Aks": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Authorization": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Compute": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Graph.Rbac": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.KeyVault": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Monitor": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Network": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.PolicyInsights": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.ResourceManager": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Storage.Management": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Websites": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common.Share": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Storage": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Strategies": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "NETStandard.Library": "2.0.3", + "Newtonsoft.Json": "10.0.3", + "PowerShellStandard.Library": "5.1.0", + "System.Security.Permissions": "4.5.0" + }, + "runtime": { + "Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll": {} + } + }, + "Azure.Core/1.22.0": { + "dependencies": { + "Microsoft.Bcl.AsyncInterfaces": "1.1.1", + "System.Diagnostics.DiagnosticSource": "4.6.0", + "System.Memory.Data": "1.0.2", + "System.Numerics.Vectors": "4.5.0", + "System.Text.Encodings.Web": "4.7.2", + "System.Text.Json": "4.7.2", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "runtime": { + "lib/netstandard2.0/Azure.Core.dll": { + "assemblyVersion": "1.22.0.0", + "fileVersion": "1.2200.22.6212" + } + } + }, + "Azure.Identity/1.5.0": { + "dependencies": { + "Azure.Core": "1.22.0", + "Microsoft.Identity.Client": "4.30.1", + "Microsoft.Identity.Client.Extensions.Msal": "2.18.4", + "System.Memory": "4.5.4", + "System.Security.Cryptography.ProtectedData": "4.5.0", + "System.Text.Json": "4.7.2", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "runtime": { + "lib/netstandard2.0/Azure.Identity.dll": { + "assemblyVersion": "1.5.0.0", + "fileVersion": "1.500.21.51401" + } + } + }, + "Hyak.Common/1.2.2": { + "dependencies": { + "NETStandard.Library": "2.0.3", + "Newtonsoft.Json": "10.0.3", + "System.Reflection": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.4/Hyak.Common.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.2.2.0" + } + } + }, + "Microsoft.ApplicationInsights/2.12.0": { + "dependencies": { + "System.Diagnostics.DiagnosticSource": "4.6.0", + "System.Runtime.InteropServices": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.ApplicationInsights.dll": { + "assemblyVersion": "2.12.0.21496", + "fileVersion": "2.12.0.21496" + } + } + }, + "Microsoft.Azure.Common/2.2.1": { + "dependencies": { + "Hyak.Common": "1.2.2", + "NETStandard.Library": "2.0.3" + }, + "runtime": { + "lib/netstandard1.4/Microsoft.Azure.Common.dll": { + "assemblyVersion": "2.0.0.0", + "fileVersion": "2.2.1.0" + } + } + }, + "Microsoft.Azure.PowerShell.Authentication.Abstractions/1.3.57-preview": { + "dependencies": { + "Hyak.Common": "1.2.2", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Authentication.Abstractions.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Aks/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Aks.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Authorization/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Authorization.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Compute/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Compute.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Graph.Rbac/1.3.57-preview": { + "dependencies": { + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.ResourceManager": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Graph.Rbac.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.KeyVault/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3", + "System.Collections.NonGeneric": "4.3.0", + "System.Collections.Specialized": "4.3.0", + "System.Reflection": "4.3.0", + "System.Security.SecureString": "4.3.0", + "System.Xml.XmlDocument": "4.3.0", + "System.Xml.XmlSerializer": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.KeyVault.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Monitor/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3", + "System.Collections.Specialized": "4.3.0", + "System.Reflection": "4.3.0", + "System.Security.SecureString": "4.3.0", + "System.Xml.XmlDocument": "4.3.0", + "System.Xml.XmlSerializer": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Monitor.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Network/1.3.57-preview": { + "dependencies": { + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Network.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.PolicyInsights/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.PolicyInsights.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.ResourceManager/1.3.57-preview": { + "dependencies": { + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.ResourceManager.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Storage.Management/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "System.Collections.NonGeneric": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Storage.Management.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Websites/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3", + "System.Collections.Specialized": "4.3.0", + "System.Reflection": "4.3.0", + "System.Security.SecureString": "4.3.0", + "System.Xml.XmlDocument": "4.3.0", + "System.Xml.XmlSerializer": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Websites.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Common/1.3.57-preview": { + "dependencies": { + "Hyak.Common": "1.2.2", + "Microsoft.ApplicationInsights": "2.12.0", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common.Share": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Common.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Common.Share/1.3.57-preview": { + "dependencies": { + "Hyak.Common": "1.2.2", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Common.Share.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Storage/1.3.57-preview": { + "dependencies": { + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Storage.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Strategies/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Strategies.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Bcl.AsyncInterfaces/1.1.1": { + "dependencies": { + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Bcl.AsyncInterfaces.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "4.700.20.21406" + } + } + }, + "Microsoft.CSharp/4.5.0": { + "runtime": { + "lib/netstandard2.0/Microsoft.CSharp.dll": { + "assemblyVersion": "4.0.4.0", + "fileVersion": "4.6.26515.6" + } + } + }, + "Microsoft.Identity.Client/4.30.1": { + "dependencies": { + "Microsoft.CSharp": "4.5.0", + "NETStandard.Library": "2.0.3", + "System.ComponentModel.TypeConverter": "4.3.0", + "System.Diagnostics.Process": "4.3.0", + "System.Dynamic.Runtime": "4.3.0", + "System.Private.Uri": "4.3.2", + "System.Runtime.Serialization.Formatters": "4.3.0", + "System.Runtime.Serialization.Json": "4.3.0", + "System.Runtime.Serialization.Primitives": "4.3.0", + "System.Security.Cryptography.X509Certificates": "4.3.0", + "System.Security.SecureString": "4.3.0", + "System.Xml.XDocument": "4.3.0", + "System.Xml.XmlDocument": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/Microsoft.Identity.Client.dll": { + "assemblyVersion": "4.30.1.0", + "fileVersion": "4.30.1.0" + } + } + }, + "Microsoft.Identity.Client.Extensions.Msal/2.18.4": { + "dependencies": { + "Microsoft.Identity.Client": "4.30.1", + "System.Security.Cryptography.ProtectedData": "4.5.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Identity.Client.Extensions.Msal.dll": { + "assemblyVersion": "2.18.4.0", + "fileVersion": "2.18.4.0" + } + } + }, + "Microsoft.NETCore.Platforms/1.1.1": {}, + "Microsoft.NETCore.Targets/1.1.3": {}, + "Microsoft.Rest.ClientRuntime/2.3.23": { + "dependencies": { + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Rest.ClientRuntime.dll": { + "assemblyVersion": "2.0.0.0", + "fileVersion": "2.3.23.0" + } + } + }, + "Microsoft.Rest.ClientRuntime.Azure/3.3.19": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Rest.ClientRuntime.Azure.dll": { + "assemblyVersion": "3.0.0.0", + "fileVersion": "3.3.18.0" + } + } + }, + "Microsoft.Win32.Primitives/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "Microsoft.Win32.Registry/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Collections": "4.3.0", + "System.Globalization": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0" + } + }, + "NETStandard.Library/2.0.3": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1" + } + }, + "Newtonsoft.Json/10.0.3": { + "dependencies": { + "Microsoft.CSharp": "4.5.0", + "NETStandard.Library": "2.0.3", + "System.ComponentModel.TypeConverter": "4.3.0", + "System.Runtime.Serialization.Formatters": "4.3.0", + "System.Runtime.Serialization.Primitives": "4.3.0", + "System.Xml.XmlDocument": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/Newtonsoft.Json.dll": { + "assemblyVersion": "10.0.0.0", + "fileVersion": "10.0.3.21018" + } + } + }, + "PowerShellStandard.Library/5.1.0": {}, + "runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.native.System/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3" + } + }, + "runtime.native.System.Net.Http/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3" + } + }, + "runtime.native.System.Security.Cryptography.Apple/4.3.0": { + "dependencies": { + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple": "4.3.0" + } + }, + "runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "dependencies": { + "runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" + } + }, + "runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple/4.3.0": {}, + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "System.Buffers/4.5.1": { + "runtime": { + "lib/netstandard2.0/System.Buffers.dll": { + "assemblyVersion": "4.0.3.0", + "fileVersion": "4.6.28619.1" + } + } + }, + "System.Collections/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Collections.Concurrent/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Diagnostics.Tracing": "4.3.0", + "System.Globalization": "4.3.0", + "System.Reflection": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0", + "System.Threading.Tasks": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Collections.Concurrent.dll": { + "assemblyVersion": "4.0.13.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Collections.NonGeneric/4.3.0": { + "dependencies": { + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Collections.NonGeneric.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Collections.Specialized/4.3.0": { + "dependencies": { + "System.Collections.NonGeneric": "4.3.0", + "System.Globalization": "4.3.0", + "System.Globalization.Extensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Collections.Specialized.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.ComponentModel/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.ComponentModel.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.ComponentModel.Primitives/4.3.0": { + "dependencies": { + "System.ComponentModel": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.0/System.ComponentModel.Primitives.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.ComponentModel.TypeConverter/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Collections.NonGeneric": "4.3.0", + "System.Collections.Specialized": "4.3.0", + "System.ComponentModel": "4.3.0", + "System.ComponentModel.Primitives": "4.3.0", + "System.Globalization": "4.3.0", + "System.Linq": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Extensions": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.5/System.ComponentModel.TypeConverter.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Diagnostics.Debug/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Diagnostics.DiagnosticSource/4.6.0": { + "dependencies": { + "System.Memory": "4.5.4" + }, + "runtime": { + "lib/netstandard1.3/System.Diagnostics.DiagnosticSource.dll": { + "assemblyVersion": "4.0.4.0", + "fileVersion": "4.700.19.46214" + } + } + }, + "System.Diagnostics.Process/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.Win32.Primitives": "4.3.0", + "Microsoft.Win32.Registry": "4.3.0", + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.IO.FileSystem": "4.3.0", + "System.IO.FileSystem.Primitives": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Text.Encoding.Extensions": "4.3.0", + "System.Threading": "4.3.0", + "System.Threading.Tasks": "4.3.0", + "System.Threading.Thread": "4.3.0", + "System.Threading.ThreadPool": "4.3.0", + "runtime.native.System": "4.3.0" + } + }, + "System.Diagnostics.Tools/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Diagnostics.Tracing/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Dynamic.Runtime/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Linq": "4.3.0", + "System.Linq.Expressions": "4.3.0", + "System.ObjectModel": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Dynamic.Runtime.dll": { + "assemblyVersion": "4.0.12.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Globalization/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Globalization.Calendars/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Globalization": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Globalization.Extensions/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Globalization": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.InteropServices": "4.3.0" + } + }, + "System.IO/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading.Tasks": "4.3.0" + } + }, + "System.IO.FileSystem/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.IO": "4.3.0", + "System.IO.FileSystem.Primitives": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading.Tasks": "4.3.0" + } + }, + "System.IO.FileSystem.Primitives/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.IO.FileSystem.Primitives.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Linq/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0" + }, + "runtime": { + "lib/netstandard1.6/System.Linq.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Linq.Expressions/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Linq": "4.3.0", + "System.ObjectModel": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Emit.Lightweight": "4.3.0", + "System.Reflection.Extensions": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.6/System.Linq.Expressions.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Memory/4.5.4": { + "dependencies": { + "System.Buffers": "4.5.1", + "System.Numerics.Vectors": "4.5.0", + "System.Runtime.CompilerServices.Unsafe": "4.7.1" + }, + "runtime": { + "lib/netstandard2.0/System.Memory.dll": { + "assemblyVersion": "4.0.1.1", + "fileVersion": "4.6.28619.1" + } + } + }, + "System.Memory.Data/1.0.2": { + "dependencies": { + "System.Text.Encodings.Web": "4.7.2", + "System.Text.Json": "4.7.2" + }, + "runtime": { + "lib/netstandard2.0/System.Memory.Data.dll": { + "assemblyVersion": "1.0.2.0", + "fileVersion": "1.0.221.20802" + } + } + }, + "System.Numerics.Vectors/4.5.0": { + "runtime": { + "lib/netstandard2.0/System.Numerics.Vectors.dll": { + "assemblyVersion": "4.1.4.0", + "fileVersion": "4.6.26515.6" + } + } + }, + "System.ObjectModel/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.ObjectModel.dll": { + "assemblyVersion": "4.0.13.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Private.DataContractSerialization/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Collections.Concurrent": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Linq": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Emit.Lightweight": "4.3.0", + "System.Reflection.Extensions": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Serialization.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Text.Encoding.Extensions": "4.3.0", + "System.Text.RegularExpressions": "4.3.0", + "System.Threading": "4.3.0", + "System.Threading.Tasks": "4.3.0", + "System.Xml.ReaderWriter": "4.3.0", + "System.Xml.XDocument": "4.3.0", + "System.Xml.XmlDocument": "4.3.0", + "System.Xml.XmlSerializer": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Private.DataContractSerialization.dll": { + "assemblyVersion": "4.1.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Private.Uri/4.3.2": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3" + } + }, + "System.Reflection/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.IO": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Reflection.Emit/4.3.0": { + "dependencies": { + "System.IO": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Reflection.Emit.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Reflection.Emit.ILGeneration/4.3.0": { + "dependencies": { + "System.Reflection": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Reflection.Emit.ILGeneration.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Reflection.Emit.Lightweight/4.3.0": { + "dependencies": { + "System.Reflection": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Reflection.Emit.Lightweight.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Reflection.Extensions/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Reflection": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Reflection.Primitives/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Reflection.TypeExtensions/4.3.0": { + "dependencies": { + "System.Reflection": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.5/System.Reflection.TypeExtensions.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Resources.ResourceManager/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Globalization": "4.3.0", + "System.Reflection": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Runtime/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3" + } + }, + "System.Runtime.CompilerServices.Unsafe/4.7.1": { + "runtime": { + "lib/netstandard2.0/System.Runtime.CompilerServices.Unsafe.dll": { + "assemblyVersion": "4.0.6.0", + "fileVersion": "4.700.20.12001" + } + } + }, + "System.Runtime.Extensions/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Runtime.Handles/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Runtime.InteropServices/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Reflection": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Handles": "4.3.0" + } + }, + "System.Runtime.Numerics/4.3.0": { + "dependencies": { + "System.Globalization": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Runtime.Numerics.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Runtime.Serialization.Formatters/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Reflection": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Serialization.Primitives": "4.3.0" + }, + "runtime": { + "lib/netstandard1.4/System.Runtime.Serialization.Formatters.dll": { + "assemblyVersion": "4.0.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Runtime.Serialization.Json/4.3.0": { + "dependencies": { + "System.IO": "4.3.0", + "System.Private.DataContractSerialization": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Runtime.Serialization.Json.dll": { + "assemblyVersion": "4.0.3.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Runtime.Serialization.Primitives/4.3.0": { + "dependencies": { + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Runtime.Serialization.Primitives.dll": { + "assemblyVersion": "4.1.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Security.AccessControl/4.5.0": { + "dependencies": { + "System.Security.Principal.Windows": "4.5.0" + }, + "runtime": { + "lib/netstandard2.0/System.Security.AccessControl.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.26515.6" + } + } + }, + "System.Security.Cryptography.Algorithms/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Collections": "4.3.0", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Runtime.Numerics": "4.3.0", + "System.Security.Cryptography.Encoding": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "runtime.native.System.Security.Cryptography.Apple": "4.3.0", + "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" + } + }, + "System.Security.Cryptography.Cng/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Security.Cryptography.Algorithms": "4.3.0", + "System.Security.Cryptography.Encoding": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0" + } + }, + "System.Security.Cryptography.Csp/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.IO": "4.3.0", + "System.Reflection": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Security.Cryptography.Algorithms": "4.3.0", + "System.Security.Cryptography.Encoding": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading": "4.3.0" + } + }, + "System.Security.Cryptography.Encoding/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Collections": "4.3.0", + "System.Collections.Concurrent": "4.3.0", + "System.Linq": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" + } + }, + "System.Security.Cryptography.OpenSsl/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Runtime.Numerics": "4.3.0", + "System.Security.Cryptography.Algorithms": "4.3.0", + "System.Security.Cryptography.Encoding": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" + }, + "runtime": { + "lib/netstandard1.6/System.Security.Cryptography.OpenSsl.dll": { + "assemblyVersion": "4.0.0.0", + "fileVersion": "1.0.24212.1" + } + } + }, + "System.Security.Cryptography.Primitives/4.3.0": { + "dependencies": { + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Threading": "4.3.0", + "System.Threading.Tasks": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Security.Cryptography.Primitives.dll": { + "assemblyVersion": "4.0.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Security.Cryptography.ProtectedData/4.5.0": { + "dependencies": { + "System.Memory": "4.5.4" + }, + "runtime": { + "lib/netstandard2.0/System.Security.Cryptography.ProtectedData.dll": { + "assemblyVersion": "4.0.3.0", + "fileVersion": "4.6.26515.6" + } + } + }, + "System.Security.Cryptography.X509Certificates/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.Globalization.Calendars": "4.3.0", + "System.IO": "4.3.0", + "System.IO.FileSystem": "4.3.0", + "System.IO.FileSystem.Primitives": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Runtime.Numerics": "4.3.0", + "System.Security.Cryptography.Algorithms": "4.3.0", + "System.Security.Cryptography.Cng": "4.3.0", + "System.Security.Cryptography.Csp": "4.3.0", + "System.Security.Cryptography.Encoding": "4.3.0", + "System.Security.Cryptography.OpenSsl": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading": "4.3.0", + "runtime.native.System": "4.3.0", + "runtime.native.System.Net.Http": "4.3.0", + "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" + } + }, + "System.Security.Permissions/4.5.0": { + "dependencies": { + "System.Security.AccessControl": "4.5.0" + }, + "runtime": { + "lib/netstandard2.0/System.Security.Permissions.dll": { + "assemblyVersion": "4.0.1.0", + "fileVersion": "4.6.26515.6" + } + } + }, + "System.Security.Principal.Windows/4.5.0": { + "runtime": { + "lib/netstandard2.0/System.Security.Principal.Windows.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.26515.6" + } + } + }, + "System.Security.SecureString/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading": "4.3.0" + } + }, + "System.Text.Encoding/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Text.Encoding.Extensions/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0", + "System.Text.Encoding": "4.3.0" + } + }, + "System.Text.Encodings.Web/4.7.2": { + "dependencies": { + "System.Buffers": "4.5.1", + "System.Memory": "4.5.4" + }, + "runtime": { + "lib/netstandard2.0/System.Text.Encodings.Web.dll": { + "assemblyVersion": "4.0.5.1", + "fileVersion": "4.700.21.11602" + } + } + }, + "System.Text.Json/4.7.2": { + "dependencies": { + "Microsoft.Bcl.AsyncInterfaces": "1.1.1", + "System.Buffers": "4.5.1", + "System.Memory": "4.5.4", + "System.Numerics.Vectors": "4.5.0", + "System.Runtime.CompilerServices.Unsafe": "4.7.1", + "System.Text.Encodings.Web": "4.7.2", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "runtime": { + "lib/netstandard2.0/System.Text.Json.dll": { + "assemblyVersion": "4.0.1.2", + "fileVersion": "4.700.20.21406" + } + } + }, + "System.Text.RegularExpressions/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Globalization": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.6/System.Text.RegularExpressions.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Threading/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0", + "System.Threading.Tasks": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Threading.dll": { + "assemblyVersion": "4.0.12.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Threading.Tasks/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Threading.Tasks.Extensions/4.5.4": { + "dependencies": { + "System.Runtime.CompilerServices.Unsafe": "4.7.1" + }, + "runtime": { + "lib/netstandard2.0/System.Threading.Tasks.Extensions.dll": { + "assemblyVersion": "4.2.0.1", + "fileVersion": "4.6.28619.1" + } + } + }, + "System.Threading.Thread/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Threading.Thread.dll": { + "assemblyVersion": "4.0.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Threading.ThreadPool/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0", + "System.Runtime.Handles": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Threading.ThreadPool.dll": { + "assemblyVersion": "4.0.11.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Xml.ReaderWriter/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.IO.FileSystem": "4.3.0", + "System.IO.FileSystem.Primitives": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Text.Encoding.Extensions": "4.3.0", + "System.Text.RegularExpressions": "4.3.0", + "System.Threading.Tasks": "4.3.0", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "runtime": { + "lib/netstandard1.3/System.Xml.ReaderWriter.dll": { + "assemblyVersion": "4.1.0.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Xml.XDocument/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Diagnostics.Tools": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Reflection": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading": "4.3.0", + "System.Xml.ReaderWriter": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Xml.XDocument.dll": { + "assemblyVersion": "4.0.12.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Xml.XmlDocument/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading": "4.3.0", + "System.Xml.ReaderWriter": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Xml.XmlDocument.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Xml.XmlSerializer/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Linq": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Extensions": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Text.RegularExpressions": "4.3.0", + "System.Threading": "4.3.0", + "System.Xml.ReaderWriter": "4.3.0", + "System.Xml.XmlDocument": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Xml.XmlSerializer.dll": { + "assemblyVersion": "4.0.12.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "Microsoft.Azure.PowerShell.Authentication/1.0.0": { + "dependencies": { + "Azure.Core": "1.22.0", + "Azure.Identity": "1.5.0", + "Hyak.Common": "1.2.2", + "Microsoft.ApplicationInsights": "2.12.0", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Aks": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Authorization": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Compute": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Graph.Rbac": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.KeyVault": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Monitor": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Network": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.PolicyInsights": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.ResourceManager": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Storage.Management": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Websites": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common.Share": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Storage": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Strategies": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "Microsoft.Azure.PowerShell.Authentication.dll": {} + } + }, + "Microsoft.Azure.PowerShell.Authentication.ResourceManager/1.0.0": { + "dependencies": { + "Azure.Core": "1.22.0", + "Hyak.Common": "1.2.2", + "Microsoft.ApplicationInsights": "2.12.0", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Azure.PowerShell.Authentication": "1.0.0", + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Aks": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Authorization": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Compute": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Graph.Rbac": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.KeyVault": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Monitor": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Network": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.PolicyInsights": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.ResourceManager": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Storage.Management": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Websites": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common.Share": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Storage": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Strategies": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "Microsoft.Azure.PowerShell.Authentication.ResourceManager.dll": {} + } + }, + "Microsoft.Azure.PowerShell.Authenticators/1.0.0": { + "dependencies": { + "Azure.Identity": "1.5.0", + "Microsoft.Azure.PowerShell.Authentication": "1.0.0" + }, + "runtime": { + "Microsoft.Azure.PowerShell.Authenticators.dll": {} + } + } + } + }, + "libraries": { + "Microsoft.Azure.PowerShell.Cmdlets.Accounts/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Azure.Core/1.22.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ze/xRCHSSDe5TIk5vBDbVrauW1EN7UIbnBvIBfMH8KSt/I9+/7yPAjTBDgNBk0IwG6WBV+BBHp4IUtS/PGAQwQ==", + "path": "azure.core/1.22.0", + "hashPath": "azure.core.1.22.0.nupkg.sha512" + }, + "Azure.Identity/1.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-VfF88dqrgKXZNOS/y4XrX/jmIfP3pkY+hBUzBNpoKml1nR+QshX6XlXWyToLtWV80TDQ1CmUVCJksktDg5+j1w==", + "path": "azure.identity/1.5.0", + "hashPath": "azure.identity.1.5.0.nupkg.sha512" + }, + "Hyak.Common/1.2.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-uZpnFn48nSQwHcO0/GSBZ7ExaO0sTXKv8KariXXEWLaB4Q3AeQoprYG4WpKsCT0ByW3YffETivgc5rcH5RRDvQ==", + "path": "hyak.common/1.2.2", + "hashPath": "hyak.common.1.2.2.nupkg.sha512" + }, + "Microsoft.ApplicationInsights/2.12.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-4vZcVaxywAzfLm5mAc2/llaZQTzbCqu9KirxxI/t49AkZH5Qxf7JxuAMUuv2/6JEdOOkGDzpvdrrIlf6LkFGcg==", + "path": "microsoft.applicationinsights/2.12.0", + "hashPath": "microsoft.applicationinsights.2.12.0.nupkg.sha512" + }, + "Microsoft.Azure.Common/2.2.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-abzRooh4ACKjzAKxRB6r+SHKW3d+IrLcgtVG81D+3kQU/OMjAZS1oDp9CDalhSbmxa84u0MHM5N+AKeTtKPoiw==", + "path": "microsoft.azure.common/2.2.1", + "hashPath": "microsoft.azure.common.2.2.1.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Authentication.Abstractions/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-bKDPidNeqBpTDikPnIuoMoGd26pD2PNE41cut0ASwL5exJwLNggYO55U+f/cJkgjCUMR8i5nqnlfpGHSS1I0vw==", + "path": "microsoft.azure.powershell.authentication.abstractions/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.authentication.abstractions.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Aks/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-sUGkvOvpqlEK5zdZ7HWaou3GY5bnlNrE0LuZ137+TsNfgx2E3+0Ika3a02i/9+niDDf60xj4LaNOYDSuK5zdJA==", + "path": "microsoft.azure.powershell.clients.aks/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.aks.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Authorization/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Q760F40/qfas2Al+GQhhE4gJt768pQPxlCjqrjjkukgVsq+X/M8IqpCeBzbRTiiyerhcjJoyNxqlGuZpUhqGxw==", + "path": "microsoft.azure.powershell.clients.authorization/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.authorization.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Compute/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-1fcsBdYMmEJPMPN8EAgJkaJ2WxxTKH3VcLECYdL2cfg2bgN8CKbbjSvarrXEezhyduE+LdYnL0e8Pigsnaj55Q==", + "path": "microsoft.azure.powershell.clients.compute/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.compute.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Graph.Rbac/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-BIMthJ1x2vQAN3iWChnNj8BfgrXvKXn+n06E0/h2MNurMXbAOn5eiPIfE8bnj2BO99uSh1ns09yEgOTPJIvZBQ==", + "path": "microsoft.azure.powershell.clients.graph.rbac/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.graph.rbac.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.KeyVault/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-MfvwM8ABj/EswmYu0Bf/8kyAO6kUv2zYSihVn384SVmypomVKUu69GN0VXKbmGaovPI8v3H41Ldp7DqbPRun5A==", + "path": "microsoft.azure.powershell.clients.keyvault/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.keyvault.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Monitor/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-UyCKG5BWVjYFRtH2JNx6f4KdccaSqww2y0OE2PYgib8VhLqkoPr/BQg6vKzaGsghLIerZ/egQ7ntPPw3PCtS3w==", + "path": "microsoft.azure.powershell.clients.monitor/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.monitor.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Network/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-YAAHxw+zzvkGNWAi668NSoTR+V/7vf+gRhu1oFa1O1/f2NGpz5XuqPrQyAPrri64hKqB/k3OMrM7sjlIv16dAg==", + "path": "microsoft.azure.powershell.clients.network/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.network.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.PolicyInsights/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-urRIwRVzzOwpk8HhKq/b785DiL/arnmGUHbN4HvRN6ZsBkE1PU431YwgUlofb9pfB3buLcl0XJFRPLBJ0yZJUw==", + "path": "microsoft.azure.powershell.clients.policyinsights/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.policyinsights.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.ResourceManager/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-juWnd63Z2Sp+6bvtOPOF0Gj1v2AfpxXcuyodd9+U7euBro2G7Yfo2UHmHo/uaYyQUbM3HaXJPvse7BLDKjhe6w==", + "path": "microsoft.azure.powershell.clients.resourcemanager/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.resourcemanager.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Storage.Management/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HPpTWIlN+5ALqJssL7+6BD/vYrWi3eWKQ3QpWYjCFk5c9HVLTNpP+M2dq9jbsxLsZj+5Pt6gC4FIS22Q13Uhag==", + "path": "microsoft.azure.powershell.clients.storage.management/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.storage.management.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Websites/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-b5yBD9FrY02r0kdNNgZ+uU0/QsW3AtmnCE/x1mUG5j8ka/V04AYUo+sDokQBzu+vnK6Y6OrVDtyWjmnKTDHpWA==", + "path": "microsoft.azure.powershell.clients.websites/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.websites.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Common/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-9jZYZ9LKbx16r69y7cO9d7bDjpE0/HgeBU386Y/O6q05VRaq2wAsB2rbQ9AjxcPGHfwS0+2US/RImSSqjVABRQ==", + "path": "microsoft.azure.powershell.common/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.common.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Common.Share/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-4mJSjnwZVLQYWhP47eDzdt0yaLIf2I4pqaEIqcfAjkjdbKpnCXCnJUEFRId061yuKpq1LtfBZkHDRi68I5CJxg==", + "path": "microsoft.azure.powershell.common.share/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.common.share.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Storage/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-fObXEcuhk1JUoQ0fiCV4nK4NJWqvsfsKCzapF7SFEQ87X6AasL6m5KGT8JQSnHmc849xxxaixPTxyWaf9BBlpw==", + "path": "microsoft.azure.powershell.storage/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.storage.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Strategies/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HwyxUwDHCmY6Zdxg2xpFC9Gqmu92Xr0cAr4ElWYwz8Z7PE9uYVkTpKMIKd7oIJJgsIANTfqEU1HKoeI3FXPLqw==", + "path": "microsoft.azure.powershell.strategies/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.strategies.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Bcl.AsyncInterfaces/1.1.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-yuvf07qFWFqtK3P/MRkEKLhn5r2UbSpVueRziSqj0yJQIKFwG1pq9mOayK3zE5qZCTs0CbrwL9M6R8VwqyGy2w==", + "path": "microsoft.bcl.asyncinterfaces/1.1.1", + "hashPath": "microsoft.bcl.asyncinterfaces.1.1.1.nupkg.sha512" + }, + "Microsoft.CSharp/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-kaj6Wb4qoMuH3HySFJhxwQfe8R/sJsNJnANrvv8WdFPMoNbKY5htfNscv+LHCu5ipz+49m2e+WQXpLXr9XYemQ==", + "path": "microsoft.csharp/4.5.0", + "hashPath": "microsoft.csharp.4.5.0.nupkg.sha512" + }, + "Microsoft.Identity.Client/4.30.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-xk8tJeGfB2yD3+d7a0DXyV7/HYyEG10IofUHYHoPYKmDbroi/j9t1BqSHgbq1nARDjg7m8Ki6e21AyNU7e/R4Q==", + "path": "microsoft.identity.client/4.30.1", + "hashPath": "microsoft.identity.client.4.30.1.nupkg.sha512" + }, + "Microsoft.Identity.Client.Extensions.Msal/2.18.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HpG4oLwhQsy0ce7OWq9iDdLtJKOvKRStIKoSEOeBMKuohfuOWNDyhg8fMAJkpG/kFeoe4J329fiMHcJmmB+FPw==", + "path": "microsoft.identity.client.extensions.msal/2.18.4", + "hashPath": "microsoft.identity.client.extensions.msal.2.18.4.nupkg.sha512" + }, + "Microsoft.NETCore.Platforms/1.1.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-TMBuzAHpTenGbGgk0SMTwyEkyijY/Eae4ZGsFNYJvAr/LDn1ku3Etp3FPxChmDp5HHF3kzJuoaa08N0xjqAJfQ==", + "path": "microsoft.netcore.platforms/1.1.1", + "hashPath": "microsoft.netcore.platforms.1.1.1.nupkg.sha512" + }, + "Microsoft.NETCore.Targets/1.1.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3Wrmi0kJDzClwAC+iBdUBpEKmEle8FQNsCs77fkiOIw/9oYA07bL1EZNX0kQ2OMN3xpwvl0vAtOCYY3ndDNlhQ==", + "path": "microsoft.netcore.targets/1.1.3", + "hashPath": "microsoft.netcore.targets.1.1.3.nupkg.sha512" + }, + "Microsoft.Rest.ClientRuntime/2.3.23": { + "type": "package", + "serviceable": true, + "sha512": "sha512-92kNTi1N7zI5wwI2ZXswBRnk61OUYnuYJXrlgOhes5IsAqGmgw9DPGmhUzeY8OaZ8TTrQdDzvgXFnbCHwLzSVA==", + "path": "microsoft.rest.clientruntime/2.3.23", + "hashPath": "microsoft.rest.clientruntime.2.3.23.nupkg.sha512" + }, + "Microsoft.Rest.ClientRuntime.Azure/3.3.19": { + "type": "package", + "serviceable": true, + "sha512": "sha512-+NVBWvRXNwaAPTZUxjUlQggsrf3X0GbiRoxYfgc3kG9E55ZxZxvZPT3nIfC4DNqzGSXUEvmLbckdXgBBzGdUaA==", + "path": "microsoft.rest.clientruntime.azure/3.3.19", + "hashPath": "microsoft.rest.clientruntime.azure.3.3.19.nupkg.sha512" + }, + "Microsoft.Win32.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-9ZQKCWxH7Ijp9BfahvL2Zyf1cJIk8XYLF6Yjzr2yi0b2cOut/HQ31qf1ThHAgCc3WiZMdnWcfJCgN82/0UunxA==", + "path": "microsoft.win32.primitives/4.3.0", + "hashPath": "microsoft.win32.primitives.4.3.0.nupkg.sha512" + }, + "Microsoft.Win32.Registry/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Lw1/VwLH1yxz6SfFEjVRCN0pnflLEsWgnV4qsdJ512/HhTwnKXUG+zDQ4yTO3K/EJQemGoNaBHX5InISNKTzUQ==", + "path": "microsoft.win32.registry/4.3.0", + "hashPath": "microsoft.win32.registry.4.3.0.nupkg.sha512" + }, + "NETStandard.Library/2.0.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-st47PosZSHrjECdjeIzZQbzivYBJFv6P2nv4cj2ypdI204DO+vZ7l5raGMiX4eXMJ53RfOIg+/s4DHVZ54Nu2A==", + "path": "netstandard.library/2.0.3", + "hashPath": "netstandard.library.2.0.3.nupkg.sha512" + }, + "Newtonsoft.Json/10.0.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-hSXaFmh7hNCuEoC4XNY5DrRkLDzYHqPx/Ik23R4J86Z7PE/Y6YidhG602dFVdLBRSdG6xp9NabH3dXpcoxWvww==", + "path": "newtonsoft.json/10.0.3", + "hashPath": "newtonsoft.json.10.0.3.nupkg.sha512" + }, + "PowerShellStandard.Library/5.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-iYaRvQsM1fow9h3uEmio+2m2VXfulgI16AYHaTZ8Sf7erGe27Qc8w/h6QL5UPuwv1aXR40QfzMEwcCeiYJp2cw==", + "path": "powershellstandard.library/5.1.0", + "hashPath": "powershellstandard.library.5.1.0.nupkg.sha512" + }, + "runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HdSSp5MnJSsg08KMfZThpuLPJpPwE5hBXvHwoKWosyHHfe8Mh5WKT0ylEOf6yNzX6Ngjxe4Whkafh5q7Ymac4Q==", + "path": "runtime.debian.8-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.debian.8-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-+yH1a49wJMy8Zt4yx5RhJrxO/DBDByAiCzNwiETI+1S4mPdCu0OY4djdciC7Vssk0l22wQaDLrXxXkp+3+7bVA==", + "path": "runtime.fedora.23-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.fedora.23-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-c3YNH1GQJbfIPJeCnr4avseugSqPrxwIqzthYyZDN6EuOyNOzq+y2KSUfRcXauya1sF4foESTgwM5e1A8arAKw==", + "path": "runtime.fedora.24-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.fedora.24-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.native.System/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-c/qWt2LieNZIj1jGnVNsE2Kl23Ya2aSTBuXMD6V7k9KWr6l16Tqdwq+hJScEpWER9753NWC8h96PaVNY5Ld7Jw==", + "path": "runtime.native.system/4.3.0", + "hashPath": "runtime.native.system.4.3.0.nupkg.sha512" + }, + "runtime.native.System.Net.Http/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ZVuZJqnnegJhd2k/PtAbbIcZ3aZeITq3sj06oKfMBSfphW3HDmk/t4ObvbOk/JA/swGR0LNqMksAh/f7gpTROg==", + "path": "runtime.native.system.net.http/4.3.0", + "hashPath": "runtime.native.system.net.http.4.3.0.nupkg.sha512" + }, + "runtime.native.System.Security.Cryptography.Apple/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-DloMk88juo0OuOWr56QG7MNchmafTLYWvABy36izkrLI5VledI0rq28KGs1i9wbpeT9NPQrx/wTf8U2vazqQ3Q==", + "path": "runtime.native.system.security.cryptography.apple/4.3.0", + "hashPath": "runtime.native.system.security.cryptography.apple.4.3.0.nupkg.sha512" + }, + "runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-NS1U+700m4KFRHR5o4vo9DSlTmlCKu/u7dtE5sUHVIPB+xpXxYQvgBgA6wEIeCz6Yfn0Z52/72WYsToCEPJnrw==", + "path": "runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-b3pthNgxxFcD+Pc0WSEoC0+md3MyhRS6aCEeenvNE3Fdw1HyJ18ZhRFVJJzIeR/O/jpxPboB805Ho0T3Ul7w8A==", + "path": "runtime.opensuse.13.2-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.opensuse.13.2-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-KeLz4HClKf+nFS7p/6Fi/CqyLXh81FpiGzcmuS8DGi9lUqSnZ6Es23/gv2O+1XVGfrbNmviF7CckBpavkBoIFQ==", + "path": "runtime.opensuse.42.1-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.opensuse.42.1-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-kVXCuMTrTlxq4XOOMAysuNwsXWpYeboGddNGpIgNSZmv1b6r/s/DPk0fYMB7Q5Qo4bY68o48jt4T4y5BVecbCQ==", + "path": "runtime.osx.10.10-x64.runtime.native.system.security.cryptography.apple/4.3.0", + "hashPath": "runtime.osx.10.10-x64.runtime.native.system.security.cryptography.apple.4.3.0.nupkg.sha512" + }, + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-X7IdhILzr4ROXd8mI1BUCQMSHSQwelUlBjF1JyTKCjXaOGn2fB4EKBxQbCK2VjO3WaWIdlXZL3W6TiIVnrhX4g==", + "path": "runtime.osx.10.10-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.osx.10.10-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-nyFNiCk/r+VOiIqreLix8yN+q3Wga9+SE8BCgkf+2BwEKiNx6DyvFjCgkfV743/grxv8jHJ8gUK4XEQw7yzRYg==", + "path": "runtime.rhel.7-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.rhel.7-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ytoewC6wGorL7KoCAvRfsgoJPJbNq+64k2SqW6JcOAebWsFUvCCYgfzQMrnpvPiEl4OrblUlhF2ji+Q1+SVLrQ==", + "path": "runtime.ubuntu.14.04-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.ubuntu.14.04-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-I8bKw2I8k58Wx7fMKQJn2R8lamboCAiHfHeV/pS65ScKWMMI0+wJkLYlEKvgW1D/XvSl/221clBoR2q9QNNM7A==", + "path": "runtime.ubuntu.16.04-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.ubuntu.16.04-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-VB5cn/7OzUfzdnC8tqAIMQciVLiq2epm2NrAm1E9OjNRyG4lVhfR61SMcLizejzQP8R8Uf/0l5qOIbUEi+RdEg==", + "path": "runtime.ubuntu.16.10-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.ubuntu.16.10-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "System.Buffers/4.5.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg==", + "path": "system.buffers/4.5.1", + "hashPath": "system.buffers.4.5.1.nupkg.sha512" + }, + "System.Collections/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3Dcj85/TBdVpL5Zr+gEEBUuFe2icOnLalmEh9hfck1PTYbbyWuZgh4fmm2ysCLTrqLQw6t3TgTyJ+VLp+Qb+Lw==", + "path": "system.collections/4.3.0", + "hashPath": "system.collections.4.3.0.nupkg.sha512" + }, + "System.Collections.Concurrent/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ztl69Xp0Y/UXCL+3v3tEU+lIy+bvjKNUmopn1wep/a291pVPK7dxBd6T7WnlQqRog+d1a/hSsgRsmFnIBKTPLQ==", + "path": "system.collections.concurrent/4.3.0", + "hashPath": "system.collections.concurrent.4.3.0.nupkg.sha512" + }, + "System.Collections.NonGeneric/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-prtjIEMhGUnQq6RnPEYLpFt8AtLbp9yq2zxOSrY7KJJZrw25Fi97IzBqY7iqssbM61Ek5b8f3MG/sG1N2sN5KA==", + "path": "system.collections.nongeneric/4.3.0", + "hashPath": "system.collections.nongeneric.4.3.0.nupkg.sha512" + }, + "System.Collections.Specialized/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Epx8PoVZR0iuOnJJDzp7pWvdfMMOAvpUo95pC4ScH2mJuXkKA2Y4aR3cG9qt2klHgSons1WFh4kcGW7cSXvrxg==", + "path": "system.collections.specialized/4.3.0", + "hashPath": "system.collections.specialized.4.3.0.nupkg.sha512" + }, + "System.ComponentModel/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-VyGn1jGRZVfxnh8EdvDCi71v3bMXrsu8aYJOwoV7SNDLVhiEqwP86pPMyRGsDsxhXAm2b3o9OIqeETfN5qfezw==", + "path": "system.componentmodel/4.3.0", + "hashPath": "system.componentmodel.4.3.0.nupkg.sha512" + }, + "System.ComponentModel.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-j8GUkCpM8V4d4vhLIIoBLGey2Z5bCkMVNjEZseyAlm4n5arcsJOeI3zkUP+zvZgzsbLTYh4lYeP/ZD/gdIAPrw==", + "path": "system.componentmodel.primitives/4.3.0", + "hashPath": "system.componentmodel.primitives.4.3.0.nupkg.sha512" + }, + "System.ComponentModel.TypeConverter/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-16pQ6P+EdhcXzPiEK4kbA953Fu0MNG2ovxTZU81/qsCd1zPRsKc3uif5NgvllCY598k6bI0KUyKW8fanlfaDQg==", + "path": "system.componentmodel.typeconverter/4.3.0", + "hashPath": "system.componentmodel.typeconverter.4.3.0.nupkg.sha512" + }, + "System.Diagnostics.Debug/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ZUhUOdqmaG5Jk3Xdb8xi5kIyQYAA4PnTNlHx1mu9ZY3qv4ELIdKbnL/akbGaKi2RnNUWaZsAs31rvzFdewTj2g==", + "path": "system.diagnostics.debug/4.3.0", + "hashPath": "system.diagnostics.debug.4.3.0.nupkg.sha512" + }, + "System.Diagnostics.DiagnosticSource/4.6.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-mbBgoR0rRfl2uimsZ2avZY8g7Xnh1Mza0rJZLPcxqiMWlkGukjmRkuMJ/er+AhQuiRIh80CR/Hpeztr80seV5g==", + "path": "system.diagnostics.diagnosticsource/4.6.0", + "hashPath": "system.diagnostics.diagnosticsource.4.6.0.nupkg.sha512" + }, + "System.Diagnostics.Process/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-J0wOX07+QASQblsfxmIMFc9Iq7KTXYL3zs2G/Xc704Ylv3NpuVdo6gij6V3PGiptTxqsK0K7CdXenRvKUnkA2g==", + "path": "system.diagnostics.process/4.3.0", + "hashPath": "system.diagnostics.process.4.3.0.nupkg.sha512" + }, + "System.Diagnostics.Tools/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-UUvkJfSYJMM6x527dJg2VyWPSRqIVB0Z7dbjHst1zmwTXz5CcXSYJFWRpuigfbO1Lf7yfZiIaEUesfnl/g5EyA==", + "path": "system.diagnostics.tools/4.3.0", + "hashPath": "system.diagnostics.tools.4.3.0.nupkg.sha512" + }, + "System.Diagnostics.Tracing/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-rswfv0f/Cqkh78rA5S8eN8Neocz234+emGCtTF3lxPY96F+mmmUen6tbn0glN6PMvlKQb9bPAY5e9u7fgPTkKw==", + "path": "system.diagnostics.tracing/4.3.0", + "hashPath": "system.diagnostics.tracing.4.3.0.nupkg.sha512" + }, + "System.Dynamic.Runtime/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-SNVi1E/vfWUAs/WYKhE9+qlS6KqK0YVhnlT0HQtr8pMIA8YX3lwy3uPMownDwdYISBdmAF/2holEIldVp85Wag==", + "path": "system.dynamic.runtime/4.3.0", + "hashPath": "system.dynamic.runtime.4.3.0.nupkg.sha512" + }, + "System.Globalization/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-kYdVd2f2PAdFGblzFswE4hkNANJBKRmsfa2X5LG2AcWE1c7/4t0pYae1L8vfZ5xvE2nK/R9JprtToA61OSHWIg==", + "path": "system.globalization/4.3.0", + "hashPath": "system.globalization.4.3.0.nupkg.sha512" + }, + "System.Globalization.Calendars/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-GUlBtdOWT4LTV3I+9/PJW+56AnnChTaOqqTLFtdmype/L500M2LIyXgmtd9X2P2VOkmJd5c67H5SaC2QcL1bFA==", + "path": "system.globalization.calendars/4.3.0", + "hashPath": "system.globalization.calendars.4.3.0.nupkg.sha512" + }, + "System.Globalization.Extensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-FhKmdR6MPG+pxow6wGtNAWdZh7noIOpdD5TwQ3CprzgIE1bBBoim0vbR1+AWsWjQmU7zXHgQo4TWSP6lCeiWcQ==", + "path": "system.globalization.extensions/4.3.0", + "hashPath": "system.globalization.extensions.4.3.0.nupkg.sha512" + }, + "System.IO/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3qjaHvxQPDpSOYICjUoTsmoq5u6QJAFRUITgeT/4gqkF1bajbSmb1kwSxEA8AHlofqgcKJcM8udgieRNhaJ5Cg==", + "path": "system.io/4.3.0", + "hashPath": "system.io.4.3.0.nupkg.sha512" + }, + "System.IO.FileSystem/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3wEMARTnuio+ulnvi+hkRNROYwa1kylvYahhcLk4HSoVdl+xxTFVeVlYOfLwrDPImGls0mDqbMhrza8qnWPTdA==", + "path": "system.io.filesystem/4.3.0", + "hashPath": "system.io.filesystem.4.3.0.nupkg.sha512" + }, + "System.IO.FileSystem.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-6QOb2XFLch7bEc4lIcJH49nJN2HV+OC3fHDgsLVsBVBk3Y4hFAnOBGzJ2lUu7CyDDFo9IBWkSsnbkT6IBwwiMw==", + "path": "system.io.filesystem.primitives/4.3.0", + "hashPath": "system.io.filesystem.primitives.4.3.0.nupkg.sha512" + }, + "System.Linq/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-5DbqIUpsDp0dFftytzuMmc0oeMdQwjcP/EWxsksIz/w1TcFRkZ3yKKz0PqiYFMmEwPSWw+qNVqD7PJ889JzHbw==", + "path": "system.linq/4.3.0", + "hashPath": "system.linq.4.3.0.nupkg.sha512" + }, + "System.Linq.Expressions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-PGKkrd2khG4CnlyJwxwwaWWiSiWFNBGlgXvJpeO0xCXrZ89ODrQ6tjEWS/kOqZ8GwEOUATtKtzp1eRgmYNfclg==", + "path": "system.linq.expressions/4.3.0", + "hashPath": "system.linq.expressions.4.3.0.nupkg.sha512" + }, + "System.Memory/4.5.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-1MbJTHS1lZ4bS4FmsJjnuGJOu88ZzTT2rLvrhW7Ygic+pC0NWA+3hgAen0HRdsocuQXCkUTdFn9yHJJhsijDXw==", + "path": "system.memory/4.5.4", + "hashPath": "system.memory.4.5.4.nupkg.sha512" + }, + "System.Memory.Data/1.0.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-JGkzeqgBsiZwKJZ1IxPNsDFZDhUvuEdX8L8BDC8N3KOj+6zMcNU28CNN59TpZE/VJYy9cP+5M+sbxtWJx3/xtw==", + "path": "system.memory.data/1.0.2", + "hashPath": "system.memory.data.1.0.2.nupkg.sha512" + }, + "System.Numerics.Vectors/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-QQTlPTl06J/iiDbJCiepZ4H//BVraReU4O4EoRw1U02H5TLUIT7xn3GnDp9AXPSlJUDyFs4uWjWafNX6WrAojQ==", + "path": "system.numerics.vectors/4.5.0", + "hashPath": "system.numerics.vectors.4.5.0.nupkg.sha512" + }, + "System.ObjectModel/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-bdX+80eKv9bN6K4N+d77OankKHGn6CH711a6fcOpMQu2Fckp/Ft4L/kW9WznHpyR0NRAvJutzOMHNNlBGvxQzQ==", + "path": "system.objectmodel/4.3.0", + "hashPath": "system.objectmodel.4.3.0.nupkg.sha512" + }, + "System.Private.DataContractSerialization/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-yDaJ2x3mMmjdZEDB4IbezSnCsnjQ4BxinKhRAaP6kEgL6Bb6jANWphs5SzyD8imqeC/3FxgsuXT6ykkiH1uUmA==", + "path": "system.private.datacontractserialization/4.3.0", + "hashPath": "system.private.datacontractserialization.4.3.0.nupkg.sha512" + }, + "System.Private.Uri/4.3.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-o1+7RJnu3Ik3PazR7Z7tJhjPdE000Eq2KGLLWhqJJKXj04wrS8lwb1OFtDF9jzXXADhUuZNJZlPc98uwwqmpFA==", + "path": "system.private.uri/4.3.2", + "hashPath": "system.private.uri.4.3.2.nupkg.sha512" + }, + "System.Reflection/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-KMiAFoW7MfJGa9nDFNcfu+FpEdiHpWgTcS2HdMpDvt9saK3y/G4GwprPyzqjFH9NTaGPQeWNHU+iDlDILj96aQ==", + "path": "system.reflection/4.3.0", + "hashPath": "system.reflection.4.3.0.nupkg.sha512" + }, + "System.Reflection.Emit/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-228FG0jLcIwTVJyz8CLFKueVqQK36ANazUManGaJHkO0icjiIypKW7YLWLIWahyIkdh5M7mV2dJepllLyA1SKg==", + "path": "system.reflection.emit/4.3.0", + "hashPath": "system.reflection.emit.4.3.0.nupkg.sha512" + }, + "System.Reflection.Emit.ILGeneration/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-59tBslAk9733NXLrUJrwNZEzbMAcu8k344OYo+wfSVygcgZ9lgBdGIzH/nrg3LYhXceynyvTc8t5/GD4Ri0/ng==", + "path": "system.reflection.emit.ilgeneration/4.3.0", + "hashPath": "system.reflection.emit.ilgeneration.4.3.0.nupkg.sha512" + }, + "System.Reflection.Emit.Lightweight/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-oadVHGSMsTmZsAF864QYN1t1QzZjIcuKU3l2S9cZOwDdDueNTrqq1yRj7koFfIGEnKpt6NjpL3rOzRhs4ryOgA==", + "path": "system.reflection.emit.lightweight/4.3.0", + "hashPath": "system.reflection.emit.lightweight.4.3.0.nupkg.sha512" + }, + "System.Reflection.Extensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-rJkrJD3kBI5B712aRu4DpSIiHRtr6QlfZSQsb0hYHrDCZORXCFjQfoipo2LaMUHoT9i1B7j7MnfaEKWDFmFQNQ==", + "path": "system.reflection.extensions/4.3.0", + "hashPath": "system.reflection.extensions.4.3.0.nupkg.sha512" + }, + "System.Reflection.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-5RXItQz5As4xN2/YUDxdpsEkMhvw3e6aNveFXUn4Hl/udNTCNhnKp8lT9fnc3MhvGKh1baak5CovpuQUXHAlIA==", + "path": "system.reflection.primitives/4.3.0", + "hashPath": "system.reflection.primitives.4.3.0.nupkg.sha512" + }, + "System.Reflection.TypeExtensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-7u6ulLcZbyxB5Gq0nMkQttcdBTx57ibzw+4IOXEfR+sXYQoHvjW5LTLyNr8O22UIMrqYbchJQJnos4eooYzYJA==", + "path": "system.reflection.typeextensions/4.3.0", + "hashPath": "system.reflection.typeextensions.4.3.0.nupkg.sha512" + }, + "System.Resources.ResourceManager/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-/zrcPkkWdZmI4F92gL/TPumP98AVDu/Wxr3CSJGQQ+XN6wbRZcyfSKVoPo17ilb3iOr0cCRqJInGwNMolqhS8A==", + "path": "system.resources.resourcemanager/4.3.0", + "hashPath": "system.resources.resourcemanager.4.3.0.nupkg.sha512" + }, + "System.Runtime/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-JufQi0vPQ0xGnAczR13AUFglDyVYt4Kqnz1AZaiKZ5+GICq0/1MH/mO/eAJHt/mHW1zjKBJd7kV26SrxddAhiw==", + "path": "system.runtime/4.3.0", + "hashPath": "system.runtime.4.3.0.nupkg.sha512" + }, + "System.Runtime.CompilerServices.Unsafe/4.7.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-zOHkQmzPCn5zm/BH+cxC1XbUS3P4Yoi3xzW7eRgVpDR2tPGSzyMZ17Ig1iRkfJuY0nhxkQQde8pgePNiA7z7TQ==", + "path": "system.runtime.compilerservices.unsafe/4.7.1", + "hashPath": "system.runtime.compilerservices.unsafe.4.7.1.nupkg.sha512" + }, + "System.Runtime.Extensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-guW0uK0fn5fcJJ1tJVXYd7/1h5F+pea1r7FLSOz/f8vPEqbR2ZAknuRDvTQ8PzAilDveOxNjSfr0CHfIQfFk8g==", + "path": "system.runtime.extensions/4.3.0", + "hashPath": "system.runtime.extensions.4.3.0.nupkg.sha512" + }, + "System.Runtime.Handles/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-OKiSUN7DmTWeYb3l51A7EYaeNMnvxwE249YtZz7yooT4gOZhmTjIn48KgSsw2k2lYdLgTKNJw/ZIfSElwDRVgg==", + "path": "system.runtime.handles/4.3.0", + "hashPath": "system.runtime.handles.4.3.0.nupkg.sha512" + }, + "System.Runtime.InteropServices/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-uv1ynXqiMK8mp1GM3jDqPCFN66eJ5w5XNomaK2XD+TuCroNTLFGeZ+WCmBMcBDyTFKou3P6cR6J/QsaqDp7fGQ==", + "path": "system.runtime.interopservices/4.3.0", + "hashPath": "system.runtime.interopservices.4.3.0.nupkg.sha512" + }, + "System.Runtime.Numerics/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-yMH+MfdzHjy17l2KESnPiF2dwq7T+xLnSJar7slyimAkUh/gTrS9/UQOtv7xarskJ2/XDSNvfLGOBQPjL7PaHQ==", + "path": "system.runtime.numerics/4.3.0", + "hashPath": "system.runtime.numerics.4.3.0.nupkg.sha512" + }, + "System.Runtime.Serialization.Formatters/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-KT591AkTNFOTbhZlaeMVvfax3RqhH1EJlcwF50Wm7sfnBLuHiOeZRRKrr1ns3NESkM20KPZ5Ol/ueMq5vg4QoQ==", + "path": "system.runtime.serialization.formatters/4.3.0", + "hashPath": "system.runtime.serialization.formatters.4.3.0.nupkg.sha512" + }, + "System.Runtime.Serialization.Json/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-CpVfOH0M/uZ5PH+M9+Gu56K0j9lJw3M+PKRegTkcrY/stOIvRUeonggxNrfBYLA5WOHL2j15KNJuTuld3x4o9w==", + "path": "system.runtime.serialization.json/4.3.0", + "hashPath": "system.runtime.serialization.json.4.3.0.nupkg.sha512" + }, + "System.Runtime.Serialization.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Wz+0KOukJGAlXjtKr+5Xpuxf8+c8739RI1C+A2BoQZT+wMCCoMDDdO8/4IRHfaVINqL78GO8dW8G2lW/e45Mcw==", + "path": "system.runtime.serialization.primitives/4.3.0", + "hashPath": "system.runtime.serialization.primitives.4.3.0.nupkg.sha512" + }, + "System.Security.AccessControl/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-vW8Eoq0TMyz5vAG/6ce483x/CP83fgm4SJe5P8Tb1tZaobcvPrbMEL7rhH1DRdrYbbb6F0vq3OlzmK0Pkwks5A==", + "path": "system.security.accesscontrol/4.5.0", + "hashPath": "system.security.accesscontrol.4.5.0.nupkg.sha512" + }, + "System.Security.Cryptography.Algorithms/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-W1kd2Y8mYSCgc3ULTAZ0hOP2dSdG5YauTb1089T0/kRcN2MpSAW1izOFROrJgxSlMn3ArsgHXagigyi+ibhevg==", + "path": "system.security.cryptography.algorithms/4.3.0", + "hashPath": "system.security.cryptography.algorithms.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.Cng/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-03idZOqFlsKRL4W+LuCpJ6dBYDUWReug6lZjBa3uJWnk5sPCUXckocevTaUA8iT/MFSrY/2HXkOt753xQ/cf8g==", + "path": "system.security.cryptography.cng/4.3.0", + "hashPath": "system.security.cryptography.cng.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.Csp/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-X4s/FCkEUnRGnwR3aSfVIkldBmtURMhmexALNTwpjklzxWU7yjMk7GHLKOZTNkgnWnE0q7+BCf9N2LVRWxewaA==", + "path": "system.security.cryptography.csp/4.3.0", + "hashPath": "system.security.cryptography.csp.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.Encoding/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-1DEWjZZly9ae9C79vFwqaO5kaOlI5q+3/55ohmq/7dpDyDfc8lYe7YVxJUZ5MF/NtbkRjwFRo14yM4OEo9EmDw==", + "path": "system.security.cryptography.encoding/4.3.0", + "hashPath": "system.security.cryptography.encoding.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-h4CEgOgv5PKVF/HwaHzJRiVboL2THYCou97zpmhjghx5frc7fIvlkY1jL+lnIQyChrJDMNEXS6r7byGif8Cy4w==", + "path": "system.security.cryptography.openssl/4.3.0", + "hashPath": "system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-7bDIyVFNL/xKeFHjhobUAQqSpJq9YTOpbEs6mR233Et01STBMXNAc/V+BM6dwYGc95gVh/Zf+iVXWzj3mE8DWg==", + "path": "system.security.cryptography.primitives/4.3.0", + "hashPath": "system.security.cryptography.primitives.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.ProtectedData/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-wLBKzFnDCxP12VL9ANydSYhk59fC4cvOr9ypYQLPnAj48NQIhqnjdD2yhP8yEKyBJEjERWS9DisKL7rX5eU25Q==", + "path": "system.security.cryptography.protecteddata/4.5.0", + "hashPath": "system.security.cryptography.protecteddata.4.5.0.nupkg.sha512" + }, + "System.Security.Cryptography.X509Certificates/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-t2Tmu6Y2NtJ2um0RtcuhP7ZdNNxXEgUm2JeoA/0NvlMjAhKCnM1NX07TDl3244mVp3QU6LPEhT3HTtH1uF7IYw==", + "path": "system.security.cryptography.x509certificates/4.3.0", + "hashPath": "system.security.cryptography.x509certificates.4.3.0.nupkg.sha512" + }, + "System.Security.Permissions/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-9gdyuARhUR7H+p5CjyUB/zPk7/Xut3wUSP8NJQB6iZr8L3XUXTMdoLeVAg9N4rqF8oIpE7MpdqHdDHQ7XgJe0g==", + "path": "system.security.permissions/4.5.0", + "hashPath": "system.security.permissions.4.5.0.nupkg.sha512" + }, + "System.Security.Principal.Windows/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-U77HfRXlZlOeIXd//Yoj6Jnk8AXlbeisf1oq1os+hxOGVnuG+lGSfGqTwTZBoORFF6j/0q7HXIl8cqwQ9aUGqQ==", + "path": "system.security.principal.windows/4.5.0", + "hashPath": "system.security.principal.windows.4.5.0.nupkg.sha512" + }, + "System.Security.SecureString/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-PnXp38O9q/2Oe4iZHMH60kinScv6QiiL2XH54Pj2t0Y6c2zKPEiAZsM/M3wBOHLNTBDFP0zfy13WN2M0qFz5jg==", + "path": "system.security.securestring/4.3.0", + "hashPath": "system.security.securestring.4.3.0.nupkg.sha512" + }, + "System.Text.Encoding/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-BiIg+KWaSDOITze6jGQynxg64naAPtqGHBwDrLaCtixsa5bKiR8dpPOHA7ge3C0JJQizJE+sfkz1wV+BAKAYZw==", + "path": "system.text.encoding/4.3.0", + "hashPath": "system.text.encoding.4.3.0.nupkg.sha512" + }, + "System.Text.Encoding.Extensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-YVMK0Bt/A43RmwizJoZ22ei2nmrhobgeiYwFzC4YAN+nue8RF6djXDMog0UCn+brerQoYVyaS+ghy9P/MUVcmw==", + "path": "system.text.encoding.extensions/4.3.0", + "hashPath": "system.text.encoding.extensions.4.3.0.nupkg.sha512" + }, + "System.Text.Encodings.Web/4.7.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-iTUgB/WtrZ1sWZs84F2hwyQhiRH6QNjQv2DkwrH+WP6RoFga2Q1m3f9/Q7FG8cck8AdHitQkmkXSY8qylcDmuA==", + "path": "system.text.encodings.web/4.7.2", + "hashPath": "system.text.encodings.web.4.7.2.nupkg.sha512" + }, + "System.Text.Json/4.7.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-TcMd95wcrubm9nHvJEQs70rC0H/8omiSGGpU4FQ/ZA1URIqD4pjmFJh2Mfv1yH1eHgJDWTi2hMDXwTET+zOOyg==", + "path": "system.text.json/4.7.2", + "hashPath": "system.text.json.4.7.2.nupkg.sha512" + }, + "System.Text.RegularExpressions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-RpT2DA+L660cBt1FssIE9CAGpLFdFPuheB7pLpKpn6ZXNby7jDERe8Ua/Ne2xGiwLVG2JOqziiaVCGDon5sKFA==", + "path": "system.text.regularexpressions/4.3.0", + "hashPath": "system.text.regularexpressions.4.3.0.nupkg.sha512" + }, + "System.Threading/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-VkUS0kOBcUf3Wwm0TSbrevDDZ6BlM+b/HRiapRFWjM5O0NS0LviG0glKmFK+hhPDd1XFeSdU1GmlLhb2CoVpIw==", + "path": "system.threading/4.3.0", + "hashPath": "system.threading.4.3.0.nupkg.sha512" + }, + "System.Threading.Tasks/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-LbSxKEdOUhVe8BezB/9uOGGppt+nZf6e1VFyw6v3DN6lqitm0OSn2uXMOdtP0M3W4iMcqcivm2J6UgqiwwnXiA==", + "path": "system.threading.tasks/4.3.0", + "hashPath": "system.threading.tasks.4.3.0.nupkg.sha512" + }, + "System.Threading.Tasks.Extensions/4.5.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-zteT+G8xuGu6mS+mzDzYXbzS7rd3K6Fjb9RiZlYlJPam2/hU7JCBZBVEcywNuR+oZ1ncTvc/cq0faRr3P01OVg==", + "path": "system.threading.tasks.extensions/4.5.4", + "hashPath": "system.threading.tasks.extensions.4.5.4.nupkg.sha512" + }, + "System.Threading.Thread/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-OHmbT+Zz065NKII/ZHcH9XO1dEuLGI1L2k7uYss+9C1jLxTC9kTZZuzUOyXHayRk+dft9CiDf3I/QZ0t8JKyBQ==", + "path": "system.threading.thread/4.3.0", + "hashPath": "system.threading.thread.4.3.0.nupkg.sha512" + }, + "System.Threading.ThreadPool/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-k/+g4b7vjdd4aix83sTgC9VG6oXYKAktSfNIJUNGxPEj7ryEOfzHHhfnmsZvjxawwcD9HyWXKCXmPjX8U4zeSw==", + "path": "system.threading.threadpool/4.3.0", + "hashPath": "system.threading.threadpool.4.3.0.nupkg.sha512" + }, + "System.Xml.ReaderWriter/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-GrprA+Z0RUXaR4N7/eW71j1rgMnEnEVlgii49GZyAjTH7uliMnrOU3HNFBr6fEDBCJCIdlVNq9hHbaDR621XBA==", + "path": "system.xml.readerwriter/4.3.0", + "hashPath": "system.xml.readerwriter.4.3.0.nupkg.sha512" + }, + "System.Xml.XDocument/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-5zJ0XDxAIg8iy+t4aMnQAu0MqVbqyvfoUVl1yDV61xdo3Vth45oA2FoY4pPkxYAH5f8ixpmTqXeEIya95x0aCQ==", + "path": "system.xml.xdocument/4.3.0", + "hashPath": "system.xml.xdocument.4.3.0.nupkg.sha512" + }, + "System.Xml.XmlDocument/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-lJ8AxvkX7GQxpC6GFCeBj8ThYVyQczx2+f/cWHJU8tjS7YfI6Cv6bon70jVEgs2CiFbmmM8b9j1oZVx0dSI2Ww==", + "path": "system.xml.xmldocument/4.3.0", + "hashPath": "system.xml.xmldocument.4.3.0.nupkg.sha512" + }, + "System.Xml.XmlSerializer/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-MYoTCP7EZ98RrANESW05J5ZwskKDoN0AuZ06ZflnowE50LTpbR5yRg3tHckTVm5j/m47stuGgCrCHWePyHS70Q==", + "path": "system.xml.xmlserializer/4.3.0", + "hashPath": "system.xml.xmlserializer.4.3.0.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Authentication/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Microsoft.Azure.PowerShell.Authentication.ResourceManager/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Microsoft.Azure.PowerShell.Authenticators/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll new file mode 100644 index 000000000000..2eff02a0138e Binary files /dev/null and b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll differ diff --git a/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll-Help.xml b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll-Help.xml new file mode 100644 index 000000000000..85f85750523b --- /dev/null +++ b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll-Help.xml @@ -0,0 +1,11900 @@ + + + + + Add-AzEnvironment + Add + AzEnvironment + + Adds endpoints and metadata for an instance of Azure Resource Manager. + + + + The Add-AzEnvironment cmdlet adds endpoints and metadata to enable Azure Resource Manager cmdlets to connect with a new instance of Azure Resource Manager. The built-in environments AzureCloud and AzureChinaCloud target existing public instances of Azure Resource Manager. + + + + Add-AzEnvironment + + Name + + Specifies the name of the environment to add. + + System.String + + System.String + + + None + + + PublishSettingsFileUrl + + Specifies the URL from which .publishsettings files can be downloaded. + + System.String + + System.String + + + None + + + AzureKeyVaultDnsSuffix + + Dns suffix of Azure Key Vault service. Example is vault-int.azure-int.net + + System.String + + System.String + + + None + + + AzureKeyVaultServiceEndpointResourceId + + Resource identifier of Azure Key Vault data service that is the recipient of the requested token. + + System.String + + System.String + + + None + + + TrafficManagerDnsSuffix + + Specifies the domain-name suffix for Azure Traffic Manager services. + + System.String + + System.String + + + None + + + SqlDatabaseDnsSuffix + + Specifies the domain-name suffix for Azure SQL Database servers. + + System.String + + System.String + + + None + + + AzureDataLakeStoreFileSystemEndpointSuffix + + Dns Suffix of Azure Data Lake Store FileSystem. Example: azuredatalake.net + + System.String + + System.String + + + None + + + AzureDataLakeAnalyticsCatalogAndJobEndpointSuffix + + Dns Suffix of Azure Data Lake Analytics job and catalog services + + System.String + + System.String + + + None + + + EnableAdfsAuthentication + + Indicates that Active Directory Federation Services (ADFS) on-premise authentication is allowed. + + + System.Management.Automation.SwitchParameter + + + False + + + AdTenant + + Specifies the default Active Directory tenant. + + System.String + + System.String + + + None + + + GraphAudience + + The audience for tokens authenticating with the AD Graph Endpoint. + + System.String + + System.String + + + None + + + DataLakeAudience + + The audience for tokens authenticating with the AD Data Lake services Endpoint. + + System.String + + System.String + + + None + + + ServiceEndpoint + + Specifies the endpoint for Service Management (RDFE) requests. + + System.String + + System.String + + + None + + + BatchEndpointResourceId + + The resource identifier of the Azure Batch service that is the recipient of the requested token + + System.String + + System.String + + + None + + + AzureOperationalInsightsEndpointResourceId + + The audience for tokens authenticating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureOperationalInsightsEndpoint + + The endpoint to use when communicating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + ManagementPortalUrl + + Specifies the URL for the Management Portal. + + System.String + + System.String + + + None + + + StorageEndpoint + + Specifies the endpoint for storage (blob, table, queue, and file) access. + + System.String + + System.String + + + None + + + ActiveDirectoryEndpoint + + Specifies the base authority for Azure Active Directory authentication. + + System.String + + System.String + + + None + + + ResourceManagerEndpoint + + Specifies the URL for Azure Resource Manager requests. + + System.String + + System.String + + + None + + + GalleryEndpoint + + Specifies the endpoint for the Azure Resource Manager gallery of deployment templates. + + System.String + + System.String + + + None + + + ActiveDirectoryServiceEndpointResourceId + + Specifies the audience for tokens that authenticate requests to Azure Resource Manager or Service Management (RDFE) endpoints. + + System.String + + System.String + + + None + + + GraphEndpoint + + Specifies the URL for Graph (Active Directory metadata) requests. + + System.String + + System.String + + + None + + + AzureAnalysisServicesEndpointResourceId + + The resource identifier of the Azure Analysis Services resource. + + System.String + + System.String + + + None + + + AzureAnalysisServicesEndpointSuffix + + The endpoint to use when communicating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureAttestationServiceEndpointResourceId + + The The resource identifier of the Azure Attestation service that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureAttestationServiceEndpointSuffix + + Dns suffix of Azure Attestation service. + + System.String + + System.String + + + None + + + AzureSynapseAnalyticsEndpointResourceId + + The The resource identifier of the Azure Synapse Analytics that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureSynapseAnalyticsEndpointSuffix + + Dns suffix of Azure Synapse Analytics. + + System.String + + System.String + + + None + + + ContainerRegistryEndpointSuffix + + Suffix of Azure Container Registry. + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + MicrosoftGraphEndpointResourceId + + The resource identifier of Microsoft Graph + + System.String + + System.String + + + None + + + MicrosoftGraphUrl + + Microsoft Graph Url + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Add-AzEnvironment + + Name + + Specifies the name of the environment to add. + + System.String + + System.String + + + None + + + ARMEndpoint + + The Azure Resource Manager endpoint + + System.String + + System.String + + + None + + + AzureKeyVaultDnsSuffix + + Dns suffix of Azure Key Vault service. Example is vault-int.azure-int.net + + System.String + + System.String + + + None + + + AzureKeyVaultServiceEndpointResourceId + + Resource identifier of Azure Key Vault data service that is the recipient of the requested token. + + System.String + + System.String + + + None + + + DataLakeAudience + + The audience for tokens authenticating with the AD Data Lake services Endpoint. + + System.String + + System.String + + + None + + + BatchEndpointResourceId + + The resource identifier of the Azure Batch service that is the recipient of the requested token + + System.String + + System.String + + + None + + + AzureOperationalInsightsEndpointResourceId + + The audience for tokens authenticating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureOperationalInsightsEndpoint + + The endpoint to use when communicating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + StorageEndpoint + + Specifies the endpoint for storage (blob, table, queue, and file) access. + + System.String + + System.String + + + None + + + AzureAnalysisServicesEndpointResourceId + + The resource identifier of the Azure Analysis Services resource. + + System.String + + System.String + + + None + + + AzureAnalysisServicesEndpointSuffix + + The endpoint to use when communicating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureAttestationServiceEndpointResourceId + + The The resource identifier of the Azure Attestation service that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureAttestationServiceEndpointSuffix + + Dns suffix of Azure Attestation service. + + System.String + + System.String + + + None + + + AzureSynapseAnalyticsEndpointResourceId + + The The resource identifier of the Azure Synapse Analytics that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureSynapseAnalyticsEndpointSuffix + + Dns suffix of Azure Synapse Analytics. + + System.String + + System.String + + + None + + + ContainerRegistryEndpointSuffix + + Suffix of Azure Container Registry. + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Add-AzEnvironment + + AutoDiscover + + Discovers environments via default or configured endpoint. + + + System.Management.Automation.SwitchParameter + + + False + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Uri + + Specifies URI of the internet resource to fetch environments. + + System.Uri + + System.Uri + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + ActiveDirectoryEndpoint + + Specifies the base authority for Azure Active Directory authentication. + + System.String + + System.String + + + None + + + ActiveDirectoryServiceEndpointResourceId + + Specifies the audience for tokens that authenticate requests to Azure Resource Manager or Service Management (RDFE) endpoints. + + System.String + + System.String + + + None + + + AdTenant + + Specifies the default Active Directory tenant. + + System.String + + System.String + + + None + + + ARMEndpoint + + The Azure Resource Manager endpoint + + System.String + + System.String + + + None + + + AutoDiscover + + Discovers environments via default or configured endpoint. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + AzureAnalysisServicesEndpointResourceId + + The resource identifier of the Azure Analysis Services resource. + + System.String + + System.String + + + None + + + AzureAnalysisServicesEndpointSuffix + + The endpoint to use when communicating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureAttestationServiceEndpointResourceId + + The The resource identifier of the Azure Attestation service that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureAttestationServiceEndpointSuffix + + Dns suffix of Azure Attestation service. + + System.String + + System.String + + + None + + + AzureDataLakeAnalyticsCatalogAndJobEndpointSuffix + + Dns Suffix of Azure Data Lake Analytics job and catalog services + + System.String + + System.String + + + None + + + AzureDataLakeStoreFileSystemEndpointSuffix + + Dns Suffix of Azure Data Lake Store FileSystem. Example: azuredatalake.net + + System.String + + System.String + + + None + + + AzureKeyVaultDnsSuffix + + Dns suffix of Azure Key Vault service. Example is vault-int.azure-int.net + + System.String + + System.String + + + None + + + AzureKeyVaultServiceEndpointResourceId + + Resource identifier of Azure Key Vault data service that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureOperationalInsightsEndpoint + + The endpoint to use when communicating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureOperationalInsightsEndpointResourceId + + The audience for tokens authenticating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureSynapseAnalyticsEndpointResourceId + + The The resource identifier of the Azure Synapse Analytics that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureSynapseAnalyticsEndpointSuffix + + Dns suffix of Azure Synapse Analytics. + + System.String + + System.String + + + None + + + BatchEndpointResourceId + + The resource identifier of the Azure Batch service that is the recipient of the requested token + + System.String + + System.String + + + None + + + ContainerRegistryEndpointSuffix + + Suffix of Azure Container Registry. + + System.String + + System.String + + + None + + + DataLakeAudience + + The audience for tokens authenticating with the AD Data Lake services Endpoint. + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + EnableAdfsAuthentication + + Indicates that Active Directory Federation Services (ADFS) on-premise authentication is allowed. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + GalleryEndpoint + + Specifies the endpoint for the Azure Resource Manager gallery of deployment templates. + + System.String + + System.String + + + None + + + GraphAudience + + The audience for tokens authenticating with the AD Graph Endpoint. + + System.String + + System.String + + + None + + + GraphEndpoint + + Specifies the URL for Graph (Active Directory metadata) requests. + + System.String + + System.String + + + None + + + ManagementPortalUrl + + Specifies the URL for the Management Portal. + + System.String + + System.String + + + None + + + MicrosoftGraphEndpointResourceId + + The resource identifier of Microsoft Graph + + System.String + + System.String + + + None + + + MicrosoftGraphUrl + + Microsoft Graph Url + + System.String + + System.String + + + None + + + Name + + Specifies the name of the environment to add. + + System.String + + System.String + + + None + + + PublishSettingsFileUrl + + Specifies the URL from which .publishsettings files can be downloaded. + + System.String + + System.String + + + None + + + ResourceManagerEndpoint + + Specifies the URL for Azure Resource Manager requests. + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + ServiceEndpoint + + Specifies the endpoint for Service Management (RDFE) requests. + + System.String + + System.String + + + None + + + SqlDatabaseDnsSuffix + + Specifies the domain-name suffix for Azure SQL Database servers. + + System.String + + System.String + + + None + + + StorageEndpoint + + Specifies the endpoint for storage (blob, table, queue, and file) access. + + System.String + + System.String + + + None + + + TrafficManagerDnsSuffix + + Specifies the domain-name suffix for Azure Traffic Manager services. + + System.String + + System.String + + + None + + + Uri + + Specifies URI of the internet resource to fetch environments. + + System.Uri + + System.Uri + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + System.String + + + + + + + + System.Management.Automation.SwitchParameter + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureEnvironment + + + + + + + + + + + + + + ----- Example 1: Creating and modifying a new environment ----- + Add-AzEnvironment -Name TestEnvironment ` + -ActiveDirectoryEndpoint TestADEndpoint ` + -ActiveDirectoryServiceEndpointResourceId TestADApplicationId ` + -ResourceManagerEndpoint TestRMEndpoint ` + -GalleryEndpoint TestGalleryEndpoint ` + -GraphEndpoint TestGraphEndpoint + +Name Resource Manager Url ActiveDirectory Authority +---- -------------------- ------------------------- +TestEnvironment TestRMEndpoint TestADEndpoint/ + +Set-AzEnvironment -Name TestEnvironment ` + -ActiveDirectoryEndpoint NewTestADEndpoint ` + -GraphEndpoint NewTestGraphEndpoint | Format-List + +Name : TestEnvironment +EnableAdfsAuthentication : False +OnPremise : False +ActiveDirectoryServiceEndpointResourceId : TestADApplicationId +AdTenant : +GalleryUrl : TestGalleryEndpoint +ManagementPortalUrl : +ServiceManagementUrl : +PublishSettingsFileUrl : +ResourceManagerUrl : TestRMEndpoint +SqlDatabaseDnsSuffix : +StorageEndpointSuffix : +ActiveDirectoryAuthority : NewTestADEndpoint +GraphUrl : NewTestGraphEndpoint +GraphEndpointResourceId : +TrafficManagerDnsSuffix : +AzureKeyVaultDnsSuffix : +DataLakeEndpointResourceId : +AzureDataLakeStoreFileSystemEndpointSuffix : +AzureDataLakeAnalyticsCatalogAndJobEndpointSuffix : +AzureKeyVaultServiceEndpointResourceId : +AzureOperationalInsightsEndpointResourceId : +AzureOperationalInsightsEndpoint : +AzureAnalysisServicesEndpointSuffix : +AzureAttestationServiceEndpointSuffix : +AzureAttestationServiceEndpointResourceId : +AzureSynapseAnalyticsEndpointSuffix : +AzureSynapseAnalyticsEndpointResourceId : +VersionProfiles : {} +ExtendedProperties : {} +BatchEndpointResourceId : + + In this example we are creating a new Azure environment with sample endpoints using Add-AzEnvironment, and then we are changing the value of the ActiveDirectoryEndpoint and GraphEndpoint attributes of the created environment using the cmdlet Set-AzEnvironment. + + + + + + ------- Example 2: Discovering a new environment via Uri ------- + <# +Uri https://configuredmetadata.net returns an array of environment metadata. The following example contains a payload for the AzureCloud default environment. + +[ + { + "portal": "https://portal.azure.com", + "authentication": { + "loginEndpoint": "https://login.microsoftonline.com/", + "audiences": [ + "https://management.core.windows.net/" + ], + "tenant": "common", + "identityProvider": "AAD" + }, + "media": "https://rest.media.azure.net", + "graphAudience": "https://graph.windows.net/", + "graph": "https://graph.windows.net/", + "name": "AzureCloud", + "suffixes": { + "azureDataLakeStoreFileSystem": "azuredatalakestore.net", + "acrLoginServer": "azurecr.io", + "sqlServerHostname": ".database.windows.net", + "azureDataLakeAnalyticsCatalogAndJob": "azuredatalakeanalytics.net", + "keyVaultDns": "vault.azure.net", + "storage": "core.windows.net", + "azureFrontDoorEndpointSuffix": "azurefd.net" + }, + "batch": "https://batch.core.windows.net/", + "resourceManager": "https://management.azure.com/", + "vmImageAliasDoc": "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/arm-compute/quickstart-templates/aliases.json", + "activeDirectoryDataLake": "https://datalake.azure.net/", + "sqlManagement": "https://management.core.windows.net:8443/", + "gallery": "https://gallery.azure.com/" + }, +…… +] +#> + +Add-AzEnvironment -AutoDiscover -Uri https://configuredmetadata.net + +Name Resource Manager Url ActiveDirectory Authority +---- -------------------- ------------------------- +TestEnvironment TestRMEndpoint TestADEndpoint/ + + In this example, we are discovering a new Azure environment from the `https://configuredmetadata.net` Uri. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/add-azenvironment + + + Get-AzEnvironment + + + + Remove-AzEnvironment + + + + Set-AzEnvironment + + + + + + + Clear-AzContext + Clear + AzContext + + Remove all Azure credentials, account, and subscription information. + + + + Remove all Azure Credentials, account, and subscription information. + + + + Clear-AzContext + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Delete all users and groups from the global scope without prompting + + + System.Management.Automation.SwitchParameter + + + False + + + PassThru + + Return a value indicating success or failure + + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Clear the context only for the current PowerShell session, or for all sessions. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Delete all users and groups from the global scope without prompting + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + PassThru + + Return a value indicating success or failure + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Clear the context only for the current PowerShell session, or for all sessions. + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + None + + + + + + + + + + System.Boolean + + + + + + + + + + + + + + --------------- Example 1: Clear global context --------------- + Clear-AzContext -Scope CurrentUser + + Remove all account, subscription, and credential information for any powershell session. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/clear-azcontext + + + + + + Clear-AzDefault + Clear + AzDefault + + Clears the defaults set by the user in the current context. + + + + The Clear-AzDefault cmdlet removes the defaults set by the user depending on the switch parameters specified by the user. + + + + Clear-AzDefault + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Remove all defaults if no default is specified + + + System.Management.Automation.SwitchParameter + + + False + + + PassThru + + {{Fill PassThru Description}} + + + System.Management.Automation.SwitchParameter + + + False + + + ResourceGroup + + Clear Default Resource Group + + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Remove all defaults if no default is specified + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + PassThru + + {{Fill PassThru Description}} + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + ResourceGroup + + Clear Default Resource Group + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + System.Management.Automation.SwitchParameter + + + + + + + + + + System.Boolean + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + Clear-AzDefault + + This command removes all the defaults set by the user in the current context. + + + + + + -------------------------- Example 2 -------------------------- + Clear-AzDefault -ResourceGroup + + This command removes the default resource group set by the user in the current context. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/clear-azdefault + + + + + + Connect-AzAccount + Connect + AzAccount + + Connect to Azure with an authenticated account for use with cmdlets from the Az PowerShell modules. + + + + The `Connect-AzAccount` cmdlet connects to Azure with an authenticated account for use with cmdlets from the Az PowerShell modules. You can use this authenticated account only with Azure Resource Manager requests. To add an authenticated account for use with Service Management, use the `Add-AzureAccount` cmdlet from the Azure PowerShell module. If no context is found for the current user, the user's context list is populated with a context for each of their first 25 subscriptions. The list of contexts created for the user can be found by running `Get-AzContext -ListAvailable`. To skip this context population, specify the SkipContextPopulation switch parameter. After executing this cmdlet, you can disconnect from an Azure account using `Disconnect-AzAccount`. + + + + Connect-AzAccount + + AccessToken + + Specifies an access token. + > [!CAUTION] > Access tokens are a type of credential. You should take the appropriate security precautions to > keep them confidential. Access tokens also timeout and may prevent long running tasks from > completing. + + System.String + + System.String + + + None + + + AccountId + + Account Id / User Id / User Name to login with in Default (UserWithSubscriptionId) parameter set; Account ID for access token in AccessToken parameter set; Account ID for managed service in ManagedService parameter set. Can be a managed service resource ID, or the associated client ID. To use the system assigned identity, leave this field blank. + + System.String + + System.String + + + None + + + ContextName + + Name of the default Azure context for this login. For more information about Azure contexts, see Azure PowerShell context objects (/powershell/azure/context-persistence). + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Environment + + Environment containing the Azure account. + + System.String + + System.String + + + None + + + Force + + Overwrite the existing context with the same name without prompting. + + + System.Management.Automation.SwitchParameter + + + False + + + GraphAccessToken + + AccessToken for Graph Service. + + System.String + + System.String + + + None + + + KeyVaultAccessToken + + AccessToken for KeyVault Service. + + System.String + + System.String + + + None + + + MaxContextPopulation + + Max subscription number to populate contexts after login. Default is 25. To populate all subscriptions to contexts, set to -1. + + System.Int32 + + System.Int32 + + + None + + + MicrosoftGraphAccessToken + + Access token to Microsoft Graph + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + SkipContextPopulation + + Skips context population if no contexts are found. + + + System.Management.Automation.SwitchParameter + + + False + + + SkipValidation + + Skip validation for access token. + + + System.Management.Automation.SwitchParameter + + + False + + + Subscription + + Subscription Name or ID. + + System.String + + System.String + + + None + + + Tenant + + Optional tenant name or ID. + > [!NOTE] > Due to limitations of the current API, you must use a tenant ID instead of a tenant name when > connecting with a business-to-business (B2B) account. + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Connect-AzAccount + + AccountId + + Account Id / User Id / User Name to login with in Default (UserWithSubscriptionId) parameter set; Account ID for access token in AccessToken parameter set; Account ID for managed service in ManagedService parameter set. Can be a managed service resource ID, or the associated client ID. To use the system assigned identity, leave this field blank. + + System.String + + System.String + + + None + + + AuthScope + + Optional OAuth scope for login, supported pre-defined values: AadGraph, AnalysisServices, Attestation, Batch, DataLake, KeyVault, OperationalInsights, Storage, Synapse. It also supports resource id like `https://storage.azure.com/`. + + System.String + + System.String + + + None + + + ContextName + + Name of the default Azure context for this login. For more information about Azure contexts, see Azure PowerShell context objects (/powershell/azure/context-persistence). + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Environment + + Environment containing the Azure account. + + System.String + + System.String + + + None + + + Force + + Overwrite the existing context with the same name without prompting. + + + System.Management.Automation.SwitchParameter + + + False + + + MaxContextPopulation + + Max subscription number to populate contexts after login. Default is 25. To populate all subscriptions to contexts, set to -1. + + System.Int32 + + System.Int32 + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + SkipContextPopulation + + Skips context population if no contexts are found. + + + System.Management.Automation.SwitchParameter + + + False + + + Subscription + + Subscription Name or ID. + + System.String + + System.String + + + None + + + Tenant + + Optional tenant name or ID. + > [!NOTE] > Due to limitations of the current API, you must use a tenant ID instead of a tenant name when > connecting with a business-to-business (B2B) account. + + System.String + + System.String + + + None + + + UseDeviceAuthentication + + Use device code authentication instead of a browser control. + + + System.Management.Automation.SwitchParameter + + + False + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Connect-AzAccount + + AccountId + + Account Id / User Id / User Name to login with in Default (UserWithSubscriptionId) parameter set; Account ID for access token in AccessToken parameter set; Account ID for managed service in ManagedService parameter set. Can be a managed service resource ID, or the associated client ID. To use the system assigned identity, leave this field blank. + + System.String + + System.String + + + None + + + AuthScope + + Optional OAuth scope for login, supported pre-defined values: AadGraph, AnalysisServices, Attestation, Batch, DataLake, KeyVault, OperationalInsights, Storage, Synapse. It also supports resource id like `https://storage.azure.com/`. + + System.String + + System.String + + + None + + + ContextName + + Name of the default Azure context for this login. For more information about Azure contexts, see Azure PowerShell context objects (/powershell/azure/context-persistence). + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Environment + + Environment containing the Azure account. + + System.String + + System.String + + + None + + + Force + + Overwrite the existing context with the same name without prompting. + + + System.Management.Automation.SwitchParameter + + + False + + + Identity + + Login using a Managed Service Identity. + + + System.Management.Automation.SwitchParameter + + + False + + + MaxContextPopulation + + Max subscription number to populate contexts after login. Default is 25. To populate all subscriptions to contexts, set to -1. + + System.Int32 + + System.Int32 + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + SkipContextPopulation + + Skips context population if no contexts are found. + + + System.Management.Automation.SwitchParameter + + + False + + + Subscription + + Subscription Name or ID. + + System.String + + System.String + + + None + + + Tenant + + Optional tenant name or ID. + > [!NOTE] > Due to limitations of the current API, you must use a tenant ID instead of a tenant name when > connecting with a business-to-business (B2B) account. + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Connect-AzAccount + + ApplicationId + + Application ID of the service principal. + + System.String + + System.String + + + None + + + AuthScope + + Optional OAuth scope for login, supported pre-defined values: AadGraph, AnalysisServices, Attestation, Batch, DataLake, KeyVault, OperationalInsights, Storage, Synapse. It also supports resource id like `https://storage.azure.com/`. + + System.String + + System.String + + + None + + + CertificateThumbprint + + Certificate Hash or Thumbprint. + + System.String + + System.String + + + None + + + ContextName + + Name of the default Azure context for this login. For more information about Azure contexts, see Azure PowerShell context objects (/powershell/azure/context-persistence). + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Environment + + Environment containing the Azure account. + + System.String + + System.String + + + None + + + Force + + Overwrite the existing context with the same name without prompting. + + + System.Management.Automation.SwitchParameter + + + False + + + MaxContextPopulation + + Max subscription number to populate contexts after login. Default is 25. To populate all subscriptions to contexts, set to -1. + + System.Int32 + + System.Int32 + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + SendCertificateChain + + Specifies if the x5c claim (public key of the certificate) should be sent to the STS to achieve easy certificate rollover in Azure AD. + + + System.Management.Automation.SwitchParameter + + + False + + + ServicePrincipal + + Indicates that this account authenticates by providing service principal credentials. + + + System.Management.Automation.SwitchParameter + + + False + + + SkipContextPopulation + + Skips context population if no contexts are found. + + + System.Management.Automation.SwitchParameter + + + False + + + Subscription + + Subscription Name or ID. + + System.String + + System.String + + + None + + + Tenant + + Optional tenant name or ID. + > [!NOTE] > Due to limitations of the current API, you must use a tenant ID instead of a tenant name when > connecting with a business-to-business (B2B) account. + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Connect-AzAccount + + ApplicationId + + Application ID of the service principal. + + System.String + + System.String + + + None + + + ContextName + + Name of the default Azure context for this login. For more information about Azure contexts, see Azure PowerShell context objects (/powershell/azure/context-persistence). + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Environment + + Environment containing the Azure account. + + System.String + + System.String + + + None + + + FederatedToken + + Specifies a token provided by another identity provider. The issuer and subject in this token must be first configured to be trusted by the ApplicationId. + > [!CAUTION] > Federated tokens are a type of credential. You should take the appropriate security precautions to keep them confidential. Federated tokens also timeout and may prevent long running tasks from completing. + + System.String + + System.String + + + None + + + Force + + Overwrite the existing context with the same name without prompting. + + + System.Management.Automation.SwitchParameter + + + False + + + MaxContextPopulation + + Max subscription number to populate contexts after login. Default is 25. To populate all subscriptions to contexts, set to -1. + + System.Int32 + + System.Int32 + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + ServicePrincipal + + Indicates that this account authenticates by providing service principal credentials. + + + System.Management.Automation.SwitchParameter + + + False + + + SkipContextPopulation + + Skips context population if no contexts are found. + + + System.Management.Automation.SwitchParameter + + + False + + + Subscription + + Subscription Name or ID. + + System.String + + System.String + + + None + + + Tenant + + Optional tenant name or ID. + > [!NOTE] > Due to limitations of the current API, you must use a tenant ID instead of a tenant name when > connecting with a business-to-business (B2B) account. + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Connect-AzAccount + + ApplicationId + + Application ID of the service principal. + + System.String + + System.String + + + None + + + CertificatePassword + + The password required to access the pkcs#12 certificate file. + + System.Security.SecureString + + System.Security.SecureString + + + None + + + CertificatePath + + The path of certficate file in pkcs#12 format. + + System.String + + System.String + + + None + + + ContextName + + Name of the default Azure context for this login. For more information about Azure contexts, see Azure PowerShell context objects (/powershell/azure/context-persistence). + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Environment + + Environment containing the Azure account. + + System.String + + System.String + + + None + + + Force + + Overwrite the existing context with the same name without prompting. + + + System.Management.Automation.SwitchParameter + + + False + + + MaxContextPopulation + + Max subscription number to populate contexts after login. Default is 25. To populate all subscriptions to contexts, set to -1. + + System.Int32 + + System.Int32 + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + SendCertificateChain + + Specifies if the x5c claim (public key of the certificate) should be sent to the STS to achieve easy certificate rollover in Azure AD. + + + System.Management.Automation.SwitchParameter + + + False + + + ServicePrincipal + + Indicates that this account authenticates by providing service principal credentials. + + + System.Management.Automation.SwitchParameter + + + False + + + SkipContextPopulation + + Skips context population if no contexts are found. + + + System.Management.Automation.SwitchParameter + + + False + + + Subscription + + Subscription Name or ID. + + System.String + + System.String + + + None + + + Tenant + + Optional tenant name or ID. + > [!NOTE] > Due to limitations of the current API, you must use a tenant ID instead of a tenant name when > connecting with a business-to-business (B2B) account. + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Connect-AzAccount + + AuthScope + + Optional OAuth scope for login, supported pre-defined values: AadGraph, AnalysisServices, Attestation, Batch, DataLake, KeyVault, OperationalInsights, Storage, Synapse. It also supports resource id like `https://storage.azure.com/`. + + System.String + + System.String + + + None + + + ContextName + + Name of the default Azure context for this login. For more information about Azure contexts, see Azure PowerShell context objects (/powershell/azure/context-persistence). + + System.String + + System.String + + + None + + + Credential + + Specifies a PSCredential object. For more information about the PSCredential object, type `Get-Help Get-Credential`. The PSCredential object provides the user ID and password for organizational ID credentials, or the application ID and secret for service principal credentials. + + System.Management.Automation.PSCredential + + System.Management.Automation.PSCredential + + + None + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Environment + + Environment containing the Azure account. + + System.String + + System.String + + + None + + + Force + + Overwrite the existing context with the same name without prompting. + + + System.Management.Automation.SwitchParameter + + + False + + + MaxContextPopulation + + Max subscription number to populate contexts after login. Default is 25. To populate all subscriptions to contexts, set to -1. + + System.Int32 + + System.Int32 + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + ServicePrincipal + + Indicates that this account authenticates by providing service principal credentials. + + + System.Management.Automation.SwitchParameter + + + False + + + SkipContextPopulation + + Skips context population if no contexts are found. + + + System.Management.Automation.SwitchParameter + + + False + + + Subscription + + Subscription Name or ID. + + System.String + + System.String + + + None + + + Tenant + + Optional tenant name or ID. + > [!NOTE] > Due to limitations of the current API, you must use a tenant ID instead of a tenant name when > connecting with a business-to-business (B2B) account. + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Connect-AzAccount + + AuthScope + + Optional OAuth scope for login, supported pre-defined values: AadGraph, AnalysisServices, Attestation, Batch, DataLake, KeyVault, OperationalInsights, Storage, Synapse. It also supports resource id like `https://storage.azure.com/`. + + System.String + + System.String + + + None + + + ContextName + + Name of the default Azure context for this login. For more information about Azure contexts, see Azure PowerShell context objects (/powershell/azure/context-persistence). + + System.String + + System.String + + + None + + + Credential + + Specifies a PSCredential object. For more information about the PSCredential object, type `Get-Help Get-Credential`. The PSCredential object provides the user ID and password for organizational ID credentials, or the application ID and secret for service principal credentials. + + System.Management.Automation.PSCredential + + System.Management.Automation.PSCredential + + + None + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Environment + + Environment containing the Azure account. + + System.String + + System.String + + + None + + + Force + + Overwrite the existing context with the same name without prompting. + + + System.Management.Automation.SwitchParameter + + + False + + + MaxContextPopulation + + Max subscription number to populate contexts after login. Default is 25. To populate all subscriptions to contexts, set to -1. + + System.Int32 + + System.Int32 + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + SkipContextPopulation + + Skips context population if no contexts are found. + + + System.Management.Automation.SwitchParameter + + + False + + + Subscription + + Subscription Name or ID. + + System.String + + System.String + + + None + + + Tenant + + Optional tenant name or ID. + > [!NOTE] > Due to limitations of the current API, you must use a tenant ID instead of a tenant name when > connecting with a business-to-business (B2B) account. + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + AccessToken + + Specifies an access token. + > [!CAUTION] > Access tokens are a type of credential. You should take the appropriate security precautions to > keep them confidential. Access tokens also timeout and may prevent long running tasks from > completing. + + System.String + + System.String + + + None + + + AccountId + + Account Id / User Id / User Name to login with in Default (UserWithSubscriptionId) parameter set; Account ID for access token in AccessToken parameter set; Account ID for managed service in ManagedService parameter set. Can be a managed service resource ID, or the associated client ID. To use the system assigned identity, leave this field blank. + + System.String + + System.String + + + None + + + ApplicationId + + Application ID of the service principal. + + System.String + + System.String + + + None + + + AuthScope + + Optional OAuth scope for login, supported pre-defined values: AadGraph, AnalysisServices, Attestation, Batch, DataLake, KeyVault, OperationalInsights, Storage, Synapse. It also supports resource id like `https://storage.azure.com/`. + + System.String + + System.String + + + None + + + CertificatePassword + + The password required to access the pkcs#12 certificate file. + + System.Security.SecureString + + System.Security.SecureString + + + None + + + CertificatePath + + The path of certficate file in pkcs#12 format. + + System.String + + System.String + + + None + + + CertificateThumbprint + + Certificate Hash or Thumbprint. + + System.String + + System.String + + + None + + + ContextName + + Name of the default Azure context for this login. For more information about Azure contexts, see Azure PowerShell context objects (/powershell/azure/context-persistence). + + System.String + + System.String + + + None + + + Credential + + Specifies a PSCredential object. For more information about the PSCredential object, type `Get-Help Get-Credential`. The PSCredential object provides the user ID and password for organizational ID credentials, or the application ID and secret for service principal credentials. + + System.Management.Automation.PSCredential + + System.Management.Automation.PSCredential + + + None + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Environment + + Environment containing the Azure account. + + System.String + + System.String + + + None + + + FederatedToken + + Specifies a token provided by another identity provider. The issuer and subject in this token must be first configured to be trusted by the ApplicationId. + > [!CAUTION] > Federated tokens are a type of credential. You should take the appropriate security precautions to keep them confidential. Federated tokens also timeout and may prevent long running tasks from completing. + + System.String + + System.String + + + None + + + Force + + Overwrite the existing context with the same name without prompting. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + GraphAccessToken + + AccessToken for Graph Service. + + System.String + + System.String + + + None + + + Identity + + Login using a Managed Service Identity. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + KeyVaultAccessToken + + AccessToken for KeyVault Service. + + System.String + + System.String + + + None + + + MaxContextPopulation + + Max subscription number to populate contexts after login. Default is 25. To populate all subscriptions to contexts, set to -1. + + System.Int32 + + System.Int32 + + + None + + + MicrosoftGraphAccessToken + + Access token to Microsoft Graph + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + SendCertificateChain + + Specifies if the x5c claim (public key of the certificate) should be sent to the STS to achieve easy certificate rollover in Azure AD. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + ServicePrincipal + + Indicates that this account authenticates by providing service principal credentials. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + SkipContextPopulation + + Skips context population if no contexts are found. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + SkipValidation + + Skip validation for access token. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Subscription + + Subscription Name or ID. + + System.String + + System.String + + + None + + + Tenant + + Optional tenant name or ID. + > [!NOTE] > Due to limitations of the current API, you must use a tenant ID instead of a tenant name when > connecting with a business-to-business (B2B) account. + + System.String + + System.String + + + None + + + UseDeviceAuthentication + + Use device code authentication instead of a browser control. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + System.String + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureProfile + + + + + + + + + + + + + + ------------ Example 1: Connect to an Azure account ------------ + Connect-AzAccount + +Account SubscriptionName TenantId Environment +------- ---------------- -------- ----------- +azureuser@contoso.com Subscription1 xxxx-xxxx-xxxx-xxxx AzureCloud + + + + + + + + Example 2: Connect to Azure using organizational ID credentials + $Credential = Get-Credential +Connect-AzAccount -Credential $Credential + +Account SubscriptionName TenantId Environment +------- ---------------- -------- ----------- +azureuser@contoso.com Subscription1 xxxx-xxxx-xxxx-xxxx AzureCloud + + + + + + + + Example 3: Connect to Azure using a service principal account + $Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $ApplicationId, $SecuredPassword +Connect-AzAccount -ServicePrincipal -TenantId $TenantId -Credential $Credential + +Account SubscriptionName TenantId Environment +------- ---------------- -------- ----------- +xxxx-xxxx-xxxx-xxxx Subscription1 xxxx-xxxx-xxxx-xxxx AzureCloud + + + + + + + + Example 4: Use an interactive login to connect to a specific tenant and subscription + Connect-AzAccount -Tenant 'xxxx-xxxx-xxxx-xxxx' -SubscriptionId 'yyyy-yyyy-yyyy-yyyy' + +Account SubscriptionName TenantId Environment +------- ---------------- -------- ----------- +azureuser@contoso.com Subscription1 xxxx-xxxx-xxxx-xxxx AzureCloud + + + + + + + + ----- Example 5: Connect using a Managed Service Identity ----- + Connect-AzAccount -Identity + +Account SubscriptionName TenantId Environment +------- ---------------- -------- ----------- +MSI@50342 Subscription1 xxxx-xxxx-xxxx-xxxx AzureCloud + + + + + + + + Example 6: Connect using Managed Service Identity login and ClientId + $identity = Get-AzUserAssignedIdentity -ResourceGroupName 'myResourceGroup' -Name 'myUserAssignedIdentity' +Get-AzVM -ResourceGroupName contoso -Name testvm | Update-AzVM -IdentityType UserAssigned -IdentityId $identity.Id +Connect-AzAccount -Identity -AccountId $identity.ClientId # Run on the virtual machine + +Account SubscriptionName TenantId Environment +------- ---------------- -------- ----------- +yyyy-yyyy-yyyy-yyyy Subscription1 xxxx-xxxx-xxxx-xxxx AzureCloud + + + + + + + + ------------ Example 7: Connect using certificates ------------ + $Thumbprint = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' +$TenantId = 'yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyy' +$ApplicationId = '00000000-0000-0000-0000-00000000' +Connect-AzAccount -CertificateThumbprint $Thumbprint -ApplicationId $ApplicationId -Tenant $TenantId -ServicePrincipal + +Account SubscriptionName TenantId Environment +------- ---------------- -------- ----------- +xxxxxxxx-xxxx-xxxx-xxxxxxxxx Subscription1 yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyy AzureCloud + +Account : xxxxxxxx-xxxx-xxxx-xxxxxxxx +SubscriptionName : MyTestSubscription +SubscriptionId : zzzzzzzz-zzzz-zzzz-zzzz-zzzzzzzz +TenantId : yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyy +Environment : AzureCloud + + + + + + + + -------------- Example 8: Connect with AuthScope -------------- + Connect-AzAccount -AuthScope Storage + +Account SubscriptionName TenantId Environment +------- ---------------- -------- ----------- +yyyy-yyyy-yyyy-yyyy Subscription1 xxxx-xxxx-xxxx-xxxx AzureCloud + + + + + + + + ---------- Example 9: Connect using certificate file ---------- + $securePassword = $plainPassword | ConvertTo-SecureString -AsPlainText -Force +$TenantId = 'yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyy' +$ApplicationId = 'zzzzzzzz-zzzz-zzzz-zzzz-zzzzzzzz' +Connect-AzAccount -ServicePrincipal -ApplicationId $ApplicationId -TenantId $TenantId -CertificatePath './certificatefortest.pfx' -CertificatePassword $securePassword + +Account SubscriptionName TenantId Environment +------- ---------------- -------- ----------- +xxxxxxxx-xxxx-xxxx-xxxxxxxx Subscription1 yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyy AzureCloud + + + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/connect-azaccount + + + + + + Disable-AzContextAutosave + Disable + AzContextAutosave + + Turn off autosaving Azure credentials. Your login information will be forgotten the next time you open a PowerShell window + + + + Turn off autosaving Azure credentials. Your login information will be forgotten the next time you open a PowerShell window + + + + Disable-AzContextAutosave + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + None + + + + + + + + + + Microsoft.Azure.Commands.Common.Authentication.ContextAutosaveSettings + + + + + + + + + + + + + + ---------- Example 1: Disable autosaving the context ---------- + Disable-AzContextAutosave + + Disable autosave for the current user. + + + + + + -------------------------- Example 2 -------------------------- + <!-- Aladdin Generated Example --> +Disable-AzContextAutosave -Scope Process + + + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/disable-azcontextautosave + + + + + + Disable-AzDataCollection + Disable + AzDataCollection + + Opts out of collecting data to improve the Azure PowerShell cmdlets. Data is collected by default unless you explicitly opt out. + + + + The `Disable-AzDataCollection` cmdlet is used to opt out of data collection. Azure PowerShell automatically collects telemetry data by default. To disable data collection, you must explicitly opt-out. Microsoft aggregates collected data to identify patterns of usage, to identify common issues, and to improve the experience of Azure PowerShell. Microsoft Azure PowerShell doesn't collect any private or personal data. If you've previously opted out, run the `Enable-AzDataCollection` cmdlet to re-enable data collection for the current user on the current machine. + + + + Disable-AzDataCollection + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + None + + + + + + + + + + System.Void + + + + + + + + + + + + + + -- Example 1: Disabling data collection for the current user -- + Disable-AzDataCollection + + + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/disable-azdatacollection + + + Enable-AzDataCollection + + + + + + + Disable-AzureRmAlias + Disable + AzureRmAlias + + Disables AzureRm prefix aliases for Az modules. + + + + Disables AzureRm prefix aliases for Az modules. If -Module is specified, only modules listed will have aliases disabled. Otherwise all AzureRm aliases are disabled. + + + + Disable-AzureRmAlias + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Module + + Indicates which modules to disable aliases for. If none are specified, default is all enabled modules. + + System.String[] + + System.String[] + + + None + + + PassThru + + If specified, cmdlet will return all disabled aliases + + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Indicates what scope aliases should be disabled for. Default is 'Process' + + + Process + CurrentUser + LocalMachine + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Module + + Indicates which modules to disable aliases for. If none are specified, default is all enabled modules. + + System.String[] + + System.String[] + + + None + + + PassThru + + If specified, cmdlet will return all disabled aliases + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Indicates what scope aliases should be disabled for. Default is 'Process' + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + None + + + + + + + + + + System.String + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + Disable-AzureRmAlias + + Disables all AzureRm prefixes for the current PowerShell session. + + + + + + -------------------------- Example 2 -------------------------- + Disable-AzureRmAlias -Module Az.Accounts -Scope CurrentUser + + Disables AzureRm aliases for the Az.Accounts module for both the current process and for the current user. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/disable-azurermalias + + + + + + Disconnect-AzAccount + Disconnect + AzAccount + + Disconnects a connected Azure account and removes all credentials and contexts associated with that account. + + + + The Disconnect-AzAccount cmdlet disconnects a connected Azure account and removes all credentials and contexts (subscription and tenant information) associated with that account. After executing this cmdlet, you will need to login again using Connect-AzAccount. + + + + Disconnect-AzAccount + + ApplicationId + + ServicePrincipal id (globally unique id) + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + TenantId + + Tenant id (globally unique id) + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not executed. + + + System.Management.Automation.SwitchParameter + + + False + + + + Disconnect-AzAccount + + AzureContext + + Context + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not executed. + + + System.Management.Automation.SwitchParameter + + + False + + + + Disconnect-AzAccount + + ContextName + + Name of the context to log out of + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not executed. + + + System.Management.Automation.SwitchParameter + + + False + + + + Disconnect-AzAccount + + InputObject + + The account object to remove + + Microsoft.Azure.Commands.Profile.Models.PSAzureRmAccount + + Microsoft.Azure.Commands.Profile.Models.PSAzureRmAccount + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not executed. + + + System.Management.Automation.SwitchParameter + + + False + + + + Disconnect-AzAccount + + Username + + User name of the form 'user@contoso.org' + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not executed. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + ApplicationId + + ServicePrincipal id (globally unique id) + + System.String + + System.String + + + None + + + AzureContext + + Context + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + None + + + ContextName + + Name of the context to log out of + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + InputObject + + The account object to remove + + Microsoft.Azure.Commands.Profile.Models.PSAzureRmAccount + + Microsoft.Azure.Commands.Profile.Models.PSAzureRmAccount + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + TenantId + + Tenant id (globally unique id) + + System.String + + System.String + + + None + + + Username + + User name of the form 'user@contoso.org' + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not executed. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureRmAccount + + + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureRmAccount + + + + + + + + + + + + + + ----------- Example 1: Logout of the current account ----------- + Disconnect-AzAccount + + Logs out of the Azure account associated with the current context. + + + + + + Example 2: Logout of the account associated with a particular context + Get-AzContext "Work" | Disconnect-AzAccount -Scope CurrentUser + + Logs out the account associated with the given context (named 'Work'). Because this uses the 'CurrentUser' scope, all credentials and contexts will be permanently deleted. + + + + + + ------------- Example 3: Log out a particular user ------------- + Disconnect-AzAccount -Username 'user1@contoso.org' + + Logs out the 'user1@contoso.org' user - all credentials and all contexts associated with this user will be removed. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/disconnect-azaccount + + + + + + Enable-AzContextAutosave + Enable + AzContextAutosave + + Azure contexts are PowerShell objects representing your active subscription to run commands against, and the authentication information needed to connect to an Azure cloud. With Azure contexts, Azure PowerShell doesn't need to reauthenticate your account each time you switch subscriptions. For more information, see Azure PowerShell context objects (https://docs.microsoft.com/powershell/azure/context-persistence). + This cmdlet allows the Azure context information to be saved and automatically loaded when you start a PowerShell process. For example, when opening a new window. + + + + Allows the Azure context information to be saved and automatically loaded when a PowerShell process starts. The context is saved at the end of the execution of any cmdlet that affects the context. For example, any profile cmdlet. If you're using user authentication, then tokens can be updated during the course of running any cmdlet. + + + + Enable-AzContextAutosave + + DefaultProfile + + The credentials, tenant, and subscription used for communication with Azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes. For example, whether changes apply only to the current process, or to all sessions started by this user. Changes made with the scope `CurrentUser` will affect all PowerShell sessions started by the user. If a particular session needs to have different settings, use the scope `Process`. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + CurrentUser + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet isn't run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, tenant, and subscription used for communication with Azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes. For example, whether changes apply only to the current process, or to all sessions started by this user. Changes made with the scope `CurrentUser` will affect all PowerShell sessions started by the user. If a particular session needs to have different settings, use the scope `Process`. + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + CurrentUser + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet isn't run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + None + + + + + + + + + + Microsoft.Azure.Commands.Common.Authentication.ContextAutosaveSettings + + + + + + + + + + + + + + Example 1: Enable autosaving credentials for the current user + Enable-AzContextAutosave + + + + + + + + -------------------------- Example 2 -------------------------- + <!-- Aladdin Generated Example --> +Enable-AzContextAutosave -Scope Process + + + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/enable-azcontextautosave + + + + + + Enable-AzDataCollection + Enable + AzDataCollection + + Enables Azure PowerShell to collect data to improve the user experience with the Azure PowerShell cmdlets. Executing this cmdlet opts in to data collection for the current user on the current machine. Data is collected by default unless you explicitly opt out. + + + + The `Enable-AzDataCollection` cmdlet is used to opt in to data collection. Azure PowerShell automatically collects telemetry data by default. Microsoft aggregates collected data to identify patterns of usage, to identify common issues, and to improve the experience of Azure PowerShell. Microsoft Azure PowerShell doesn't collect any private or personal data. To disable data collection, you must explicitly opt out by executing `Disable-AzDataCollection`. + + + + Enable-AzDataCollection + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + None + + + + + + + + + + System.Void + + + + + + + + + + + + + + --- Example 1: Enabling data collection for the current user --- + Enable-AzDataCollection + + + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/enable-azdatacollection + + + Disable-AzDataCollection + + + + + + + Enable-AzureRmAlias + Enable + AzureRmAlias + + Enables AzureRm prefix aliases for Az modules. + + + + Enables AzureRm prefix aliases for Az modules. If -Module is specified, only modules listed will have aliases enabled. Otherwise all AzureRm aliases are enabled. + + + + Enable-AzureRmAlias + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Module + + Indicates which modules to enable aliases for. If none are specified, default is all modules. + + System.String[] + + System.String[] + + + None + + + PassThru + + If specified, cmdlet will return all aliases enabled + + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Indicates what scope aliases should be enabled for. Default is 'Local' + + + Local + Process + CurrentUser + LocalMachine + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Module + + Indicates which modules to enable aliases for. If none are specified, default is all modules. + + System.String[] + + System.String[] + + + None + + + PassThru + + If specified, cmdlet will return all aliases enabled + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Indicates what scope aliases should be enabled for. Default is 'Local' + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + None + + + + + + + + + + System.String + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + Enable-AzureRmAlias + + Enables all AzureRm prefixes for the current PowerShell session. + + + + + + -------------------------- Example 2 -------------------------- + Enable-AzureRmAlias -Module Az.Accounts -Scope CurrentUser + + Enables AzureRm aliases for the Az.Accounts module for both the current process and for the current user. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/enable-azurermalias + + + + + + Get-AzAccessToken + Get + AzAccessToken + + Get raw access token. When using -ResourceUrl, please make sure the value does match current Azure environment. You may refer to the value of `(Get-AzContext).Environment`. + + + + Get access token + + + + Get-AzAccessToken + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + ResourceTypeName + + Optional resource type name, supported values: AadGraph, AnalysisServices, Arm, Attestation, Batch, DataLake, KeyVault, MSGraph, OperationalInsights, ResourceManager, Storage, Synapse. Default value is Arm if not specified. + + System.String + + System.String + + + None + + + TenantId + + Optional Tenant Id. Use tenant id of default context if not specified. + + System.String + + System.String + + + None + + + + Get-AzAccessToken + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + ResourceUrl + + Resource url for that you're requesting token, e.g. 'https://graph.microsoft.com/'. + + System.String + + System.String + + + None + + + TenantId + + Optional Tenant Id. Use tenant id of default context if not specified. + + System.String + + System.String + + + None + + + + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + ResourceTypeName + + Optional resource type name, supported values: AadGraph, AnalysisServices, Arm, Attestation, Batch, DataLake, KeyVault, MSGraph, OperationalInsights, ResourceManager, Storage, Synapse. Default value is Arm if not specified. + + System.String + + System.String + + + None + + + ResourceUrl + + Resource url for that you're requesting token, e.g. 'https://graph.microsoft.com/'. + + System.String + + System.String + + + None + + + TenantId + + Optional Tenant Id. Use tenant id of default context if not specified. + + System.String + + System.String + + + None + + + + + + None + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAccessToken + + + + + + + + + + + + + + ------- Example 1 Get the access token for ARM endpoint ------- + Get-AzAccessToken + + Get access token of current account for ResourceManager endpoint + + + + + + - Example 2 Get the access token for Microsoft Graph endpoint - + Get-AzAccessToken -ResourceTypeName MSGraph + + Get access token of Microsoft Graph endpoint for current account + + + + + + - Example 3 Get the access token for Microsoft Graph endpoint - + Get-AzAccessToken -ResourceUrl "https://graph.microsoft.com/" + + Get access token of Microsoft Graph endpoint for current account + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/get-azaccesstoken + + + + + + Get-AzContext + Get + AzContext + + Gets the metadata used to authenticate Azure Resource Manager requests. + + + + The Get-AzContext cmdlet gets the current metadata used to authenticate Azure Resource Manager requests. This cmdlet gets the Active Directory account, Active Directory tenant, Azure subscription, and the targeted Azure environment. Azure Resource Manager cmdlets use these settings by default when making Azure Resource Manager requests. When the available amount of subscription exceeds the default limit of 25, some subscriptions may not show up in the results of `Get-AzContext -ListAvailable`. Please run `Connect-AzAccount -MaxContextPopulation <int>` to get more contexts. + + + + Get-AzContext + + DefaultProfile + + The credentials, account, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + ListAvailable + + List all available contexts in the current session. + + + System.Management.Automation.SwitchParameter + + + False + + + RefreshContextFromTokenCache + + Refresh contexts from token cache + + + System.Management.Automation.SwitchParameter + + + False + + + + Get-AzContext + + Name + + The name of the context + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, account, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + + + + DefaultProfile + + The credentials, account, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + ListAvailable + + List all available contexts in the current session. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Name + + The name of the context + + System.String + + System.String + + + None + + + RefreshContextFromTokenCache + + Refresh contexts from token cache + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + None + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + + + + + + + + + + + + ------------ Example 1: Getting the current context ------------ + Connect-AzAccount +Get-AzContext + +Name Account SubscriptionName Environment TenantId +---- ------- ---------------- ----------- -------- +Subscription1 (xxxxxxxx-xxxx-xxxx-xxx... test@outlook.com Subscription1 AzureCloud xxxxxxxx-x... + + In this example we are logging into our account with an Azure subscription using Connect-AzAccount, and then we are getting the context of the current session by calling Get-AzContext. + + + + + + ---------- Example 2: Listing all available contexts ---------- + Get-AzContext -ListAvailable + +Name Account SubscriptionName Environment TenantId +---- ------- ---------------- ----------- -------- +Subscription1 (xxxxxxxx-xxxx-xxxx-xxx... test@outlook.com Subscription1 AzureCloud xxxxxxxx-x... +Subscription2 (xxxxxxxx-xxxx-xxxx-xxx... test@outlook.com Subscription2 AzureCloud xxxxxxxx-x... +Subscription3 (xxxxxxxx-xxxx-xxxx-xxx... test@outlook.com Subscription3 AzureCloud xxxxxxxx-x... + + In this example, all currently available contexts are displayed. The user may select one of these contexts using Select-AzContext. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/get-azcontext + + + Set-AzContext + + + + Connect-AzAccount + + + + + + + Get-AzContextAutosaveSetting + Get + AzContextAutosaveSetting + + Display metadata about the context autosave feature, including whether the context is automatically saved, and where saved context and credential information can be found. + + + + Display metadata about the context autosave feature, including whether the context is automatically saved, and where saved context and credential information can be found. + + + + Get-AzContextAutosaveSetting + + DefaultProfile + + The credentials, account, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + + + + DefaultProfile + + The credentials, account, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + + + + None + + + + + + + + + + Microsoft.Azure.Commands.Common.Authentication.ContextAutosaveSettings + + + + + + + + + + + + + + ------ Get context save metadata for the current session ------ + Get-AzContextAutosaveSetting + +Mode : Process +ContextDirectory : None +ContextFile : None +CacheDirectory : None +CacheFile : None +Settings : {} + + Get details about whether and where the context is saved. In the above example, the autosave feature has been disabled. + + + + + + -------- Get context save metadata for the current user -------- + Get-AzContextAutosaveSetting -Scope CurrentUser + +Mode : CurrentUser +ContextDirectory : C:\Users\contoso\AppData\Roaming\Windows Azure Powershell +ContextFile : AzureRmContext.json +CacheDirectory : C:\Users\contoso\AppData\Roaming\Windows Azure Powershell +CacheFile : TokenCache.dat +Settings : {} + + Get details about whether and where the context is saved by default for the current user. Note that this may be different than the settings that are active in the current session. In the above example, the autosave feature has been enabled, and data is saved to the default location. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/get-azcontextautosavesetting + + + + + + Get-AzDefault + Get + AzDefault + + Get the defaults set by the user in the current context. + + + + The Get-AzDefault cmdlet gets the Resource Group that the user has set as default in the current context. + + + + Get-AzDefault + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + ResourceGroup + + Display Default Resource Group + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + ResourceGroup + + Display Default Resource Group + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + System.Management.Automation.SwitchParameter + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSResourceGroup + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + Get-AzDefault + +Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup +Name : myResourceGroup +Properties : Microsoft.Azure.Management.Internal.Resources.Models.ResourceGroupProperties +Location : eastus +ManagedBy : +Tags : + + This command returns the current defaults if there are defaults set, or returns nothing if no default is set. + + + + + + -------------------------- Example 2 -------------------------- + Get-AzDefault -ResourceGroup + +Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup +Name : myResourceGroup +Properties : Microsoft.Azure.Management.Internal.Resources.Models.ResourceGroupProperties +Location : eastus +ManagedBy : +Tags : + + This command returns the current default Resource Group if there is a default set, or returns nothing if no default is set. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/get-azdefault + + + + + + Get-AzEnvironment + Get + AzEnvironment + + Get endpoints and metadata for an instance of Azure services. + + + + The Get-AzEnvironment cmdlet gets endpoints and metadata for an instance of Azure services. + + + + Get-AzEnvironment + + Name + + Specifies the name of the Azure instance to get. + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, account, tenant and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + + + + DefaultProfile + + The credentials, account, tenant and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Name + + Specifies the name of the Azure instance to get. + + System.String + + System.String + + + None + + + + + + System.String + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureEnvironment + + + + + + + + + + + + + + ---------- Example 1: Getting all Azure environments ---------- + Get-AzEnvironment + +Name Resource Manager Url ActiveDirectory Authority Type +---- -------------------- ------------------------- ---- +AzureUSGovernment https://management.usgovcloudapi.net/ https://login.microsoftonline.us/ Built-in +AzureGermanCloud https://management.microsoftazure.de/ https://login.microsoftonline.de/ Built-in +AzureCloud https://management.azure.com/ https://login.microsoftonline.com/ Built-in +AzureChinaCloud https://management.chinacloudapi.cn/ https://login.chinacloudapi.cn/ Built-in + + This example shows how to get the endpoints and metadata for the AzureCloud (default) environment. + + + + + + -------- Example 2: Getting the AzureCloud environment -------- + Get-AzEnvironment -Name AzureCloud + +Name Resource Manager Url ActiveDirectory Authority Type +---- -------------------- ------------------------- ---- +AzureCloud https://management.azure.com/ https://login.microsoftonline.com/ Built-in + + This example shows how to get the endpoints and metadata for the AzureCloud (default) environment. + + + + + + ------ Example 3: Getting the AzureChinaCloud environment ------ + Get-AzEnvironment -Name AzureChinaCloud | Format-List + +Name : AzureChinaCloud +Type : Built-in +EnableAdfsAuthentication : False +OnPremise : False +ActiveDirectoryServiceEndpointResourceId : https://management.core.chinacloudapi.cn/ +AdTenant : Common +GalleryUrl : https://gallery.azure.com/ +ManagementPortalUrl : https://go.microsoft.com/fwlink/?LinkId=301902 +ServiceManagementUrl : https://management.core.chinacloudapi.cn/ +PublishSettingsFileUrl : https://go.microsoft.com/fwlink/?LinkID=301776 +ResourceManagerUrl : https://management.chinacloudapi.cn/ +SqlDatabaseDnsSuffix : .database.chinacloudapi.cn +StorageEndpointSuffix : core.chinacloudapi.cn +ActiveDirectoryAuthority : https://login.chinacloudapi.cn/ +GraphUrl : https://graph.chinacloudapi.cn/ +GraphEndpointResourceId : https://graph.chinacloudapi.cn/ +TrafficManagerDnsSuffix : trafficmanager.cn +AzureKeyVaultDnsSuffix : vault.azure.cn +DataLakeEndpointResourceId : +AzureDataLakeStoreFileSystemEndpointSuffix : +AzureDataLakeAnalyticsCatalogAndJobEndpointSuffix : +AzureKeyVaultServiceEndpointResourceId : https://vault.azure.cn +ContainerRegistryEndpointSuffix : azurecr.cn +AzureOperationalInsightsEndpointResourceId : +AzureOperationalInsightsEndpoint : +AzureAnalysisServicesEndpointSuffix : asazure.chinacloudapi.cn +AnalysisServicesEndpointResourceId : https://region.asazure.chinacloudapi.cn +AzureAttestationServiceEndpointSuffix : +AzureAttestationServiceEndpointResourceId : +AzureSynapseAnalyticsEndpointSuffix : dev.azuresynapse.azure.cn +AzureSynapseAnalyticsEndpointResourceId : https://dev.azuresynapse.azure.cn + + This example shows how to get the endpoints and metadata for the AzureChinaCloud environment. + + + + + + ----- Example 4: Getting the AzureUSGovernment environment ----- + Get-AzEnvironment -Name AzureUSGovernment + +Name Resource Manager Url ActiveDirectory Authority Type +---- -------------------- ------------------------- ---- +AzureUSGovernment https://management.usgovcloudapi.net/ https://login.microsoftonline.us/ Built-in + + This example shows how to get the endpoints and metadata for the AzureUSGovernment environment. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/get-azenvironment + + + Add-AzEnvironment + + + + Remove-AzEnvironment + + + + Set-AzEnvironment + + + + + + + Get-AzSubscription + Get + AzSubscription + + Get subscriptions that the current account can access. + + + + The Get-AzSubscription cmdlet gets the subscription ID, subscription name, and home tenant for subscriptions that the current account can access. + + + + Get-AzSubscription + + AsJob + + Run cmdlet in the background and return a Job to track progress. + + + System.Management.Automation.SwitchParameter + + + False + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + SubscriptionId + + Specifies the ID of the subscription to get. + + System.String + + System.String + + + None + + + TenantId + + Specifies the ID of the tenant that contains subscriptions to get. + + System.String + + System.String + + + None + + + + Get-AzSubscription + + AsJob + + Run cmdlet in the background and return a Job to track progress. + + + System.Management.Automation.SwitchParameter + + + False + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + SubscriptionName + + Specifies the name of the subscription to get. + + System.String + + System.String + + + None + + + TenantId + + Specifies the ID of the tenant that contains subscriptions to get. + + System.String + + System.String + + + None + + + + + + AsJob + + Run cmdlet in the background and return a Job to track progress. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + SubscriptionId + + Specifies the ID of the subscription to get. + + System.String + + System.String + + + None + + + SubscriptionName + + Specifies the name of the subscription to get. + + System.String + + System.String + + + None + + + TenantId + + Specifies the ID of the tenant that contains subscriptions to get. + + System.String + + System.String + + + None + + + + + + System.String + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureSubscription + + + + + + + + + + + + + + ------- Example 1: Get all subscriptions in all tenants ------- + Get-AzSubscription + +Name Id TenantId State +---- -- -------- ----- +Subscription1 yyyy-yyyy-yyyy-yyyy aaaa-aaaa-aaaa-aaaa Enabled +Subscription2 xxxx-xxxx-xxxx-xxxx aaaa-aaaa-aaaa-aaaa Enabled +Subscription3 zzzz-zzzz-zzzz-zzzz bbbb-bbbb-bbbb-bbbb Enabled + + This command gets all subscriptions in all tenants that are authorized for the current account. + + + + + + ---- Example 2: Get all subscriptions for a specific tenant ---- + Get-AzSubscription -TenantId "aaaa-aaaa-aaaa-aaaa" + +Name Id TenantId State +---- -- -------- ----- +Subscription1 yyyy-yyyy-yyyy-yyyy aaaa-aaaa-aaaa-aaaa Enabled +Subscription2 xxxx-xxxx-xxxx-xxxx aaaa-aaaa-aaaa-aaaa Enabled + + List all subscriptions in the given tenant that are authorized for the current account. + + + + + + ---- Example 3: Get all subscriptions in the current tenant ---- + Get-AzSubscription + +Name Id TenantId State +---- -- -------- ----- +Subscription1 yyyy-yyyy-yyyy-yyyy aaaa-aaaa-aaaa-aaaa Enabled +Subscription2 xxxx-xxxx-xxxx-xxxx aaaa-aaaa-aaaa-aaaa Enabled + + This command gets all subscriptions in the current tenant that are authorized for the current user. + + + + + + Example 4: Change the current context to use a specific subscription + Get-AzSubscription -SubscriptionId "xxxx-xxxx-xxxx-xxxx" -TenantId "yyyy-yyyy-yyyy-yyyy" | Set-AzContext + +Name Account SubscriptionName Environment TenantId +---- ------- ---------------- ----------- -------- +Subscription1 (xxxx-xxxx-xxxx-xxxx) azureuser@micros... Subscription1 AzureCloud yyyy-yyyy-yyyy-yyyy + + This command gets the specified subscription, and then sets the current context to use it. All subsequent cmdlets in this session use the new subscription (Contoso Subscription 1) by default. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/get-azsubscription + + + + + + Get-AzTenant + Get + AzTenant + + Gets tenants that are authorized for the current user. + + + + The Get-AzTenant cmdlet gets tenants authorized for the current user. + + + + Get-AzTenant + + TenantId + + Specifies the ID of the tenant that this cmdlet gets. + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + TenantId + + Specifies the ID of the tenant that this cmdlet gets. + + System.String + + System.String + + + None + + + + + + System.String + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureTenant + + + + + + + + + + + + + + ---------------- Example 1: Getting all tenants ---------------- + Connect-AzAccount +Get-AzTenant + +Id Name Category Domains +-- ----------- -------- ------- +xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx Microsoft Home {test0.com, test1.com, test2.microsoft.com, test3.microsoft.com...} +yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy Testhost Home testhost.onmicrosoft.com + + This example shows how to get all of the authorized tenants of an Azure account. + + + + + + ------------- Example 2: Getting a specific tenant ------------- + Connect-AzAccount +Get-AzTenant -TenantId xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + +Id Name Category Domains +-- ----------- -------- ------- +xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx Microsoft Home {test0.com, test1.com, test2.microsoft.com, test3.microsoft.com...} + + This example shows how to get a specific authorized tenant of an Azure account. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/get-aztenant + + + + + + Import-AzContext + Import + AzContext + + Loads Azure authentication information from a file. + + + + The Import-AzContext cmdlet loads authentication information from a file to set the Azure environment and context. Cmdlets that you run in the current session use this information to authenticate requests to Azure Resource Manager. + + + + Import-AzContext + + AzureContext + + {{Fill AzureContext Description}} + + Microsoft.Azure.Commands.Common.Authentication.Models.AzureRmProfile + + Microsoft.Azure.Commands.Common.Authentication.Models.AzureRmProfile + + + None + + + DefaultProfile + + The credentials, tenant, and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Import-AzContext + + Path + + Specifies the path to context information saved by using Save-AzContext. + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant, and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + AzureContext + + {{Fill AzureContext Description}} + + Microsoft.Azure.Commands.Common.Authentication.Models.AzureRmProfile + + Microsoft.Azure.Commands.Common.Authentication.Models.AzureRmProfile + + + None + + + DefaultProfile + + The credentials, tenant, and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Path + + Specifies the path to context information saved by using Save-AzContext. + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + Microsoft.Azure.Commands.Common.Authentication.Models.AzureRmProfile + + + + + + + + System.String + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureProfile + + + + + + + + + + + + + + ----- Example 1: Importing a context from a AzureRmProfile ----- + Import-AzContext -AzContext (Connect-AzAccount) + +Account SubscriptionName TenantId Environment +------- ---------------- -------- ----------- +azureuser@contoso.com Subscription1 xxxx-xxxx-xxxx-xxxx AzureCloud + + This example imports a context from a PSAzureProfile that is passed through to the cmdlet. + + + + + + ------- Example 2: Importing a context from a JSON file ------- + Import-AzContext -Path C:\test.json + +Account SubscriptionName TenantId Environment +------- ---------------- -------- ----------- +azureuser@contoso.com Subscription1 xxxx-xxxx-xxxx-xxxx AzureCloud + + This example selects a context from a JSON file that is passed through to the cmdlet. This JSON file can be created from Save-AzContext. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/import-azcontext + + + + + + Invoke-AzRestMethod + Invoke + AzRestMethod + + Construct and perform HTTP request to Azure resource management endpoint only + + + + Construct and perform HTTP request to Azure resource management endpoint only + + + + Invoke-AzRestMethod + + ApiVersion + + Api Version + + System.String + + System.String + + + None + + + AsJob + + Run cmdlet in the background + + + System.Management.Automation.SwitchParameter + + + False + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Method + + Http Method + + + GET + POST + PUT + PATCH + DELETE + + System.String + + System.String + + + None + + + Name + + list of Target Resource Name + + System.String[] + + System.String[] + + + None + + + Payload + + JSON format payload + + System.String + + System.String + + + None + + + ResourceGroupName + + Target Resource Group Name + + System.String + + System.String + + + None + + + ResourceProviderName + + Target Resource Provider Name + + System.String + + System.String + + + None + + + ResourceType + + List of Target Resource Type + + System.String[] + + System.String[] + + + None + + + SubscriptionId + + Target Subscription Id + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Invoke-AzRestMethod + + AsJob + + Run cmdlet in the background + + + System.Management.Automation.SwitchParameter + + + False + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Method + + Http Method + + + GET + POST + PUT + PATCH + DELETE + + System.String + + System.String + + + None + + + Path + + Path of target resource URL. Hostname of Resource Manager should not be added. + + System.String + + System.String + + + None + + + Payload + + JSON format payload + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Invoke-AzRestMethod + + Uri + + Uniform Resource Identifier of the Azure resources. The target resource needs to support Azure AD authentication and the access token is derived according to resource id. If resource id is not set, its value is derived according to built-in service suffixes in current Azure Environment. + + System.Uri + + System.Uri + + + None + + + AsJob + + Run cmdlet in the background + + + System.Management.Automation.SwitchParameter + + + False + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Method + + Http Method + + + GET + POST + PUT + PATCH + DELETE + + System.String + + System.String + + + None + + + Payload + + JSON format payload + + System.String + + System.String + + + None + + + ResourceId + + Identifier URI specified by the REST API you are calling. It shouldn't be the resource id of Azure Resource Manager. + + System.Uri + + System.Uri + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + ApiVersion + + Api Version + + System.String + + System.String + + + None + + + AsJob + + Run cmdlet in the background + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Method + + Http Method + + System.String + + System.String + + + None + + + Name + + list of Target Resource Name + + System.String[] + + System.String[] + + + None + + + Path + + Path of target resource URL. Hostname of Resource Manager should not be added. + + System.String + + System.String + + + None + + + Payload + + JSON format payload + + System.String + + System.String + + + None + + + ResourceGroupName + + Target Resource Group Name + + System.String + + System.String + + + None + + + ResourceId + + Identifier URI specified by the REST API you are calling. It shouldn't be the resource id of Azure Resource Manager. + + System.Uri + + System.Uri + + + None + + + ResourceProviderName + + Target Resource Provider Name + + System.String + + System.String + + + None + + + ResourceType + + List of Target Resource Type + + System.String[] + + System.String[] + + + None + + + SubscriptionId + + Target Subscription Id + + System.String + + System.String + + + None + + + Uri + + Uniform Resource Identifier of the Azure resources. The target resource needs to support Azure AD authentication and the access token is derived according to resource id. If resource id is not set, its value is derived according to built-in service suffixes in current Azure Environment. + + System.Uri + + System.Uri + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + System.string + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSHttpResponse + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + Invoke-AzRestMethod -Path "/subscriptions/{subscription}/resourcegroups/{resourcegroup}/providers/microsoft.operationalinsights/workspaces/{workspace}?api-version={API}" -Method GET + +Headers : {[Cache-Control, System.String[]], [Pragma, System.String[]], [x-ms-request-id, System.String[]], [Strict-Transport-Security, System.String[]]…} +Version : 1.1 +StatusCode : 200 +Method : GET +Content : { + "properties": { + "source": "Azure", + "customerId": "{customerId}", + "provisioningState": "Succeeded", + "sku": { + "name": "pergb2018", + "maxCapacityReservationLevel": 3000, + "lastSkuUpdate": "Mon, 25 May 2020 11:10:01 GMT" + }, + "retentionInDays": 30, + "features": { + "legacy": 0, + "searchVersion": 1, + "enableLogAccessUsingOnlyResourcePermissions": true + }, + "workspaceCapping": { + "dailyQuotaGb": -1.0, + "quotaNextResetTime": "Thu, 18 Jun 2020 05:00:00 GMT", + "dataIngestionStatus": "RespectQuota" + }, + "enableFailover": false, + "publicNetworkAccessForIngestion": "Enabled", + "publicNetworkAccessForQuery": "Enabled", + "createdDate": "Mon, 25 May 2020 11:10:01 GMT", + "modifiedDate": "Mon, 25 May 2020 11:10:02 GMT" + }, + "id": "/subscriptions/{subscription}/resourcegroups/{resourcegroup}/providers/microsoft.operationalinsights/workspaces/{workspace}", + "name": "{workspace}", + "type": "Microsoft.OperationalInsights/workspaces", + "location": "eastasia", + "tags": {} + } + + Get log analytics workspace by path. It only supports management plane API and Hostname of Azure Resource Manager is added according to Azure environment setting. + + + + + + + -------------------------- Example 2 -------------------------- + Invoke-AzRestMethod https://graph.microsoft.com/v1.0/me + +Headers : {[Date, System.String[]], [Cache-Control, System.String[]], [Transfer-Encoding, System.String[]], [Strict-Transport-Security, System.String[]]…} +Version : 1.1 +StatusCode : 200 +Method : GET +Content : {"@odata.context":"https://graph.microsoft.com/v1.0/$metadata#users/$entity","businessPhones":["......} + + Get current signed in user via MicrosoftGraph API. This example is equivalent to `Get-AzADUser -SignedIn`. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/invoke-azrestmethod + + + + + + Open-AzSurveyLink + Open + AzSurveyLink + + Open survey link in default browser. + + + + Open survey link in default browser. + + + + Open-AzSurveyLink + + + + + + + None + + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + Open-AzSurveyLink + +Opening the default browser to https://aka.ms/azpssurvey?Q_CHL=INTERCEPT + + + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/open-azsurveylink + + + + + + Register-AzModule + Register + AzModule + + FOR INTERNAL USE ONLY - Provide Runtime Support for AutoRest Generated cmdlets + + + + FOR INTERNAL USE ONLY - Provide Runtime Support for AutoRest Generated cmdlets + + + + Register-AzModule + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + None + + + + + + + + + + System.Object + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + Register-AzModule + + Used Internally by AutoRest-generated cmdlets + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/register-azmodule + + + + + + Remove-AzContext + Remove + AzContext + + Remove a context from the set of available contexts + + + + Remove an azure context from the set of contexts + + + + Remove-AzContext + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Remove context even if it is the default + + + System.Management.Automation.SwitchParameter + + + False + + + InputObject + + A context object, normally passed through the pipeline. + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + None + + + PassThru + + Return the removed context + + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Remove-AzContext + + Name + + The name of the context + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Remove context even if it is the default + + + System.Management.Automation.SwitchParameter + + + False + + + PassThru + + Return the removed context + + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Remove context even if it is the default + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + InputObject + + A context object, normally passed through the pipeline. + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + None + + + Name + + The name of the context + + System.String + + System.String + + + None + + + PassThru + + Return the removed context + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + Remove-AzContext -Name Default + + Remove the context named default + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/remove-azcontext + + + + + + Remove-AzEnvironment + Remove + AzEnvironment + + Removes endpoints and metadata for connecting to a given Azure instance. + + + + The Remove-AzEnvironment cmdlet removes endpoints and metadata information for connecting to a given Azure instance. + + + + Remove-AzEnvironment + + Name + + Specifies the name of the environment to remove. + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Name + + Specifies the name of the environment to remove. + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + System.String + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureEnvironment + + + + + + + + + + + + + + ----- Example 1: Creating and removing a test environment ----- + Add-AzEnvironment -Name TestEnvironment ` + -ActiveDirectoryEndpoint TestADEndpoint ` + -ActiveDirectoryServiceEndpointResourceId TestADApplicationId ` + -ResourceManagerEndpoint TestRMEndpoint ` + -GalleryEndpoint TestGalleryEndpoint ` + -GraphEndpoint TestGraphEndpoint + +Name Resource Manager Url ActiveDirectory Authority +---- -------------------- ------------------------- +TestEnvironment TestRMEndpoint TestADEndpoint/ + +Remove-AzEnvironment -Name TestEnvironment + +Name Resource Manager Url ActiveDirectory Authority +---- -------------------- ------------------------- +TestEnvironment TestRMEndpoint TestADEndpoint/ + + This example shows how to create an environment using Add-AzEnvironment, and then how to delete the environment using Remove-AzEnvironment. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/remove-azenvironment + + + Add-AzEnvironment + + + + Get-AzEnvironment + + + + Set-AzEnvironment + + + + + + + Rename-AzContext + Rename + AzContext + + Rename an Azure context. By default contexts are named by user account and subscription. + + + + Rename an Azure context. By default contexts are named by user account and subscription. + + + + Rename-AzContext + + TargetName + + The new name of the context + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Rename the context even if the target context already exists + + + System.Management.Automation.SwitchParameter + + + False + + + InputObject + + A context object, normally passed through the pipeline. + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + None + + + PassThru + + Return the renamed context. + + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Rename-AzContext + + SourceName + + The name of the context + + System.String + + System.String + + + None + + + TargetName + + The new name of the context + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Rename the context even if the target context already exists + + + System.Management.Automation.SwitchParameter + + + False + + + PassThru + + Return the renamed context. + + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Rename the context even if the target context already exists + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + InputObject + + A context object, normally passed through the pipeline. + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + None + + + PassThru + + Return the renamed context. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + SourceName + + The name of the context + + System.String + + System.String + + + None + + + TargetName + + The new name of the context + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + + + + + + + + + + + + ------ Example 1: Rename a context using named parameters ------ + Rename-AzContext -SourceName "[user1@contoso.org; 12345-6789-2345-3567890]" -TargetName "Work" + + Rename the context for 'user1@contoso.org' with subscription '12345-6789-2345-3567890' to 'Work'. After this command, you will be able to target the context using 'Select-AzContext Work'. Note that you can tab through the values for 'SourceName' using tab completion. + + + + + + --- Example 2: Rename a context using positional parameters --- + Rename-AzContext "My context" "Work" + + Rename the context named "My context" to "Work". After this command, you will be able to target the context using Select-AzContext Work + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/rename-azcontext + + + + + + Resolve-AzError + Resolve + AzError + + Display detailed information about PowerShell errors, with extended details for Azure PowerShell errors. + + + + Resolves and displays detailed information about errors in the current PowerShell session, including where the error occurred in script, stack trace, and all inner and aggregate exceptions. For Azure PowerShell errors provides additional detail in debugging service issues, including complete detail about the request and server response that caused the error. + + + + Resolve-AzError + + Error + + One or more error records to resolve. If no parameters are specified, all errors in the session are resolved. + + System.Management.Automation.ErrorRecord[] + + System.Management.Automation.ErrorRecord[] + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + + Resolve-AzError + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Last + + Resolve only the last error that occurred in the session. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Error + + One or more error records to resolve. If no parameters are specified, all errors in the session are resolved. + + System.Management.Automation.ErrorRecord[] + + System.Management.Automation.ErrorRecord[] + + + None + + + Last + + Resolve only the last error that occurred in the session. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + System.Management.Automation.ErrorRecord[] + + + + + + + + + + Microsoft.Azure.Commands.Profile.Errors.AzureErrorRecord + + + + + + + + Microsoft.Azure.Commands.Profile.Errors.AzureExceptionRecord + + + + + + + + Microsoft.Azure.Commands.Profile.Errors.AzureRestExceptionRecord + + + + + + + + + + + + + + -------------- Example 1: Resolve the Last Error -------------- + Resolve-AzError -Last + +HistoryId: 3 + + +Message : Run Connect-AzAccount to login. +StackTrace : at Microsoft.Azure.Commands.ResourceManager.Common.AzureRMCmdlet.get_DefaultContext() in AzureRmCmdlet.cs:line 85 + at Microsoft.Azure.Commands.ResourceManager.Common.AzureRMCmdlet.LogCmdletStartInvocationInfo() in AzureRmCmdlet.cs:line 269 + at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.BeginProcessing() inAzurePSCmdlet.cs:line 299 + at Microsoft.Azure.Commands.ResourceManager.Common.AzureRMCmdlet.BeginProcessing() in AzureRmCmdlet.cs:line 320 + at Microsoft.Azure.Commands.Profile.GetAzureRMSubscriptionCommand.BeginProcessing() in GetAzureRMSubscription.cs:line 49 + at System.Management.Automation.Cmdlet.DoBeginProcessing() + at System.Management.Automation.CommandProcessorBase.DoBegin() +Exception : System.Management.Automation.PSInvalidOperationException +InvocationInfo : {Get-AzSubscription} +Line : Get-AzSubscription +Position : At line:1 char:1 + + Get-AzSubscription + + ~~~~~~~~~~~~~~~~~~~~~~~ +HistoryId : 3 + + Get details of the last error. + + + + + + --------- Example 2: Resolve all Errors in the Session --------- + Resolve-AzError + +HistoryId: 8 + + +RequestId : b61309e8-09c9-4f0d-ba56-08a6b28c731d +Message : Resource group 'contoso' could not be found. +ServerMessage : ResourceGroupNotFound: Resource group 'contoso' could not be found. + (System.Collections.Generic.List`1[Microsoft.Rest.Azure.CloudError]) +ServerResponse : {NotFound} +RequestMessage : {GET https://management.azure.com/subscriptions/00977cdb-163f-435f-9c32-39ec8ae61f4d/resourceGroups/co + ntoso/providers/Microsoft.Storage/storageAccounts/contoso?api-version=2016-12-01} +InvocationInfo : {Get-AzStorageAccount} +Line : Get-AzStorageAccount -ResourceGroupName contoso -Name contoso +Position : At line:1 char:1 + + Get-AzStorageAccount -ResourceGroupName contoso -Name contoso + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +StackTrace : at Microsoft.Azure.Management.Storage.StorageAccountsOperations.<GetPropertiesWithHttpMessagesAsync + >d__8.MoveNext() + --- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at Microsoft.Azure.Management.Storage.StorageAccountsOperationsExtensions.<GetPropertiesAsync>d__7. + MoveNext() + --- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at Microsoft.Azure.Management.Storage.StorageAccountsOperationsExtensions.GetProperties(IStorageAcc + ountsOperations operations, String resourceGroupName, String accountName) + at Microsoft.Azure.Commands.Management.Storage.GetAzureStorageAccountCommand.ExecuteCmdlet() in C:\ + zd\azure-powershell\src\ResourceManager\Storage\Commands.Management.Storage\StorageAccount\GetAzureSto + rageAccount.cs:line 70 + at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.ProcessRecord() in + C:\zd\azure-powershell\src\Common\Commands.Common\AzurePSCmdlet.cs:line 642 +HistoryId : 8 + + + HistoryId: 5 + + +Message : Run Connect-AzAccount to login. +StackTrace : at Microsoft.Azure.Commands.ResourceManager.Common.AzureRMCmdlet.get_DefaultContext() in C:\zd\azur + e-powershell\src\ResourceManager\Common\Commands.ResourceManager.Common\AzureRmCmdlet.cs:line 85 + at Microsoft.Azure.Commands.ResourceManager.Common.AzureRMCmdlet.LogCmdletStartInvocationInfo() in + C:\zd\azure-powershell\src\ResourceManager\Common\Commands.ResourceManager.Common\AzureRmCmdlet.cs:lin + e 269 + at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.BeginProcessing() in + C:\zd\azure-powershell\src\Common\Commands.Common\AzurePSCmdlet.cs:line 299 + at Microsoft.Azure.Commands.ResourceManager.Common.AzureRMCmdlet.BeginProcessing() in C:\zd\azure-p + owershell\src\ResourceManager\Common\Commands.ResourceManager.Common\AzureRmCmdlet.cs:line 320 + at Microsoft.Azure.Commands.Profile.GetAzureRMSubscriptionCommand.BeginProcessing() in C:\zd\azure- + powershell\src\ResourceManager\Profile\Commands.Profile\Subscription\GetAzureRMSubscription.cs:line 49 + at System.Management.Automation.Cmdlet.DoBeginProcessing() + at System.Management.Automation.CommandProcessorBase.DoBegin() +Exception : System.Management.Automation.PSInvalidOperationException +InvocationInfo : {Get-AzSubscription} +Line : Get-AzSubscription +Position : At line:1 char:1 + + Get-AzSubscription + + ~~~~~~~~~~~~~~~~~~~~~~~ +HistoryId : 5 + + Get details of all errors that have occurred in the current session. + + + + + + ------------- Example 3: Resolve a Specific Error ------------- + Resolve-AzError $Error[0] + +HistoryId: 8 + + +RequestId : b61309e8-09c9-4f0d-ba56-08a6b28c731d +Message : Resource group 'contoso' could not be found. +ServerMessage : ResourceGroupNotFound: Resource group 'contoso' could not be found. + (System.Collections.Generic.List`1[Microsoft.Rest.Azure.CloudError]) +ServerResponse : {NotFound} +RequestMessage : {GET https://management.azure.com/subscriptions/00977cdb-163f-435f-9c32-39ec8ae61f4d/resourceGroups/co + ntoso/providers/Microsoft.Storage/storageAccounts/contoso?api-version=2016-12-01} +InvocationInfo : {Get-AzStorageAccount} +Line : Get-AzStorageAccount -ResourceGroupName contoso -Name contoso +Position : At line:1 char:1 + + Get-AzStorageAccount -ResourceGroupName contoso -Name contoso + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +StackTrace : at Microsoft.Azure.Management.Storage.StorageAccountsOperations.<GetPropertiesWithHttpMessagesAsync + >d__8.MoveNext() + --- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at Microsoft.Azure.Management.Storage.StorageAccountsOperationsExtensions.<GetPropertiesAsync>d__7. + MoveNext() + --- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at Microsoft.Azure.Management.Storage.StorageAccountsOperationsExtensions.GetProperties(IStorageAcc + ountsOperations operations, String resourceGroupName, String accountName) + at Microsoft.Azure.Commands.Management.Storage.GetAzureStorageAccountCommand.ExecuteCmdlet() in C:\ + zd\azure-powershell\src\ResourceManager\Storage\Commands.Management.Storage\StorageAccount\GetAzureSto + rageAccount.cs:line 70 + at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.ProcessRecord() in + C:\zd\azure-powershell\src\Common\Commands.Common\AzurePSCmdlet.cs:line 642 +HistoryId : 8 + + Get details of the specified error. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/resolve-azerror + + + + + + Save-AzContext + Save + AzContext + + Saves the current authentication information for use in other PowerShell sessions. + + + + The Save-AzContext cmdlet saves the current authentication information for use in other PowerShell sessions. + + + + Save-AzContext + + Profile + + Specifies the Azure context from which this cmdlet reads. If you do not specify a context, this cmdlet reads from the local default context. + + Microsoft.Azure.Commands.Common.Authentication.Models.AzureRmProfile + + Microsoft.Azure.Commands.Common.Authentication.Models.AzureRmProfile + + + None + + + Path + + Specifies the path of the file to which to save authentication information. + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Overwrite the given file if it exists + + + System.Management.Automation.SwitchParameter + + + False + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Overwrite the given file if it exists + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Path + + Specifies the path of the file to which to save authentication information. + + System.String + + System.String + + + None + + + Profile + + Specifies the Azure context from which this cmdlet reads. If you do not specify a context, this cmdlet reads from the local default context. + + Microsoft.Azure.Commands.Common.Authentication.Models.AzureRmProfile + + Microsoft.Azure.Commands.Common.Authentication.Models.AzureRmProfile + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + Microsoft.Azure.Commands.Common.Authentication.Models.AzureRmProfile + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureProfile + + + + + + + + + + + + + + ------- Example 1: Saving the current session's context ------- + Connect-AzAccount +Save-AzContext -Path C:\test.json + + This example saves the current session's Azure context to the JSON file provided. + + + + + + -------------- Example 2: Saving a given context -------------- + Save-AzContext -Profile (Connect-AzAccount) -Path C:\test.json + + This example saves the Azure context that is passed through to the cmdlet to the JSON file provided. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/save-azcontext + + + + + + Select-AzContext + Select + AzContext + + Select a subscription and account to target in Azure PowerShell cmdlets + + + + Select a subscription to target (or account or tenant) in Azure PowerShell cmdlets. After this cmdlet, future cmdlets will target the selected context. + + + + Select-AzContext + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + InputObject + + A context object, normally passed through the pipeline. + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Select-AzContext + + Name + + The name of the context + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + InputObject + + A context object, normally passed through the pipeline. + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + None + + + Name + + The name of the context + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + + + + + + + + + + + + -------------- Example 1: Target a named context -------------- + Select-AzContext "Work" + +Name Account SubscriptionName Environment TenantId +---- ------- ---------------- ----------- -------- +Work test@outlook.com Subscription1 AzureCloud xxxxxxxx-x... + + Target future Azure PowerShell cmdlets at the account, tenant, and subscription in the 'Work' context. + + + + + + -------------------------- Example 2 -------------------------- + <!-- Aladdin Generated Example --> +Select-AzContext -Name TestEnvironment -Scope Process + + + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/select-azcontext + + + + + + Send-Feedback + Send + Feedback + + Sends feedback to the Azure PowerShell team via a set of guided prompts. + + + + The Send-Feedback cmdlet sends feedback to the Azure PowerShell team. + + + + Send-Feedback + + DefaultProfile + + The credentials, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + + + + DefaultProfile + + The credentials, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + + + + None + + + + + + + + + + System.Void + + + + + + + + + + + + + + -------------------------- Example 1: -------------------------- + Send-Feedback + +With zero (0) being the least and ten (10) being the most, how likely are you to recommend Azure PowerShell to a friend or colleague? + +10 + +What does Azure PowerShell do well? + +Response. + +Upon what could Azure PowerShell improve? + +Response. + +Please enter your email if you are interested in providing follow up information: + +your@email.com + + + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/send-feedback + + + + + + Set-AzContext + Set + AzContext + + Sets the tenant, subscription, and environment for cmdlets to use in the current session. + + + + The Set-AzContext cmdlet sets authentication information for cmdlets that you run in the current session. The context includes tenant, subscription, and environment information. + + + + Set-AzContext + + Context + + Specifies the context for the current session. + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + None + + + DefaultProfile + + The credentials, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + ExtendedProperty + + Additional context properties + + System.Collections.Generic.IDictionary`2[System.String,System.String] + + System.Collections.Generic.IDictionary`2[System.String,System.String] + + + None + + + Force + + Overwrite the existing context with the same name, if any. + + + System.Management.Automation.SwitchParameter + + + False + + + Name + + Name of the context + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Set-AzContext + + Subscription + + The name or id of the subscription that the context should be set to. This parameter has aliases to -SubscriptionName and -SubscriptionId, so, for clarity, either of these can be used instead of -Subscription when specifying name and id, respectively. + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + ExtendedProperty + + Additional context properties + + System.Collections.Generic.IDictionary`2[System.String,System.String] + + System.Collections.Generic.IDictionary`2[System.String,System.String] + + + None + + + Force + + Overwrite the existing context with the same name, if any. + + + System.Management.Automation.SwitchParameter + + + False + + + Name + + Name of the context + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Tenant + + Tenant domain name or ID + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Set-AzContext + + SubscriptionObject + + A subscription object + + Microsoft.Azure.Commands.Profile.Models.PSAzureSubscription + + Microsoft.Azure.Commands.Profile.Models.PSAzureSubscription + + + None + + + DefaultProfile + + The credentials, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + ExtendedProperty + + Additional context properties + + System.Collections.Generic.IDictionary`2[System.String,System.String] + + System.Collections.Generic.IDictionary`2[System.String,System.String] + + + None + + + Force + + Overwrite the existing context with the same name, if any. + + + System.Management.Automation.SwitchParameter + + + False + + + Name + + Name of the context + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Set-AzContext + + DefaultProfile + + The credentials, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + ExtendedProperty + + Additional context properties + + System.Collections.Generic.IDictionary`2[System.String,System.String] + + System.Collections.Generic.IDictionary`2[System.String,System.String] + + + None + + + Force + + Overwrite the existing context with the same name, if any. + + + System.Management.Automation.SwitchParameter + + + False + + + Name + + Name of the context + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Tenant + + Tenant domain name or ID + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Set-AzContext + + TenantObject + + A Tenant Object + + Microsoft.Azure.Commands.Profile.Models.PSAzureTenant + + Microsoft.Azure.Commands.Profile.Models.PSAzureTenant + + + None + + + DefaultProfile + + The credentials, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + ExtendedProperty + + Additional context properties + + System.Collections.Generic.IDictionary`2[System.String,System.String] + + System.Collections.Generic.IDictionary`2[System.String,System.String] + + + None + + + Force + + Overwrite the existing context with the same name, if any. + + + System.Management.Automation.SwitchParameter + + + False + + + Name + + Name of the context + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + Context + + Specifies the context for the current session. + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + None + + + DefaultProfile + + The credentials, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + ExtendedProperty + + Additional context properties + + System.Collections.Generic.IDictionary`2[System.String,System.String] + + System.Collections.Generic.IDictionary`2[System.String,System.String] + + + None + + + Force + + Overwrite the existing context with the same name, if any. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Name + + Name of the context + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Subscription + + The name or id of the subscription that the context should be set to. This parameter has aliases to -SubscriptionName and -SubscriptionId, so, for clarity, either of these can be used instead of -Subscription when specifying name and id, respectively. + + System.String + + System.String + + + None + + + SubscriptionObject + + A subscription object + + Microsoft.Azure.Commands.Profile.Models.PSAzureSubscription + + Microsoft.Azure.Commands.Profile.Models.PSAzureSubscription + + + None + + + Tenant + + Tenant domain name or ID + + System.String + + System.String + + + None + + + TenantObject + + A Tenant Object + + Microsoft.Azure.Commands.Profile.Models.PSAzureTenant + + Microsoft.Azure.Commands.Profile.Models.PSAzureTenant + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureTenant + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureSubscription + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + + + + + + + + + + + + ----------- Example 1: Set the subscription context ----------- + Set-AzContext -Subscription "xxxx-xxxx-xxxx-xxxx" + +Name Account SubscriptionName Environment TenantId +---- ------- ---------------- ----------- -------- +Work test@outlook.com Subscription1 AzureCloud xxxxxxxx-x... + + This command sets the context to use the specified subscription. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/set-azcontext + + + Get-AzContext + + + + + + + Set-AzDefault + Set + AzDefault + + Sets a default in the current context + + + + The Set-AzDefault cmdlet adds or changes the defaults in the current context. + + + + Set-AzDefault + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Create a new resource group if specified default does not exist + + + System.Management.Automation.SwitchParameter + + + False + + + ResourceGroupName + + Name of the resource group being set as default + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Create a new resource group if specified default does not exist + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + ResourceGroupName + + Name of the resource group being set as default + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + System.String + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSResourceGroup + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + Set-AzDefault -ResourceGroupName myResourceGroup + +Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup +Name : myResourceGroup +Properties : Microsoft.Azure.Management.Internal.Resources.Models.ResourceGroupProperties +Location : eastus +ManagedBy : +Tags : + + This command sets the default resource group to the resource group specified by the user. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/set-azdefault + + + + + + Set-AzEnvironment + Set + AzEnvironment + + Sets properties for an Azure environment. + + + + The Set-AzEnvironment cmdlet sets endpoints and metadata for connecting to an instance of Azure. + + + + Set-AzEnvironment + + Name + + Specifies the name of the environment to modify. + + System.String + + System.String + + + None + + + PublishSettingsFileUrl + + Specifies the URL from which .publishsettings files can be downloaded. + + System.String + + System.String + + + None + + + AzureKeyVaultDnsSuffix + + Dns suffix of Azure Key Vault service. Example is vault-int.azure-int.net + + System.String + + System.String + + + None + + + AzureKeyVaultServiceEndpointResourceId + + Resource identifier of Azure Key Vault data service that is the recipient of the requested token. + + System.String + + System.String + + + None + + + TrafficManagerDnsSuffix + + Specifies the domain-name suffix for Azure Traffic Manager services. + + System.String + + System.String + + + None + + + SqlDatabaseDnsSuffix + + Specifies the domain-name suffix for Azure SQL Database servers. + + System.String + + System.String + + + None + + + AzureDataLakeStoreFileSystemEndpointSuffix + + Dns Suffix of Azure Data Lake Store FileSystem. Example: azuredatalake.net + + System.String + + System.String + + + None + + + AzureDataLakeAnalyticsCatalogAndJobEndpointSuffix + + Dns Suffix of Azure Data Lake Analytics job and catalog services + + System.String + + System.String + + + None + + + EnableAdfsAuthentication + + Indicates that Active Directory Federation Services (ADFS) on-premise authentication is allowed. + + + System.Management.Automation.SwitchParameter + + + False + + + AdTenant + + Specifies the default Active Directory tenant. + + System.String + + System.String + + + None + + + GraphAudience + + The audience for tokens authenticating with the AD Graph Endpoint. + + System.String + + System.String + + + None + + + DataLakeAudience + + The audience for tokens authenticating with the AD Data Lake services Endpoint. + + System.String + + System.String + + + None + + + ServiceEndpoint + + Specifies the endpoint for Service Management (RDFE) requests. + + System.String + + System.String + + + None + + + BatchEndpointResourceId + + The resource identifier of the Azure Batch service that is the recipient of the requested token + + System.String + + System.String + + + None + + + AzureOperationalInsightsEndpointResourceId + + The audience for tokens authenticating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureOperationalInsightsEndpoint + + The endpoint to use when communicating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + ManagementPortalUrl + + Specifies the URL for the Management Portal. + + System.String + + System.String + + + None + + + StorageEndpoint + + Specifies the endpoint for storage (blob, table, queue, and file) access. + + System.String + + System.String + + + None + + + ActiveDirectoryEndpoint + + Specifies the base authority for Azure Active Directory authentication. + + System.String + + System.String + + + None + + + ResourceManagerEndpoint + + Specifies the URL for Azure Resource Manager requests. + + System.String + + System.String + + + None + + + GalleryEndpoint + + Specifies the endpoint for the Azure Resource Manager gallery of deployment templates. + + System.String + + System.String + + + None + + + ActiveDirectoryServiceEndpointResourceId + + Specifies the audience for tokens that authenticate requests to Azure Resource Manager or Service Management (RDFE) endpoints. + + System.String + + System.String + + + None + + + GraphEndpoint + + Specifies the URL for Graph (Active Directory metadata) requests. + + System.String + + System.String + + + None + + + AzureAnalysisServicesEndpointResourceId + + The resource identifier of the Azure Analysis Services resource. + + System.String + + System.String + + + None + + + AzureAnalysisServicesEndpointSuffix + + The endpoint to use when communicating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureAttestationServiceEndpointResourceId + + The The resource identifier of the Azure Attestation service that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureAttestationServiceEndpointSuffix + + Dns suffix of Azure Attestation service. + + System.String + + System.String + + + None + + + AzureSynapseAnalyticsEndpointResourceId + + The The resource identifier of the Azure Synapse Analytics that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureSynapseAnalyticsEndpointSuffix + + Dns suffix of Azure Synapse Analytics. + + System.String + + System.String + + + None + + + ContainerRegistryEndpointSuffix + + Suffix of Azure Container Registry. + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, account, tenant and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + MicrosoftGraphEndpointResourceId + + The resource identifier of Microsoft Graph + + System.String + + System.String + + + None + + + MicrosoftGraphUrl + + Microsoft Graph Url + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Set-AzEnvironment + + Name + + Specifies the name of the environment to modify. + + System.String + + System.String + + + None + + + ARMEndpoint + + The Azure Resource Manager endpoint. + + System.String + + System.String + + + None + + + AzureKeyVaultDnsSuffix + + Dns suffix of Azure Key Vault service. Example is vault-int.azure-int.net + + System.String + + System.String + + + None + + + AzureKeyVaultServiceEndpointResourceId + + Resource identifier of Azure Key Vault data service that is the recipient of the requested token. + + System.String + + System.String + + + None + + + DataLakeAudience + + The audience for tokens authenticating with the AD Data Lake services Endpoint. + + System.String + + System.String + + + None + + + BatchEndpointResourceId + + The resource identifier of the Azure Batch service that is the recipient of the requested token + + System.String + + System.String + + + None + + + AzureOperationalInsightsEndpointResourceId + + The audience for tokens authenticating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureOperationalInsightsEndpoint + + The endpoint to use when communicating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + StorageEndpoint + + Specifies the endpoint for storage (blob, table, queue, and file) access. + + System.String + + System.String + + + None + + + AzureAnalysisServicesEndpointResourceId + + The resource identifier of the Azure Analysis Services resource. + + System.String + + System.String + + + None + + + AzureAnalysisServicesEndpointSuffix + + The endpoint to use when communicating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureAttestationServiceEndpointResourceId + + The The resource identifier of the Azure Attestation service that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureAttestationServiceEndpointSuffix + + Dns suffix of Azure Attestation service. + + System.String + + System.String + + + None + + + AzureSynapseAnalyticsEndpointResourceId + + The The resource identifier of the Azure Synapse Analytics that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureSynapseAnalyticsEndpointSuffix + + Dns suffix of Azure Synapse Analytics. + + System.String + + System.String + + + None + + + ContainerRegistryEndpointSuffix + + Suffix of Azure Container Registry. + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, account, tenant and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + ActiveDirectoryEndpoint + + Specifies the base authority for Azure Active Directory authentication. + + System.String + + System.String + + + None + + + ActiveDirectoryServiceEndpointResourceId + + Specifies the audience for tokens that authenticate requests to Azure Resource Manager or Service Management (RDFE) endpoints. + + System.String + + System.String + + + None + + + AdTenant + + Specifies the default Active Directory tenant. + + System.String + + System.String + + + None + + + ARMEndpoint + + The Azure Resource Manager endpoint. + + System.String + + System.String + + + None + + + AzureAnalysisServicesEndpointResourceId + + The resource identifier of the Azure Analysis Services resource. + + System.String + + System.String + + + None + + + AzureAnalysisServicesEndpointSuffix + + The endpoint to use when communicating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureAttestationServiceEndpointResourceId + + The The resource identifier of the Azure Attestation service that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureAttestationServiceEndpointSuffix + + Dns suffix of Azure Attestation service. + + System.String + + System.String + + + None + + + AzureDataLakeAnalyticsCatalogAndJobEndpointSuffix + + Dns Suffix of Azure Data Lake Analytics job and catalog services + + System.String + + System.String + + + None + + + AzureDataLakeStoreFileSystemEndpointSuffix + + Dns Suffix of Azure Data Lake Store FileSystem. Example: azuredatalake.net + + System.String + + System.String + + + None + + + AzureKeyVaultDnsSuffix + + Dns suffix of Azure Key Vault service. Example is vault-int.azure-int.net + + System.String + + System.String + + + None + + + AzureKeyVaultServiceEndpointResourceId + + Resource identifier of Azure Key Vault data service that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureOperationalInsightsEndpoint + + The endpoint to use when communicating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureOperationalInsightsEndpointResourceId + + The audience for tokens authenticating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureSynapseAnalyticsEndpointResourceId + + The The resource identifier of the Azure Synapse Analytics that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureSynapseAnalyticsEndpointSuffix + + Dns suffix of Azure Synapse Analytics. + + System.String + + System.String + + + None + + + BatchEndpointResourceId + + The resource identifier of the Azure Batch service that is the recipient of the requested token + + System.String + + System.String + + + None + + + ContainerRegistryEndpointSuffix + + Suffix of Azure Container Registry. + + System.String + + System.String + + + None + + + DataLakeAudience + + The audience for tokens authenticating with the AD Data Lake services Endpoint. + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, account, tenant and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + EnableAdfsAuthentication + + Indicates that Active Directory Federation Services (ADFS) on-premise authentication is allowed. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + GalleryEndpoint + + Specifies the endpoint for the Azure Resource Manager gallery of deployment templates. + + System.String + + System.String + + + None + + + GraphAudience + + The audience for tokens authenticating with the AD Graph Endpoint. + + System.String + + System.String + + + None + + + GraphEndpoint + + Specifies the URL for Graph (Active Directory metadata) requests. + + System.String + + System.String + + + None + + + ManagementPortalUrl + + Specifies the URL for the Management Portal. + + System.String + + System.String + + + None + + + MicrosoftGraphEndpointResourceId + + The resource identifier of Microsoft Graph + + System.String + + System.String + + + None + + + MicrosoftGraphUrl + + Microsoft Graph Url + + System.String + + System.String + + + None + + + Name + + Specifies the name of the environment to modify. + + System.String + + System.String + + + None + + + PublishSettingsFileUrl + + Specifies the URL from which .publishsettings files can be downloaded. + + System.String + + System.String + + + None + + + ResourceManagerEndpoint + + Specifies the URL for Azure Resource Manager requests. + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + ServiceEndpoint + + Specifies the endpoint for Service Management (RDFE) requests. + + System.String + + System.String + + + None + + + SqlDatabaseDnsSuffix + + Specifies the domain-name suffix for Azure SQL Database servers. + + System.String + + System.String + + + None + + + StorageEndpoint + + Specifies the endpoint for storage (blob, table, queue, and file) access. + + System.String + + System.String + + + None + + + TrafficManagerDnsSuffix + + Specifies the domain-name suffix for Azure Traffic Manager services. + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + System.String + + + + + + + + System.Management.Automation.SwitchParameter + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureEnvironment + + + + + + + + + + + + + + ----- Example 1: Creating and modifying a new environment ----- + Add-AzEnvironment -Name TestEnvironment ` + -ActiveDirectoryEndpoint TestADEndpoint ` + -ActiveDirectoryServiceEndpointResourceId TestADApplicationId ` + -ResourceManagerEndpoint TestRMEndpoint ` + -GalleryEndpoint TestGalleryEndpoint ` + -GraphEndpoint TestGraphEndpoint + +Name Resource Manager Url ActiveDirectory Authority +---- -------------------- ------------------------- +TestEnvironment TestRMEndpoint TestADEndpoint/ + +Set-AzEnvironment -Name TestEnvironment ` + -ActiveDirectoryEndpoint NewTestADEndpoint ` + -GraphEndpoint NewTestGraphEndpoint | Format-List + +Name : TestEnvironment +EnableAdfsAuthentication : False +ActiveDirectoryServiceEndpointResourceId : TestADApplicationId +AdTenant : +GalleryUrl : TestGalleryEndpoint +ManagementPortalUrl : +ServiceManagementUrl : +PublishSettingsFileUrl : +ResourceManagerUrl : TestRMEndpoint +SqlDatabaseDnsSuffix : +StorageEndpointSuffix : +ActiveDirectoryAuthority : NewTestADEndpoint +GraphUrl : NewTestGraphEndpoint +GraphEndpointResourceId : +TrafficManagerDnsSuffix : +AzureKeyVaultDnsSuffix : +AzureDataLakeStoreFileSystemEndpointSuffix : +AzureDataLakeAnalyticsCatalogAndJobEndpointSuffix : +AzureKeyVaultServiceEndpointResourceId : +BatchEndpointResourceId : +AzureOperationalInsightsEndpoint : +AzureOperationalInsightsEndpointResourceId : +AzureAttestationServiceEndpointSuffix : +AzureAttestationServiceEndpointResourceId : +AzureSynapseAnalyticsEndpointSuffix : +AzureSynapseAnalyticsEndpointResourceId : + + In this example we are creating a new Azure environment with sample endpoints using Add-AzEnvironment, and then we are changing the value of the ActiveDirectoryEndpoint and GraphEndpoint attributes of the created environment using the cmdlet Set-AzEnvironment. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/set-azenvironment + + + Add-AzEnvironment + + + + Get-AzEnvironment + + + + Remove-AzEnvironment + + + + + + + Uninstall-AzureRm + Uninstall + AzureRm + + Removes all AzureRm modules from a machine. + + + + Removes all AzureRm modules from a machine. + + + + Uninstall-AzureRm + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + PassThru + + Return list of Modules removed if specified. + + + System.Management.Automation.SwitchParameter + + + False + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + PassThru + + Return list of Modules removed if specified. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + None + + + + + + + + + + System.String + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + Uninstall-AzureRm + + Running this command will remove all AzureRm modules from the machine for the version of PowerShell in which the cmdlet is run. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/uninstall-azurerm + + + + \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Common.Share.dll b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Common.Share.dll new file mode 100644 index 000000000000..e45ac91a1264 Binary files /dev/null and b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Common.Share.dll differ diff --git a/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Common.dll b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Common.dll new file mode 100644 index 000000000000..a705c3fd25a8 Binary files /dev/null and b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Common.dll differ diff --git a/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Storage.dll b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Storage.dll new file mode 100644 index 000000000000..f15127c61779 Binary files /dev/null and b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Storage.dll differ diff --git a/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Strategies.dll b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Strategies.dll new file mode 100644 index 000000000000..f82770a9ceed Binary files /dev/null and b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Strategies.dll differ diff --git a/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.Rest.ClientRuntime.Azure.dll b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.Rest.ClientRuntime.Azure.dll new file mode 100644 index 000000000000..1d99c7015912 Binary files /dev/null and b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.Rest.ClientRuntime.Azure.dll differ diff --git a/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.Rest.ClientRuntime.dll b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.Rest.ClientRuntime.dll new file mode 100644 index 000000000000..4b4be00999a4 Binary files /dev/null and b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.Rest.ClientRuntime.dll differ diff --git a/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.WindowsAzure.Storage.DataMovement.dll b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.WindowsAzure.Storage.DataMovement.dll new file mode 100644 index 000000000000..6ac672abd486 Binary files /dev/null and b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.WindowsAzure.Storage.DataMovement.dll differ diff --git a/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.WindowsAzure.Storage.dll b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.WindowsAzure.Storage.dll new file mode 100644 index 000000000000..70c5ed6806c6 Binary files /dev/null and b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/Microsoft.WindowsAzure.Storage.dll differ diff --git a/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/PostImportScripts/LoadAuthenticators.ps1 b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/PostImportScripts/LoadAuthenticators.ps1 new file mode 100644 index 000000000000..bb0bc9e63f5d --- /dev/null +++ b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/PostImportScripts/LoadAuthenticators.ps1 @@ -0,0 +1,219 @@ +if ($PSEdition -eq 'Desktop') { + try { + [Microsoft.Azure.Commands.Profile.Utilities.CustomAssemblyResolver]::Initialize() + } catch {} +} +# SIG # Begin signature block +# MIInugYJKoZIhvcNAQcCoIInqzCCJ6cCAQExDzANBglghkgBZQMEAgEFADB5Bgor +# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG +# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCBn8ROze2QLH/c6 +# GtPhR/BPLgOtmjkNhcq+fFmu16VcrqCCDYEwggX/MIID56ADAgECAhMzAAACUosz +# qviV8znbAAAAAAJSMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD +# VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01pY3Jvc29mdCBDb2RlIFNpZ25p +# bmcgUENBIDIwMTEwHhcNMjEwOTAyMTgzMjU5WhcNMjIwOTAxMTgzMjU5WjB0MQsw +# CQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9u +# ZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMR4wHAYDVQQDExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB +# AQDQ5M+Ps/X7BNuv5B/0I6uoDwj0NJOo1KrVQqO7ggRXccklyTrWL4xMShjIou2I +# sbYnF67wXzVAq5Om4oe+LfzSDOzjcb6ms00gBo0OQaqwQ1BijyJ7NvDf80I1fW9O +# L76Kt0Wpc2zrGhzcHdb7upPrvxvSNNUvxK3sgw7YTt31410vpEp8yfBEl/hd8ZzA +# v47DCgJ5j1zm295s1RVZHNp6MoiQFVOECm4AwK2l28i+YER1JO4IplTH44uvzX9o +# RnJHaMvWzZEpozPy4jNO2DDqbcNs4zh7AWMhE1PWFVA+CHI/En5nASvCvLmuR/t8 +# q4bc8XR8QIZJQSp+2U6m2ldNAgMBAAGjggF+MIIBejAfBgNVHSUEGDAWBgorBgEE +# AYI3TAgBBggrBgEFBQcDAzAdBgNVHQ4EFgQUNZJaEUGL2Guwt7ZOAu4efEYXedEw +# UAYDVR0RBEkwR6RFMEMxKTAnBgNVBAsTIE1pY3Jvc29mdCBPcGVyYXRpb25zIFB1 +# ZXJ0byBSaWNvMRYwFAYDVQQFEw0yMzAwMTIrNDY3NTk3MB8GA1UdIwQYMBaAFEhu +# ZOVQBdOCqhc3NyK1bajKdQKVMFQGA1UdHwRNMEswSaBHoEWGQ2h0dHA6Ly93d3cu +# bWljcm9zb2Z0LmNvbS9wa2lvcHMvY3JsL01pY0NvZFNpZ1BDQTIwMTFfMjAxMS0w +# Ny0wOC5jcmwwYQYIKwYBBQUHAQEEVTBTMFEGCCsGAQUFBzAChkVodHRwOi8vd3d3 +# Lm1pY3Jvc29mdC5jb20vcGtpb3BzL2NlcnRzL01pY0NvZFNpZ1BDQTIwMTFfMjAx +# MS0wNy0wOC5jcnQwDAYDVR0TAQH/BAIwADANBgkqhkiG9w0BAQsFAAOCAgEAFkk3 +# uSxkTEBh1NtAl7BivIEsAWdgX1qZ+EdZMYbQKasY6IhSLXRMxF1B3OKdR9K/kccp +# kvNcGl8D7YyYS4mhCUMBR+VLrg3f8PUj38A9V5aiY2/Jok7WZFOAmjPRNNGnyeg7 +# l0lTiThFqE+2aOs6+heegqAdelGgNJKRHLWRuhGKuLIw5lkgx9Ky+QvZrn/Ddi8u +# TIgWKp+MGG8xY6PBvvjgt9jQShlnPrZ3UY8Bvwy6rynhXBaV0V0TTL0gEx7eh/K1 +# o8Miaru6s/7FyqOLeUS4vTHh9TgBL5DtxCYurXbSBVtL1Fj44+Od/6cmC9mmvrti +# yG709Y3Rd3YdJj2f3GJq7Y7KdWq0QYhatKhBeg4fxjhg0yut2g6aM1mxjNPrE48z +# 6HWCNGu9gMK5ZudldRw4a45Z06Aoktof0CqOyTErvq0YjoE4Xpa0+87T/PVUXNqf +# 7Y+qSU7+9LtLQuMYR4w3cSPjuNusvLf9gBnch5RqM7kaDtYWDgLyB42EfsxeMqwK +# WwA+TVi0HrWRqfSx2olbE56hJcEkMjOSKz3sRuupFCX3UroyYf52L+2iVTrda8XW +# esPG62Mnn3T8AuLfzeJFuAbfOSERx7IFZO92UPoXE1uEjL5skl1yTZB3MubgOA4F +# 8KoRNhviFAEST+nG8c8uIsbZeb08SeYQMqjVEmkwggd6MIIFYqADAgECAgphDpDS +# AAAAAAADMA0GCSqGSIb3DQEBCwUAMIGIMQswCQYDVQQGEwJVUzETMBEGA1UECBMK +# V2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0 +# IENvcnBvcmF0aW9uMTIwMAYDVQQDEylNaWNyb3NvZnQgUm9vdCBDZXJ0aWZpY2F0 +# ZSBBdXRob3JpdHkgMjAxMTAeFw0xMTA3MDgyMDU5MDlaFw0yNjA3MDgyMTA5MDla +# MH4xCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdS +# ZWRtb25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMT +# H01pY3Jvc29mdCBDb2RlIFNpZ25pbmcgUENBIDIwMTEwggIiMA0GCSqGSIb3DQEB +# AQUAA4ICDwAwggIKAoICAQCr8PpyEBwurdhuqoIQTTS68rZYIZ9CGypr6VpQqrgG +# OBoESbp/wwwe3TdrxhLYC/A4wpkGsMg51QEUMULTiQ15ZId+lGAkbK+eSZzpaF7S +# 35tTsgosw6/ZqSuuegmv15ZZymAaBelmdugyUiYSL+erCFDPs0S3XdjELgN1q2jz +# y23zOlyhFvRGuuA4ZKxuZDV4pqBjDy3TQJP4494HDdVceaVJKecNvqATd76UPe/7 +# 4ytaEB9NViiienLgEjq3SV7Y7e1DkYPZe7J7hhvZPrGMXeiJT4Qa8qEvWeSQOy2u +# M1jFtz7+MtOzAz2xsq+SOH7SnYAs9U5WkSE1JcM5bmR/U7qcD60ZI4TL9LoDho33 +# X/DQUr+MlIe8wCF0JV8YKLbMJyg4JZg5SjbPfLGSrhwjp6lm7GEfauEoSZ1fiOIl +# XdMhSz5SxLVXPyQD8NF6Wy/VI+NwXQ9RRnez+ADhvKwCgl/bwBWzvRvUVUvnOaEP +# 6SNJvBi4RHxF5MHDcnrgcuck379GmcXvwhxX24ON7E1JMKerjt/sW5+v/N2wZuLB +# l4F77dbtS+dJKacTKKanfWeA5opieF+yL4TXV5xcv3coKPHtbcMojyyPQDdPweGF +# RInECUzF1KVDL3SV9274eCBYLBNdYJWaPk8zhNqwiBfenk70lrC8RqBsmNLg1oiM +# CwIDAQABo4IB7TCCAekwEAYJKwYBBAGCNxUBBAMCAQAwHQYDVR0OBBYEFEhuZOVQ +# BdOCqhc3NyK1bajKdQKVMBkGCSsGAQQBgjcUAgQMHgoAUwB1AGIAQwBBMAsGA1Ud +# DwQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFHItOgIxkEO5FAVO +# 4eqnxzHRI4k0MFoGA1UdHwRTMFEwT6BNoEuGSWh0dHA6Ly9jcmwubWljcm9zb2Z0 +# LmNvbS9wa2kvY3JsL3Byb2R1Y3RzL01pY1Jvb0NlckF1dDIwMTFfMjAxMV8wM18y +# Mi5jcmwwXgYIKwYBBQUHAQEEUjBQME4GCCsGAQUFBzAChkJodHRwOi8vd3d3Lm1p +# Y3Jvc29mdC5jb20vcGtpL2NlcnRzL01pY1Jvb0NlckF1dDIwMTFfMjAxMV8wM18y +# Mi5jcnQwgZ8GA1UdIASBlzCBlDCBkQYJKwYBBAGCNy4DMIGDMD8GCCsGAQUFBwIB +# FjNodHRwOi8vd3d3Lm1pY3Jvc29mdC5jb20vcGtpb3BzL2RvY3MvcHJpbWFyeWNw +# cy5odG0wQAYIKwYBBQUHAgIwNB4yIB0ATABlAGcAYQBsAF8AcABvAGwAaQBjAHkA +# XwBzAHQAYQB0AGUAbQBlAG4AdAAuIB0wDQYJKoZIhvcNAQELBQADggIBAGfyhqWY +# 4FR5Gi7T2HRnIpsLlhHhY5KZQpZ90nkMkMFlXy4sPvjDctFtg/6+P+gKyju/R6mj +# 82nbY78iNaWXXWWEkH2LRlBV2AySfNIaSxzzPEKLUtCw/WvjPgcuKZvmPRul1LUd +# d5Q54ulkyUQ9eHoj8xN9ppB0g430yyYCRirCihC7pKkFDJvtaPpoLpWgKj8qa1hJ +# Yx8JaW5amJbkg/TAj/NGK978O9C9Ne9uJa7lryft0N3zDq+ZKJeYTQ49C/IIidYf +# wzIY4vDFLc5bnrRJOQrGCsLGra7lstnbFYhRRVg4MnEnGn+x9Cf43iw6IGmYslmJ +# aG5vp7d0w0AFBqYBKig+gj8TTWYLwLNN9eGPfxxvFX1Fp3blQCplo8NdUmKGwx1j +# NpeG39rz+PIWoZon4c2ll9DuXWNB41sHnIc+BncG0QaxdR8UvmFhtfDcxhsEvt9B +# xw4o7t5lL+yX9qFcltgA1qFGvVnzl6UJS0gQmYAf0AApxbGbpT9Fdx41xtKiop96 +# eiL6SJUfq/tHI4D1nvi/a7dLl+LrdXga7Oo3mXkYS//WsyNodeav+vyL6wuA6mk7 +# r/ww7QRMjt/fdW1jkT3RnVZOT7+AVyKheBEyIXrvQQqxP/uozKRdwaGIm1dxVk5I +# RcBCyZt2WwqASGv9eZ/BvW1taslScxMNelDNMYIZjzCCGYsCAQEwgZUwfjELMAkG +# A1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQx +# HjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEoMCYGA1UEAxMfTWljcm9z +# b2Z0IENvZGUgU2lnbmluZyBQQ0EgMjAxMQITMwAAAlKLM6r4lfM52wAAAAACUjAN +# BglghkgBZQMEAgEFAKCBrjAZBgkqhkiG9w0BCQMxDAYKKwYBBAGCNwIBBDAcBgor +# BgEEAYI3AgELMQ4wDAYKKwYBBAGCNwIBFTAvBgkqhkiG9w0BCQQxIgQgLwxfLTEa +# f5cZ43nGFJSGxV1AZMu24c5Ln5TdSBDWTncwQgYKKwYBBAGCNwIBDDE0MDKgFIAS +# AE0AaQBjAHIAbwBzAG8AZgB0oRqAGGh0dHA6Ly93d3cubWljcm9zb2Z0LmNvbTAN +# BgkqhkiG9w0BAQEFAASCAQCH+MB7uS3RlpbV8q8Nvg9aa0UmWWYCFOT/3n7V09Q6 +# p3v/uFdZ8AXCe8zdAeWFwLOQg9974QcDbIbvXm1V96+Z7zEEimU/Zr1ou5Cv0knI +# riaKdejplgnDt1EnBE9JlSyVsV7aOYr4EueMCb1Xn1dfGabKcgVlJUlP0JyZPQfs +# YqsyxEznkgNE769m8ozUwCx33jJN1Llcs3FYEe5irzu8UthSkFQ8vpG3YABhlk6M +# 4jPeb38LKbkEE0jclq6sfdmT+JL8j7Z05KfgaD076LnpSaqkcu9+2RH3TARosqhq +# I/N3nhDQclKIl1kYSXFG1E4/6ea3rAa98adIaR0YNcpFoYIXGTCCFxUGCisGAQQB +# gjcDAwExghcFMIIXAQYJKoZIhvcNAQcCoIIW8jCCFu4CAQMxDzANBglghkgBZQME +# AgEFADCCAVkGCyqGSIb3DQEJEAEEoIIBSASCAUQwggFAAgEBBgorBgEEAYRZCgMB +# MDEwDQYJYIZIAWUDBAIBBQAEIDsI/xX4lqk74CTV97lUQ0iyAOiIu4ggTwVzbGvl +# +HKeAgZiMTFcH0UYEzIwMjIwMzMxMTAwMDA5LjQ1OVowBIACAfSggdikgdUwgdIx +# CzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRt +# b25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xLTArBgNVBAsTJE1p +# Y3Jvc29mdCBJcmVsYW5kIE9wZXJhdGlvbnMgTGltaXRlZDEmMCQGA1UECxMdVGhh +# bGVzIFRTUyBFU046QTI0MC00QjgyLTEzMEUxJTAjBgNVBAMTHE1pY3Jvc29mdCBU +# aW1lLVN0YW1wIFNlcnZpY2WgghFoMIIHFDCCBPygAwIBAgITMwAAAY16VS54dJkq +# twABAAABjTANBgkqhkiG9w0BAQsFADB8MQswCQYDVQQGEwJVUzETMBEGA1UECBMK +# V2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0 +# IENvcnBvcmF0aW9uMSYwJAYDVQQDEx1NaWNyb3NvZnQgVGltZS1TdGFtcCBQQ0Eg +# MjAxMDAeFw0yMTEwMjgxOTI3NDVaFw0yMzAxMjYxOTI3NDVaMIHSMQswCQYDVQQG +# EwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwG +# A1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMS0wKwYDVQQLEyRNaWNyb3NvZnQg +# SXJlbGFuZCBPcGVyYXRpb25zIExpbWl0ZWQxJjAkBgNVBAsTHVRoYWxlcyBUU1Mg +# RVNOOkEyNDAtNEI4Mi0xMzBFMSUwIwYDVQQDExxNaWNyb3NvZnQgVGltZS1TdGFt +# cCBTZXJ2aWNlMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA2jRILZg+ +# O6U7dLcuwBPMB+0tJUz0wHLqJ5f7KJXQsTzWToADUMYV4xVZnp9mPTWojUJ/l3O4 +# XqegLDNduFAObcitrLyY5HDsxAfUG1/2YilcSkSP6CcMqWfsSwULGX5zlsVKHJ7t +# vwg26y6eLklUdFMpiq294T4uJQdXd5O7mFy0vVkaGPGxNWLbZxKNzqKtFnWQ7jMt +# Z05XvafkIWZrNTFv8GGpAlHtRsZ1A8KDo6IDSGVNZZXbQs+fOwMOGp/Bzod8f1YI +# 8Gb2oN/mx2ccvdGr9la55QZeVsM7LfTaEPQxbgAcLgWDlIPcmTzcBksEzLOQsSpB +# zsqPaWI9ykVw5ofmrkFKMbpQT5EMki2suJoVM5xGgdZWnt/tz00xubPSKFi4B4IM +# FUB9mcANUq9cHaLsHbDJ+AUsVO0qnVjwzXPYJeR7C/B8X0Ul6UkIdplZmncQZSBK +# 3yZQy+oGsuJKXFAq3BlxT6kDuhYYvO7itLrPeY0knut1rKkxom+ui6vCdthCfnAi +# yknyRC2lknqzz8x1mDkQ5Q6Ox9p6/lduFupSJMtgsCPN9fIvrfppMDFIvRoULsHO +# dLJjrRli8co5M+vZmf20oTxYuXzM0tbRurEJycB5ZMbwznsFHymOkgyx8OeFnXV3 +# car45uejI1B1iqUDbeSNxnvczuOhcpzwackCAwEAAaOCATYwggEyMB0GA1UdDgQW +# BBR4zJFuh59GwpTuSju4STcflihmkzAfBgNVHSMEGDAWgBSfpxVdAF5iXYP05dJl +# pxtTNRnpcjBfBgNVHR8EWDBWMFSgUqBQhk5odHRwOi8vd3d3Lm1pY3Jvc29mdC5j +# b20vcGtpb3BzL2NybC9NaWNyb3NvZnQlMjBUaW1lLVN0YW1wJTIwUENBJTIwMjAx +# MCgxKS5jcmwwbAYIKwYBBQUHAQEEYDBeMFwGCCsGAQUFBzAChlBodHRwOi8vd3d3 +# Lm1pY3Jvc29mdC5jb20vcGtpb3BzL2NlcnRzL01pY3Jvc29mdCUyMFRpbWUtU3Rh +# bXAlMjBQQ0ElMjAyMDEwKDEpLmNydDAMBgNVHRMBAf8EAjAAMBMGA1UdJQQMMAoG +# CCsGAQUFBwMIMA0GCSqGSIb3DQEBCwUAA4ICAQA1r3Oz0lEq3VvpdFlh3YBxc4hn +# YkALyYPDa9FO4XgqwkBm8Lsb+lK3tbGGgpi6QJbK3iM3BK0ObBcwRaJVCxGLGtr6 +# Jz9hRumRyF8o4n2y3YiKv4olBxNjFShSGc9E29JmVjBmLgmfjRqPc/2rD25q4ow4 +# uA3rc9ekiaufgGhcSAdek/l+kASbzohOt/5z2+IlgT4e3auSUzt2GAKfKZB02ZDG +# WKKeCY3pELj1tuh6yfrOJPPInO4ZZLW3vgKavtL8e6FJZyJoDFMewJ59oEL+AK3e +# 2M2I4IFE9n6LVS8bS9UbMUMvrAlXN5ZM2I8GdHB9TbfI17Wm/9Uf4qu588PJN7vC +# Jj9s+KxZqXc5sGScLgqiPqIbbNTE+/AEZ/eTixc9YLgTyMqakZI59wGqjrONQSY7 +# u0VEDkEE6ikz+FSFRKKzpySb0WTgMvWxsLvbnN8ACmISPnBHYZoGssPAL7foGGKF +# LdABTQC2PX19WjrfyrshHdiqSlCspqIGBTxRaHtyPMro3B/26gPfCl3MC3rC3NGq +# 4xGnIHDZGSizUmGg8TkQAloVdU5dJ1v910gjxaxaUraGhP8IttE0RWnU5XRp/sGa +# NmDcMwbyHuSpaFsn3Q21OzitP4BnN5tprHangAC7joe4zmLnmRnAiUc9sRqQ2bms +# MAvUpsO8nlOFmiM1LzCCB3EwggVZoAMCAQICEzMAAAAVxedrngKbSZkAAAAAABUw +# DQYJKoZIhvcNAQELBQAwgYgxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5n +# dG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9y +# YXRpb24xMjAwBgNVBAMTKU1pY3Jvc29mdCBSb290IENlcnRpZmljYXRlIEF1dGhv +# cml0eSAyMDEwMB4XDTIxMDkzMDE4MjIyNVoXDTMwMDkzMDE4MzIyNVowfDELMAkG +# A1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQx +# HjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEmMCQGA1UEAxMdTWljcm9z +# b2Z0IFRpbWUtU3RhbXAgUENBIDIwMTAwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAw +# ggIKAoICAQDk4aZM57RyIQt5osvXJHm9DtWC0/3unAcH0qlsTnXIyjVX9gF/bErg +# 4r25PhdgM/9cT8dm95VTcVrifkpa/rg2Z4VGIwy1jRPPdzLAEBjoYH1qUoNEt6aO +# RmsHFPPFdvWGUNzBRMhxXFExN6AKOG6N7dcP2CZTfDlhAnrEqv1yaa8dq6z2Nr41 +# JmTamDu6GnszrYBbfowQHJ1S/rboYiXcag/PXfT+jlPP1uyFVk3v3byNpOORj7I5 +# LFGc6XBpDco2LXCOMcg1KL3jtIckw+DJj361VI/c+gVVmG1oO5pGve2krnopN6zL +# 64NF50ZuyjLVwIYwXE8s4mKyzbnijYjklqwBSru+cakXW2dg3viSkR4dPf0gz3N9 +# QZpGdc3EXzTdEonW/aUgfX782Z5F37ZyL9t9X4C626p+Nuw2TPYrbqgSUei/BQOj +# 0XOmTTd0lBw0gg/wEPK3Rxjtp+iZfD9M269ewvPV2HM9Q07BMzlMjgK8QmguEOqE +# UUbi0b1qGFphAXPKZ6Je1yh2AuIzGHLXpyDwwvoSCtdjbwzJNmSLW6CmgyFdXzB0 +# kZSU2LlQ+QuJYfM2BjUYhEfb3BvR/bLUHMVr9lxSUV0S2yW6r1AFemzFER1y7435 +# UsSFF5PAPBXbGjfHCBUYP3irRbb1Hode2o+eFnJpxq57t7c+auIurQIDAQABo4IB +# 3TCCAdkwEgYJKwYBBAGCNxUBBAUCAwEAATAjBgkrBgEEAYI3FQIEFgQUKqdS/mTE +# mr6CkTxGNSnPEP8vBO4wHQYDVR0OBBYEFJ+nFV0AXmJdg/Tl0mWnG1M1GelyMFwG +# A1UdIARVMFMwUQYMKwYBBAGCN0yDfQEBMEEwPwYIKwYBBQUHAgEWM2h0dHA6Ly93 +# d3cubWljcm9zb2Z0LmNvbS9wa2lvcHMvRG9jcy9SZXBvc2l0b3J5Lmh0bTATBgNV +# HSUEDDAKBggrBgEFBQcDCDAZBgkrBgEEAYI3FAIEDB4KAFMAdQBiAEMAQTALBgNV +# HQ8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAfBgNVHSMEGDAWgBTV9lbLj+iiXGJo +# 0T2UkFvXzpoYxDBWBgNVHR8ETzBNMEugSaBHhkVodHRwOi8vY3JsLm1pY3Jvc29m +# dC5jb20vcGtpL2NybC9wcm9kdWN0cy9NaWNSb29DZXJBdXRfMjAxMC0wNi0yMy5j +# cmwwWgYIKwYBBQUHAQEETjBMMEoGCCsGAQUFBzAChj5odHRwOi8vd3d3Lm1pY3Jv +# c29mdC5jb20vcGtpL2NlcnRzL01pY1Jvb0NlckF1dF8yMDEwLTA2LTIzLmNydDAN +# BgkqhkiG9w0BAQsFAAOCAgEAnVV9/Cqt4SwfZwExJFvhnnJL/Klv6lwUtj5OR2R4 +# sQaTlz0xM7U518JxNj/aZGx80HU5bbsPMeTCj/ts0aGUGCLu6WZnOlNN3Zi6th54 +# 2DYunKmCVgADsAW+iehp4LoJ7nvfam++Kctu2D9IdQHZGN5tggz1bSNU5HhTdSRX +# ud2f8449xvNo32X2pFaq95W2KFUn0CS9QKC/GbYSEhFdPSfgQJY4rPf5KYnDvBew +# VIVCs/wMnosZiefwC2qBwoEZQhlSdYo2wh3DYXMuLGt7bj8sCXgU6ZGyqVvfSaN0 +# DLzskYDSPeZKPmY7T7uG+jIa2Zb0j/aRAfbOxnT99kxybxCrdTDFNLB62FD+Cljd +# QDzHVG2dY3RILLFORy3BFARxv2T5JL5zbcqOCb2zAVdJVGTZc9d/HltEAY5aGZFr +# DZ+kKNxnGSgkujhLmm77IVRrakURR6nxt67I6IleT53S0Ex2tVdUCbFpAUR+fKFh +# bHP+CrvsQWY9af3LwUFJfn6Tvsv4O+S3Fb+0zj6lMVGEvL8CwYKiexcdFYmNcP7n +# tdAoGokLjzbaukz5m/8K6TT4JDVnK+ANuOaMmdbhIurwJ0I9JZTmdHRbatGePu1+ +# oDEzfbzL6Xu/OHBE0ZDxyKs6ijoIYn/ZcGNTTY3ugm2lBRDBcQZqELQdVTNYs6Fw +# ZvKhggLXMIICQAIBATCCAQChgdikgdUwgdIxCzAJBgNVBAYTAlVTMRMwEQYDVQQI +# EwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNyb3Nv +# ZnQgQ29ycG9yYXRpb24xLTArBgNVBAsTJE1pY3Jvc29mdCBJcmVsYW5kIE9wZXJh +# dGlvbnMgTGltaXRlZDEmMCQGA1UECxMdVGhhbGVzIFRTUyBFU046QTI0MC00Qjgy +# LTEzMEUxJTAjBgNVBAMTHE1pY3Jvc29mdCBUaW1lLVN0YW1wIFNlcnZpY2WiIwoB +# ATAHBgUrDgMCGgMVAIBzlZM9TRND4PgtpLWQZkSPYVcJoIGDMIGApH4wfDELMAkG +# A1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQx +# HjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEmMCQGA1UEAxMdTWljcm9z +# b2Z0IFRpbWUtU3RhbXAgUENBIDIwMTAwDQYJKoZIhvcNAQEFBQACBQDl73XWMCIY +# DzIwMjIwMzMxMDgzNTM0WhgPMjAyMjA0MDEwODM1MzRaMHcwPQYKKwYBBAGEWQoE +# ATEvMC0wCgIFAOXvddYCAQAwCgIBAAICF6kCAf8wBwIBAAICER8wCgIFAOXwx1YC +# AQAwNgYKKwYBBAGEWQoEAjEoMCYwDAYKKwYBBAGEWQoDAqAKMAgCAQACAwehIKEK +# MAgCAQACAwGGoDANBgkqhkiG9w0BAQUFAAOBgQAY60kde7HWABLbM75dgVqLPwu2 +# UX3qQDaoStTqkS7953pYHKc6GEqRd/nLCCeYBqC+XJRMTMNbd4ZDkkCzsxlr5HFi +# GE6eT7+KvwqQf+djK59ZAts0no9RPZcdCJwQfvqU3RK91gp/Sg2bCMvAfTN4LRGp +# qQ4tYYP2GrJJNqVbkDGCBA0wggQJAgEBMIGTMHwxCzAJBgNVBAYTAlVTMRMwEQYD +# VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24xJjAkBgNVBAMTHU1pY3Jvc29mdCBUaW1lLVN0YW1w +# IFBDQSAyMDEwAhMzAAABjXpVLnh0mSq3AAEAAAGNMA0GCWCGSAFlAwQCAQUAoIIB +# SjAaBgkqhkiG9w0BCQMxDQYLKoZIhvcNAQkQAQQwLwYJKoZIhvcNAQkEMSIEIOQz +# W64DlGXuO2zRgqB/n+gyoReL9ldfVdiKRVTSCDK+MIH6BgsqhkiG9w0BCRACLzGB +# 6jCB5zCB5DCBvQQgnpYRM/odXkDAnzf2udL569W8cfGTgwVuenQ8ttIYzX8wgZgw +# gYCkfjB8MQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UE +# BxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSYwJAYD +# VQQDEx1NaWNyb3NvZnQgVGltZS1TdGFtcCBQQ0EgMjAxMAITMwAAAY16VS54dJkq +# twABAAABjTAiBCCgvCueU3dRfCsOKSpG5oksOx2/8SHFEjSLBygedl9oUzANBgkq +# hkiG9w0BAQsFAASCAgASDKu2OAv74hH075B2jN90FtXMtuST3zF61GC5OXm38b4j +# NSjLjbMslJJqeXiyODEQFNxmdE9AgPguQK13CeNnqsx2krlMfIC4o+M2pN7lqWCk +# gWfp5QemsmucuotA2dXLF98jGlQ1JShvFVOvUyxs0QKejf323B/mYdoUzvKurP1M +# k+FUjq/w3mgN9oj5oHoCIkdg1gDWNh80zEa0/YxEE7YYzg8bPLsGpK+f7B75Q51Y +# Sz7Gp/LGpQiG/LjytNQmsHwy/bl3FCr5/2WxBkAs8BneisPIfNLW0gfEo5Azkjo9 +# KEm5l8ILkJ3/4Qx9HiGjqwrdto8kGWAlGoIELtsO0BGT4onF4ynlKQgw82JK+4RD +# tWXCnPqjojkl+/4tfbeEdUoPvNgYpvS6ZRRYJIWg5s7XViroohZCCSkqt8aMjTZF +# HJBsKzmdHvVvAGELQ7TKaN3mOMUXb/o4vIK0TYrYN6FUn5iVnA7X2LIbJj0j3Mef +# BwEeOFhSjxz2Ob1oihNBoR1v5y+XfkbT7igIVQqwM27ujcOooOsDkpgizs0FajJV +# jeRsqEsXgfpaKCAq5czpOTutrvvwEn/cINrR3JW1TRSGt3VUvSWkmBs1T+7Oj6H6 +# ewWQaQIDYdEiDUL8OJhl+GzebujxPo//NXTY0MZCxK3DXhXi5okwsImzh5010w== +# SIG # End signature block diff --git a/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Azure.Core.dll b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Azure.Core.dll new file mode 100644 index 000000000000..67edb79248ca Binary files /dev/null and b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Azure.Core.dll differ diff --git a/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Azure.Identity.dll b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Azure.Identity.dll new file mode 100644 index 000000000000..0d214db71cad Binary files /dev/null and b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Azure.Identity.dll differ diff --git a/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Azure.PowerShell.Authenticators.dll b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Azure.PowerShell.Authenticators.dll new file mode 100644 index 000000000000..2b2e59f4a657 Binary files /dev/null and b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Azure.PowerShell.Authenticators.dll differ diff --git a/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Bcl.AsyncInterfaces.dll b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Bcl.AsyncInterfaces.dll new file mode 100644 index 000000000000..869ac1b86c57 Binary files /dev/null and b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Bcl.AsyncInterfaces.dll differ diff --git a/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Identity.Client.Extensions.Msal.dll b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Identity.Client.Extensions.Msal.dll new file mode 100644 index 000000000000..d22ddefa2339 Binary files /dev/null and b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Identity.Client.Extensions.Msal.dll differ diff --git a/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Identity.Client.dll b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Identity.Client.dll new file mode 100644 index 000000000000..7f392562319f Binary files /dev/null and b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Identity.Client.dll differ diff --git a/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Newtonsoft.Json.12.0.3.dll b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Newtonsoft.Json.12.0.3.dll new file mode 100644 index 000000000000..6344999edbb3 Binary files /dev/null and b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Newtonsoft.Json.12.0.3.dll differ diff --git a/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Newtonsoft.Json.dll b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Newtonsoft.Json.dll new file mode 100644 index 000000000000..9b0ae142146e Binary files /dev/null and b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Newtonsoft.Json.dll differ diff --git a/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Buffers.dll b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Buffers.dll new file mode 100644 index 000000000000..c517a3b62cc7 Binary files /dev/null and b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Buffers.dll differ diff --git a/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Diagnostics.DiagnosticSource.dll b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Diagnostics.DiagnosticSource.dll new file mode 100644 index 000000000000..a2b54fb042de Binary files /dev/null and b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Diagnostics.DiagnosticSource.dll differ diff --git a/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Memory.Data.dll b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Memory.Data.dll new file mode 100644 index 000000000000..5aa381018c00 Binary files /dev/null and b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Memory.Data.dll differ diff --git a/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Memory.dll b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Memory.dll new file mode 100644 index 000000000000..bdfc501e9647 Binary files /dev/null and b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Memory.dll differ diff --git a/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Net.Http.WinHttpHandler.dll b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Net.Http.WinHttpHandler.dll new file mode 100644 index 000000000000..8bd471e74c6e Binary files /dev/null and b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Net.Http.WinHttpHandler.dll differ diff --git a/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Numerics.Vectors.dll b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Numerics.Vectors.dll new file mode 100644 index 000000000000..08659724d4f8 Binary files /dev/null and b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Numerics.Vectors.dll differ diff --git a/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Private.ServiceModel.dll b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Private.ServiceModel.dll new file mode 100644 index 000000000000..3f9f84edf0ed Binary files /dev/null and b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Private.ServiceModel.dll differ diff --git a/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Reflection.DispatchProxy.dll b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Reflection.DispatchProxy.dll new file mode 100644 index 000000000000..64a57cbbecce Binary files /dev/null and b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Reflection.DispatchProxy.dll differ diff --git a/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Runtime.CompilerServices.Unsafe.dll b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Runtime.CompilerServices.Unsafe.dll new file mode 100644 index 000000000000..0c27a0e21c7e Binary files /dev/null and b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Runtime.CompilerServices.Unsafe.dll differ diff --git a/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.AccessControl.dll b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.AccessControl.dll new file mode 100644 index 000000000000..e8074324cd13 Binary files /dev/null and b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.AccessControl.dll differ diff --git a/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.Cryptography.Cng.dll b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.Cryptography.Cng.dll new file mode 100644 index 000000000000..4f4c30e080bd Binary files /dev/null and b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.Cryptography.Cng.dll differ diff --git a/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.Permissions.dll b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.Permissions.dll new file mode 100644 index 000000000000..d1af38f0f8b7 Binary files /dev/null and b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.Permissions.dll differ diff --git a/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.Principal.Windows.dll b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.Principal.Windows.dll new file mode 100644 index 000000000000..afd187c14918 Binary files /dev/null and b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.Principal.Windows.dll differ diff --git a/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.ServiceModel.Primitives.dll b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.ServiceModel.Primitives.dll new file mode 100644 index 000000000000..c1aa0a64f8f9 Binary files /dev/null and b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.ServiceModel.Primitives.dll differ diff --git a/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Text.Encodings.Web.dll b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Text.Encodings.Web.dll new file mode 100644 index 000000000000..6d2b207854ac Binary files /dev/null and b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Text.Encodings.Web.dll differ diff --git a/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Text.Json.dll b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Text.Json.dll new file mode 100644 index 000000000000..a3a85c2b7255 Binary files /dev/null and b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Text.Json.dll differ diff --git a/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Threading.Tasks.Extensions.dll b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Threading.Tasks.Extensions.dll new file mode 100644 index 000000000000..dfab23478ab4 Binary files /dev/null and b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Threading.Tasks.Extensions.dll differ diff --git a/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Xml.ReaderWriter.dll b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Xml.ReaderWriter.dll new file mode 100644 index 000000000000..022e63a21a86 Binary files /dev/null and b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Xml.ReaderWriter.dll differ diff --git a/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/StartupScripts/AzError.ps1 b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/StartupScripts/AzError.ps1 new file mode 100644 index 000000000000..f234bd2dd7e5 --- /dev/null +++ b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/StartupScripts/AzError.ps1 @@ -0,0 +1,278 @@ +function Write-InstallationCheckToFile +{ + Param($installationchecks) + if (Get-Module AzureRM.Profile -ListAvailable -ErrorAction Ignore) + { + Write-Warning ("Both Az and AzureRM modules were detected on this machine. Az and AzureRM modules cannot be imported in the same session or used in the same script or runbook. If you are running PowerShell in an environment you control you can use the 'Uninstall-AzureRm' cmdlet to remove all AzureRm modules from your machine. " + + "If you are running in Azure Automation, take care that none of your runbooks import both Az and AzureRM modules. More information can be found here: https://aka.ms/azps-migration-guide") + } + + $installationchecks.Add("AzSideBySideCheck","true") + try + { + if (Test-Path $pathToInstallationChecks -ErrorAction Ignore) + { + Remove-Item -Path $pathToInstallationChecks -ErrorAction Stop + } + + $pathToInstallDir = Split-Path -Path $pathToInstallationChecks -Parent -ErrorAction Stop + if (Test-Path $pathToInstallDir -ErrorAction Ignore) + { + New-Item -Path $pathToInstallationChecks -ErrorAction Stop -ItemType File -Value ($installationchecks | ConvertTo-Json -ErrorAction Stop) + } + } + catch + { + Write-Verbose "Installation checks failed to write to file." + } +} + +if (!($env:SkipAzInstallationChecks -eq "true")) +{ + $pathToInstallationChecks = Join-Path (Join-Path $HOME ".Azure") "AzInstallationChecks.json" + $installationchecks = @{} + if (!(Test-Path $pathToInstallationChecks -ErrorAction Ignore)) + { + Write-InstallationCheckToFile $installationchecks + } + else + { + try + { + ((Get-Content $pathToInstallationChecks -ErrorAction Stop) | ConvertFrom-Json -ErrorAction Stop).PSObject.Properties | Foreach { $installationchecks[$_.Name] = $_.Value } + } + catch + { + Write-InstallationCheckToFile $installationchecks + } + + if (!$installationchecks.ContainsKey("AzSideBySideCheck")) + { + Write-InstallationCheckToFile $installationchecks + } + } +} + +if (Get-Module AzureRM.profile -ErrorAction Ignore) +{ + Write-Warning ("AzureRM.Profile already loaded. Az and AzureRM modules cannot be imported in the same session or used in the same script or runbook. If you are running PowerShell in an environment you control you can use the 'Uninstall-AzureRm' cmdlet to remove all AzureRm modules from your machine. " + + "If you are running in Azure Automation, take care that none of your runbooks import both Az and AzureRM modules. More information can be found here: https://aka.ms/azps-migration-guide.") + throw ("AzureRM.Profile already loaded. Az and AzureRM modules cannot be imported in the same session or used in the same script or runbook. If you are running PowerShell in an environment you control you can use the 'Uninstall-AzureRm' cmdlet to remove all AzureRm modules from your machine. " + + "If you are running in Azure Automation, take care that none of your runbooks import both Az and AzureRM modules. More information can be found here: https://aka.ms/azps-migration-guide.") +} + +Update-TypeData -AppendPath (Join-Path (Get-Item $PSScriptRoot).Parent.FullName Accounts.types.ps1xml) -ErrorAction Ignore +# SIG # Begin signature block +# MIInuQYJKoZIhvcNAQcCoIInqjCCJ6YCAQExDzANBglghkgBZQMEAgEFADB5Bgor +# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG +# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCDT3s8rOGw0kP8l +# AbYXJ7G9hr2fOKBRtW5xO6fWVEOZvqCCDYEwggX/MIID56ADAgECAhMzAAACUosz +# qviV8znbAAAAAAJSMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD +# VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01pY3Jvc29mdCBDb2RlIFNpZ25p +# bmcgUENBIDIwMTEwHhcNMjEwOTAyMTgzMjU5WhcNMjIwOTAxMTgzMjU5WjB0MQsw +# CQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9u +# ZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMR4wHAYDVQQDExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB +# AQDQ5M+Ps/X7BNuv5B/0I6uoDwj0NJOo1KrVQqO7ggRXccklyTrWL4xMShjIou2I +# sbYnF67wXzVAq5Om4oe+LfzSDOzjcb6ms00gBo0OQaqwQ1BijyJ7NvDf80I1fW9O +# L76Kt0Wpc2zrGhzcHdb7upPrvxvSNNUvxK3sgw7YTt31410vpEp8yfBEl/hd8ZzA +# v47DCgJ5j1zm295s1RVZHNp6MoiQFVOECm4AwK2l28i+YER1JO4IplTH44uvzX9o +# RnJHaMvWzZEpozPy4jNO2DDqbcNs4zh7AWMhE1PWFVA+CHI/En5nASvCvLmuR/t8 +# q4bc8XR8QIZJQSp+2U6m2ldNAgMBAAGjggF+MIIBejAfBgNVHSUEGDAWBgorBgEE +# AYI3TAgBBggrBgEFBQcDAzAdBgNVHQ4EFgQUNZJaEUGL2Guwt7ZOAu4efEYXedEw +# UAYDVR0RBEkwR6RFMEMxKTAnBgNVBAsTIE1pY3Jvc29mdCBPcGVyYXRpb25zIFB1 +# ZXJ0byBSaWNvMRYwFAYDVQQFEw0yMzAwMTIrNDY3NTk3MB8GA1UdIwQYMBaAFEhu +# ZOVQBdOCqhc3NyK1bajKdQKVMFQGA1UdHwRNMEswSaBHoEWGQ2h0dHA6Ly93d3cu +# bWljcm9zb2Z0LmNvbS9wa2lvcHMvY3JsL01pY0NvZFNpZ1BDQTIwMTFfMjAxMS0w +# Ny0wOC5jcmwwYQYIKwYBBQUHAQEEVTBTMFEGCCsGAQUFBzAChkVodHRwOi8vd3d3 +# Lm1pY3Jvc29mdC5jb20vcGtpb3BzL2NlcnRzL01pY0NvZFNpZ1BDQTIwMTFfMjAx +# MS0wNy0wOC5jcnQwDAYDVR0TAQH/BAIwADANBgkqhkiG9w0BAQsFAAOCAgEAFkk3 +# uSxkTEBh1NtAl7BivIEsAWdgX1qZ+EdZMYbQKasY6IhSLXRMxF1B3OKdR9K/kccp +# kvNcGl8D7YyYS4mhCUMBR+VLrg3f8PUj38A9V5aiY2/Jok7WZFOAmjPRNNGnyeg7 +# l0lTiThFqE+2aOs6+heegqAdelGgNJKRHLWRuhGKuLIw5lkgx9Ky+QvZrn/Ddi8u +# TIgWKp+MGG8xY6PBvvjgt9jQShlnPrZ3UY8Bvwy6rynhXBaV0V0TTL0gEx7eh/K1 +# o8Miaru6s/7FyqOLeUS4vTHh9TgBL5DtxCYurXbSBVtL1Fj44+Od/6cmC9mmvrti +# yG709Y3Rd3YdJj2f3GJq7Y7KdWq0QYhatKhBeg4fxjhg0yut2g6aM1mxjNPrE48z +# 6HWCNGu9gMK5ZudldRw4a45Z06Aoktof0CqOyTErvq0YjoE4Xpa0+87T/PVUXNqf +# 7Y+qSU7+9LtLQuMYR4w3cSPjuNusvLf9gBnch5RqM7kaDtYWDgLyB42EfsxeMqwK +# WwA+TVi0HrWRqfSx2olbE56hJcEkMjOSKz3sRuupFCX3UroyYf52L+2iVTrda8XW +# esPG62Mnn3T8AuLfzeJFuAbfOSERx7IFZO92UPoXE1uEjL5skl1yTZB3MubgOA4F +# 8KoRNhviFAEST+nG8c8uIsbZeb08SeYQMqjVEmkwggd6MIIFYqADAgECAgphDpDS +# AAAAAAADMA0GCSqGSIb3DQEBCwUAMIGIMQswCQYDVQQGEwJVUzETMBEGA1UECBMK +# V2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0 +# IENvcnBvcmF0aW9uMTIwMAYDVQQDEylNaWNyb3NvZnQgUm9vdCBDZXJ0aWZpY2F0 +# ZSBBdXRob3JpdHkgMjAxMTAeFw0xMTA3MDgyMDU5MDlaFw0yNjA3MDgyMTA5MDla +# MH4xCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdS +# ZWRtb25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMT +# H01pY3Jvc29mdCBDb2RlIFNpZ25pbmcgUENBIDIwMTEwggIiMA0GCSqGSIb3DQEB +# AQUAA4ICDwAwggIKAoICAQCr8PpyEBwurdhuqoIQTTS68rZYIZ9CGypr6VpQqrgG +# OBoESbp/wwwe3TdrxhLYC/A4wpkGsMg51QEUMULTiQ15ZId+lGAkbK+eSZzpaF7S +# 35tTsgosw6/ZqSuuegmv15ZZymAaBelmdugyUiYSL+erCFDPs0S3XdjELgN1q2jz +# y23zOlyhFvRGuuA4ZKxuZDV4pqBjDy3TQJP4494HDdVceaVJKecNvqATd76UPe/7 +# 4ytaEB9NViiienLgEjq3SV7Y7e1DkYPZe7J7hhvZPrGMXeiJT4Qa8qEvWeSQOy2u +# M1jFtz7+MtOzAz2xsq+SOH7SnYAs9U5WkSE1JcM5bmR/U7qcD60ZI4TL9LoDho33 +# X/DQUr+MlIe8wCF0JV8YKLbMJyg4JZg5SjbPfLGSrhwjp6lm7GEfauEoSZ1fiOIl +# XdMhSz5SxLVXPyQD8NF6Wy/VI+NwXQ9RRnez+ADhvKwCgl/bwBWzvRvUVUvnOaEP +# 6SNJvBi4RHxF5MHDcnrgcuck379GmcXvwhxX24ON7E1JMKerjt/sW5+v/N2wZuLB +# l4F77dbtS+dJKacTKKanfWeA5opieF+yL4TXV5xcv3coKPHtbcMojyyPQDdPweGF +# RInECUzF1KVDL3SV9274eCBYLBNdYJWaPk8zhNqwiBfenk70lrC8RqBsmNLg1oiM +# CwIDAQABo4IB7TCCAekwEAYJKwYBBAGCNxUBBAMCAQAwHQYDVR0OBBYEFEhuZOVQ +# BdOCqhc3NyK1bajKdQKVMBkGCSsGAQQBgjcUAgQMHgoAUwB1AGIAQwBBMAsGA1Ud +# DwQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFHItOgIxkEO5FAVO +# 4eqnxzHRI4k0MFoGA1UdHwRTMFEwT6BNoEuGSWh0dHA6Ly9jcmwubWljcm9zb2Z0 +# LmNvbS9wa2kvY3JsL3Byb2R1Y3RzL01pY1Jvb0NlckF1dDIwMTFfMjAxMV8wM18y +# Mi5jcmwwXgYIKwYBBQUHAQEEUjBQME4GCCsGAQUFBzAChkJodHRwOi8vd3d3Lm1p +# Y3Jvc29mdC5jb20vcGtpL2NlcnRzL01pY1Jvb0NlckF1dDIwMTFfMjAxMV8wM18y +# Mi5jcnQwgZ8GA1UdIASBlzCBlDCBkQYJKwYBBAGCNy4DMIGDMD8GCCsGAQUFBwIB +# FjNodHRwOi8vd3d3Lm1pY3Jvc29mdC5jb20vcGtpb3BzL2RvY3MvcHJpbWFyeWNw +# cy5odG0wQAYIKwYBBQUHAgIwNB4yIB0ATABlAGcAYQBsAF8AcABvAGwAaQBjAHkA +# XwBzAHQAYQB0AGUAbQBlAG4AdAAuIB0wDQYJKoZIhvcNAQELBQADggIBAGfyhqWY +# 4FR5Gi7T2HRnIpsLlhHhY5KZQpZ90nkMkMFlXy4sPvjDctFtg/6+P+gKyju/R6mj +# 82nbY78iNaWXXWWEkH2LRlBV2AySfNIaSxzzPEKLUtCw/WvjPgcuKZvmPRul1LUd +# d5Q54ulkyUQ9eHoj8xN9ppB0g430yyYCRirCihC7pKkFDJvtaPpoLpWgKj8qa1hJ +# Yx8JaW5amJbkg/TAj/NGK978O9C9Ne9uJa7lryft0N3zDq+ZKJeYTQ49C/IIidYf +# wzIY4vDFLc5bnrRJOQrGCsLGra7lstnbFYhRRVg4MnEnGn+x9Cf43iw6IGmYslmJ +# aG5vp7d0w0AFBqYBKig+gj8TTWYLwLNN9eGPfxxvFX1Fp3blQCplo8NdUmKGwx1j +# NpeG39rz+PIWoZon4c2ll9DuXWNB41sHnIc+BncG0QaxdR8UvmFhtfDcxhsEvt9B +# xw4o7t5lL+yX9qFcltgA1qFGvVnzl6UJS0gQmYAf0AApxbGbpT9Fdx41xtKiop96 +# eiL6SJUfq/tHI4D1nvi/a7dLl+LrdXga7Oo3mXkYS//WsyNodeav+vyL6wuA6mk7 +# r/ww7QRMjt/fdW1jkT3RnVZOT7+AVyKheBEyIXrvQQqxP/uozKRdwaGIm1dxVk5I +# RcBCyZt2WwqASGv9eZ/BvW1taslScxMNelDNMYIZjjCCGYoCAQEwgZUwfjELMAkG +# A1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQx +# HjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEoMCYGA1UEAxMfTWljcm9z +# b2Z0IENvZGUgU2lnbmluZyBQQ0EgMjAxMQITMwAAAlKLM6r4lfM52wAAAAACUjAN +# BglghkgBZQMEAgEFAKCBrjAZBgkqhkiG9w0BCQMxDAYKKwYBBAGCNwIBBDAcBgor +# BgEEAYI3AgELMQ4wDAYKKwYBBAGCNwIBFTAvBgkqhkiG9w0BCQQxIgQgpH7D8Not +# WnytrY9dBBVdkjoPJbp/Jb5/OaJtNH+9PHMwQgYKKwYBBAGCNwIBDDE0MDKgFIAS +# AE0AaQBjAHIAbwBzAG8AZgB0oRqAGGh0dHA6Ly93d3cubWljcm9zb2Z0LmNvbTAN +# BgkqhkiG9w0BAQEFAASCAQBeESsu04jkAEIOu00+XAL5Cw3b4lPK1+Y/A63nt7uC +# g0IvVE66lSl52+b6CVBX/G72fi7HlOIYoCyVKEIasUVN+dqAtdM2ib0RLRPrWxH9 +# 2axBlgxQg9nBAZkklffNIZjmkC+gZN37i3g0DHSwmb1ej9OwHDD0MYQpF8oIa81e +# oj07j6dAzRwVM0TaHEJj9kPXA81HN6CAYBJ/V3p0wYRbp3c2L9j2R9MtVVvnx/7z +# sbKvHJV+l3b/xCT5T0/J5l5QoLzzNyfWB7Zvaz0DbKX1bln/rcb8uPYKVEz4wsKW +# 5zAm12WLQ87vxiIGLA6tv4lXxggEAUm68Nwjfw6vqkHRoYIXGDCCFxQGCisGAQQB +# gjcDAwExghcEMIIXAAYJKoZIhvcNAQcCoIIW8TCCFu0CAQMxDzANBglghkgBZQME +# AgEFADCCAVgGCyqGSIb3DQEJEAEEoIIBRwSCAUMwggE/AgEBBgorBgEEAYRZCgMB +# MDEwDQYJYIZIAWUDBAIBBQAEIEbwTnYvqLH2wAcLSr8ZwikKunQnLTH8PEiqd0Vr +# sTtWAgZiMTFcHxoYEjIwMjIwMzMxMTAwMDA4Ljg4WjAEgAIB9KCB2KSB1TCB0jEL +# MAkGA1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1v +# bmQxHjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEtMCsGA1UECxMkTWlj +# cm9zb2Z0IElyZWxhbmQgT3BlcmF0aW9ucyBMaW1pdGVkMSYwJAYDVQQLEx1UaGFs +# ZXMgVFNTIEVTTjpBMjQwLTRCODItMTMwRTElMCMGA1UEAxMcTWljcm9zb2Z0IFRp +# bWUtU3RhbXAgU2VydmljZaCCEWgwggcUMIIE/KADAgECAhMzAAABjXpVLnh0mSq3 +# AAEAAAGNMA0GCSqGSIb3DQEBCwUAMHwxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpX +# YXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNyb3NvZnQg +# Q29ycG9yYXRpb24xJjAkBgNVBAMTHU1pY3Jvc29mdCBUaW1lLVN0YW1wIFBDQSAy +# MDEwMB4XDTIxMTAyODE5Mjc0NVoXDTIzMDEyNjE5Mjc0NVowgdIxCzAJBgNVBAYT +# AlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYD +# VQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xLTArBgNVBAsTJE1pY3Jvc29mdCBJ +# cmVsYW5kIE9wZXJhdGlvbnMgTGltaXRlZDEmMCQGA1UECxMdVGhhbGVzIFRTUyBF +# U046QTI0MC00QjgyLTEzMEUxJTAjBgNVBAMTHE1pY3Jvc29mdCBUaW1lLVN0YW1w +# IFNlcnZpY2UwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDaNEgtmD47 +# pTt0ty7AE8wH7S0lTPTAcuonl/soldCxPNZOgANQxhXjFVmen2Y9NaiNQn+Xc7he +# p6AsM124UA5tyK2svJjkcOzEB9QbX/ZiKVxKRI/oJwypZ+xLBQsZfnOWxUocnu2/ +# CDbrLp4uSVR0UymKrb3hPi4lB1d3k7uYXLS9WRoY8bE1YttnEo3Ooq0WdZDuMy1n +# Tle9p+QhZms1MW/wYakCUe1GxnUDwoOjogNIZU1lldtCz587Aw4an8HOh3x/Vgjw +# Zvag3+bHZxy90av2VrnlBl5Wwzst9NoQ9DFuABwuBYOUg9yZPNwGSwTMs5CxKkHO +# yo9pYj3KRXDmh+auQUoxulBPkQySLay4mhUznEaB1lae3+3PTTG5s9IoWLgHggwV +# QH2ZwA1Sr1wdouwdsMn4BSxU7SqdWPDNc9gl5HsL8HxfRSXpSQh2mVmadxBlIErf +# JlDL6gay4kpcUCrcGXFPqQO6Fhi87uK0us95jSSe63WsqTGib66Lq8J22EJ+cCLK +# SfJELaWSerPPzHWYORDlDo7H2nr+V24W6lIky2CwI8318i+t+mkwMUi9GhQuwc50 +# smOtGWLxyjkz69mZ/bShPFi5fMzS1tG6sQnJwHlkxvDOewUfKY6SDLHw54WddXdx +# qvjm56MjUHWKpQNt5I3Ge9zO46FynPBpyQIDAQABo4IBNjCCATIwHQYDVR0OBBYE +# FHjMkW6Hn0bClO5KO7hJNx+WKGaTMB8GA1UdIwQYMBaAFJ+nFV0AXmJdg/Tl0mWn +# G1M1GelyMF8GA1UdHwRYMFYwVKBSoFCGTmh0dHA6Ly93d3cubWljcm9zb2Z0LmNv +# bS9wa2lvcHMvY3JsL01pY3Jvc29mdCUyMFRpbWUtU3RhbXAlMjBQQ0ElMjAyMDEw +# KDEpLmNybDBsBggrBgEFBQcBAQRgMF4wXAYIKwYBBQUHMAKGUGh0dHA6Ly93d3cu +# bWljcm9zb2Z0LmNvbS9wa2lvcHMvY2VydHMvTWljcm9zb2Z0JTIwVGltZS1TdGFt +# cCUyMFBDQSUyMDIwMTAoMSkuY3J0MAwGA1UdEwEB/wQCMAAwEwYDVR0lBAwwCgYI +# KwYBBQUHAwgwDQYJKoZIhvcNAQELBQADggIBADWvc7PSUSrdW+l0WWHdgHFziGdi +# QAvJg8Nr0U7heCrCQGbwuxv6Ure1sYaCmLpAlsreIzcErQ5sFzBFolULEYsa2von +# P2FG6ZHIXyjifbLdiIq/iiUHE2MVKFIZz0Tb0mZWMGYuCZ+NGo9z/asPbmrijDi4 +# Detz16SJq5+AaFxIB16T+X6QBJvOiE63/nPb4iWBPh7dq5JTO3YYAp8pkHTZkMZY +# op4JjekQuPW26HrJ+s4k88ic7hlktbe+Apq+0vx7oUlnImgMUx7Ann2gQv4Ard7Y +# zYjggUT2fotVLxtL1RsxQy+sCVc3lkzYjwZ0cH1Nt8jXtab/1R/iq7nzw8k3u8Im +# P2z4rFmpdzmwZJwuCqI+ohts1MT78ARn95OLFz1guBPIypqRkjn3AaqOs41BJju7 +# RUQOQQTqKTP4VIVEorOnJJvRZOAy9bGwu9uc3wAKYhI+cEdhmgayw8Avt+gYYoUt +# 0AFNALY9fX1aOt/KuyEd2KpKUKymogYFPFFoe3I8yujcH/bqA98KXcwLesLc0arj +# EacgcNkZKLNSYaDxORACWhV1Tl0nW/3XSCPFrFpStoaE/wi20TRFadTldGn+wZo2 +# YNwzBvIe5KloWyfdDbU7OK0/gGc3m2msdqeAALuOh7jOYueZGcCJRz2xGpDZuaww +# C9Smw7yeU4WaIzUvMIIHcTCCBVmgAwIBAgITMwAAABXF52ueAptJmQAAAAAAFTAN +# BgkqhkiG9w0BAQsFADCBiDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0 +# b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3Jh +# dGlvbjEyMDAGA1UEAxMpTWljcm9zb2Z0IFJvb3QgQ2VydGlmaWNhdGUgQXV0aG9y +# aXR5IDIwMTAwHhcNMjEwOTMwMTgyMjI1WhcNMzAwOTMwMTgzMjI1WjB8MQswCQYD +# VQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEe +# MBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSYwJAYDVQQDEx1NaWNyb3Nv +# ZnQgVGltZS1TdGFtcCBQQ0EgMjAxMDCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCC +# AgoCggIBAOThpkzntHIhC3miy9ckeb0O1YLT/e6cBwfSqWxOdcjKNVf2AX9sSuDi +# vbk+F2Az/1xPx2b3lVNxWuJ+Slr+uDZnhUYjDLWNE893MsAQGOhgfWpSg0S3po5G +# awcU88V29YZQ3MFEyHFcUTE3oAo4bo3t1w/YJlN8OWECesSq/XJprx2rrPY2vjUm +# ZNqYO7oaezOtgFt+jBAcnVL+tuhiJdxqD89d9P6OU8/W7IVWTe/dvI2k45GPsjks +# UZzpcGkNyjYtcI4xyDUoveO0hyTD4MmPfrVUj9z6BVWYbWg7mka97aSueik3rMvr +# g0XnRm7KMtXAhjBcTyziYrLNueKNiOSWrAFKu75xqRdbZ2De+JKRHh09/SDPc31B +# mkZ1zcRfNN0Sidb9pSB9fvzZnkXftnIv231fgLrbqn427DZM9ituqBJR6L8FA6PR +# c6ZNN3SUHDSCD/AQ8rdHGO2n6Jl8P0zbr17C89XYcz1DTsEzOUyOArxCaC4Q6oRR +# RuLRvWoYWmEBc8pnol7XKHYC4jMYctenIPDC+hIK12NvDMk2ZItboKaDIV1fMHSR +# lJTYuVD5C4lh8zYGNRiER9vcG9H9stQcxWv2XFJRXRLbJbqvUAV6bMURHXLvjflS +# xIUXk8A8FdsaN8cIFRg/eKtFtvUeh17aj54WcmnGrnu3tz5q4i6tAgMBAAGjggHd +# MIIB2TASBgkrBgEEAYI3FQEEBQIDAQABMCMGCSsGAQQBgjcVAgQWBBQqp1L+ZMSa +# voKRPEY1Kc8Q/y8E7jAdBgNVHQ4EFgQUn6cVXQBeYl2D9OXSZacbUzUZ6XIwXAYD +# VR0gBFUwUzBRBgwrBgEEAYI3TIN9AQEwQTA/BggrBgEFBQcCARYzaHR0cDovL3d3 +# dy5taWNyb3NvZnQuY29tL3BraW9wcy9Eb2NzL1JlcG9zaXRvcnkuaHRtMBMGA1Ud +# JQQMMAoGCCsGAQUFBwMIMBkGCSsGAQQBgjcUAgQMHgoAUwB1AGIAQwBBMAsGA1Ud +# DwQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFNX2VsuP6KJcYmjR +# PZSQW9fOmhjEMFYGA1UdHwRPME0wS6BJoEeGRWh0dHA6Ly9jcmwubWljcm9zb2Z0 +# LmNvbS9wa2kvY3JsL3Byb2R1Y3RzL01pY1Jvb0NlckF1dF8yMDEwLTA2LTIzLmNy +# bDBaBggrBgEFBQcBAQROMEwwSgYIKwYBBQUHMAKGPmh0dHA6Ly93d3cubWljcm9z +# b2Z0LmNvbS9wa2kvY2VydHMvTWljUm9vQ2VyQXV0XzIwMTAtMDYtMjMuY3J0MA0G +# CSqGSIb3DQEBCwUAA4ICAQCdVX38Kq3hLB9nATEkW+Geckv8qW/qXBS2Pk5HZHix +# BpOXPTEztTnXwnE2P9pkbHzQdTltuw8x5MKP+2zRoZQYIu7pZmc6U03dmLq2HnjY +# Ni6cqYJWAAOwBb6J6Gngugnue99qb74py27YP0h1AdkY3m2CDPVtI1TkeFN1JFe5 +# 3Z/zjj3G82jfZfakVqr3lbYoVSfQJL1AoL8ZthISEV09J+BAljis9/kpicO8F7BU +# hUKz/AyeixmJ5/ALaoHCgRlCGVJ1ijbCHcNhcy4sa3tuPywJeBTpkbKpW99Jo3QM +# vOyRgNI95ko+ZjtPu4b6MhrZlvSP9pEB9s7GdP32THJvEKt1MMU0sHrYUP4KWN1A +# PMdUbZ1jdEgssU5HLcEUBHG/ZPkkvnNtyo4JvbMBV0lUZNlz138eW0QBjloZkWsN +# n6Qo3GcZKCS6OEuabvshVGtqRRFHqfG3rsjoiV5PndLQTHa1V1QJsWkBRH58oWFs +# c/4Ku+xBZj1p/cvBQUl+fpO+y/g75LcVv7TOPqUxUYS8vwLBgqJ7Fx0ViY1w/ue1 +# 0CgaiQuPNtq6TPmb/wrpNPgkNWcr4A245oyZ1uEi6vAnQj0llOZ0dFtq0Z4+7X6g +# MTN9vMvpe784cETRkPHIqzqKOghif9lwY1NNje6CbaUFEMFxBmoQtB1VM1izoXBm +# 8qGCAtcwggJAAgEBMIIBAKGB2KSB1TCB0jELMAkGA1UEBhMCVVMxEzARBgNVBAgT +# Cldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jvc29m +# dCBDb3Jwb3JhdGlvbjEtMCsGA1UECxMkTWljcm9zb2Z0IElyZWxhbmQgT3BlcmF0 +# aW9ucyBMaW1pdGVkMSYwJAYDVQQLEx1UaGFsZXMgVFNTIEVTTjpBMjQwLTRCODIt +# MTMwRTElMCMGA1UEAxMcTWljcm9zb2Z0IFRpbWUtU3RhbXAgU2VydmljZaIjCgEB +# MAcGBSsOAwIaAxUAgHOVkz1NE0Pg+C2ktZBmRI9hVwmggYMwgYCkfjB8MQswCQYD +# VQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEe +# MBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSYwJAYDVQQDEx1NaWNyb3Nv +# ZnQgVGltZS1TdGFtcCBQQ0EgMjAxMDANBgkqhkiG9w0BAQUFAAIFAOXvddYwIhgP +# MjAyMjAzMzEwODM1MzRaGA8yMDIyMDQwMTA4MzUzNFowdzA9BgorBgEEAYRZCgQB +# MS8wLTAKAgUA5e911gIBADAKAgEAAgIXqQIB/zAHAgEAAgIRHzAKAgUA5fDHVgIB +# ADA2BgorBgEEAYRZCgQCMSgwJjAMBgorBgEEAYRZCgMCoAowCAIBAAIDB6EgoQow +# CAIBAAIDAYagMA0GCSqGSIb3DQEBBQUAA4GBABjrSR17sdYAEtszvl2BWos/C7ZR +# fepANqhK1OqRLv3nelgcpzoYSpF3+csIJ5gGoL5clExMw1t3hkOSQLOzGWvkcWIY +# Tp5Pv4q/CpB/52Mrn1kC2zSej1E9lx0InBB++pTdEr3WCn9KDZsIy8B9M3gtEamp +# Di1hg/Yaskk2pVuQMYIEDTCCBAkCAQEwgZMwfDELMAkGA1UEBhMCVVMxEzARBgNV +# BAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jv +# c29mdCBDb3Jwb3JhdGlvbjEmMCQGA1UEAxMdTWljcm9zb2Z0IFRpbWUtU3RhbXAg +# UENBIDIwMTACEzMAAAGNelUueHSZKrcAAQAAAY0wDQYJYIZIAWUDBAIBBQCgggFK +# MBoGCSqGSIb3DQEJAzENBgsqhkiG9w0BCRABBDAvBgkqhkiG9w0BCQQxIgQgv72G +# 0X2zWUJuJvjSqtgMZ02BVYmEgLTkIUsRp8UHvXIwgfoGCyqGSIb3DQEJEAIvMYHq +# MIHnMIHkMIG9BCCelhEz+h1eQMCfN/a50vnr1bxx8ZODBW56dDy20hjNfzCBmDCB +# gKR+MHwxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQH +# EwdSZWRtb25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xJjAkBgNV +# BAMTHU1pY3Jvc29mdCBUaW1lLVN0YW1wIFBDQSAyMDEwAhMzAAABjXpVLnh0mSq3 +# AAEAAAGNMCIEIKC8K55Td1F8Kw4pKkbmiSw7Hb/xIcUSNIsHKB52X2hTMA0GCSqG +# SIb3DQEBCwUABIICAMsOXK3vJQX7Jt2lDwVppNTdiboPDVwXRfezsK8NLGK7wZhp +# e/fEsGp3kFdqmeiDT/QGZV+ixnGjOTyJSaq6+wtvZyqKLUoEkhD9g+hFk23Hn3ui +# RiAp6LSf263zzgNQ9SbNssjiOChkILaTpt+GeV+lHAH6N412gYM7pbVyw9v7jvx+ +# Mp+iFKUVQAqZZDGm55MyTqfVdPeb8YpN9pqPSYG4ruCTwZBYGI+p7LFuKgQqF+FB +# 2KTqsTuxoHI6HAV3OibJcIFKQLFxaHjD0/YjYeZSoMUMD/ojZpdEoFrLtTXmIZ2e +# yOFKcX1LMzwwHhEpOpc9m9g4/B2kYTHUl1hFupXEu9PZnNa0IweqtM/GdX/Ji/// +# JRcDe8vtLNQz7z8ZQF28k1ufRDGfm5YIQDHu9Zx33gbpsWIyGZMmlbU4UMJDvAbM +# +sCYtGGLcMEObyiurnDOF4dix7QAdLWqGG2YiyZ9u0T/hRLi3THXhLGK5Xt4dgBk +# aeyJv7T3ZPfsbu8a10lgFkyVbmJt6up2OZbaqW1PjmvgtcsNmRyhD9oSZzOXdTiW +# iIGeLtHEkiSvZnWbaDqpx7ahcaHsmS5QvwWkYGGx1uHMOwJHuFq7jKPo3SYMxAwq +# GQW+QTZroDYL+UTfaUobfPyrS3bDw3L7xVqOOBwGidlOwx3ZYU4mNlSbfCN3 +# SIG # End signature block diff --git a/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/StartupScripts/InitializeAssemblyResolver.ps1 b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/StartupScripts/InitializeAssemblyResolver.ps1 new file mode 100644 index 000000000000..4e557723dc33 --- /dev/null +++ b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/StartupScripts/InitializeAssemblyResolver.ps1 @@ -0,0 +1,234 @@ +if ($PSEdition -eq 'Desktop') { + try { + [Microsoft.Azure.Commands.Profile.Utilities.CustomAssemblyResolver]::Initialize() + } + catch { + Write-Warning $_ + } +} +else { + try { + Add-Type -Path ([System.IO.Path]::Combine($PSScriptRoot, "..", "Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.dll")) | Out-Null + $assemblyLoadContextFolder = [System.IO.Path]::Combine($PSScriptRoot, "..", "AzSharedAlcAssemblies") + Write-Debug "Registering Az shared AssemblyLoadContext for path: '$assemblyLoadContextFolder'." + [Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.AzAssemblyLoadContextInitializer]::RegisterAzSharedAssemblyLoadContext($assemblyLoadContextFolder) + Write-Debug "AssemblyLoadContext registered." + } + catch { + Write-Warning $_ + } +} +# SIG # Begin signature block +# MIInrQYJKoZIhvcNAQcCoIInnjCCJ5oCAQExDzANBglghkgBZQMEAgEFADB5Bgor +# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG +# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCCfno9x0LEd5gPe +# 4cvAg6ULJtMLR6g+Xis+I4rbSZlHZqCCDYEwggX/MIID56ADAgECAhMzAAACUosz +# qviV8znbAAAAAAJSMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD +# VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01pY3Jvc29mdCBDb2RlIFNpZ25p +# bmcgUENBIDIwMTEwHhcNMjEwOTAyMTgzMjU5WhcNMjIwOTAxMTgzMjU5WjB0MQsw +# CQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9u +# ZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMR4wHAYDVQQDExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB +# AQDQ5M+Ps/X7BNuv5B/0I6uoDwj0NJOo1KrVQqO7ggRXccklyTrWL4xMShjIou2I +# sbYnF67wXzVAq5Om4oe+LfzSDOzjcb6ms00gBo0OQaqwQ1BijyJ7NvDf80I1fW9O +# L76Kt0Wpc2zrGhzcHdb7upPrvxvSNNUvxK3sgw7YTt31410vpEp8yfBEl/hd8ZzA +# v47DCgJ5j1zm295s1RVZHNp6MoiQFVOECm4AwK2l28i+YER1JO4IplTH44uvzX9o +# RnJHaMvWzZEpozPy4jNO2DDqbcNs4zh7AWMhE1PWFVA+CHI/En5nASvCvLmuR/t8 +# q4bc8XR8QIZJQSp+2U6m2ldNAgMBAAGjggF+MIIBejAfBgNVHSUEGDAWBgorBgEE +# AYI3TAgBBggrBgEFBQcDAzAdBgNVHQ4EFgQUNZJaEUGL2Guwt7ZOAu4efEYXedEw +# UAYDVR0RBEkwR6RFMEMxKTAnBgNVBAsTIE1pY3Jvc29mdCBPcGVyYXRpb25zIFB1 +# ZXJ0byBSaWNvMRYwFAYDVQQFEw0yMzAwMTIrNDY3NTk3MB8GA1UdIwQYMBaAFEhu +# ZOVQBdOCqhc3NyK1bajKdQKVMFQGA1UdHwRNMEswSaBHoEWGQ2h0dHA6Ly93d3cu +# bWljcm9zb2Z0LmNvbS9wa2lvcHMvY3JsL01pY0NvZFNpZ1BDQTIwMTFfMjAxMS0w +# Ny0wOC5jcmwwYQYIKwYBBQUHAQEEVTBTMFEGCCsGAQUFBzAChkVodHRwOi8vd3d3 +# Lm1pY3Jvc29mdC5jb20vcGtpb3BzL2NlcnRzL01pY0NvZFNpZ1BDQTIwMTFfMjAx +# MS0wNy0wOC5jcnQwDAYDVR0TAQH/BAIwADANBgkqhkiG9w0BAQsFAAOCAgEAFkk3 +# uSxkTEBh1NtAl7BivIEsAWdgX1qZ+EdZMYbQKasY6IhSLXRMxF1B3OKdR9K/kccp +# kvNcGl8D7YyYS4mhCUMBR+VLrg3f8PUj38A9V5aiY2/Jok7WZFOAmjPRNNGnyeg7 +# l0lTiThFqE+2aOs6+heegqAdelGgNJKRHLWRuhGKuLIw5lkgx9Ky+QvZrn/Ddi8u +# TIgWKp+MGG8xY6PBvvjgt9jQShlnPrZ3UY8Bvwy6rynhXBaV0V0TTL0gEx7eh/K1 +# o8Miaru6s/7FyqOLeUS4vTHh9TgBL5DtxCYurXbSBVtL1Fj44+Od/6cmC9mmvrti +# yG709Y3Rd3YdJj2f3GJq7Y7KdWq0QYhatKhBeg4fxjhg0yut2g6aM1mxjNPrE48z +# 6HWCNGu9gMK5ZudldRw4a45Z06Aoktof0CqOyTErvq0YjoE4Xpa0+87T/PVUXNqf +# 7Y+qSU7+9LtLQuMYR4w3cSPjuNusvLf9gBnch5RqM7kaDtYWDgLyB42EfsxeMqwK +# WwA+TVi0HrWRqfSx2olbE56hJcEkMjOSKz3sRuupFCX3UroyYf52L+2iVTrda8XW +# esPG62Mnn3T8AuLfzeJFuAbfOSERx7IFZO92UPoXE1uEjL5skl1yTZB3MubgOA4F +# 8KoRNhviFAEST+nG8c8uIsbZeb08SeYQMqjVEmkwggd6MIIFYqADAgECAgphDpDS +# AAAAAAADMA0GCSqGSIb3DQEBCwUAMIGIMQswCQYDVQQGEwJVUzETMBEGA1UECBMK +# V2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0 +# IENvcnBvcmF0aW9uMTIwMAYDVQQDEylNaWNyb3NvZnQgUm9vdCBDZXJ0aWZpY2F0 +# ZSBBdXRob3JpdHkgMjAxMTAeFw0xMTA3MDgyMDU5MDlaFw0yNjA3MDgyMTA5MDla +# MH4xCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdS +# ZWRtb25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMT +# H01pY3Jvc29mdCBDb2RlIFNpZ25pbmcgUENBIDIwMTEwggIiMA0GCSqGSIb3DQEB +# AQUAA4ICDwAwggIKAoICAQCr8PpyEBwurdhuqoIQTTS68rZYIZ9CGypr6VpQqrgG +# OBoESbp/wwwe3TdrxhLYC/A4wpkGsMg51QEUMULTiQ15ZId+lGAkbK+eSZzpaF7S +# 35tTsgosw6/ZqSuuegmv15ZZymAaBelmdugyUiYSL+erCFDPs0S3XdjELgN1q2jz +# y23zOlyhFvRGuuA4ZKxuZDV4pqBjDy3TQJP4494HDdVceaVJKecNvqATd76UPe/7 +# 4ytaEB9NViiienLgEjq3SV7Y7e1DkYPZe7J7hhvZPrGMXeiJT4Qa8qEvWeSQOy2u +# M1jFtz7+MtOzAz2xsq+SOH7SnYAs9U5WkSE1JcM5bmR/U7qcD60ZI4TL9LoDho33 +# X/DQUr+MlIe8wCF0JV8YKLbMJyg4JZg5SjbPfLGSrhwjp6lm7GEfauEoSZ1fiOIl +# XdMhSz5SxLVXPyQD8NF6Wy/VI+NwXQ9RRnez+ADhvKwCgl/bwBWzvRvUVUvnOaEP +# 6SNJvBi4RHxF5MHDcnrgcuck379GmcXvwhxX24ON7E1JMKerjt/sW5+v/N2wZuLB +# l4F77dbtS+dJKacTKKanfWeA5opieF+yL4TXV5xcv3coKPHtbcMojyyPQDdPweGF +# RInECUzF1KVDL3SV9274eCBYLBNdYJWaPk8zhNqwiBfenk70lrC8RqBsmNLg1oiM +# CwIDAQABo4IB7TCCAekwEAYJKwYBBAGCNxUBBAMCAQAwHQYDVR0OBBYEFEhuZOVQ +# BdOCqhc3NyK1bajKdQKVMBkGCSsGAQQBgjcUAgQMHgoAUwB1AGIAQwBBMAsGA1Ud +# DwQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFHItOgIxkEO5FAVO +# 4eqnxzHRI4k0MFoGA1UdHwRTMFEwT6BNoEuGSWh0dHA6Ly9jcmwubWljcm9zb2Z0 +# LmNvbS9wa2kvY3JsL3Byb2R1Y3RzL01pY1Jvb0NlckF1dDIwMTFfMjAxMV8wM18y +# Mi5jcmwwXgYIKwYBBQUHAQEEUjBQME4GCCsGAQUFBzAChkJodHRwOi8vd3d3Lm1p +# Y3Jvc29mdC5jb20vcGtpL2NlcnRzL01pY1Jvb0NlckF1dDIwMTFfMjAxMV8wM18y +# Mi5jcnQwgZ8GA1UdIASBlzCBlDCBkQYJKwYBBAGCNy4DMIGDMD8GCCsGAQUFBwIB +# FjNodHRwOi8vd3d3Lm1pY3Jvc29mdC5jb20vcGtpb3BzL2RvY3MvcHJpbWFyeWNw +# cy5odG0wQAYIKwYBBQUHAgIwNB4yIB0ATABlAGcAYQBsAF8AcABvAGwAaQBjAHkA +# XwBzAHQAYQB0AGUAbQBlAG4AdAAuIB0wDQYJKoZIhvcNAQELBQADggIBAGfyhqWY +# 4FR5Gi7T2HRnIpsLlhHhY5KZQpZ90nkMkMFlXy4sPvjDctFtg/6+P+gKyju/R6mj +# 82nbY78iNaWXXWWEkH2LRlBV2AySfNIaSxzzPEKLUtCw/WvjPgcuKZvmPRul1LUd +# d5Q54ulkyUQ9eHoj8xN9ppB0g430yyYCRirCihC7pKkFDJvtaPpoLpWgKj8qa1hJ +# Yx8JaW5amJbkg/TAj/NGK978O9C9Ne9uJa7lryft0N3zDq+ZKJeYTQ49C/IIidYf +# wzIY4vDFLc5bnrRJOQrGCsLGra7lstnbFYhRRVg4MnEnGn+x9Cf43iw6IGmYslmJ +# aG5vp7d0w0AFBqYBKig+gj8TTWYLwLNN9eGPfxxvFX1Fp3blQCplo8NdUmKGwx1j +# NpeG39rz+PIWoZon4c2ll9DuXWNB41sHnIc+BncG0QaxdR8UvmFhtfDcxhsEvt9B +# xw4o7t5lL+yX9qFcltgA1qFGvVnzl6UJS0gQmYAf0AApxbGbpT9Fdx41xtKiop96 +# eiL6SJUfq/tHI4D1nvi/a7dLl+LrdXga7Oo3mXkYS//WsyNodeav+vyL6wuA6mk7 +# r/ww7QRMjt/fdW1jkT3RnVZOT7+AVyKheBEyIXrvQQqxP/uozKRdwaGIm1dxVk5I +# RcBCyZt2WwqASGv9eZ/BvW1taslScxMNelDNMYIZgjCCGX4CAQEwgZUwfjELMAkG +# A1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQx +# HjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEoMCYGA1UEAxMfTWljcm9z +# b2Z0IENvZGUgU2lnbmluZyBQQ0EgMjAxMQITMwAAAlKLM6r4lfM52wAAAAACUjAN +# BglghkgBZQMEAgEFAKCBrjAZBgkqhkiG9w0BCQMxDAYKKwYBBAGCNwIBBDAcBgor +# BgEEAYI3AgELMQ4wDAYKKwYBBAGCNwIBFTAvBgkqhkiG9w0BCQQxIgQgyFkgUqEG +# ohT1KbDw544Hgmj3zWoOXkAlMHIwAyFcowAwQgYKKwYBBAGCNwIBDDE0MDKgFIAS +# AE0AaQBjAHIAbwBzAG8AZgB0oRqAGGh0dHA6Ly93d3cubWljcm9zb2Z0LmNvbTAN +# BgkqhkiG9w0BAQEFAASCAQCa0t0uHrS1Z8rXJEETxc2oe78Dv4Qo198ub5+3zLvP +# Uwb+RkVmouToXjo3dapicrrP8ELcphopBonxGcVJFdu9HT8uuwL9KEp0yDpjUxKA +# 0yPVc1pc+f5vmlLY1kyUHMb9Deahzp5oJnL6NLyupJ8w6DLb21SCiIWl71l5vf2B +# i8Nx+jIjxGEC5Emqk6GLFAjR4TR6KO1j6gkHutOu3k0Q/+CgvgEwPbwtBXjcE9jV +# u7AZ6Iu5mE8q7NQ01GwWUMs13xpWLxE8HgvWtu3ozXjFeFaG3u9NEyx/zlkEB1cS +# Ntqh/F34ovkTvJxnIBPSRZfGubCV0fp9Qm0gXxrz3y/roYIXDDCCFwgGCisGAQQB +# gjcDAwExghb4MIIW9AYJKoZIhvcNAQcCoIIW5TCCFuECAQMxDzANBglghkgBZQME +# AgEFADCCAVUGCyqGSIb3DQEJEAEEoIIBRASCAUAwggE8AgEBBgorBgEEAYRZCgMB +# MDEwDQYJYIZIAWUDBAIBBQAEIBvIyrpwHucEdb9YUkDCNmUPQk1ErTyZteMy3AB+ +# P++VAgZiL7Y+PNcYEzIwMjIwMzMxMTAwMDA5LjE3NlowBIACAfSggdSkgdEwgc4x +# CzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRt +# b25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xKTAnBgNVBAsTIE1p +# Y3Jvc29mdCBPcGVyYXRpb25zIFB1ZXJ0byBSaWNvMSYwJAYDVQQLEx1UaGFsZXMg +# VFNTIEVTTjo2MEJDLUUzODMtMjYzNTElMCMGA1UEAxMcTWljcm9zb2Z0IFRpbWUt +# U3RhbXAgU2VydmljZaCCEV8wggcQMIIE+KADAgECAhMzAAABpllFgzlNnutLAAEA +# AAGmMA0GCSqGSIb3DQEBCwUAMHwxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNo +# aW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29y +# cG9yYXRpb24xJjAkBgNVBAMTHU1pY3Jvc29mdCBUaW1lLVN0YW1wIFBDQSAyMDEw +# MB4XDTIyMDMwMjE4NTEyMVoXDTIzMDUxMTE4NTEyMVowgc4xCzAJBgNVBAYTAlVT +# MRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQK +# ExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xKTAnBgNVBAsTIE1pY3Jvc29mdCBPcGVy +# YXRpb25zIFB1ZXJ0byBSaWNvMSYwJAYDVQQLEx1UaGFsZXMgVFNTIEVTTjo2MEJD +# LUUzODMtMjYzNTElMCMGA1UEAxMcTWljcm9zb2Z0IFRpbWUtU3RhbXAgU2Vydmlj +# ZTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBANmYv3tSI+fJ/NQJnjz7 +# JvCnc+Xm0rKoe9YKD4MvMYCul7egdrT/zv5vFbQgjNQ74672fNweaztkR65V8y29 +# u5PL2sf01p+uche0Zu4tSig+GsQ6ZQl9tjPRAY/3ITBHDeIYyvq8Wne9+7NoPLhx +# DSO6dtX7YCuQ4zcTP3SE6MvB4b5NighdtvoZVaYk1lXpjUTfdmKoX1ABq1sJbULS +# nSi0Qd4vvl3mZ9jxwv9dR/nlZP62lrZYZq7LPtHD6BlmclB5PT89DnSm1sjaZnFH +# rKzOsmq5GlmL5SFugCCZOoKz133FJeQaFMcXBZSCQjNABWBbHIRCE1ysHHG83Ddo +# nRmnC8EOlYeRwTWz/QCz6q0riOIbYyC/A2BgUEpu9/9EymrTsyMr2/zS8GdEybQ5 +# W7f0WrcrmKB/Y62+g6TmfOS8NtU+L1jGoKNG6Q5RlfJwZu8J/Q9dl4OxyHKuy78+ +# wm6HsF7uAizpsWh63UUaoK/OGQiBG3NJ+kef5eWpnva4ZJfhAnqYTAZD1uHgf8Vf +# Qjnl0BB2YXzK9WaTqde8d+8qCxVKr5hJYvbO+X3+2k5PCirUK/SboreX+xUhVaQE +# hVDYqlatyPttI7Z2IrkhMzwFvc+p0QeyMiNmo2cBZejx8icDOcUidwymDUYqGPE7 +# MA8vtKW3feeSSYJsCEkuUO/vAgMBAAGjggE2MIIBMjAdBgNVHQ4EFgQUOlQhO/zG +# lqK99UkNL/Gu/AryN9gwHwYDVR0jBBgwFoAUn6cVXQBeYl2D9OXSZacbUzUZ6XIw +# XwYDVR0fBFgwVjBUoFKgUIZOaHR0cDovL3d3dy5taWNyb3NvZnQuY29tL3BraW9w +# cy9jcmwvTWljcm9zb2Z0JTIwVGltZS1TdGFtcCUyMFBDQSUyMDIwMTAoMSkuY3Js +# MGwGCCsGAQUFBwEBBGAwXjBcBggrBgEFBQcwAoZQaHR0cDovL3d3dy5taWNyb3Nv +# ZnQuY29tL3BraW9wcy9jZXJ0cy9NaWNyb3NvZnQlMjBUaW1lLVN0YW1wJTIwUENB +# JTIwMjAxMCgxKS5jcnQwDAYDVR0TAQH/BAIwADATBgNVHSUEDDAKBggrBgEFBQcD +# CDANBgkqhkiG9w0BAQsFAAOCAgEAgMDxWDTpGqLnFoPhm/iDfwHGF8xr2NbrJl8e +# gEg2ThTJsTf0wBE+ZQsnYfrRmXBbe6sCXLVN70qPuI+OEbN5MOai7Bue1/4j5VTk +# WquH5GZeVat2N+dD7lSUWp0dU8j+uBhBL5GFSmoDVVm+zW2GR2juPI1v254AJTb2 +# l458anlkJjGvmYn2BtRS13h/wDR7hrQaI7BgdyHWAV5+HEj5UhrIrrvtwJiivSaU +# EA3qK6ZK/rZIQv/uORDkONw+2pHHIE1SXm/WIlhrVS2HIogfr3JjqvZion6LJSD7 +# 41j8xVDLiClwAbspHoVFjxtxBcMjqPx6aWCJS8vjSoTnhkV4PO55mqsM7Q8XQRGQ +# hA7w4zNQOJu9kD4xFdYpPUmLN/daIcEElofBjGz+sEd1B4yqqIk3u2G4VygTXFmt +# hL8chSo7r+GIvTqWKhSA/sanS4N3jCgCCe3FTSJsp4g5nwavLvWAtzcOIvSRorGm +# AeN0m2wgzBK95T/qgrGGDXSos1JNDWRVBnP0qsw1Qoq5G0D8hxvQPs3X43KBv1GJ +# l0wo5rcC+9OMWxJlB63gtToQsA1CErYoYLMZtUzJL74jwZk/grpHEQhIhB3sneC8 +# wzGKJuft7YO/HWCpuwdChIjynTnBh+yFGMdg3wRrIbOcw/iKmXZopMTQMOcmIeIw +# JAezA7AwggdxMIIFWaADAgECAhMzAAAAFcXna54Cm0mZAAAAAAAVMA0GCSqGSIb3 +# DQEBCwUAMIGIMQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4G +# A1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMTIw +# MAYDVQQDEylNaWNyb3NvZnQgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkgMjAx +# MDAeFw0yMTA5MzAxODIyMjVaFw0zMDA5MzAxODMyMjVaMHwxCzAJBgNVBAYTAlVT +# MRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQK +# ExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xJjAkBgNVBAMTHU1pY3Jvc29mdCBUaW1l +# LVN0YW1wIFBDQSAyMDEwMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA +# 5OGmTOe0ciELeaLL1yR5vQ7VgtP97pwHB9KpbE51yMo1V/YBf2xK4OK9uT4XYDP/ +# XE/HZveVU3Fa4n5KWv64NmeFRiMMtY0Tz3cywBAY6GB9alKDRLemjkZrBxTzxXb1 +# hlDcwUTIcVxRMTegCjhuje3XD9gmU3w5YQJ6xKr9cmmvHaus9ja+NSZk2pg7uhp7 +# M62AW36MEBydUv626GIl3GoPz130/o5Tz9bshVZN7928jaTjkY+yOSxRnOlwaQ3K +# Ni1wjjHINSi947SHJMPgyY9+tVSP3PoFVZhtaDuaRr3tpK56KTesy+uDRedGbsoy +# 1cCGMFxPLOJiss254o2I5JasAUq7vnGpF1tnYN74kpEeHT39IM9zfUGaRnXNxF80 +# 3RKJ1v2lIH1+/NmeRd+2ci/bfV+AutuqfjbsNkz2K26oElHovwUDo9Fzpk03dJQc +# NIIP8BDyt0cY7afomXw/TNuvXsLz1dhzPUNOwTM5TI4CvEJoLhDqhFFG4tG9ahha +# YQFzymeiXtcodgLiMxhy16cg8ML6EgrXY28MyTZki1ugpoMhXV8wdJGUlNi5UPkL +# iWHzNgY1GIRH29wb0f2y1BzFa/ZcUlFdEtsluq9QBXpsxREdcu+N+VLEhReTwDwV +# 2xo3xwgVGD94q0W29R6HXtqPnhZyacaue7e3PmriLq0CAwEAAaOCAd0wggHZMBIG +# CSsGAQQBgjcVAQQFAgMBAAEwIwYJKwYBBAGCNxUCBBYEFCqnUv5kxJq+gpE8RjUp +# zxD/LwTuMB0GA1UdDgQWBBSfpxVdAF5iXYP05dJlpxtTNRnpcjBcBgNVHSAEVTBT +# MFEGDCsGAQQBgjdMg30BATBBMD8GCCsGAQUFBwIBFjNodHRwOi8vd3d3Lm1pY3Jv +# c29mdC5jb20vcGtpb3BzL0RvY3MvUmVwb3NpdG9yeS5odG0wEwYDVR0lBAwwCgYI +# KwYBBQUHAwgwGQYJKwYBBAGCNxQCBAweCgBTAHUAYgBDAEEwCwYDVR0PBAQDAgGG +# MA8GA1UdEwEB/wQFMAMBAf8wHwYDVR0jBBgwFoAU1fZWy4/oolxiaNE9lJBb186a +# GMQwVgYDVR0fBE8wTTBLoEmgR4ZFaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3Br +# aS9jcmwvcHJvZHVjdHMvTWljUm9vQ2VyQXV0XzIwMTAtMDYtMjMuY3JsMFoGCCsG +# AQUFBwEBBE4wTDBKBggrBgEFBQcwAoY+aHR0cDovL3d3dy5taWNyb3NvZnQuY29t +# L3BraS9jZXJ0cy9NaWNSb29DZXJBdXRfMjAxMC0wNi0yMy5jcnQwDQYJKoZIhvcN +# AQELBQADggIBAJ1VffwqreEsH2cBMSRb4Z5yS/ypb+pcFLY+TkdkeLEGk5c9MTO1 +# OdfCcTY/2mRsfNB1OW27DzHkwo/7bNGhlBgi7ulmZzpTTd2YurYeeNg2LpypglYA +# A7AFvonoaeC6Ce5732pvvinLbtg/SHUB2RjebYIM9W0jVOR4U3UkV7ndn/OOPcbz +# aN9l9qRWqveVtihVJ9AkvUCgvxm2EhIRXT0n4ECWOKz3+SmJw7wXsFSFQrP8DJ6L +# GYnn8AtqgcKBGUIZUnWKNsIdw2FzLixre24/LAl4FOmRsqlb30mjdAy87JGA0j3m +# Sj5mO0+7hvoyGtmW9I/2kQH2zsZ0/fZMcm8Qq3UwxTSwethQ/gpY3UA8x1RtnWN0 +# SCyxTkctwRQEcb9k+SS+c23Kjgm9swFXSVRk2XPXfx5bRAGOWhmRaw2fpCjcZxko +# JLo4S5pu+yFUa2pFEUep8beuyOiJXk+d0tBMdrVXVAmxaQFEfnyhYWxz/gq77EFm +# PWn9y8FBSX5+k77L+DvktxW/tM4+pTFRhLy/AsGConsXHRWJjXD+57XQKBqJC482 +# 2rpM+Zv/Cuk0+CQ1ZyvgDbjmjJnW4SLq8CdCPSWU5nR0W2rRnj7tfqAxM328y+l7 +# vzhwRNGQ8cirOoo6CGJ/2XBjU02N7oJtpQUQwXEGahC0HVUzWLOhcGbyoYIC0jCC +# AjsCAQEwgfyhgdSkgdEwgc4xCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5n +# dG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9y +# YXRpb24xKTAnBgNVBAsTIE1pY3Jvc29mdCBPcGVyYXRpb25zIFB1ZXJ0byBSaWNv +# MSYwJAYDVQQLEx1UaGFsZXMgVFNTIEVTTjo2MEJDLUUzODMtMjYzNTElMCMGA1UE +# AxMcTWljcm9zb2Z0IFRpbWUtU3RhbXAgU2VydmljZaIjCgEBMAcGBSsOAwIaAxUA +# anQzrZW9TB93Ve7Pa4UPao2ffK2ggYMwgYCkfjB8MQswCQYDVQQGEwJVUzETMBEG +# A1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWlj +# cm9zb2Z0IENvcnBvcmF0aW9uMSYwJAYDVQQDEx1NaWNyb3NvZnQgVGltZS1TdGFt +# cCBQQ0EgMjAxMDANBgkqhkiG9w0BAQUFAAIFAOXv9TcwIhgPMjAyMjAzMzExMzM5 +# MDNaGA8yMDIyMDQwMTEzMzkwM1owdzA9BgorBgEEAYRZCgQBMS8wLTAKAgUA5e/1 +# NwIBADAKAgEAAgIlMAIB/zAHAgEAAgIRCDAKAgUA5fFGtwIBADA2BgorBgEEAYRZ +# CgQCMSgwJjAMBgorBgEEAYRZCgMCoAowCAIBAAIDB6EgoQowCAIBAAIDAYagMA0G +# CSqGSIb3DQEBBQUAA4GBALD1RzDUwq+H9m0MSYjCz5wQ1OtK2kysUfWmpMU4m/5I +# had8kbNZdJ3KIrx0YGBUzNZ+Lq0oh2bND8oZcOvd2Hp24j+V7qoE3si8uVWGudxS +# modF1/mMXXk9ekKyQlZEjz3BMuu37KSyigsrBtFsCP8HOYXKBGcDbc6qn5XH4yKD +# MYIEDTCCBAkCAQEwgZMwfDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0 +# b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3Jh +# dGlvbjEmMCQGA1UEAxMdTWljcm9zb2Z0IFRpbWUtU3RhbXAgUENBIDIwMTACEzMA +# AAGmWUWDOU2e60sAAQAAAaYwDQYJYIZIAWUDBAIBBQCgggFKMBoGCSqGSIb3DQEJ +# AzENBgsqhkiG9w0BCRABBDAvBgkqhkiG9w0BCQQxIgQgBSF4kR8GItz8rwRGC1l8 +# k8ybbSy8clYGHzCOxkaX3MUwgfoGCyqGSIb3DQEJEAIvMYHqMIHnMIHkMIG9BCCD +# CxmLwz90fWvhMKbJTAQaKt3DoXeiAhfp8TD9tgSrDTCBmDCBgKR+MHwxCzAJBgNV +# BAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4w +# HAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xJjAkBgNVBAMTHU1pY3Jvc29m +# dCBUaW1lLVN0YW1wIFBDQSAyMDEwAhMzAAABpllFgzlNnutLAAEAAAGmMCIEIBah +# XRJ2u8MV3DcxWnj3RsKu1063lhZi+mCg8CTJsOXVMA0GCSqGSIb3DQEBCwUABIIC +# AKwjzxsDe/9a9+S3w9P62SVFf6qdfGVu9TFSVozXaesncRAk2r5PYVIzQBLXEctH +# uMjKgizzU+OOxm1sxXQFxUa56d7W+W0Jg7ULtoKBKPQtEUN5uAo4j2bxZGMLqPMd +# DR5oFeKvtuIUk4DiXx02gUT6GITVUnFkkHt4y9j9PwZb7TNlan8/wTeTHO0kH2QZ +# xSt9oLx0jSb5/nBUCAE7G38h6P29oMvljU4xleVaSon0n73QlTg/hMAedxBVDol7 +# ZFh6Q93jDq/8l4XsA4y1UIObDo/8NxDvISc2tYeybT++wrtwkOLw6jpWXezk4uA3 +# cPi5rfOQhiBPG8dLCT9SWelaQWFq6wDL/wWQWWohrMVGaRoIp+p7TrRTUl3eoGIW +# lvUbTuUotQzzmQY1Zf8S4g430lulVYqdenhq6E3mzdU9VjueouAji4yYyJ8jeZmz +# c2e2W3goWOO5UWBujRETmFekpuj1cPiQ1en4QlRDeDHIgUa8OQcFbhof3cXZ0+CM +# mFYy5NofggR5oWN1IO6TAGc5w4tn+6i5RrR+C464W7R39A8peRCPXpZHMX5Nfinl +# McxNzvCRdwxdwMcfAl5fbvKiHAMFVaJlU8YkDHxtshVTBTAdB5scvBwEfVBqTRgN +# Y3evpxNmLhQ49mbUo+IsGdgKb4wU3AOkvXBDIVg0/Ll+ +# SIG # End signature block diff --git a/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/[Content_Types].xml b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/[Content_Types].xml new file mode 100644 index 000000000000..95d6227f2ef8 --- /dev/null +++ b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/[Content_Types].xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/_rels/.rels b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/_rels/.rels new file mode 100644 index 000000000000..95479a0e6d24 --- /dev/null +++ b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/_rels/.rels @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/en-US/about_az.help.txt b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/en-US/about_az.help.txt new file mode 100644 index 000000000000..7e294d272854 --- /dev/null +++ b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/en-US/about_az.help.txt @@ -0,0 +1,50 @@ +About topic for Azure PowerShell - about_az + +TOPIC + +about_Az + +SHORT DESCRIPTION + +The Azure Az PowerShell module is a set of cmdlets for managing Azure +resources directly from the PowerShell command line and in PowerShell +scripts. + +LONG DESCRIPTION + +Azure PowerShell provides cross-platform cmdlets for managing Azure +services. All Azure PowerShell cmdlets work on Windows PowerShell 5.1 and +supported versions of PowerShell 7. + +The Azure PowerShell cmdlets follow the naming convention {verb}-Az{noun}. + +- {verb} is an approved PowerShell verb reflecting the corresponding HTTP + operation. + +- {noun} matches or has a close equivalent to the name of the resource. + +The cmdlets produce .NET objects that can be piped between commands +simplifying the sequencing of commands making Azure PowerShell a powerful +solution for scripting and automation purposes. + +A PowerShell module is available for each Azure service. For convenience, +we provide a wrapper module named "Az" that comprises the stable modules. +Modules in preview must be installed independently or via the "AzPreview" +wrapper module. + +Azure PowerShell is frequently updated to include bug fixes and service +updates. It is recommended to plan to update to the most recent version +regularly (a minimum of twice a year). + +GETTING STARTED + +1. Connect to Azure using Connect-AzAccount + +2. Run your first command. For example, create a resource group in the + east US region. + + New-AzResourceGroup -Name "MyResoureGroup" -location "eastus" + +SEE ALSO + +Azure PowerShell documentation: https://docs.microsoft.com/powershell/azure diff --git a/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/package/services/metadata/core-properties/1aa0749a068a4238881858013f1a5b7f.psmdcp b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/package/services/metadata/core-properties/1aa0749a068a4238881858013f1a5b7f.psmdcp new file mode 100644 index 000000000000..5c37526de859 --- /dev/null +++ b/swaggerci/eventgrid/generated/modules/Az.Accounts/2.7.5/package/services/metadata/core-properties/1aa0749a068a4238881858013f1a5b7f.psmdcp @@ -0,0 +1,11 @@ + + + Microsoft Corporation + Microsoft Azure PowerShell - Accounts credential management cmdlets for Azure Resource Manager in Windows PowerShell and PowerShell Core. + +For more information on account credential management, please visit the following: https://docs.microsoft.com/powershell/azure/authenticate-azureps + Az.Accounts + 2.7.5 + Azure ResourceManager ARM Accounts Authentication Environment Subscription PSModule PSIncludes_Cmdlet PSCmdlet_Disable-AzDataCollection PSCmdlet_Disable-AzContextAutosave PSCmdlet_Enable-AzDataCollection PSCmdlet_Enable-AzContextAutosave PSCmdlet_Remove-AzEnvironment PSCmdlet_Get-AzEnvironment PSCmdlet_Set-AzEnvironment PSCmdlet_Add-AzEnvironment PSCmdlet_Get-AzSubscription PSCmdlet_Connect-AzAccount PSCmdlet_Get-AzContext PSCmdlet_Set-AzContext PSCmdlet_Import-AzContext PSCmdlet_Save-AzContext PSCmdlet_Get-AzTenant PSCmdlet_Send-Feedback PSCmdlet_Resolve-AzError PSCmdlet_Select-AzContext PSCmdlet_Rename-AzContext PSCmdlet_Remove-AzContext PSCmdlet_Clear-AzContext PSCmdlet_Disconnect-AzAccount PSCmdlet_Get-AzContextAutosaveSetting PSCmdlet_Set-AzDefault PSCmdlet_Get-AzDefault PSCmdlet_Clear-AzDefault PSCmdlet_Register-AzModule PSCmdlet_Enable-AzureRmAlias PSCmdlet_Disable-AzureRmAlias PSCmdlet_Uninstall-AzureRm PSCmdlet_Invoke-AzRestMethod PSCmdlet_Get-AzAccessToken PSCmdlet_Open-AzSurveyLink PSCommand_Disable-AzDataCollection PSCommand_Disable-AzContextAutosave PSCommand_Enable-AzDataCollection PSCommand_Enable-AzContextAutosave PSCommand_Remove-AzEnvironment PSCommand_Get-AzEnvironment PSCommand_Set-AzEnvironment PSCommand_Add-AzEnvironment PSCommand_Get-AzSubscription PSCommand_Connect-AzAccount PSCommand_Get-AzContext PSCommand_Set-AzContext PSCommand_Import-AzContext PSCommand_Save-AzContext PSCommand_Get-AzTenant PSCommand_Send-Feedback PSCommand_Resolve-AzError PSCommand_Select-AzContext PSCommand_Rename-AzContext PSCommand_Remove-AzContext PSCommand_Clear-AzContext PSCommand_Disconnect-AzAccount PSCommand_Get-AzContextAutosaveSetting PSCommand_Set-AzDefault PSCommand_Get-AzDefault PSCommand_Clear-AzDefault PSCommand_Register-AzModule PSCommand_Enable-AzureRmAlias PSCommand_Disable-AzureRmAlias PSCommand_Uninstall-AzureRm PSCommand_Invoke-AzRestMethod PSCommand_Get-AzAccessToken PSCommand_Open-AzSurveyLink PSCommand_Add-AzAccount PSCommand_Login-AzAccount PSCommand_Remove-AzAccount PSCommand_Logout-AzAccount PSCommand_Select-AzSubscription PSCommand_Resolve-Error PSCommand_Save-AzProfile PSCommand_Get-AzDomain PSCommand_Invoke-AzRest + NuGet, Version=3.4.4.1321, Culture=neutral, PublicKeyToken=31bf3856ad364e35;Microsoft Windows NT 6.2.9200.0;.NET Framework 4.5 + \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/runtime/AsyncCommandRuntime.cs b/swaggerci/eventgrid/generated/runtime/AsyncCommandRuntime.cs new file mode 100644 index 000000000000..d89c89a7ce73 --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/AsyncCommandRuntime.cs @@ -0,0 +1,832 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell +{ + using System.Management.Automation; + using System.Management.Automation.Host; + using System.Threading; + using System.Linq; + + internal interface IAsyncCommandRuntimeExtensions + { + Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep Wrap(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep func); + System.Collections.Generic.IEnumerable Wrap(System.Collections.Generic.IEnumerable funcs); + + T ExecuteSync(System.Func step); + } + + public class AsyncCommandRuntime : System.Management.Automation.ICommandRuntime2, IAsyncCommandRuntimeExtensions, System.IDisposable + { + private ICommandRuntime2 originalCommandRuntime; + private System.Threading.Thread originalThread; + public bool AllowInteractive { get; set; } = false; + + public CancellationToken cancellationToken; + SemaphoreSlim semaphore = new SemaphoreSlim(1, 1); + ManualResetEventSlim readyToRun = new ManualResetEventSlim(false); + ManualResetEventSlim completed = new ManualResetEventSlim(false); + + System.Action runOnMainThread; + + private System.Management.Automation.PSCmdlet cmdlet; + + internal AsyncCommandRuntime(System.Management.Automation.PSCmdlet cmdlet, CancellationToken cancellationToken) + { + this.originalCommandRuntime = cmdlet.CommandRuntime as ICommandRuntime2; + this.originalThread = System.Threading.Thread.CurrentThread; + this.cancellationToken = cancellationToken; + this.cmdlet = cmdlet; + if (cmdlet.PagingParameters != null) + { + WriteDebug("Client side pagination is enabled for this cmdlet"); + } + cmdlet.CommandRuntime = this; + } + + public PSHost Host => this.originalCommandRuntime.Host; + + public PSTransactionContext CurrentPSTransaction => this.originalCommandRuntime.CurrentPSTransaction; + + private void CheckForInteractive() + { + // This is an interactive call -- if we are not on the original thread, this will only work if this was done at ACR creation time; + if (!AllowInteractive) + { + throw new System.Exception("AsyncCommandRuntime is not configured for interactive calls"); + } + } + private void WaitOurTurn() + { + // wait for our turn to play + semaphore?.Wait(cancellationToken); + + // ensure that completed is not set + completed.Reset(); + } + + private void WaitForCompletion() + { + // wait for the result (or cancellation!) + WaitHandle.WaitAny(new[] { cancellationToken.WaitHandle, completed?.WaitHandle }); + + // let go of the semaphore + semaphore?.Release(); + + } + + public bool ShouldContinue(string query, string caption, bool hasSecurityImpact, ref bool yesToAll, ref bool noToAll) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + return originalCommandRuntime.ShouldContinue(query, caption, hasSecurityImpact, ref yesToAll, ref noToAll); + } + + CheckForInteractive(); + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + bool yta = yesToAll; + bool nta = noToAll; + bool result = false; + + // set the function to run + runOnMainThread = () => result = originalCommandRuntime.ShouldContinue(query, caption, hasSecurityImpact, ref yta, ref nta); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // set the output variables + yesToAll = yta; + noToAll = nta; + return result; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public bool ShouldContinue(string query, string caption) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + return originalCommandRuntime.ShouldContinue(query, caption); + } + + CheckForInteractive(); + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + bool result = false; + + // set the function to run + runOnMainThread = () => result = originalCommandRuntime.ShouldContinue(query, caption); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // set the output variables + return result; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public bool ShouldContinue(string query, string caption, ref bool yesToAll, ref bool noToAll) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + return originalCommandRuntime.ShouldContinue(query, caption, ref yesToAll, ref noToAll); + } + + CheckForInteractive(); + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + bool yta = yesToAll; + bool nta = noToAll; + bool result = false; + + // set the function to run + runOnMainThread = () => result = originalCommandRuntime.ShouldContinue(query, caption, ref yta, ref nta); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // set the output variables + yesToAll = yta; + noToAll = nta; + return result; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public bool ShouldProcess(string target) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + return originalCommandRuntime.ShouldProcess(target); + } + + CheckForInteractive(); + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + bool result = false; + + // set the function to run + runOnMainThread = () => result = originalCommandRuntime.ShouldProcess(target); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // set the output variables + return result; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public bool ShouldProcess(string target, string action) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + return originalCommandRuntime.ShouldProcess(target, action); + } + + CheckForInteractive(); + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + bool result = false; + + // set the function to run + runOnMainThread = () => result = originalCommandRuntime.ShouldProcess(target, action); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // set the output variables + return result; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public bool ShouldProcess(string verboseDescription, string verboseWarning, string caption) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + return originalCommandRuntime.ShouldProcess(verboseDescription, verboseWarning, caption); + } + + CheckForInteractive(); + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + bool result = false; + + // set the function to run + runOnMainThread = () => result = originalCommandRuntime.ShouldProcess(verboseDescription, verboseWarning, caption); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // set the output variables + return result; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public bool ShouldProcess(string verboseDescription, string verboseWarning, string caption, out ShouldProcessReason shouldProcessReason) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + return originalCommandRuntime.ShouldProcess(verboseDescription, verboseWarning, caption, out shouldProcessReason); + } + + CheckForInteractive(); + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + bool result = false; + ShouldProcessReason reason = ShouldProcessReason.None; + + // set the function to run + runOnMainThread = () => result = originalCommandRuntime.ShouldProcess(verboseDescription, verboseWarning, caption, out reason); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // set the output variables + shouldProcessReason = reason; + return result; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public void ThrowTerminatingError(ErrorRecord errorRecord) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + originalCommandRuntime.ThrowTerminatingError(errorRecord); + return; + } + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + // set the function to run + runOnMainThread = () => originalCommandRuntime.ThrowTerminatingError(errorRecord); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // return + return; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public bool TransactionAvailable() + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + return originalCommandRuntime.TransactionAvailable(); + } + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + bool result = false; + + // set the function to run + runOnMainThread = () => result = originalCommandRuntime.TransactionAvailable(); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // set the output variables + return result; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public void WriteCommandDetail(string text) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + originalCommandRuntime.WriteCommandDetail(text); + return; + } + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + // set the function to run + runOnMainThread = () => originalCommandRuntime.WriteCommandDetail(text); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // return + return; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public void WriteDebug(string text) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + originalCommandRuntime.WriteDebug(text); + return; + } + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + // set the function to run + runOnMainThread = () => originalCommandRuntime.WriteDebug(text); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // return + return; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public void WriteError(ErrorRecord errorRecord) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + originalCommandRuntime.WriteError(errorRecord); + return; + } + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + // set the function to run + runOnMainThread = () => originalCommandRuntime.WriteError(errorRecord); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // return + return; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public void WriteInformation(InformationRecord informationRecord) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + originalCommandRuntime.WriteInformation(informationRecord); + return; + } + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + // set the function to run + runOnMainThread = () => originalCommandRuntime.WriteInformation(informationRecord); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // return + return; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public void WriteObject(object sendToPipeline) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + originalCommandRuntime.WriteObject(sendToPipeline); + return; + } + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + // set the function to run + runOnMainThread = () => originalCommandRuntime.WriteObject(sendToPipeline); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // return + return; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public void WriteObject(object sendToPipeline, bool enumerateCollection) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + originalCommandRuntime.WriteObject(sendToPipeline, enumerateCollection); + return; + } + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + // set the function to run + runOnMainThread = () => originalCommandRuntime.WriteObject(sendToPipeline, enumerateCollection); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // return + return; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public void WriteProgress(ProgressRecord progressRecord) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + originalCommandRuntime.WriteProgress(progressRecord); + return; + } + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + // set the function to run + runOnMainThread = () => originalCommandRuntime.WriteProgress(progressRecord); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // return + return; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public void WriteProgress(long sourceId, ProgressRecord progressRecord) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + originalCommandRuntime.WriteProgress(sourceId, progressRecord); + return; + } + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + // set the function to run + runOnMainThread = () => originalCommandRuntime.WriteProgress(sourceId, progressRecord); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // return + return; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public void WriteVerbose(string text) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + originalCommandRuntime.WriteVerbose(text); + return; + } + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + // set the function to run + runOnMainThread = () => originalCommandRuntime.WriteVerbose(text); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // return + return; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public void WriteWarning(string text) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + originalCommandRuntime.WriteWarning(text); + return; + } + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + // set the function to run + runOnMainThread = () => originalCommandRuntime.WriteWarning(text); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // return + return; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public void Wait(System.Threading.Tasks.Task ProcessRecordAsyncTask, System.Threading.CancellationToken cancellationToken) + { + do + { + WaitHandle.WaitAny(new[] { readyToRun.WaitHandle, ((System.IAsyncResult)ProcessRecordAsyncTask).AsyncWaitHandle }); + if (readyToRun.IsSet) + { + // reset the request for the next time + readyToRun.Reset(); + + // run the delegate on this thread + runOnMainThread(); + + // tell the originator everything is complete + completed.Set(); + } + } + while (!ProcessRecordAsyncTask.IsCompleted); + if (ProcessRecordAsyncTask.IsFaulted) + { + // don't unwrap a Aggregate Exception -- we'll lose the stack trace of the actual exception. + // if( ProcessRecordAsyncTask.Exception is System.AggregateException aggregate ) { + // throw aggregate.InnerException; + // } + throw ProcessRecordAsyncTask.Exception; + } + } + public Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep Wrap(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep func) => func.Target.GetType().Name != "Closure" ? func : (p1, p2, p3) => ExecuteSync>(() => func(p1, p2, p3)); + public System.Collections.Generic.IEnumerable Wrap(System.Collections.Generic.IEnumerable funcs) => funcs?.Select(Wrap); + + public T ExecuteSync(System.Func step) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + return step(); + } + + T result = default(T); + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + // set the function to run + runOnMainThread = () => { result = step(); }; + // tell the main thread to go ahead + readyToRun.Set(); + // wait for the result (or cancellation!) + WaitForCompletion(); + // return + return result; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public void Dispose() + { + if (cmdlet != null) + { + cmdlet.CommandRuntime = this.originalCommandRuntime; + cmdlet = null; + } + + semaphore?.Dispose(); + semaphore = null; + readyToRun?.Dispose(); + readyToRun = null; + completed?.Dispose(); + completed = null; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/runtime/AsyncJob.cs b/swaggerci/eventgrid/generated/runtime/AsyncJob.cs new file mode 100644 index 000000000000..ed72d26cb951 --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/AsyncJob.cs @@ -0,0 +1,270 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell +{ + using System.Management.Automation; + using System.Management.Automation.Host; + using System.Threading; + + using System.Threading.Tasks; + + public class LongRunningJobCancelledException : System.Exception + { + public LongRunningJobCancelledException(string message) : base(message) + { + + } + } + + public class AsyncJob : Job, System.Management.Automation.ICommandRuntime2 + { + const int MaxRecords = 1000; + + private string _statusMessage = string.Empty; + + public override string StatusMessage => _statusMessage; + + public override bool HasMoreData => Output.Count > 0 || Progress.Count > 0 || Error.Count > 0 || Warning.Count > 0 || Verbose.Count > 0 || Debug.Count > 0; + + public override string Location => "localhost"; + + public PSHost Host => originalCommandRuntime.Host; + + public PSTransactionContext CurrentPSTransaction => originalCommandRuntime.CurrentPSTransaction; + + public override void StopJob() + { + Cancel(); + } + + private readonly PSCmdlet cmdlet; + private readonly ICommandRuntime2 originalCommandRuntime; + private readonly System.Threading.Thread originalThread; + + private void CheckForInteractive() + { + // This is an interactive call -- We should never allow interactivity in AsnycJob cmdlets. + throw new System.Exception("Cmdlets in AsyncJob; interactive calls are not permitted."); + } + private bool IsJobDone => CancellationToken.IsCancellationRequested || this.JobStateInfo.State == JobState.Failed || this.JobStateInfo.State == JobState.Stopped || this.JobStateInfo.State == JobState.Stopping || this.JobStateInfo.State == JobState.Completed; + + private readonly System.Action Cancel; + private readonly CancellationToken CancellationToken; + + internal AsyncJob(PSCmdlet cmdlet, string line, string name, CancellationToken cancellationToken, System.Action cancelMethod) : base(line, name) + { + SetJobState(JobState.NotStarted); + // know how to cancel/check for cancelation + this.CancellationToken = cancellationToken; + this.Cancel = cancelMethod; + + // we might need these. + this.originalCommandRuntime = cmdlet.CommandRuntime as ICommandRuntime2; + this.originalThread = System.Threading.Thread.CurrentThread; + + // the instance of the cmdlet we're going to run + this.cmdlet = cmdlet; + + // set the command runtime to the AsyncJob + cmdlet.CommandRuntime = this; + } + + /// + /// Monitors the task (which should be ProcessRecordAsync) to control + /// the lifetime of the job itself + /// + /// + public void Monitor(Task task) + { + SetJobState(JobState.Running); + task.ContinueWith(antecedent => + { + if (antecedent.IsCanceled) + { + // if the task was canceled, we're just going to call it completed. + SetJobState(JobState.Completed); + } + else if (antecedent.IsFaulted) + { + foreach (var innerException in antecedent.Exception.Flatten().InnerExceptions) + { + WriteError(new System.Management.Automation.ErrorRecord(innerException, string.Empty, System.Management.Automation.ErrorCategory.NotSpecified, null)); + } + + // a fault indicates an actual failure + SetJobState(JobState.Failed); + } + else + { + // otherwiser it's a completed state. + SetJobState(JobState.Completed); + } + }, CancellationToken); + } + + private void CheckForCancellation() + { + if (IsJobDone) + { + throw new LongRunningJobCancelledException("Long running job is canceled or stopping, continuation of the cmdlet is not permitted."); + } + } + + public void WriteInformation(InformationRecord informationRecord) + { + CheckForCancellation(); + + this.Information.Add(informationRecord); + } + + public bool ShouldContinue(string query, string caption, bool hasSecurityImpact, ref bool yesToAll, ref bool noToAll) + { + CheckForInteractive(); + return false; + } + + public void WriteDebug(string text) + { + _statusMessage = text; + CheckForCancellation(); + + if (Debug.IsOpen && Debug.Count < MaxRecords) + { + Debug.Add(new DebugRecord(text)); + } + } + + public void WriteError(ErrorRecord errorRecord) + { + if (Error.IsOpen) + { + Error.Add(errorRecord); + } + } + + public void WriteObject(object sendToPipeline) + { + CheckForCancellation(); + + if (Output.IsOpen) + { + Output.Add(new PSObject(sendToPipeline)); + } + } + + public void WriteObject(object sendToPipeline, bool enumerateCollection) + { + CheckForCancellation(); + + if (enumerateCollection && sendToPipeline is System.Collections.IEnumerable enumerable) + { + foreach (var item in enumerable) + { + WriteObject(item); + } + } + else + { + WriteObject(sendToPipeline); + } + } + + public void WriteProgress(ProgressRecord progressRecord) + { + CheckForCancellation(); + + if (Progress.IsOpen && Progress.Count < MaxRecords) + { + Progress.Add(progressRecord); + } + } + + public void WriteProgress(long sourceId, ProgressRecord progressRecord) + { + CheckForCancellation(); + + if (Progress.IsOpen && Progress.Count < MaxRecords) + { + Progress.Add(progressRecord); + } + } + + public void WriteVerbose(string text) + { + CheckForCancellation(); + + if (Verbose.IsOpen && Verbose.Count < MaxRecords) + { + Verbose.Add(new VerboseRecord(text)); + } + } + + public void WriteWarning(string text) + { + CheckForCancellation(); + + if (Warning.IsOpen && Warning.Count < MaxRecords) + { + Warning.Add(new WarningRecord(text)); + } + } + + public void WriteCommandDetail(string text) + { + WriteVerbose(text); + } + + public bool ShouldProcess(string target) + { + CheckForInteractive(); + return false; + } + + public bool ShouldProcess(string target, string action) + { + CheckForInteractive(); + return false; + } + + public bool ShouldProcess(string verboseDescription, string verboseWarning, string caption) + { + CheckForInteractive(); + return false; + } + + public bool ShouldProcess(string verboseDescription, string verboseWarning, string caption, out ShouldProcessReason shouldProcessReason) + { + CheckForInteractive(); + shouldProcessReason = ShouldProcessReason.None; + return false; + } + + public bool ShouldContinue(string query, string caption) + { + CheckForInteractive(); + return false; + } + + public bool ShouldContinue(string query, string caption, ref bool yesToAll, ref bool noToAll) + { + CheckForInteractive(); + return false; + } + + public bool TransactionAvailable() + { + // interactivity required? + return false; + } + + public void ThrowTerminatingError(ErrorRecord errorRecord) + { + if (Error.IsOpen) + { + Error.Add(errorRecord); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/runtime/AsyncOperationResponse.cs b/swaggerci/eventgrid/generated/runtime/AsyncOperationResponse.cs new file mode 100644 index 000000000000..5bb2e47a0f8b --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/AsyncOperationResponse.cs @@ -0,0 +1,177 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell +{ + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + [System.ComponentModel.TypeConverter(typeof(AsyncOperationResponseTypeConverter))] + public class AsyncOperationResponse + { + private string _target; + public string Target { get => _target; set => _target = value; } + public AsyncOperationResponse() + { + } + internal AsyncOperationResponse(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json) + { + // pull target + { Target = If(json?.PropertyT("target"), out var _v) ? (string)_v : (string)Target; } + } + public string ToJsonString() + { + return $"{{ \"target\" : \"{this.Target}\" }}"; + } + + public static AsyncOperationResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject json ? new AsyncOperationResponse(json) : null; + } + + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static AsyncOperationResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(jsonText)); + + } + + public partial class AsyncOperationResponseTypeConverter : System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static object ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(AsyncOperationResponse).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AsyncOperationResponse.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString()); ; + } + catch + { + // Unable to use JSON pattern + } + + if (typeof(System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return new AsyncOperationResponse { Target = (sourceValue as System.Management.Automation.PSObject).GetValueForProperty("target", "", global::System.Convert.ToString) }; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return new AsyncOperationResponse { Target = (sourceValue as global::System.Collections.IDictionary).GetValueForProperty("target", "", global::System.Convert.ToString) }; + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/runtime/BuildTime/Cmdlets/ExportCmdletSurface.cs b/swaggerci/eventgrid/generated/runtime/BuildTime/Cmdlets/ExportCmdletSurface.cs new file mode 100644 index 000000000000..9875d50ab26c --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/BuildTime/Cmdlets/ExportCmdletSurface.cs @@ -0,0 +1,113 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Management.Automation; +using System.Text; +using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.PsHelpers; + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell +{ + [Cmdlet(VerbsData.Export, "CmdletSurface")] + [DoNotExport] + public class ExportCmdletSurface : PSCmdlet + { + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string ModuleName { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string CmdletFolder { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string OutputFolder { get; set; } + + [Parameter] + public bool IncludeGeneralParameters { get; set; } + + [Parameter] + public bool UseExpandedFormat { get; set; } + + protected override void ProcessRecord() + { + try + { + var variants = GetScriptCmdlets(this, CmdletFolder) + .SelectMany(fi => fi.ToVariants()) + .Where(v => !v.IsDoNotExport) + .ToArray(); + var allProfiles = variants.SelectMany(v => v.Profiles).Distinct().ToArray(); + var profileGroups = allProfiles.Any() + ? variants + .SelectMany(v => (v.Profiles.Any() ? v.Profiles : allProfiles).Select(p => (profile: p, variant: v))) + .GroupBy(pv => pv.profile) + .Select(pvg => new ProfileGroup(pvg.Select(pv => pv.variant).ToArray(), pvg.Key)) + : new[] { new ProfileGroup(variants) }; + foreach (var profileGroup in profileGroups) + { + var variantGroups = profileGroup.Variants + .GroupBy(v => new { v.CmdletName }) + .Select(vg => new VariantGroup(ModuleName, vg.Key.CmdletName, vg.Select(v => v).ToArray(), String.Empty, profileGroup.ProfileName)); + var sb = UseExpandedFormat ? ExpandedFormat(variantGroups) : CondensedFormat(variantGroups); + Directory.CreateDirectory(OutputFolder); + File.WriteAllText(Path.Combine(OutputFolder, $"CmdletSurface-{profileGroup.ProfileName}.md"), sb.ToString()); + } + } + catch (Exception ee) + { + Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); + throw ee; + } + } + + private StringBuilder ExpandedFormat(IEnumerable variantGroups) + { + var sb = new StringBuilder(); + foreach (var variantGroup in variantGroups.OrderBy(vg => vg.CmdletName)) + { + sb.Append($"### {variantGroup.CmdletName}{Environment.NewLine}"); + var parameterGroups = variantGroup.ParameterGroups + .Where(pg => !pg.DontShow && (IncludeGeneralParameters || (pg.OrderCategory != ParameterCategory.Azure && pg.OrderCategory != ParameterCategory.Runtime))); + foreach (var parameterGroup in parameterGroups) + { + sb.Append($" - {parameterGroup.ParameterName} `{parameterGroup.ParameterType.ToSyntaxTypeName()}`{Environment.NewLine}"); + } + sb.AppendLine(); + } + + return sb; + } + + private StringBuilder CondensedFormat(IEnumerable variantGroups) + { + var sb = new StringBuilder(); + var condensedGroups = variantGroups + .GroupBy(vg => vg.CmdletNoun) + .Select(vgg => ( + CmdletNoun: vgg.Key, + CmdletVerbs: vgg.Select(vg => vg.CmdletVerb).OrderBy(cv => cv).ToArray(), + ParameterGroups: vgg.SelectMany(vg => vg.ParameterGroups).DistinctBy(p => p.ParameterName).ToArray(), + OutputTypes: vgg.SelectMany(vg => vg.OutputTypes).Select(ot => ot.Type).DistinctBy(t => t.Name).Select(t => t.ToSyntaxTypeName()).ToArray())) + .OrderBy(vg => vg.CmdletNoun); + foreach (var condensedGroup in condensedGroups) + { + sb.Append($"### {condensedGroup.CmdletNoun} [{String.Join(", ", condensedGroup.CmdletVerbs)}] `{String.Join(", ", condensedGroup.OutputTypes)}`{Environment.NewLine}"); + var parameterGroups = condensedGroup.ParameterGroups + .Where(pg => !pg.DontShow && (IncludeGeneralParameters || (pg.OrderCategory != ParameterCategory.Azure && pg.OrderCategory != ParameterCategory.Runtime))); + foreach (var parameterGroup in parameterGroups) + { + sb.Append($" - {parameterGroup.ParameterName} `{parameterGroup.ParameterType.ToSyntaxTypeName()}`{Environment.NewLine}"); + } + sb.AppendLine(); + } + + return sb; + } + } +} diff --git a/swaggerci/eventgrid/generated/runtime/BuildTime/Cmdlets/ExportExampleStub.cs b/swaggerci/eventgrid/generated/runtime/BuildTime/Cmdlets/ExportExampleStub.cs new file mode 100644 index 000000000000..ca0899f6cd07 --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/BuildTime/Cmdlets/ExportExampleStub.cs @@ -0,0 +1,74 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.IO; +using System.Linq; +using System.Management.Automation; +using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.MarkdownTypesExtensions; +using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.PsHelpers; + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell +{ + [Cmdlet(VerbsData.Export, "ExampleStub")] + [DoNotExport] + public class ExportExampleStub : PSCmdlet + { + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string ExportsFolder { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string OutputFolder { get; set; } + + protected override void ProcessRecord() + { + try + { + if (!Directory.Exists(ExportsFolder)) + { + throw new ArgumentException($"Exports folder '{ExportsFolder}' does not exist"); + } + + var exportDirectories = Directory.GetDirectories(ExportsFolder); + if (!exportDirectories.Any()) + { + exportDirectories = new[] { ExportsFolder }; + } + + var exampleText = String.Join(String.Empty, DefaultExampleHelpInfos.Select(ehi => ehi.ToHelpExampleOutput())); + foreach (var exportDirectory in exportDirectories) + { + var outputFolder = OutputFolder; + if (exportDirectory != ExportsFolder) + { + outputFolder = Path.Combine(OutputFolder, Path.GetFileName(exportDirectory)); + Directory.CreateDirectory(outputFolder); + } + + var cmdletFilePaths = GetScriptCmdlets(exportDirectory).Select(fi => Path.Combine(outputFolder, $"{fi.Name}.md")).ToArray(); + var currentExamplesFilePaths = Directory.GetFiles(outputFolder).ToArray(); + // Remove examples of non-existing cmdlets + var removedCmdletFilePaths = currentExamplesFilePaths.Except(cmdletFilePaths); + foreach (var removedCmdletFilePath in removedCmdletFilePaths) + { + File.Delete(removedCmdletFilePath); + } + + // Only create example stubs if they don't exist + foreach (var cmdletFilePath in cmdletFilePaths.Except(currentExamplesFilePaths)) + { + File.WriteAllText(cmdletFilePath, exampleText); + } + } + } + catch (Exception ee) + { + Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); + throw ee; + } + } + } +} diff --git a/swaggerci/eventgrid/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs b/swaggerci/eventgrid/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs new file mode 100644 index 000000000000..471e859436f8 --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs @@ -0,0 +1,101 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Management.Automation; +using System.Reflection; + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell +{ + [Cmdlet(VerbsData.Export, "FormatPs1xml")] + [DoNotExport] + public class ExportFormatPs1xml : PSCmdlet + { + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string FilePath { get; set; } + + private const string ModelNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models"; + private const string SupportNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support"; + private const string PropertiesExcludedForTableview = @""; + + private static readonly bool IsAzure = Convert.ToBoolean(@"true"); + + protected override void ProcessRecord() + { + try + { + var viewModels = GetFilteredViewParameters().Select(CreateViewModel).ToList(); + var ps1xml = new Configuration + { + ViewDefinitions = new ViewDefinitions + { + Views = viewModels + } + }; + File.WriteAllText(FilePath, ps1xml.ToXmlString()); + } + catch (Exception ee) + { + Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); + throw ee; + } + } + + private static IEnumerable GetFilteredViewParameters() + { + //https://stackoverflow.com/a/79738/294804 + //https://stackoverflow.com/a/949285/294804 + var types = Assembly.GetExecutingAssembly().GetExportedTypes() + .Where(t => t.IsClass + && (t.Namespace.StartsWith(ModelNamespace) || t.Namespace.StartsWith(SupportNamespace)) + && !t.GetCustomAttributes().Any()); + return types.Select(t => new ViewParameters(t, t.GetProperties() + .Select(p => new PropertyFormat(p)) + .Where(pf => !pf.Property.GetCustomAttributes().Any() + && (!PropertiesExcludedForTableview.Split(',').Contains(pf.Property.Name)) + && (pf.FormatTable != null || (pf.Origin != PropertyOrigin.Inlined && pf.Property.PropertyType.IsPsSimple()))) + .OrderByDescending(pf => pf.Index.HasValue) + .ThenBy(pf => pf.Index) + .ThenByDescending(pf => pf.Origin.HasValue) + .ThenBy(pf => pf.Origin))).Where(vp => vp.Properties.Any()); + } + + private static View CreateViewModel(ViewParameters viewParameters) + { + var entries = viewParameters.Properties.Select(pf => + (TableColumnHeader: new TableColumnHeader { Label = pf.Label, Width = pf.Width }, + TableColumnItem: new TableColumnItem { PropertyName = pf.Property.Name })).ToArray(); + + return new View + { + Name = viewParameters.Type.FullName, + ViewSelectedBy = new ViewSelectedBy + { + TypeName = viewParameters.Type.FullName + }, + TableControl = new TableControl + { + TableHeaders = new TableHeaders + { + TableColumnHeaders = entries.Select(e => e.TableColumnHeader).ToList() + }, + TableRowEntries = new TableRowEntries + { + TableRowEntry = new TableRowEntry + { + TableColumnItems = new TableColumnItems + { + TableItems = entries.Select(e => e.TableColumnItem).ToList() + } + } + } + } + }; + } + } +} diff --git a/swaggerci/eventgrid/generated/runtime/BuildTime/Cmdlets/ExportHelpMarkdown.cs b/swaggerci/eventgrid/generated/runtime/BuildTime/Cmdlets/ExportHelpMarkdown.cs new file mode 100644 index 000000000000..ec4b78a83090 --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/BuildTime/Cmdlets/ExportHelpMarkdown.cs @@ -0,0 +1,53 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Linq; +using System.Management.Automation; +using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.MarkdownRenderer; + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell +{ + [Cmdlet(VerbsData.Export, "HelpMarkdown")] + [DoNotExport] + public class ExportHelpMarkdown : PSCmdlet + { + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public PSModuleInfo ModuleInfo { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public PSObject[] FunctionInfo { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public PSObject[] HelpInfo { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string DocsFolder { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string ExamplesFolder { get; set; } + + protected override void ProcessRecord() + { + try + { + var helpInfos = HelpInfo.Select(hi => hi.ToPsHelpInfo()); + var variantGroups = FunctionInfo.Select(fi => fi.BaseObject).Cast() + .Join(helpInfos, fi => fi.Name, phi => phi.CmdletName, (fi, phi) => fi.ToVariants(phi)) + .Select(va => new VariantGroup(ModuleInfo.Name, va.First().CmdletName, va, String.Empty)); + WriteMarkdowns(variantGroups, ModuleInfo.ToModuleInfo(), DocsFolder, ExamplesFolder); + } + catch (Exception ee) + { + Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); + throw ee; + } + } + } +} diff --git a/swaggerci/eventgrid/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs b/swaggerci/eventgrid/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs new file mode 100644 index 000000000000..545f11da34b4 --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs @@ -0,0 +1,117 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Management.Automation; +using System.Reflection; +using System.Text; + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell +{ + [Cmdlet(VerbsData.Export, "ModelSurface")] + [DoNotExport] + public class ExportModelSurface : PSCmdlet + { + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string OutputFolder { get; set; } + + [Parameter] + public bool UseExpandedFormat { get; set; } + + private const string ModelNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models"; + private const string SupportNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Support"; + + protected override void ProcessRecord() + { + try + { + var types = Assembly.GetExecutingAssembly().GetExportedTypes() + .Where(t => t.IsClass && (t.Namespace.StartsWith(ModelNamespace) || t.Namespace.StartsWith(SupportNamespace))); + var typeInfos = types.Select(t => new ModelTypeInfo + { + Type = t, + TypeName = t.Name, + Properties = t.GetProperties(BindingFlags.Public | BindingFlags.Instance).Where(p => !p.GetIndexParameters().Any()).OrderBy(p => p.Name).ToArray(), + NamespaceGroup = t.Namespace.Split('.').LastOrDefault().EmptyIfNull() + }).Where(mti => mti.Properties.Any()); + var sb = UseExpandedFormat ? ExpandedFormat(typeInfos) : CondensedFormat(typeInfos); + Directory.CreateDirectory(OutputFolder); + File.WriteAllText(Path.Combine(OutputFolder, "ModelSurface.md"), sb.ToString()); + } + catch (Exception ee) + { + Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); + throw ee; + } + } + + private static StringBuilder ExpandedFormat(IEnumerable typeInfos) + { + var sb = new StringBuilder(); + foreach (var typeInfo in typeInfos.OrderBy(mti => mti.TypeName).ThenBy(mti => mti.NamespaceGroup)) + { + sb.Append($"### {typeInfo.TypeName} [{typeInfo.NamespaceGroup}]{Environment.NewLine}"); + foreach (var property in typeInfo.Properties) + { + sb.Append($" - {property.Name} `{property.PropertyType.ToSyntaxTypeName()}`{Environment.NewLine}"); + } + sb.AppendLine(); + } + + return sb; + } + + private static StringBuilder CondensedFormat(IEnumerable typeInfos) + { + var sb = new StringBuilder(); + var typeGroups = typeInfos + .GroupBy(mti => mti.TypeName) + .Select(tig => ( + Types: tig.Select(mti => mti.Type).ToArray(), + TypeName: tig.Key, + Properties: tig.SelectMany(mti => mti.Properties).DistinctBy(p => p.Name).OrderBy(p => p.Name).ToArray(), + NamespaceGroups: tig.Select(mti => mti.NamespaceGroup).OrderBy(ng => ng).ToArray() + )) + .OrderBy(tg => tg.TypeName); + foreach (var typeGroup in typeGroups) + { + var aType = typeGroup.Types.Select(GetAssociativeType).FirstOrDefault(t => t != null); + var aText = aType != null ? $@" \<{aType.ToSyntaxTypeName()}\>" : String.Empty; + sb.Append($"### {typeGroup.TypeName}{aText} [{String.Join(", ", typeGroup.NamespaceGroups)}]{Environment.NewLine}"); + foreach (var property in typeGroup.Properties) + { + var propertyAType = GetAssociativeType(property.PropertyType); + var propertyAText = propertyAType != null ? $" <{propertyAType.ToSyntaxTypeName()}>" : String.Empty; + var enumNames = GetEnumFieldNames(property.PropertyType.Unwrap()); + var enumNamesText = enumNames.Any() ? $" **{{{String.Join(", ", enumNames)}}}**" : String.Empty; + sb.Append($" - {property.Name} `{property.PropertyType.ToSyntaxTypeName()}{propertyAText}`{enumNamesText}{Environment.NewLine}"); + } + sb.AppendLine(); + } + + return sb; + } + + //https://stackoverflow.com/a/4963190/294804 + private static Type GetAssociativeType(Type type) => + type.GetInterfaces().FirstOrDefault(i => i.IsGenericType && i.GetGenericTypeDefinition() == typeof(IAssociativeArray<>))?.GetGenericArguments().First(); + + private static string[] GetEnumFieldNames(Type type) => + type.IsValueType && !type.IsPrimitive && type != typeof(decimal) && type != typeof(DateTime) + ? type.GetFields(BindingFlags.Public | BindingFlags.Static).Where(f => f.FieldType == type).Select(p => p.Name).ToArray() + : new string[] { }; + + private class ModelTypeInfo + { + public Type Type { get; set; } + public string TypeName { get; set; } + public PropertyInfo[] Properties { get; set; } + public string NamespaceGroup { get; set; } + } + } +} diff --git a/swaggerci/eventgrid/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs b/swaggerci/eventgrid/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs new file mode 100644 index 000000000000..84e50137cd51 --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs @@ -0,0 +1,169 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.IO; +using System.Linq; +using System.Management.Automation; +using System.Text; +using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.PsHelpers; +using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.MarkdownRenderer; +using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.PsProxyTypeExtensions; +using System.Collections.Generic; + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell +{ + [Cmdlet(VerbsData.Export, "ProxyCmdlet", DefaultParameterSetName = "Docs")] + [DoNotExport] + public class ExportProxyCmdlet : PSCmdlet + { + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string ModuleName { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string[] ModulePath { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string ExportsFolder { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string InternalFolder { get; set; } + + [Parameter(Mandatory = true, ParameterSetName = "Docs")] + [AllowEmptyString] + public string ModuleDescription { get; set; } + + [Parameter(Mandatory = true, ParameterSetName = "Docs")] + [ValidateNotNullOrEmpty] + public string DocsFolder { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string ExamplesFolder { get; set; } + + [Parameter(Mandatory = true, ParameterSetName = "Docs")] + public Guid ModuleGuid { get; set; } + + [Parameter(Mandatory = true, ParameterSetName = "NoDocs")] + public SwitchParameter ExcludeDocs { get; set; } + + protected override void ProcessRecord() + { + try + { + var variants = GetModuleCmdletsAndHelpInfo(this, ModulePath).SelectMany(ci => ci.ToVariants()).Where(v => !v.IsDoNotExport).ToArray(); + var allProfiles = variants.SelectMany(v => v.Profiles).Distinct().ToArray(); + var profileGroups = allProfiles.Any() + ? variants + .SelectMany(v => (v.Profiles.Any() ? v.Profiles : allProfiles).Select(p => (profile: p, variant: v))) + .GroupBy(pv => pv.profile) + .Select(pvg => new ProfileGroup(pvg.Select(pv => pv.variant).ToArray(), pvg.Key)) + : new[] { new ProfileGroup(variants) }; + var variantGroups = profileGroups.SelectMany(pg => pg.Variants + .GroupBy(v => new { v.CmdletName, v.IsInternal }) + .Select(vg => new VariantGroup(ModuleName, vg.Key.CmdletName, vg.Select(v => v).ToArray(), + Path.Combine(vg.Key.IsInternal ? InternalFolder : ExportsFolder, pg.ProfileFolder), pg.ProfileName, isInternal: vg.Key.IsInternal))) + .ToArray(); + + var license = new StringBuilder(); + license.Append(@" +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- +"); + HashSet LicenseSet = new HashSet(); + foreach (var variantGroup in variantGroups) + { + var parameterGroups = variantGroup.ParameterGroups.ToList(); + var isValidProfile = !String.IsNullOrEmpty(variantGroup.ProfileName) && variantGroup.ProfileName != NoProfiles; + var examplesFolder = isValidProfile ? Path.Combine(ExamplesFolder, variantGroup.ProfileName) : ExamplesFolder; + var markdownInfo = new MarkdownHelpInfo(variantGroup, examplesFolder); + List examples = new List(); + foreach (var it in markdownInfo.Examples) + { + examples.Add(it); + } + variantGroup.HelpInfo.Examples = examples.ToArray(); + var sb = new StringBuilder(); + sb.Append($"{Environment.NewLine}"); + sb.Append(variantGroup.ToHelpCommentOutput()); + sb.Append($"function {variantGroup.CmdletName} {{{Environment.NewLine}"); + sb.Append(variantGroup.Aliases.ToAliasOutput()); + sb.Append(variantGroup.OutputTypes.ToOutputTypeOutput()); + sb.Append(variantGroup.ToCmdletBindingOutput()); + sb.Append(variantGroup.ProfileName.ToProfileOutput()); + + sb.Append("param("); + sb.Append($"{(parameterGroups.Any() ? Environment.NewLine : String.Empty)}"); + foreach (var parameterGroup in parameterGroups) + { + var parameters = parameterGroup.HasAllVariants ? parameterGroup.Parameters.Take(1) : parameterGroup.Parameters; + parameters = parameters.Where(p => !p.IsHidden()); + if (!parameters.Any()) + { + continue; + } + foreach (var parameter in parameters) + { + sb.Append(parameter.ToParameterOutput(variantGroup.HasMultipleVariants, parameterGroup.HasAllVariants)); + } + sb.Append(parameterGroup.Aliases.ToAliasOutput(true)); + sb.Append(parameterGroup.HasValidateNotNull.ToValidateNotNullOutput()); + sb.Append(parameterGroup.HasAllowEmptyArray.ToAllowEmptyArray()); + sb.Append(parameterGroup.CompleterInfo.ToArgumentCompleterOutput()); + sb.Append(parameterGroup.OrderCategory.ToParameterCategoryOutput()); + sb.Append(parameterGroup.InfoAttribute.ToInfoOutput(parameterGroup.ParameterType)); + sb.Append(parameterGroup.ToDefaultInfoOutput()); + sb.Append(parameterGroup.ParameterType.ToParameterTypeOutput()); + sb.Append(parameterGroup.Description.ToParameterDescriptionOutput()); + sb.Append(parameterGroup.ParameterName.ToParameterNameOutput(parameterGroups.IndexOf(parameterGroup) == parameterGroups.Count - 1)); + } + sb.Append($"){Environment.NewLine}{Environment.NewLine}"); + + sb.Append(variantGroup.ToBeginOutput()); + sb.Append(variantGroup.ToProcessOutput()); + sb.Append(variantGroup.ToEndOutput()); + + sb.Append($"}}{Environment.NewLine}"); + + Directory.CreateDirectory(variantGroup.OutputFolder); + File.WriteAllText(variantGroup.FilePath, license.ToString()); + File.AppendAllText(variantGroup.FilePath, sb.ToString()); + if (!LicenseSet.Contains(Path.Combine(variantGroup.OutputFolder, "ProxyCmdletDefinitions.ps1"))) + { + // only add license in the header + File.AppendAllText(Path.Combine(variantGroup.OutputFolder, "ProxyCmdletDefinitions.ps1"), license.ToString()); + LicenseSet.Add(Path.Combine(variantGroup.OutputFolder, "ProxyCmdletDefinitions.ps1")); + } + File.AppendAllText(Path.Combine(variantGroup.OutputFolder, "ProxyCmdletDefinitions.ps1"), sb.ToString()); + } + + if (!ExcludeDocs) + { + var moduleInfo = new PsModuleHelpInfo(ModuleName, ModuleGuid, ModuleDescription); + foreach (var variantGroupsByProfile in variantGroups.GroupBy(vg => vg.ProfileName)) + { + var profileName = variantGroupsByProfile.Key; + var isValidProfile = !String.IsNullOrEmpty(profileName) && profileName != NoProfiles; + var docsFolder = isValidProfile ? Path.Combine(DocsFolder, profileName) : DocsFolder; + var examplesFolder = isValidProfile ? Path.Combine(ExamplesFolder, profileName) : ExamplesFolder; + WriteMarkdowns(variantGroupsByProfile, moduleInfo, docsFolder, examplesFolder); + } + } + } + catch (Exception ee) + { + Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); + throw ee; + } + } + } +} diff --git a/swaggerci/eventgrid/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs b/swaggerci/eventgrid/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs new file mode 100644 index 000000000000..2eeb1e427c9a --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs @@ -0,0 +1,191 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.IO; +using System.Linq; +using System.Management.Automation; +using System.Text; +using System.Text.RegularExpressions; +using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.PsHelpers; + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell +{ + [Cmdlet(VerbsData.Export, "Psd1")] + [DoNotExport] + public class ExportPsd1 : PSCmdlet + { + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string ExportsFolder { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string CustomFolder { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string Psd1Path { get; set; } + + [Parameter(Mandatory = true)] + public Guid ModuleGuid { get; set; } + + private static readonly bool IsAzure = Convert.ToBoolean(@"true"); + private const string CustomFolderRelative = "./custom"; + private const string Indent = Psd1Indent; + private const string Undefined = "undefined"; + private bool IsUndefined(string value) => string.Equals(Undefined, value, StringComparison.OrdinalIgnoreCase); + + protected override void ProcessRecord() + { + try + { + if (!Directory.Exists(ExportsFolder)) + { + throw new ArgumentException($"Exports folder '{ExportsFolder}' does not exist"); + } + + if (!Directory.Exists(CustomFolder)) + { + throw new ArgumentException($"Custom folder '{CustomFolder}' does not exist"); + } + + string version = Convert.ToString(@"0.1.0"); + // Validate the module version should be semantic version + // Following regex is official from https://semver.org/ + Regex rx = new Regex(@"^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$", RegexOptions.Compiled); + if (rx.Matches(version).Count != 1) + { + throw new ArgumentException("Module-version is not a valid Semantic Version"); + } + + string previewVersion = null; + if (version.Contains('-')) + { + string[] versions = version.Split("-".ToCharArray(), 2); + version = versions[0]; + previewVersion = versions[1]; + } + + var sb = new StringBuilder(); + sb.AppendLine("@{"); + sb.AppendLine($@"{GuidStart} = '{ModuleGuid}'"); + sb.AppendLine($@"{Indent}RootModule = '{"./Az.EventGrid.psm1"}'"); + sb.AppendLine($@"{Indent}ModuleVersion = '{version}'"); + sb.AppendLine($@"{Indent}CompatiblePSEditions = 'Core', 'Desktop'"); + sb.AppendLine($@"{Indent}Author = '{"Microsoft Corporation"}'"); + sb.AppendLine($@"{Indent}CompanyName = '{"Microsoft Corporation"}'"); + sb.AppendLine($@"{Indent}Copyright = '{"Microsoft Corporation. All rights reserved."}'"); + sb.AppendLine($@"{Indent}Description = '{"Microsoft Azure PowerShell: EventGrid cmdlets"}'"); + sb.AppendLine($@"{Indent}PowerShellVersion = '5.1'"); + sb.AppendLine($@"{Indent}DotNetFrameworkVersion = '4.7.2'"); + + // RequiredModules + if (!IsUndefined("undefined")) + { + sb.AppendLine($@"{Indent}RequiredModules = @({"undefined"})"); + } + + // RequiredAssemblies + if (!IsUndefined("undefined")) + { + sb.AppendLine($@"{Indent}RequiredAssemblies = @({"undefined"})"); + } + else + { + sb.AppendLine($@"{Indent}RequiredAssemblies = '{"./bin/Az.EventGrid.private.dll"}'"); + } + + // NestedModules + if (!IsUndefined("undefined")) + { + sb.AppendLine($@"{Indent}NestedModules = @({"undefined"})"); + } + + // FormatsToProcess + if (!IsUndefined("undefined")) + { + sb.AppendLine($@"{Indent}FormatsToProcess = @({"undefined"})"); + } + else + { + var customFormatPs1xmlFiles = Directory.GetFiles(CustomFolder) + .Where(f => f.EndsWith(".format.ps1xml")) + .Select(f => $"{CustomFolderRelative}/{Path.GetFileName(f)}"); + var formatList = customFormatPs1xmlFiles.Prepend("./Az.EventGrid.format.ps1xml").ToPsList(); + sb.AppendLine($@"{Indent}FormatsToProcess = {formatList}"); + } + + // TypesToProcess + if (!IsUndefined("undefined")) + { + sb.AppendLine($@"{Indent}TypesToProcess = @({"undefined"})"); + } + + // ScriptsToProcess + if (!IsUndefined("undefined")) + { + sb.AppendLine($@"{Indent}ScriptsToProcess = @({"undefined"})"); + } + + var functionInfos = GetScriptCmdlets(ExportsFolder).ToArray(); + // FunctionsToExport + if (!IsUndefined("undefined")) + { + sb.AppendLine($@"{Indent}FunctionsToExport = @({"undefined"})"); + } + else + { + var cmdletsList = functionInfos.Select(fi => fi.Name).Distinct().Append("*").ToPsList(); + sb.AppendLine($@"{Indent}FunctionsToExport = {cmdletsList}"); + } + + // AliasesToExport + if (!IsUndefined("undefined")) + { + sb.AppendLine($@"{Indent}AliasesToExport = @({"undefined"})"); + } + else + { + var aliasesList = functionInfos.SelectMany(fi => fi.ScriptBlock.Attributes).ToAliasNames().Append("*").ToPsList(); + sb.AppendLine($@"{Indent}AliasesToExport = {aliasesList}"); + } + + // CmdletsToExport + if (!IsUndefined("undefined")) + { + sb.AppendLine($@"{Indent}CmdletsToExport = @({"undefined"})"); + } + + sb.AppendLine($@"{Indent}PrivateData = @{{"); + sb.AppendLine($@"{Indent}{Indent}PSData = @{{"); + + if (previewVersion != null) + { + sb.AppendLine($@"{Indent}{Indent}{Indent}Prerelease = {previewVersion}"); + } + sb.AppendLine($@"{Indent}{Indent}{Indent}Tags = {"Azure ResourceManager ARM PSModule EventGrid".Split(' ').ToPsList().NullIfEmpty() ?? "''"}"); + sb.AppendLine($@"{Indent}{Indent}{Indent}LicenseUri = '{"https://aka.ms/azps-license"}'"); + sb.AppendLine($@"{Indent}{Indent}{Indent}ProjectUri = '{"https://github.com/Azure/azure-powershell"}'"); + sb.AppendLine($@"{Indent}{Indent}{Indent}ReleaseNotes = ''"); + var profilesList = ""; + if (IsAzure && !String.IsNullOrEmpty(profilesList)) + { + sb.AppendLine($@"{Indent}{Indent}{Indent}Profiles = {profilesList}"); + } + + sb.AppendLine($@"{Indent}{Indent}}}"); + sb.AppendLine($@"{Indent}}}"); + sb.AppendLine(@"}"); + + File.WriteAllText(Psd1Path, sb.ToString()); + } + catch (Exception ee) + { + Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); + throw ee; + } + } + } +} diff --git a/swaggerci/eventgrid/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs b/swaggerci/eventgrid/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs new file mode 100644 index 000000000000..9498f08513ea --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs @@ -0,0 +1,148 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.IO; +using System.Linq; +using System.Management.Automation; +using System.Text; +using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.PsProxyOutputExtensions; +using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.PsHelpers; + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell +{ + [Cmdlet(VerbsData.Export, "TestStub")] + [DoNotExport] + public class ExportTestStub : PSCmdlet + { + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string ModuleName { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string ExportsFolder { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string OutputFolder { get; set; } + + [Parameter] + public SwitchParameter IncludeGenerated { get; set; } + + protected override void ProcessRecord() + { + try + { + if (!Directory.Exists(ExportsFolder)) + { + throw new ArgumentException($"Exports folder '{ExportsFolder}' does not exist"); + } + + var exportDirectories = Directory.GetDirectories(ExportsFolder); + if (!exportDirectories.Any()) + { + exportDirectories = new[] { ExportsFolder }; + } + var utilFile = Path.Combine(OutputFolder, "utils.ps1"); + if (!File.Exists(utilFile)) + { + var sc = new StringBuilder(); + sc.AppendLine(@"function RandomString([bool]$allChars, [int32]$len) { + if ($allChars) { + return -join ((33..126) | Get-Random -Count $len | % {[char]$_}) + } else { + return -join ((48..57) + (97..122) | Get-Random -Count $len | % {[char]$_}) + } +} +$env = @{} +if ($UsePreviousConfigForRecord) { + $previousEnv = Get-Content (Join-Path $PSScriptRoot 'env.json') | ConvertFrom-Json + $previousEnv.psobject.properties | Foreach-Object { $env[$_.Name] = $_.Value } +} +# Add script method called AddWithCache to $env, when useCache is set true, it will try to get the value from the $env first. +# example: $val = $env.AddWithCache('key', $val, $true) +$env | Add-Member -Type ScriptMethod -Value { param( [string]$key, [object]$val, [bool]$useCache) if ($this.Contains($key) -and $useCache) { return $this[$key] } else { $this[$key] = $val; return $val } } -Name 'AddWithCache' +function setupEnv() { + # Preload subscriptionId and tenant from context, which will be used in test + # as default. You could change them if needed. + $env.SubscriptionId = (Get-AzContext).Subscription.Id + $env.Tenant = (Get-AzContext).Tenant.Id + # For any resources you created for test, you should add it to $env here. + $envFile = 'env.json' + if ($TestMode -eq 'live') { + $envFile = 'localEnv.json' + } + set-content -Path (Join-Path $PSScriptRoot $envFile) -Value (ConvertTo-Json $env) +} +function cleanupEnv() { + # Clean resources you create for testing +} +"); + File.WriteAllText(utilFile, sc.ToString()); + } + foreach (var exportDirectory in exportDirectories) + { + var outputFolder = OutputFolder; + if (exportDirectory != ExportsFolder) + { + outputFolder = Path.Combine(OutputFolder, Path.GetFileName(exportDirectory)); + Directory.CreateDirectory(outputFolder); + } + + var variantGroups = GetScriptCmdlets(exportDirectory) + .SelectMany(fi => fi.ToVariants()) + .Where(v => !v.IsDoNotExport) + .GroupBy(v => v.CmdletName) + .Select(vg => new VariantGroup(ModuleName, vg.Key, vg.Select(v => v).ToArray(), outputFolder, isTest: true)) + .Where(vtg => !File.Exists(vtg.FilePath) && (IncludeGenerated || !vtg.IsGenerated)); + + foreach (var variantGroup in variantGroups) + { + var sb = new StringBuilder(); + sb.AppendLine($"if(($null -eq $TestName) -or ($TestName -contains '{variantGroup.CmdletName}'))"); + sb.AppendLine(@"{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath)" +); + sb.AppendLine($@" $TestRecordingFile = Join-Path $PSScriptRoot '{variantGroup.CmdletName}.Recording.json'"); + sb.AppendLine(@" $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} +"); + + + sb.AppendLine($"Describe '{variantGroup.CmdletName}' {{"); + var variants = variantGroup.Variants + .Where(v => IncludeGenerated || !v.Attributes.OfType().Any()) + .ToList(); + + foreach (var variant in variants) + { + sb.AppendLine($"{Indent}It '{variant.VariantName}' -skip {{"); + sb.AppendLine($"{Indent}{Indent}{{ throw [System.NotImplementedException] }} | Should -Not -Throw"); + var variantSeparator = variants.IndexOf(variant) == variants.Count - 1 ? String.Empty : Environment.NewLine; + sb.AppendLine($"{Indent}}}{variantSeparator}"); + } + sb.AppendLine("}"); + + File.WriteAllText(variantGroup.FilePath, sb.ToString()); + } + } + } + catch (Exception ee) + { + Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); + throw ee; + } + } + } +} diff --git a/swaggerci/eventgrid/generated/runtime/BuildTime/Cmdlets/GetCommonParameter.cs b/swaggerci/eventgrid/generated/runtime/BuildTime/Cmdlets/GetCommonParameter.cs new file mode 100644 index 000000000000..e0955abf3736 --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/BuildTime/Cmdlets/GetCommonParameter.cs @@ -0,0 +1,52 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System.Collections.Generic; +using System.Linq; +using System.Management.Automation; + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell +{ + [Cmdlet(VerbsCommon.Get, "CommonParameter")] + [OutputType(typeof(Dictionary))] + [DoNotExport] + public class GetCommonParameter : PSCmdlet + { + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public PSCmdlet PSCmdlet { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public Dictionary PSBoundParameter { get; set; } + + protected override void ProcessRecord() + { + try + { + var variants = PSCmdlet.MyInvocation.MyCommand.ToVariants(); + var commonParameterNames = variants.ToParameterGroups() + .Where(pg => pg.OrderCategory == ParameterCategory.Azure || pg.OrderCategory == ParameterCategory.Runtime) + .Select(pg => pg.ParameterName); + if (variants.Any(v => v.SupportsShouldProcess)) + { + commonParameterNames = commonParameterNames.Append("Confirm").Append("WhatIf"); + } + if (variants.Any(v => v.SupportsPaging)) + { + commonParameterNames = commonParameterNames.Append("First").Append("Skip").Append("IncludeTotalCount"); + } + + var names = commonParameterNames.ToArray(); + var keys = PSBoundParameter.Keys.Where(k => names.Contains(k)); + WriteObject(keys.ToDictionary(key => key, key => PSBoundParameter[key]), true); + } + catch (System.Exception ee) + { + System.Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); + throw ee; + } + } + } +} diff --git a/swaggerci/eventgrid/generated/runtime/BuildTime/Cmdlets/GetModuleGuid.cs b/swaggerci/eventgrid/generated/runtime/BuildTime/Cmdlets/GetModuleGuid.cs new file mode 100644 index 000000000000..215b554acf94 --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/BuildTime/Cmdlets/GetModuleGuid.cs @@ -0,0 +1,31 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System.Management.Automation; +using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.PsHelpers; + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell +{ + [Cmdlet(VerbsCommon.Get, "ModuleGuid")] + [DoNotExport] + public class GetModuleGuid : PSCmdlet + { + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string Psd1Path { get; set; } + + protected override void ProcessRecord() + { + try + { + WriteObject(ReadGuidFromPsd1(Psd1Path)); + } + catch (System.Exception ee) + { + System.Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); + throw ee; + } + } + } +} diff --git a/swaggerci/eventgrid/generated/runtime/BuildTime/Cmdlets/GetScriptCmdlet.cs b/swaggerci/eventgrid/generated/runtime/BuildTime/Cmdlets/GetScriptCmdlet.cs new file mode 100644 index 000000000000..7b1be73526bb --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/BuildTime/Cmdlets/GetScriptCmdlet.cs @@ -0,0 +1,54 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System.Linq; +using System.Management.Automation; +using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.PsHelpers; + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell +{ + [Cmdlet(VerbsCommon.Get, "ScriptCmdlet")] + [OutputType(typeof(string[]))] + [DoNotExport] + public class GetScriptCmdlet : PSCmdlet + { + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string ScriptFolder { get; set; } + + [Parameter] + public SwitchParameter IncludeDoNotExport { get; set; } + + [Parameter] + public SwitchParameter AsAlias { get; set; } + + [Parameter] + public SwitchParameter AsFunctionInfo { get; set; } + + protected override void ProcessRecord() + { + try + { + var functionInfos = GetScriptCmdlets(this, ScriptFolder) + .Where(fi => IncludeDoNotExport || !fi.ScriptBlock.Attributes.OfType().Any()) + .ToArray(); + if (AsFunctionInfo) + { + WriteObject(functionInfos, true); + return; + } + var aliases = functionInfos.SelectMany(i => i.ScriptBlock.Attributes).ToAliasNames(); + var names = functionInfos.Select(fi => fi.Name).Distinct(); + var output = (AsAlias ? aliases : names).DefaultIfEmpty("''").ToArray(); + WriteObject(output, true); + } + catch (System.Exception ee) + { + System.Console.Error.WriteLine($"{ee.GetType().Name}: {ee.Message}"); + System.Console.Error.WriteLine(ee.StackTrace); + throw ee; + } + } + } +} diff --git a/swaggerci/eventgrid/generated/runtime/BuildTime/CollectionExtensions.cs b/swaggerci/eventgrid/generated/runtime/BuildTime/CollectionExtensions.cs new file mode 100644 index 000000000000..e479a639816f --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/BuildTime/CollectionExtensions.cs @@ -0,0 +1,20 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell +{ + internal static class CollectionExtensions + { + public static T[] NullIfEmpty(this T[] collection) => (collection?.Any() ?? false) ? collection : null; + public static IEnumerable EmptyIfNull(this IEnumerable collection) => collection ?? Enumerable.Empty(); + + // https://stackoverflow.com/a/4158364/294804 + public static IEnumerable DistinctBy(this IEnumerable collection, Func selector) => + collection.GroupBy(selector).Select(group => group.First()); + } +} diff --git a/swaggerci/eventgrid/generated/runtime/BuildTime/MarkdownRenderer.cs b/swaggerci/eventgrid/generated/runtime/BuildTime/MarkdownRenderer.cs new file mode 100644 index 000000000000..21e0caed7fb7 --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/BuildTime/MarkdownRenderer.cs @@ -0,0 +1,114 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.MarkdownTypesExtensions; +using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.PsProxyOutputExtensions; + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell +{ + internal static class MarkdownRenderer + { + public static void WriteMarkdowns(IEnumerable variantGroups, PsModuleHelpInfo moduleHelpInfo, string docsFolder, string examplesFolder) + { + Directory.CreateDirectory(docsFolder); + var markdownInfos = variantGroups.Where(vg => !vg.IsInternal).Select(vg => new MarkdownHelpInfo(vg, examplesFolder)).OrderBy(mhi => mhi.CmdletName).ToArray(); + + foreach (var markdownInfo in markdownInfos) + { + var sb = new StringBuilder(); + sb.Append(markdownInfo.ToHelpMetadataOutput()); + sb.Append($"# {markdownInfo.CmdletName}{Environment.NewLine}{Environment.NewLine}"); + sb.Append($"## SYNOPSIS{Environment.NewLine}{markdownInfo.Synopsis.ToDescriptionFormat()}{Environment.NewLine}{Environment.NewLine}"); + + sb.Append($"## SYNTAX{Environment.NewLine}{Environment.NewLine}"); + var hasMultipleParameterSets = markdownInfo.SyntaxInfos.Length > 1; + foreach (var syntaxInfo in markdownInfo.SyntaxInfos) + { + sb.Append(syntaxInfo.ToHelpSyntaxOutput(hasMultipleParameterSets)); + } + + sb.Append($"## DESCRIPTION{Environment.NewLine}{markdownInfo.Description.ToDescriptionFormat()}{Environment.NewLine}{Environment.NewLine}"); + + sb.Append($"## EXAMPLES{Environment.NewLine}{Environment.NewLine}"); + foreach (var exampleInfo in markdownInfo.Examples) + { + sb.Append(exampleInfo.ToHelpExampleOutput()); + } + + sb.Append($"## PARAMETERS{Environment.NewLine}{Environment.NewLine}"); + foreach (var parameter in markdownInfo.Parameters) + { + sb.Append(parameter.ToHelpParameterOutput()); + } + if (markdownInfo.SupportsShouldProcess) + { + foreach (var parameter in SupportsShouldProcessParameters) + { + sb.Append(parameter.ToHelpParameterOutput()); + } + } + + sb.Append($"### CommonParameters{Environment.NewLine}This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).{Environment.NewLine}{Environment.NewLine}"); + + sb.Append($"## INPUTS{Environment.NewLine}{Environment.NewLine}"); + foreach (var input in markdownInfo.Inputs) + { + sb.Append($"### {input}{Environment.NewLine}{Environment.NewLine}"); + } + + sb.Append($"## OUTPUTS{Environment.NewLine}{Environment.NewLine}"); + foreach (var output in markdownInfo.Outputs) + { + sb.Append($"### {output}{Environment.NewLine}{Environment.NewLine}"); + } + + sb.Append($"## NOTES{Environment.NewLine}{Environment.NewLine}"); + sb.Append($"ALIASES{Environment.NewLine}{Environment.NewLine}"); + foreach (var alias in markdownInfo.Aliases) + { + sb.Append($"{alias}{Environment.NewLine}{Environment.NewLine}"); + } + if (markdownInfo.ComplexInterfaceInfos.Any()) + { + sb.Append($"{ComplexParameterHeader}{Environment.NewLine}"); + } + foreach (var complexInterfaceInfo in markdownInfo.ComplexInterfaceInfos) + { + sb.Append($"{complexInterfaceInfo.ToNoteOutput(includeDashes: true, includeBackticks: true)}{Environment.NewLine}{Environment.NewLine}"); + } + + sb.Append($"## RELATED LINKS{Environment.NewLine}{Environment.NewLine}"); + foreach (var relatedLink in markdownInfo.RelatedLinks) + { + sb.Append($"{relatedLink}{Environment.NewLine}{Environment.NewLine}"); + } + + File.WriteAllText(Path.Combine(docsFolder, $"{markdownInfo.CmdletName}.md"), sb.ToString()); + } + + WriteModulePage(moduleHelpInfo, markdownInfos, docsFolder); + } + + private static void WriteModulePage(PsModuleHelpInfo moduleInfo, MarkdownHelpInfo[] markdownInfos, string docsFolder) + { + var sb = new StringBuilder(); + sb.Append(moduleInfo.ToModulePageMetadataOutput()); + sb.Append($"# {moduleInfo.Name} Module{Environment.NewLine}"); + sb.Append($"## Description{Environment.NewLine}{moduleInfo.Description.ToDescriptionFormat()}{Environment.NewLine}{Environment.NewLine}"); + + sb.Append($"## {moduleInfo.Name} Cmdlets{Environment.NewLine}"); + foreach (var markdownInfo in markdownInfos) + { + sb.Append(markdownInfo.ToModulePageCmdletOutput()); + } + + File.WriteAllText(Path.Combine(docsFolder, $"{moduleInfo.Name}.md"), sb.ToString()); + } + } +} diff --git a/swaggerci/eventgrid/generated/runtime/BuildTime/Models/PsFormatTypes.cs b/swaggerci/eventgrid/generated/runtime/BuildTime/Models/PsFormatTypes.cs new file mode 100644 index 000000000000..515098d5e75b --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/BuildTime/Models/PsFormatTypes.cs @@ -0,0 +1,138 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Xml.Serialization; + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell +{ + internal class ViewParameters + { + public Type Type { get; } + public IEnumerable Properties { get; } + + public ViewParameters(Type type, IEnumerable properties) + { + Type = type; + Properties = properties; + } + } + + internal class PropertyFormat + { + public PropertyInfo Property { get; } + public FormatTableAttribute FormatTable { get; } + + public int? Index { get; } + public string Label { get; } + public int? Width { get; } + public PropertyOrigin? Origin { get; } + + public PropertyFormat(PropertyInfo propertyInfo) + { + Property = propertyInfo; + FormatTable = Property.GetCustomAttributes().FirstOrDefault(); + var origin = Property.GetCustomAttributes().FirstOrDefault(); + + Index = FormatTable?.HasIndex ?? false ? (int?)FormatTable.Index : null; + Label = FormatTable?.Label ?? propertyInfo.Name; + Width = FormatTable?.HasWidth ?? false ? (int?)FormatTable.Width : null; + // If we have an index, we don't want to use Origin. + Origin = FormatTable?.HasIndex ?? false ? null : origin?.Origin; + } + } + + [Serializable] + [XmlRoot(nameof(Configuration))] + public class Configuration + { + [XmlElement("ViewDefinitions")] + public ViewDefinitions ViewDefinitions { get; set; } + } + + [Serializable] + public class ViewDefinitions + { + //https://stackoverflow.com/a/10518657/294804 + [XmlElement("View")] + public List Views { get; set; } + } + + [Serializable] + public class View + { + [XmlElement(nameof(Name))] + public string Name { get; set; } + [XmlElement(nameof(ViewSelectedBy))] + public ViewSelectedBy ViewSelectedBy { get; set; } + [XmlElement(nameof(TableControl))] + public TableControl TableControl { get; set; } + } + + [Serializable] + public class ViewSelectedBy + { + [XmlElement(nameof(TypeName))] + public string TypeName { get; set; } + } + + [Serializable] + public class TableControl + { + [XmlElement(nameof(TableHeaders))] + public TableHeaders TableHeaders { get; set; } + [XmlElement(nameof(TableRowEntries))] + public TableRowEntries TableRowEntries { get; set; } + } + + [Serializable] + public class TableHeaders + { + [XmlElement("TableColumnHeader")] + public List TableColumnHeaders { get; set; } + } + + [Serializable] + public class TableColumnHeader + { + [XmlElement(nameof(Label))] + public string Label { get; set; } + [XmlElement(nameof(Width))] + public int? Width { get; set; } + + //https://stackoverflow.com/a/4095225/294804 + public bool ShouldSerializeWidth() => Width.HasValue; + } + + [Serializable] + public class TableRowEntries + { + [XmlElement(nameof(TableRowEntry))] + public TableRowEntry TableRowEntry { get; set; } + } + + [Serializable] + public class TableRowEntry + { + [XmlElement(nameof(TableColumnItems))] + public TableColumnItems TableColumnItems { get; set; } + } + + [Serializable] + public class TableColumnItems + { + [XmlElement("TableColumnItem")] + public List TableItems { get; set; } + } + + [Serializable] + public class TableColumnItem + { + [XmlElement(nameof(PropertyName))] + public string PropertyName { get; set; } + } +} diff --git a/swaggerci/eventgrid/generated/runtime/BuildTime/Models/PsHelpMarkdownOutputs.cs b/swaggerci/eventgrid/generated/runtime/BuildTime/Models/PsHelpMarkdownOutputs.cs new file mode 100644 index 000000000000..8cd285b80d4b --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/BuildTime/Models/PsHelpMarkdownOutputs.cs @@ -0,0 +1,199 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Linq; +using System.Management.Automation; +using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.PsHelpOutputExtensions; + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell +{ + internal class HelpMetadataOutput + { + public MarkdownHelpInfo HelpInfo { get; } + + public HelpMetadataOutput(MarkdownHelpInfo helpInfo) + { + HelpInfo = helpInfo; + } + + public override string ToString() => $@"--- +external help file:{(!String.IsNullOrEmpty(HelpInfo.ExternalHelpFilename) ? $" {HelpInfo.ExternalHelpFilename}" : String.Empty)} +Module Name: {HelpInfo.ModuleName} +online version: {HelpInfo.OnlineVersion} +schema: {HelpInfo.Schema.ToString(3)} +--- + +"; + } + + internal class HelpSyntaxOutput + { + public MarkdownSyntaxHelpInfo SyntaxInfo { get; } + public bool HasMultipleParameterSets { get; } + + public HelpSyntaxOutput(MarkdownSyntaxHelpInfo syntaxInfo, bool hasMultipleParameterSets) + { + SyntaxInfo = syntaxInfo; + HasMultipleParameterSets = hasMultipleParameterSets; + } + + public override string ToString() + { + var psnText = HasMultipleParameterSets ? $"### {SyntaxInfo.ParameterSetName}{(SyntaxInfo.IsDefault ? " (Default)" : String.Empty)}{Environment.NewLine}" : String.Empty; + return $@"{psnText}``` +{SyntaxInfo.SyntaxText} +``` + +"; + } + } + + internal class HelpExampleOutput + { + private string ExampleTemplate = + "{0}{1}" + Environment.NewLine + + "{2}" + Environment.NewLine + "{3}" + Environment.NewLine + "{4}" + Environment.NewLine + Environment.NewLine + + "{5}" + Environment.NewLine + Environment.NewLine; + + private string ExampleTemplateWithOutput = + "{0}{1}" + Environment.NewLine + + "{2}" + Environment.NewLine + "{3}" + Environment.NewLine + "{4}" + Environment.NewLine + Environment.NewLine + + "{5}" + Environment.NewLine + "{6}" + Environment.NewLine + "{7}" + Environment.NewLine + Environment.NewLine + + "{8}" + Environment.NewLine + Environment.NewLine; + + public MarkdownExampleHelpInfo ExampleInfo { get; } + + public HelpExampleOutput(MarkdownExampleHelpInfo exampleInfo) + { + ExampleInfo = exampleInfo; + } + + public override string ToString() + { + if (string.IsNullOrEmpty(ExampleInfo.Output)) + { + return string.Format(ExampleTemplate, + ExampleNameHeader, ExampleInfo.Name, + ExampleCodeHeader, ExampleInfo.Code, ExampleCodeFooter, + ExampleInfo.Description.ToDescriptionFormat()); + } + else + { + return string.Format(ExampleTemplateWithOutput, + ExampleNameHeader, ExampleInfo.Name, + ExampleCodeHeader, ExampleInfo.Code, ExampleCodeFooter, + ExampleOutputHeader, ExampleInfo.Output, ExampleOutputFooter, + ExampleInfo.Description.ToDescriptionFormat()); ; + } + } + } + + internal class HelpParameterOutput + { + public MarkdownParameterHelpInfo ParameterInfo { get; } + + public HelpParameterOutput(MarkdownParameterHelpInfo parameterInfo) + { + ParameterInfo = parameterInfo; + } + + public override string ToString() + { + var pipelineInputTypes = new[] + { + ParameterInfo.AcceptsPipelineByValue ? "ByValue" : String.Empty, + ParameterInfo.AcceptsPipelineByPropertyName ? "ByPropertyName" : String.Empty + }.JoinIgnoreEmpty(", "); + var pipelineInput = ParameterInfo.AcceptsPipelineByValue || ParameterInfo.AcceptsPipelineByPropertyName + ? $@"{true} ({pipelineInputTypes})" + : false.ToString(); + + return $@"### -{ParameterInfo.Name} +{ParameterInfo.Description.ToDescriptionFormat()} + +```yaml +Type: {ParameterInfo.Type.FullName} +Parameter Sets: {(ParameterInfo.HasAllParameterSets ? "(All)" : ParameterInfo.ParameterSetNames.JoinIgnoreEmpty(", "))} +Aliases:{(ParameterInfo.Aliases.Any() ? $" {ParameterInfo.Aliases.JoinIgnoreEmpty(", ")}" : String.Empty)} + +Required: {ParameterInfo.IsRequired} +Position: {ParameterInfo.Position} +Default value: {ParameterInfo.DefaultValue} +Accept pipeline input: {pipelineInput} +Accept wildcard characters: {ParameterInfo.AcceptsWildcardCharacters} +``` + +"; + } + } + + internal class ModulePageMetadataOutput + { + public PsModuleHelpInfo ModuleInfo { get; } + + private static string HelpLinkPrefix { get; } = @"https://docs.microsoft.com/en-us/powershell/module/"; + + public ModulePageMetadataOutput(PsModuleHelpInfo moduleInfo) + { + ModuleInfo = moduleInfo; + } + + public override string ToString() => $@"--- +Module Name: {ModuleInfo.Name} +Module Guid: {ModuleInfo.Guid} +Download Help Link: {HelpLinkPrefix}{ModuleInfo.Name.ToLowerInvariant()} +Help Version: 1.0.0.0 +Locale: en-US +--- + +"; + } + + internal class ModulePageCmdletOutput + { + public MarkdownHelpInfo HelpInfo { get; } + + public ModulePageCmdletOutput(MarkdownHelpInfo helpInfo) + { + HelpInfo = helpInfo; + } + + public override string ToString() => $@"### [{HelpInfo.CmdletName}]({HelpInfo.CmdletName}.md) +{HelpInfo.Synopsis.ToDescriptionFormat()} + +"; + } + + internal static class PsHelpOutputExtensions + { + public static string EscapeAngleBrackets(this string text) => text?.Replace("<", @"\<").Replace(">", @"\>"); + public static string ReplaceSentenceEndWithNewline(this string text) => text?.Replace(". ", $".{Environment.NewLine}").Replace(". ", $".{Environment.NewLine}"); + public static string ReplaceBrWithNewline(this string text) => text?.Replace("
", $"{Environment.NewLine}"); + public static string ToDescriptionFormat(this string text, bool escapeAngleBrackets = true) + { + var description = text?.ReplaceBrWithNewline(); + description = escapeAngleBrackets ? description?.EscapeAngleBrackets() : description; + return description?.ReplaceSentenceEndWithNewline().Trim(); + } + + public const string ExampleNameHeader = "### "; + public const string ExampleCodeHeader = "```powershell"; + public const string ExampleCodeFooter = "```"; + public const string ExampleOutputHeader = "```output"; + public const string ExampleOutputFooter = "```"; + + public static HelpMetadataOutput ToHelpMetadataOutput(this MarkdownHelpInfo helpInfo) => new HelpMetadataOutput(helpInfo); + + public static HelpSyntaxOutput ToHelpSyntaxOutput(this MarkdownSyntaxHelpInfo syntaxInfo, bool hasMultipleParameterSets) => new HelpSyntaxOutput(syntaxInfo, hasMultipleParameterSets); + + public static HelpExampleOutput ToHelpExampleOutput(this MarkdownExampleHelpInfo exampleInfo) => new HelpExampleOutput(exampleInfo); + + public static HelpParameterOutput ToHelpParameterOutput(this MarkdownParameterHelpInfo parameterInfo) => new HelpParameterOutput(parameterInfo); + + public static ModulePageMetadataOutput ToModulePageMetadataOutput(this PsModuleHelpInfo moduleInfo) => new ModulePageMetadataOutput(moduleInfo); + + public static ModulePageCmdletOutput ToModulePageCmdletOutput(this MarkdownHelpInfo helpInfo) => new ModulePageCmdletOutput(helpInfo); + } +} diff --git a/swaggerci/eventgrid/generated/runtime/BuildTime/Models/PsHelpTypes.cs b/swaggerci/eventgrid/generated/runtime/BuildTime/Models/PsHelpTypes.cs new file mode 100644 index 000000000000..a264a4df09ff --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/BuildTime/Models/PsHelpTypes.cs @@ -0,0 +1,202 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Management.Automation; + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell +{ + internal class PsHelpInfo + { + public string CmdletName { get; } + public string ModuleName { get; } + public string Synopsis { get; } + public string Description { get; } + public string AlertText { get; } + public string Category { get; } + public PsHelpLinkInfo OnlineVersion { get; } + public PsHelpLinkInfo[] RelatedLinks { get; } + public bool? HasCommonParameters { get; } + public bool? HasWorkflowCommonParameters { get; } + + public PsHelpTypeInfo[] InputTypes { get; } + public PsHelpTypeInfo[] OutputTypes { get; } + public PsHelpExampleInfo[] Examples { get; set; } + public string[] Aliases { get; } + + public PsParameterHelpInfo[] Parameters { get; } + public PsHelpSyntaxInfo[] Syntax { get; } + + public object Component { get; } + public object Functionality { get; } + public object PsSnapIn { get; } + public object Role { get; } + public string NonTerminatingErrors { get; } + + public PsHelpInfo(PSObject helpObject = null) + { + helpObject = helpObject ?? new PSObject(); + CmdletName = helpObject.GetProperty("Name").NullIfEmpty() ?? helpObject.GetNestedProperty("details", "name"); + ModuleName = helpObject.GetProperty("ModuleName"); + Synopsis = helpObject.GetProperty("Synopsis"); + Description = helpObject.GetProperty("description").EmptyIfNull().ToDescriptionText().NullIfEmpty() ?? + helpObject.GetNestedProperty("details", "description").EmptyIfNull().ToDescriptionText(); + AlertText = helpObject.GetNestedProperty("alertSet", "alert").EmptyIfNull().ToDescriptionText(); + Category = helpObject.GetProperty("Category"); + HasCommonParameters = helpObject.GetProperty("CommonParameters").ToNullableBool(); + HasWorkflowCommonParameters = helpObject.GetProperty("WorkflowCommonParameters").ToNullableBool(); + + var links = helpObject.GetNestedProperty("relatedLinks", "navigationLink").EmptyIfNull().Select(nl => nl.ToLinkInfo()).ToArray(); + OnlineVersion = links.FirstOrDefault(l => l.Text?.ToLowerInvariant().StartsWith("online version:") ?? links.Length == 1); + RelatedLinks = links.Where(l => !l.Text?.ToLowerInvariant().StartsWith("online version:") ?? links.Length != 1).ToArray(); + + InputTypes = helpObject.GetNestedProperty("inputTypes", "inputType").EmptyIfNull().Select(it => it.ToTypeInfo()).ToArray(); + OutputTypes = helpObject.GetNestedProperty("returnValues", "returnValue").EmptyIfNull().Select(rv => rv.ToTypeInfo()).ToArray(); + Examples = helpObject.GetNestedProperty("examples", "example").EmptyIfNull().Select(e => e.ToExampleInfo()).ToArray(); + Aliases = helpObject.GetProperty("aliases").EmptyIfNull().Split(new[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries); + + Parameters = helpObject.GetNestedProperty("parameters", "parameter").EmptyIfNull().Select(p => p.ToPsParameterHelpInfo()).ToArray(); + Syntax = helpObject.GetNestedProperty("syntax", "syntaxItem").EmptyIfNull().Select(si => si.ToSyntaxInfo()).ToArray(); + + Component = helpObject.GetProperty("Component"); + Functionality = helpObject.GetProperty("Functionality"); + PsSnapIn = helpObject.GetProperty("PSSnapIn"); + Role = helpObject.GetProperty("Role"); + NonTerminatingErrors = helpObject.GetProperty("nonTerminatingErrors"); + } + } + + internal class PsHelpTypeInfo + { + public string Name { get; } + public string Description { get; } + + public PsHelpTypeInfo(PSObject typeObject) + { + Name = typeObject.GetNestedProperty("type", "name").EmptyIfNull().Trim(); + Description = typeObject.GetProperty("description").EmptyIfNull().ToDescriptionText(); + } + } + + internal class PsHelpLinkInfo + { + public string Uri { get; } + public string Text { get; } + + public PsHelpLinkInfo(PSObject linkObject) + { + Uri = linkObject.GetProperty("uri"); + Text = linkObject.GetProperty("linkText"); + } + } + + internal class PsHelpSyntaxInfo + { + public string CmdletName { get; } + public PsParameterHelpInfo[] Parameters { get; } + + public PsHelpSyntaxInfo(PSObject syntaxObject) + { + CmdletName = syntaxObject.GetProperty("name"); + Parameters = syntaxObject.GetProperty("parameter").EmptyIfNull().Select(p => p.ToPsParameterHelpInfo()).ToArray(); + } + } + + internal class PsHelpExampleInfo + { + public string Title { get; } + public string Code { get; } + public string Output { get; } + public string Remarks { get; } + + public PsHelpExampleInfo(PSObject exampleObject) + { + Title = exampleObject.GetProperty("title"); + Code = exampleObject.GetProperty("code"); + Output = exampleObject.GetProperty("output"); + Remarks = exampleObject.GetProperty("remarks").EmptyIfNull().ToDescriptionText(); + } + public PsHelpExampleInfo(MarkdownExampleHelpInfo markdownExample) + { + Title = markdownExample.Name; + Code = markdownExample.Code; + Output = markdownExample.Output; + Remarks = markdownExample.Description; + } + + public static implicit operator PsHelpExampleInfo(MarkdownExampleHelpInfo markdownExample) => new PsHelpExampleInfo(markdownExample); + } + + internal class PsParameterHelpInfo + { + public string DefaultValueAsString { get; } + + public string Name { get; } + public string TypeName { get; } + public string Description { get; } + public string SupportsPipelineInput { get; } + public string PositionText { get; } + public string[] ParameterSetNames { get; } + public string[] Aliases { get; } + + public bool? SupportsGlobbing { get; } + public bool? IsRequired { get; } + public bool? IsVariableLength { get; } + public bool? IsDynamic { get; } + + public PsParameterHelpInfo(PSObject parameterHelpObject = null) + { + parameterHelpObject = parameterHelpObject ?? new PSObject(); + DefaultValueAsString = parameterHelpObject.GetProperty("defaultValue"); + Name = parameterHelpObject.GetProperty("name"); + TypeName = parameterHelpObject.GetProperty("parameterValue").NullIfEmpty() ?? parameterHelpObject.GetNestedProperty("type", "name"); + Description = parameterHelpObject.GetProperty("Description").EmptyIfNull().ToDescriptionText(); + SupportsPipelineInput = parameterHelpObject.GetProperty("pipelineInput"); + PositionText = parameterHelpObject.GetProperty("position"); + ParameterSetNames = parameterHelpObject.GetProperty("parameterSetName").EmptyIfNull().Split(new[] { ", " }, StringSplitOptions.RemoveEmptyEntries); + Aliases = parameterHelpObject.GetProperty("aliases").EmptyIfNull().Split(new[] { ", " }, StringSplitOptions.RemoveEmptyEntries); + + SupportsGlobbing = parameterHelpObject.GetProperty("globbing").ToNullableBool(); + IsRequired = parameterHelpObject.GetProperty("required").ToNullableBool(); + IsVariableLength = parameterHelpObject.GetProperty("variableLength").ToNullableBool(); + IsDynamic = parameterHelpObject.GetProperty("isDynamic").ToNullableBool(); + } + } + + internal class PsModuleHelpInfo + { + public string Name { get; } + public Guid Guid { get; } + public string Description { get; } + + public PsModuleHelpInfo(PSModuleInfo moduleInfo) + : this(moduleInfo?.Name ?? String.Empty, moduleInfo?.Guid ?? Guid.NewGuid(), moduleInfo?.Description ?? String.Empty) + { + } + + public PsModuleHelpInfo(string name, Guid guid, string description) + { + Name = name; + Guid = guid; + Description = description; + } + } + + internal static class HelpTypesExtensions + { + public static PsHelpInfo ToPsHelpInfo(this PSObject helpObject) => new PsHelpInfo(helpObject); + public static PsParameterHelpInfo ToPsParameterHelpInfo(this PSObject parameterHelpObject) => new PsParameterHelpInfo(parameterHelpObject); + + public static string ToDescriptionText(this IEnumerable descriptionObject) => descriptionObject != null + ? String.Join(Environment.NewLine, descriptionObject.Select(dl => dl.GetProperty("Text").EmptyIfNull())).NullIfWhiteSpace() + : null; + public static PsHelpTypeInfo ToTypeInfo(this PSObject typeObject) => new PsHelpTypeInfo(typeObject); + public static PsHelpExampleInfo ToExampleInfo(this PSObject exampleObject) => new PsHelpExampleInfo(exampleObject); + public static PsHelpLinkInfo ToLinkInfo(this PSObject linkObject) => new PsHelpLinkInfo(linkObject); + public static PsHelpSyntaxInfo ToSyntaxInfo(this PSObject syntaxObject) => new PsHelpSyntaxInfo(syntaxObject); + public static PsModuleHelpInfo ToModuleInfo(this PSModuleInfo moduleInfo) => new PsModuleHelpInfo(moduleInfo); + } +} diff --git a/swaggerci/eventgrid/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs b/swaggerci/eventgrid/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs new file mode 100644 index 000000000000..fe49a6d0cac2 --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs @@ -0,0 +1,294 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Management.Automation; +using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.MarkdownTypesExtensions; +using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.PsHelpOutputExtensions; + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell +{ + internal class MarkdownHelpInfo + { + public string ExternalHelpFilename { get; } + public string ModuleName { get; } + public string OnlineVersion { get; } + public Version Schema { get; } + + public string CmdletName { get; } + public string[] Aliases { get; } + public string Synopsis { get; } + public string Description { get; } + + public MarkdownSyntaxHelpInfo[] SyntaxInfos { get; } + public MarkdownExampleHelpInfo[] Examples { get; } + public MarkdownParameterHelpInfo[] Parameters { get; } + + public string[] Inputs { get; } + public string[] Outputs { get; } + public ComplexInterfaceInfo[] ComplexInterfaceInfos { get; } + public string[] RelatedLinks { get; } + + public bool SupportsShouldProcess { get; } + public bool SupportsPaging { get; } + + public MarkdownHelpInfo(VariantGroup variantGroup, string examplesFolder, string externalHelpFilename = "") + { + ExternalHelpFilename = externalHelpFilename; + ModuleName = variantGroup.RootModuleName != "" ? variantGroup.RootModuleName : variantGroup.ModuleName; + var helpInfo = variantGroup.HelpInfo; + var commentInfo = variantGroup.CommentInfo; + Schema = Version.Parse("2.0.0"); + + CmdletName = variantGroup.CmdletName; + Aliases = (variantGroup.Aliases.NullIfEmpty() ?? helpInfo.Aliases).Where(a => a != "None").ToArray(); + Synopsis = commentInfo.Synopsis; + Description = commentInfo.Description; + + SyntaxInfos = variantGroup.Variants + .Select(v => new MarkdownSyntaxHelpInfo(v, variantGroup.ParameterGroups, v.VariantName == variantGroup.DefaultParameterSetName)) + .OrderByDescending(v => v.IsDefault).ThenBy(v => v.ParameterSetName).ToArray(); + Examples = GetExamplesFromMarkdown(examplesFolder).NullIfEmpty() + ?? helpInfo.Examples.Select(e => e.ToExampleHelpInfo()).ToArray().NullIfEmpty() + ?? DefaultExampleHelpInfos; + + Parameters = variantGroup.ParameterGroups + .Where(pg => !pg.DontShow && !pg.Parameters.All(p => p.IsHidden())) + .Select(pg => new MarkdownParameterHelpInfo( + variantGroup.Variants.SelectMany(v => v.HelpInfo.Parameters).Where(phi => phi.Name == pg.ParameterName).ToArray(), pg)) + .OrderBy(phi => phi.Name).ToArray(); + + Inputs = commentInfo.Inputs; + Outputs = commentInfo.Outputs; + + ComplexInterfaceInfos = variantGroup.ComplexInterfaceInfos; + OnlineVersion = commentInfo.OnlineVersion; + RelatedLinks = commentInfo.RelatedLinks; + + SupportsShouldProcess = variantGroup.SupportsShouldProcess; + SupportsPaging = variantGroup.SupportsPaging; + } + + private MarkdownExampleHelpInfo[] GetExamplesFromMarkdown(string examplesFolder) + { + var filePath = Path.Combine(examplesFolder, $"{CmdletName}.md"); + if (!Directory.Exists(examplesFolder) || !File.Exists(filePath)) return null; + + var lines = File.ReadAllLines(filePath); + var nameIndices = lines.Select((l, i) => l.StartsWith(ExampleNameHeader) ? i : -1).Where(i => i != -1).ToArray(); + //https://codereview.stackexchange.com/a/187148/68772 + var indexCountGroups = nameIndices.Skip(1).Append(lines.Length).Zip(nameIndices, (next, current) => (NameIndex: current, LineCount: next - current)); + var exampleGroups = indexCountGroups.Select(icg => lines.Skip(icg.NameIndex).Take(icg.LineCount).ToArray()); + return exampleGroups.Select(eg => + { + var name = eg.First().Replace(ExampleNameHeader, String.Empty); + var codeStartIndex = eg.Select((l, i) => l.StartsWith(ExampleCodeHeader) ? (int?)i : null).FirstOrDefault(i => i.HasValue); + var codeEndIndex = eg.Select((l, i) => l.StartsWith(ExampleCodeFooter) ? (int?)i : null).FirstOrDefault(i => i.HasValue && i != codeStartIndex); + var code = codeStartIndex.HasValue && codeEndIndex.HasValue + ? String.Join(Environment.NewLine, eg.Skip(codeStartIndex.Value + 1).Take(codeEndIndex.Value - (codeStartIndex.Value + 1))) + : String.Empty; + var outputStartIndex = eg.Select((l, i) => l.StartsWith(ExampleOutputHeader) ? (int?)i : null).FirstOrDefault(i => i.HasValue); + var outputEndIndex = eg.Select((l, i) => l.StartsWith(ExampleOutputFooter) ? (int?)i : null).FirstOrDefault(i => i.HasValue && i > outputStartIndex); + var output = outputStartIndex.HasValue && outputEndIndex.HasValue + ? String.Join(Environment.NewLine, eg.Skip(outputStartIndex.Value + 1).Take(outputEndIndex.Value - (outputStartIndex.Value + 1))) + : String.Empty; + var descriptionStartIndex = (outputEndIndex ?? (codeEndIndex ?? 0)) + 1; + descriptionStartIndex = String.IsNullOrWhiteSpace(eg[descriptionStartIndex]) ? descriptionStartIndex + 1 : descriptionStartIndex; + var descriptionEndIndex = eg.Length - 1; + descriptionEndIndex = String.IsNullOrWhiteSpace(eg[descriptionEndIndex]) ? descriptionEndIndex - 1 : descriptionEndIndex; + var description = String.Join(Environment.NewLine, eg.Skip(descriptionStartIndex).Take((descriptionEndIndex + 1) - descriptionStartIndex)); + return new MarkdownExampleHelpInfo(name, code, output, description); + }).ToArray(); + } + } + + internal class MarkdownSyntaxHelpInfo + { + public Variant Variant { get; } + public bool IsDefault { get; } + public string ParameterSetName { get; } + public Parameter[] Parameters { get; } + public string SyntaxText { get; } + + public MarkdownSyntaxHelpInfo(Variant variant, ParameterGroup[] parameterGroups, bool isDefault) + { + Variant = variant; + IsDefault = isDefault; + ParameterSetName = Variant.VariantName; + Parameters = Variant.Parameters + .Where(p => !p.DontShow && !p.IsHidden()).OrderByDescending(p => p.IsMandatory) + //https://stackoverflow.com/a/6461526/294804 + .ThenByDescending(p => p.Position.HasValue).ThenBy(p => p.Position) + // Use the OrderCategory of the parameter group because the final order category is the highest of the group, and not the order category of the individual parameters from the variants. + .ThenBy(p => parameterGroups.First(pg => pg.ParameterName == p.ParameterName).OrderCategory).ThenBy(p => p.ParameterName).ToArray(); + SyntaxText = CreateSyntaxFormat(); + } + + //https://github.com/PowerShell/platyPS/blob/a607a926bfffe1e1a1e53c19e0057eddd0c07611/src/Markdown.MAML/Renderer/Markdownv2Renderer.cs#L29-L32 + private const int SyntaxLineWidth = 110; + private string CreateSyntaxFormat() + { + var parameterStrings = Parameters.Select(p => p.ToPropertySyntaxOutput().ToString()); + if (Variant.SupportsShouldProcess) + { + parameterStrings = parameterStrings.Append(" [-Confirm]").Append(" [-WhatIf]"); + } + parameterStrings = parameterStrings.Append(" []"); + + var lines = new List(20); + return parameterStrings.Aggregate(Variant.CmdletName, (current, ps) => + { + var combined = current + ps; + if (combined.Length <= SyntaxLineWidth) return combined; + + lines.Add(current); + return ps; + }, last => + { + lines.Add(last); + return String.Join(Environment.NewLine, lines); + }); + } + } + + internal class MarkdownExampleHelpInfo + { + public string Name { get; } + public string Code { get; } + public string Output { get; } + public string Description { get; } + + public MarkdownExampleHelpInfo(string name, string code, string output, string description) + { + Name = name; + Code = code; + Output = output; + Description = description; + } + } + + internal class MarkdownParameterHelpInfo + { + public string Name { get; set; } + public string Description { get; set; } + public Type Type { get; set; } + public string Position { get; set; } + public string DefaultValue { get; set; } + + public bool HasAllParameterSets { get; set; } + public string[] ParameterSetNames { get; set; } + public string[] Aliases { get; set; } + + public bool IsRequired { get; set; } + public bool IsDynamic { get; set; } + public bool AcceptsPipelineByValue { get; set; } + public bool AcceptsPipelineByPropertyName { get; set; } + public bool AcceptsWildcardCharacters { get; set; } + + // For use by common parameters that have no backing data in the objects themselves. + public MarkdownParameterHelpInfo() { } + + public MarkdownParameterHelpInfo(PsParameterHelpInfo[] parameterHelpInfos, ParameterGroup parameterGroup) + { + Name = parameterGroup.ParameterName; + Description = parameterGroup.Description.NullIfEmpty() + ?? parameterHelpInfos.Select(phi => phi.Description).FirstOrDefault(d => !String.IsNullOrEmpty(d)).EmptyIfNull(); + Type = parameterGroup.ParameterType; + Position = parameterGroup.FirstPosition?.ToString() + ?? parameterHelpInfos.Select(phi => phi.PositionText).FirstOrDefault(d => !String.IsNullOrEmpty(d)).ToUpperFirstCharacter().NullIfEmpty() + ?? "Named"; + // This no longer uses firstHelpInfo.DefaultValueAsString since it seems to be broken. For example, it has a value of 0 for Int32, but no default value was declared. + DefaultValue = parameterGroup.DefaultInfo?.Script ?? "None"; + + HasAllParameterSets = parameterGroup.HasAllVariants; + ParameterSetNames = (parameterGroup.Parameters.Select(p => p.VariantName).ToArray().NullIfEmpty() + ?? parameterHelpInfos.SelectMany(phi => phi.ParameterSetNames).Distinct()) + .OrderBy(psn => psn).ToArray(); + Aliases = parameterGroup.Aliases.NullIfEmpty() ?? parameterHelpInfos.SelectMany(phi => phi.Aliases).ToArray(); + + IsRequired = parameterHelpInfos.Select(phi => phi.IsRequired).FirstOrDefault(r => r == true) ?? parameterGroup.Parameters.Any(p => p.IsMandatory); + IsDynamic = parameterHelpInfos.Select(phi => phi.IsDynamic).FirstOrDefault(d => d == true) ?? false; + AcceptsPipelineByValue = parameterHelpInfos.Select(phi => phi.SupportsPipelineInput?.Contains("ByValue")).FirstOrDefault(bv => bv == true) ?? parameterGroup.ValueFromPipeline; + AcceptsPipelineByPropertyName = parameterHelpInfos.Select(phi => phi.SupportsPipelineInput?.Contains("ByPropertyName")).FirstOrDefault(bv => bv == true) ?? parameterGroup.ValueFromPipelineByPropertyName; + AcceptsWildcardCharacters = parameterGroup.SupportsWildcards; + } + } + + internal static class MarkdownTypesExtensions + { + public static MarkdownExampleHelpInfo ToExampleHelpInfo(this PsHelpExampleInfo exampleInfo) => new MarkdownExampleHelpInfo(exampleInfo.Title, exampleInfo.Code, exampleInfo.Output, exampleInfo.Remarks); + + public static MarkdownExampleHelpInfo[] DefaultExampleHelpInfos = + { + new MarkdownExampleHelpInfo("Example 1: {{ Add title here }}", $@"{{{{ Add code here }}}}", $@"{{{{ Add output here }}}}", @"{{ Add description here }}"), + new MarkdownExampleHelpInfo("Example 2: {{ Add title here }}", $@"{{{{ Add code here }}}}", $@"{{{{ Add output here }}}}", @"{{ Add description here }}"), + }; + + public static MarkdownParameterHelpInfo[] SupportsShouldProcessParameters = + { + new MarkdownParameterHelpInfo + { + Name = "Confirm", + Description ="Prompts you for confirmation before running the cmdlet.", + Type = typeof(SwitchParameter), + Position = "Named", + DefaultValue = "None", + HasAllParameterSets = true, + ParameterSetNames = new [] { "(All)" }, + Aliases = new [] { "cf" } + }, + new MarkdownParameterHelpInfo + { + Name = "WhatIf", + Description ="Shows what would happen if the cmdlet runs. The cmdlet is not run.", + Type = typeof(SwitchParameter), + Position = "Named", + DefaultValue = "None", + HasAllParameterSets = true, + ParameterSetNames = new [] { "(All)" }, + Aliases = new [] { "wi" } + } + }; + + public static MarkdownParameterHelpInfo[] SupportsPagingParameters = + { + new MarkdownParameterHelpInfo + { + Name = "First", + Description ="Gets only the first 'n' objects.", + Type = typeof(ulong), + Position = "Named", + DefaultValue = "None", + HasAllParameterSets = true, + ParameterSetNames = new [] { "(All)" }, + Aliases = new string[0] + }, + new MarkdownParameterHelpInfo + { + Name = "IncludeTotalCount", + Description ="Reports the number of objects in the data set (an integer) followed by the objects. If the cmdlet cannot determine the total count, it returns \"Unknown total count\".", + Type = typeof(SwitchParameter), + Position = "Named", + DefaultValue = "None", + HasAllParameterSets = true, + ParameterSetNames = new [] { "(All)" }, + Aliases = new string[0] + }, + new MarkdownParameterHelpInfo + { + Name = "Skip", + Description ="Ignores the first 'n' objects and then gets the remaining objects.", + Type = typeof(ulong), + Position = "Named", + DefaultValue = "None", + HasAllParameterSets = true, + ParameterSetNames = new [] { "(All)" }, + Aliases = new string[0] + } + }; + } +} diff --git a/swaggerci/eventgrid/generated/runtime/BuildTime/Models/PsProxyOutputs.cs b/swaggerci/eventgrid/generated/runtime/BuildTime/Models/PsProxyOutputs.cs new file mode 100644 index 000000000000..94515d5e94d7 --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/BuildTime/Models/PsProxyOutputs.cs @@ -0,0 +1,611 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Management.Automation; +using System.Text; +using System.Text.RegularExpressions; +using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.PsProxyOutputExtensions; +using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.PsProxyTypeExtensions; + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell +{ + internal class OutputTypeOutput + { + public PSTypeName[] OutputTypes { get; } + + public OutputTypeOutput(IEnumerable outputTypes) + { + OutputTypes = outputTypes.ToArray(); + } + + public override string ToString() => OutputTypes != null && OutputTypes.Any() ? $"[OutputType({OutputTypes.Select(ot => $"[{ot}]").JoinIgnoreEmpty(ItemSeparator)})]{Environment.NewLine}" : String.Empty; + } + + internal class CmdletBindingOutput + { + public VariantGroup VariantGroup { get; } + + public CmdletBindingOutput(VariantGroup variantGroup) + { + VariantGroup = variantGroup; + } + + public override string ToString() + { + var dpsText = VariantGroup.DefaultParameterSetName.IsValidDefaultParameterSetName() ? $"DefaultParameterSetName='{VariantGroup.DefaultParameterSetName}'" : String.Empty; + var sspText = VariantGroup.SupportsShouldProcess ? $"SupportsShouldProcess{ItemSeparator}ConfirmImpact='Medium'" : String.Empty; + var pbText = $"PositionalBinding={false.ToPsBool()}"; + var propertyText = new[] { dpsText, pbText, sspText }.JoinIgnoreEmpty(ItemSeparator); + return $"[CmdletBinding({propertyText})]{Environment.NewLine}"; + } + } + + internal class ParameterOutput + { + public Parameter Parameter { get; } + public bool HasMultipleVariantsInVariantGroup { get; } + public bool HasAllVariantsInParameterGroup { get; } + + public ParameterOutput(Parameter parameter, bool hasMultipleVariantsInVariantGroup, bool hasAllVariantsInParameterGroup) + { + Parameter = parameter; + HasMultipleVariantsInVariantGroup = hasMultipleVariantsInVariantGroup; + HasAllVariantsInParameterGroup = hasAllVariantsInParameterGroup; + } + + public override string ToString() + { + var psnText = HasMultipleVariantsInVariantGroup && !HasAllVariantsInParameterGroup ? $"ParameterSetName='{Parameter.VariantName}'" : String.Empty; + var positionText = Parameter.Position != null ? $"Position={Parameter.Position}" : String.Empty; + var mandatoryText = Parameter.IsMandatory ? "Mandatory" : String.Empty; + var dontShowText = Parameter.DontShow ? "DontShow" : String.Empty; + var vfpText = Parameter.ValueFromPipeline ? "ValueFromPipeline" : String.Empty; + var vfpbpnText = Parameter.ValueFromPipelineByPropertyName ? "ValueFromPipelineByPropertyName" : String.Empty; + var propertyText = new[] { psnText, positionText, mandatoryText, dontShowText, vfpText, vfpbpnText }.JoinIgnoreEmpty(ItemSeparator); + return $"{Indent}[Parameter({propertyText})]{Environment.NewLine}"; + } + } + + internal class AliasOutput + { + public string[] Aliases { get; } + public bool IncludeIndent { get; } + + public AliasOutput(string[] aliases, bool includeIndent = false) + { + Aliases = aliases; + IncludeIndent = includeIndent; + } + + public override string ToString() => Aliases?.Any() ?? false ? $"{(IncludeIndent ? Indent : String.Empty)}[Alias({Aliases.Select(an => $"'{an}'").JoinIgnoreEmpty(ItemSeparator)})]{Environment.NewLine}" : String.Empty; + } + + internal class ValidateNotNullOutput + { + public bool HasValidateNotNull { get; } + + public ValidateNotNullOutput(bool hasValidateNotNull) + { + HasValidateNotNull = hasValidateNotNull; + } + + public override string ToString() => HasValidateNotNull ? $"{Indent}[ValidateNotNull()]{Environment.NewLine}" : String.Empty; + } + + internal class AllowEmptyArrayOutput + { + public bool HasAllowEmptyArray { get; } + + public AllowEmptyArrayOutput(bool hasAllowEmptyArray) + { + HasAllowEmptyArray = hasAllowEmptyArray; + } + + public override string ToString() => HasAllowEmptyArray ? $"{Indent}[AllowEmptyCollection()]{Environment.NewLine}" : String.Empty; + } + internal class ArgumentCompleterOutput + { + public CompleterInfo CompleterInfo { get; } + + public ArgumentCompleterOutput(CompleterInfo completerInfo) + { + CompleterInfo = completerInfo; + } + + public override string ToString() => CompleterInfo != null + ? $"{Indent}[ArgumentCompleter({(CompleterInfo.IsTypeCompleter ? $"[{CompleterInfo.Type.Unwrap().ToPsType()}]" : $"{{{CompleterInfo.Script.ToPsSingleLine("; ")}}}")})]{Environment.NewLine}" + : String.Empty; + } + + internal class DefaultInfoOutput + { + public bool HasDefaultInfo { get; } + public DefaultInfo DefaultInfo { get; } + + public DefaultInfoOutput(ParameterGroup parameterGroup) + { + HasDefaultInfo = parameterGroup.HasDefaultInfo; + DefaultInfo = parameterGroup.DefaultInfo; + } + + public override string ToString() + { + var nameText = !String.IsNullOrEmpty(DefaultInfo?.Name) ? $"Name='{DefaultInfo?.Name}'" : String.Empty; + var descriptionText = !String.IsNullOrEmpty(DefaultInfo?.Description) ? $"Description='{DefaultInfo?.Description.ToPsStringLiteral()}'" : String.Empty; + var scriptText = !String.IsNullOrEmpty(DefaultInfo?.Script) ? $"Script='{DefaultInfo?.Script.ToPsSingleLine("; ")}'" : String.Empty; + var propertyText = new[] { nameText, descriptionText, scriptText }.JoinIgnoreEmpty(ItemSeparator); + return HasDefaultInfo ? $"{Indent}[{typeof(DefaultInfoAttribute).ToPsAttributeType()}({propertyText})]{Environment.NewLine}" : String.Empty; + } + } + + internal class ParameterTypeOutput + { + public Type ParameterType { get; } + + public ParameterTypeOutput(Type parameterType) + { + ParameterType = parameterType; + } + + public override string ToString() => $"{Indent}[{ParameterType.ToPsType()}]{Environment.NewLine}"; + } + + internal class ParameterNameOutput + { + public string ParameterName { get; } + public bool IsLast { get; } + + public ParameterNameOutput(string parameterName, bool isLast) + { + ParameterName = parameterName; + IsLast = isLast; + } + + public override string ToString() => $"{Indent}${{{ParameterName}}}{(IsLast ? String.Empty : $",{Environment.NewLine}")}{Environment.NewLine}"; + } + + internal class BaseOutput + { + public VariantGroup VariantGroup { get; } + + protected static readonly bool IsAzure = Convert.ToBoolean(@"true"); + public BaseOutput(VariantGroup variantGroup) + { + VariantGroup = variantGroup; + } + public string ClearTelemetryContext() + { + return (!VariantGroup.IsInternal && IsAzure) ? $@"{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()" : ""; + } + } + + internal class BeginOutput : BaseOutput + { + public BeginOutput(VariantGroup variantGroup) : base(variantGroup) + { + } + + public string GetProcessCustomAttributesAtRuntime() + { + return VariantGroup.IsInternal ? "" : $@"{Indent}{Indent}$cmdInfo = Get-Command -Name $mapping[$parameterSet]{Environment.NewLine}{Indent}{Indent}[Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)"; + } + private string GetTelemetry() + { + if (!VariantGroup.IsInternal && IsAzure) + { + return $@" +{Indent}{Indent}if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {{ +{Indent}{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() +{Indent}{Indent}}} +{Indent}{Indent}$preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId +{Indent}{Indent}if ($preTelemetryId -eq '') {{ +{Indent}{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() +{Indent}{Indent}{Indent}[Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) +{Indent}{Indent}}} else {{ +{Indent}{Indent}{Indent}$internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets +{Indent}{Indent}{Indent}if ($internalCalledCmdlets -eq '') {{ +{Indent}{Indent}{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name +{Indent}{Indent}{Indent}}} else {{ +{Indent}{Indent}{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name +{Indent}{Indent}{Indent}}} +{Indent}{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' +{Indent}{Indent}}} +"; + } + return ""; + } + public override string ToString() => $@"begin {{ +{Indent}try {{ +{Indent}{Indent}$outBuffer = $null +{Indent}{Indent}if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {{ +{Indent}{Indent}{Indent}$PSBoundParameters['OutBuffer'] = 1 +{Indent}{Indent}}} +{Indent}{Indent}$parameterSet = $PSCmdlet.ParameterSetName +{GetTelemetry()} +{GetParameterSetToCmdletMapping()}{GetDefaultValuesStatements()} +{GetProcessCustomAttributesAtRuntime()} +{Indent}{Indent}$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) +{Indent}{Indent}$scriptCmd = {{& $wrappedCmd @PSBoundParameters}} +{Indent}{Indent}$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) +{Indent}{Indent}$steppablePipeline.Begin($PSCmdlet) +{Indent}}} catch {{ +{ClearTelemetryContext()} +{Indent}{Indent}throw +{Indent}}} +}} + +"; + + private string GetParameterSetToCmdletMapping() + { + var sb = new StringBuilder(); + sb.AppendLine($"{Indent}{Indent}$mapping = @{{"); + foreach (var variant in VariantGroup.Variants) + { + sb.AppendLine($@"{Indent}{Indent}{Indent}{variant.VariantName} = '{variant.PrivateModuleName}\{variant.PrivateCmdletName}';"); + } + sb.Append($"{Indent}{Indent}}}"); + return sb.ToString(); + } + + private string GetDefaultValuesStatements() + { + var defaultInfos = VariantGroup.ParameterGroups.Where(pg => pg.HasDefaultInfo).Select(pg => pg.DefaultInfo).ToArray(); + var sb = new StringBuilder(); + + foreach (var defaultInfo in defaultInfos) + { + var variantListString = defaultInfo.ParameterGroup.VariantNames.ToPsList(); + var parameterName = defaultInfo.ParameterGroup.ParameterName; + sb.AppendLine(); + sb.AppendLine($"{Indent}{Indent}if (({variantListString}) -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('{parameterName}')) {{"); + sb.AppendLine($"{Indent}{Indent}{Indent}$PSBoundParameters['{parameterName}'] = {defaultInfo.Script}"); + sb.Append($"{Indent}{Indent}}}"); + } + return sb.ToString(); + } + } + + internal class ProcessOutput : BaseOutput + { + public ProcessOutput(VariantGroup variantGroup) : base(variantGroup) + { + } + + private string GetFinally() + { + if (IsAzure && !VariantGroup.IsInternal) + { + return $@" +{Indent}finally {{ +{Indent}{Indent}$backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId +{Indent}{Indent}$backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets +{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() +{Indent}}} +"; + } + return ""; + } + public override string ToString() => $@"process {{ +{Indent}try {{ +{Indent}{Indent}$steppablePipeline.Process($_) +{Indent}}} catch {{ +{ClearTelemetryContext()} +{Indent}{Indent}throw +{Indent}}} +{GetFinally()} +}} +"; + } + + internal class EndOutput : BaseOutput + { + public EndOutput(VariantGroup variantGroup) : base(variantGroup) + { + } + + private string GetTelemetry() + { + if (!VariantGroup.IsInternal && IsAzure) + { + return $@" +{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId +{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets +{Indent}{Indent}if ($preTelemetryId -eq '') {{ +{Indent}{Indent}{Indent}[Microsoft.Azure.PowerShell.Cmdlets.EventGrid.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) +{Indent}{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() +{Indent}{Indent}}} +{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId +"; + } + return ""; + } + public override string ToString() => $@"end {{ +{Indent}try {{ +{Indent}{Indent}$steppablePipeline.End() +{GetTelemetry()} +{Indent}}} catch {{ +{ClearTelemetryContext()} +{Indent}{Indent}throw +{Indent}}} +}} +"; + } + + internal class HelpCommentOutput + { + public VariantGroup VariantGroup { get; } + public CommentInfo CommentInfo { get; } + + public HelpCommentOutput(VariantGroup variantGroup) + { + VariantGroup = variantGroup; + CommentInfo = variantGroup.CommentInfo; + } + + public override string ToString() + { + var inputs = String.Join(Environment.NewLine, CommentInfo.Inputs.Select(i => $".Inputs{Environment.NewLine}{i}")); + var inputsText = !String.IsNullOrEmpty(inputs) ? $"{Environment.NewLine}{inputs}" : String.Empty; + var outputs = String.Join(Environment.NewLine, CommentInfo.Outputs.Select(o => $".Outputs{Environment.NewLine}{o}")); + var outputsText = !String.IsNullOrEmpty(outputs) ? $"{Environment.NewLine}{outputs}" : String.Empty; + var notes = String.Join($"{Environment.NewLine}{Environment.NewLine}", VariantGroup.ComplexInterfaceInfos.Select(cii => cii.ToNoteOutput())); + var notesText = !String.IsNullOrEmpty(notes) ? $"{Environment.NewLine}.Notes{Environment.NewLine}{ComplexParameterHeader}{notes}" : String.Empty; + var relatedLinks = String.Join(Environment.NewLine, CommentInfo.RelatedLinks.Select(l => $".Link{Environment.NewLine}{l}")); + var relatedLinksText = !String.IsNullOrEmpty(relatedLinks) ? $"{Environment.NewLine}{relatedLinks}" : String.Empty; + var examples = ""; + foreach (var example in VariantGroup.HelpInfo.Examples) + { + examples = examples + ".Example" + "\r\n" + example.Code + "\r\n"; + } + return $@"<# +.Synopsis +{CommentInfo.Synopsis.ToDescriptionFormat(false)} +.Description +{CommentInfo.Description.ToDescriptionFormat(false)} +{examples}{inputsText}{outputsText}{notesText} +.Link +{CommentInfo.OnlineVersion}{relatedLinksText} +#> +"; + } + } + + internal class ParameterDescriptionOutput + { + public string Description { get; } + + public ParameterDescriptionOutput(string description) + { + Description = description; + } + + public override string ToString() => !String.IsNullOrEmpty(Description) + ? Description.ToDescriptionFormat(false).NormalizeNewLines() + .Split(new[] { Environment.NewLine }, StringSplitOptions.None) + .Aggregate(String.Empty, (c, n) => c + $"{Indent}# {n}{Environment.NewLine}") + : String.Empty; + } + + internal class ProfileOutput + { + public string ProfileName { get; } + + public ProfileOutput(string profileName) + { + ProfileName = profileName; + } + + public override string ToString() => ProfileName != NoProfiles ? $"[{typeof(ProfileAttribute).ToPsAttributeType()}('{ProfileName}')]{Environment.NewLine}" : String.Empty; + } + + internal class DescriptionOutput + { + public string Description { get; } + + public DescriptionOutput(string description) + { + Description = description; + } + + public override string ToString() => !String.IsNullOrEmpty(Description) ? $"[{typeof(DescriptionAttribute).ToPsAttributeType()}('{Description.ToPsStringLiteral()}')]{Environment.NewLine}" : String.Empty; + } + + internal class ParameterCategoryOutput + { + public ParameterCategory Category { get; } + + public ParameterCategoryOutput(ParameterCategory category) + { + Category = category; + } + + public override string ToString() => $"{Indent}[{typeof(CategoryAttribute).ToPsAttributeType()}('{Category}')]{Environment.NewLine}"; + } + + internal class InfoOutput + { + public InfoAttribute Info { get; } + public Type ParameterType { get; } + + public InfoOutput(InfoAttribute info, Type parameterType) + { + Info = info; + ParameterType = parameterType; + } + + public override string ToString() + { + // Rendering of InfoAttribute members that are not used currently + /*var serializedNameText = Info.SerializedName != null ? $"SerializedName='{Info.SerializedName}'" : String.Empty; + var readOnlyText = Info.ReadOnly ? "ReadOnly" : String.Empty; + var descriptionText = !String.IsNullOrEmpty(Info.Description) ? $"Description='{Info.Description.ToPsStringLiteral()}'" : String.Empty;*/ + + var requiredText = Info.Required ? "Required" : String.Empty; + var unwrappedType = ParameterType.Unwrap(); + var hasValidPossibleTypes = Info.PossibleTypes.Any(pt => pt != unwrappedType); + var possibleTypesText = hasValidPossibleTypes + ? $"PossibleTypes=({Info.PossibleTypes.Select(pt => $"[{pt.ToPsType()}]").JoinIgnoreEmpty(ItemSeparator)})" + : String.Empty; + var propertyText = new[] { /*serializedNameText, */requiredText,/* readOnlyText,*/ possibleTypesText/*, descriptionText*/ }.JoinIgnoreEmpty(ItemSeparator); + return hasValidPossibleTypes ? $"{Indent}[{typeof(InfoAttribute).ToPsAttributeType()}({propertyText})]{Environment.NewLine}" : String.Empty; + } + } + + internal class PropertySyntaxOutput + { + public string ParameterName { get; } + public Type ParameterType { get; } + public bool IsMandatory { get; } + public int? Position { get; } + + public bool IncludeSpace { get; } + public bool IncludeDash { get; } + + public PropertySyntaxOutput(Parameter parameter) + { + ParameterName = parameter.ParameterName; + ParameterType = parameter.ParameterType; + IsMandatory = parameter.IsMandatory; + Position = parameter.Position; + IncludeSpace = true; + IncludeDash = true; + } + + public PropertySyntaxOutput(ComplexInterfaceInfo complexInterfaceInfo) + { + ParameterName = complexInterfaceInfo.Name; + ParameterType = complexInterfaceInfo.Type; + IsMandatory = complexInterfaceInfo.Required; + Position = null; + IncludeSpace = false; + IncludeDash = false; + } + + public override string ToString() + { + var leftOptional = !IsMandatory ? "[" : String.Empty; + var leftPositional = Position != null ? "[" : String.Empty; + var rightPositional = Position != null ? "]" : String.Empty; + var type = ParameterType != typeof(SwitchParameter) ? $" <{ParameterType.ToSyntaxTypeName()}>" : String.Empty; + var rightOptional = !IsMandatory ? "]" : String.Empty; + var space = IncludeSpace ? " " : String.Empty; + var dash = IncludeDash ? "-" : String.Empty; + return $"{space}{leftOptional}{leftPositional}{dash}{ParameterName}{rightPositional}{type}{rightOptional}"; + } + } + + internal static class PsProxyOutputExtensions + { + public const string NoParameters = "__NoParameters"; + + public const string AllParameterSets = "__AllParameterSets"; + + public const string HalfIndent = " "; + + public const string Indent = HalfIndent + HalfIndent; + + public const string ItemSeparator = ", "; + + public static readonly string ComplexParameterHeader = $"COMPLEX PARAMETER PROPERTIES{Environment.NewLine}{Environment.NewLine}To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.{Environment.NewLine}{Environment.NewLine}"; + + public static string ToPsBool(this bool value) => $"${value.ToString().ToLowerInvariant()}"; + + public static string ToPsType(this Type type) + { + var regex = new Regex(@"^(.*)`{1}\d+(.*)$"); + var typeText = type.ToString(); + var match = regex.Match(typeText); + return match.Success ? $"{match.Groups[1]}{match.Groups[2]}" : typeText; + } + + public static string ToPsAttributeType(this Type type) => type.ToPsType().RemoveEnd("Attribute"); + + // https://stackoverflow.com/a/5284606/294804 + private static string RemoveEnd(this string text, string suffix) => text.EndsWith(suffix) ? text.Substring(0, text.Length - suffix.Length) : text; + + public static string ToPsSingleLine(this string value, string replacer = " ") => value.ReplaceNewLines(replacer, new[] { "
", "\r\n", "\n" }); + + public static string ToPsStringLiteral(this string value) => value?.Replace("'", "''").Replace("‘", "''").Replace("’", "''").ToPsSingleLine().Trim() ?? String.Empty; + + public static string JoinIgnoreEmpty(this IEnumerable values, string separator) => String.Join(separator, values?.Where(v => !String.IsNullOrEmpty(v))); + + // https://stackoverflow.com/a/41961738/294804 + public static string ToSyntaxTypeName(this Type type) + { + if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>)) + { + return $"{type.GetGenericArguments().First().ToSyntaxTypeName()}?"; + } + + if (type.IsGenericType) + { + var genericTypes = String.Join(ItemSeparator, type.GetGenericArguments().Select(ToSyntaxTypeName)); + return $"{type.Name.Split('`').First()}<{genericTypes}>"; + } + + return type.Name; + } + + public static OutputTypeOutput ToOutputTypeOutput(this IEnumerable outputTypes) => new OutputTypeOutput(outputTypes); + + public static CmdletBindingOutput ToCmdletBindingOutput(this VariantGroup variantGroup) => new CmdletBindingOutput(variantGroup); + + public static ParameterOutput ToParameterOutput(this Parameter parameter, bool hasMultipleVariantsInVariantGroup, bool hasAllVariantsInParameterGroup) => new ParameterOutput(parameter, hasMultipleVariantsInVariantGroup, hasAllVariantsInParameterGroup); + + public static AliasOutput ToAliasOutput(this string[] aliases, bool includeIndent = false) => new AliasOutput(aliases, includeIndent); + + public static ValidateNotNullOutput ToValidateNotNullOutput(this bool hasValidateNotNull) => new ValidateNotNullOutput(hasValidateNotNull); + + public static AllowEmptyArrayOutput ToAllowEmptyArray(this bool hasAllowEmptyArray) => new AllowEmptyArrayOutput(hasAllowEmptyArray); + + public static ArgumentCompleterOutput ToArgumentCompleterOutput(this CompleterInfo completerInfo) => new ArgumentCompleterOutput(completerInfo); + + public static DefaultInfoOutput ToDefaultInfoOutput(this ParameterGroup parameterGroup) => new DefaultInfoOutput(parameterGroup); + + public static ParameterTypeOutput ToParameterTypeOutput(this Type parameterType) => new ParameterTypeOutput(parameterType); + + public static ParameterNameOutput ToParameterNameOutput(this string parameterName, bool isLast) => new ParameterNameOutput(parameterName, isLast); + + public static BeginOutput ToBeginOutput(this VariantGroup variantGroup) => new BeginOutput(variantGroup); + + public static ProcessOutput ToProcessOutput(this VariantGroup variantGroup) => new ProcessOutput(variantGroup); + + public static EndOutput ToEndOutput(this VariantGroup variantGroup) => new EndOutput(variantGroup); + + public static HelpCommentOutput ToHelpCommentOutput(this VariantGroup variantGroup) => new HelpCommentOutput(variantGroup); + + public static ParameterDescriptionOutput ToParameterDescriptionOutput(this string description) => new ParameterDescriptionOutput(description); + + public static ProfileOutput ToProfileOutput(this string profileName) => new ProfileOutput(profileName); + + public static DescriptionOutput ToDescriptionOutput(this string description) => new DescriptionOutput(description); + + public static ParameterCategoryOutput ToParameterCategoryOutput(this ParameterCategory category) => new ParameterCategoryOutput(category); + + public static PropertySyntaxOutput ToPropertySyntaxOutput(this Parameter parameter) => new PropertySyntaxOutput(parameter); + + public static PropertySyntaxOutput ToPropertySyntaxOutput(this ComplexInterfaceInfo complexInterfaceInfo) => new PropertySyntaxOutput(complexInterfaceInfo); + + public static InfoOutput ToInfoOutput(this InfoAttribute info, Type parameterType) => new InfoOutput(info, parameterType); + + public static string ToNoteOutput(this ComplexInterfaceInfo complexInterfaceInfo, string currentIndent = "", bool includeDashes = false, bool includeBackticks = false, bool isFirst = true) + { + string RenderProperty(ComplexInterfaceInfo info, string indent, bool dash, bool backtick) => + $"{indent}{(dash ? "- " : String.Empty)}{(backtick ? "`" : String.Empty)}{info.ToPropertySyntaxOutput()}{(backtick ? "`" : String.Empty)}: {info.Description}"; + + var nested = complexInterfaceInfo.NestedInfos.Select(ni => + { + var nestedIndent = $"{currentIndent}{HalfIndent}"; + return ni.IsComplexInterface + ? ni.ToNoteOutput(nestedIndent, includeDashes, includeBackticks, false) + : RenderProperty(ni, nestedIndent, includeDashes, includeBackticks); + }).Prepend(RenderProperty(complexInterfaceInfo, currentIndent, !isFirst && includeDashes, !isFirst && includeBackticks)); + return String.Join(Environment.NewLine, nested); + } + } +} diff --git a/swaggerci/eventgrid/generated/runtime/BuildTime/Models/PsProxyTypes.cs b/swaggerci/eventgrid/generated/runtime/BuildTime/Models/PsProxyTypes.cs new file mode 100644 index 000000000000..d8c749a4a3e8 --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/BuildTime/Models/PsProxyTypes.cs @@ -0,0 +1,514 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Management.Automation; +using System.Reflection; +using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.PsProxyOutputExtensions; +using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell.PsProxyTypeExtensions; + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell +{ + internal class ProfileGroup + { + public string ProfileName { get; } + public Variant[] Variants { get; } + public string ProfileFolder { get; } + + public ProfileGroup(Variant[] variants, string profileName = NoProfiles) + { + ProfileName = profileName; + Variants = variants; + ProfileFolder = ProfileName != NoProfiles ? ProfileName : String.Empty; + } + } + + internal class VariantGroup + { + public string ModuleName { get; } + + public string RootModuleName {get => @"";} + public string CmdletName { get; } + public string CmdletVerb { get; } + public string CmdletNoun { get; } + public string ProfileName { get; } + public Variant[] Variants { get; } + public ParameterGroup[] ParameterGroups { get; } + public ComplexInterfaceInfo[] ComplexInterfaceInfos { get; } + + public string[] Aliases { get; } + public PSTypeName[] OutputTypes { get; } + public bool SupportsShouldProcess { get; } + public bool SupportsPaging { get; } + public string DefaultParameterSetName { get; } + public bool HasMultipleVariants { get; } + public PsHelpInfo HelpInfo { get; } + public bool IsGenerated { get; } + public bool IsInternal { get; } + + public string OutputFolder { get; } + public string FileName { get; } + public string FilePath { get; } + + public CommentInfo CommentInfo { get; } + + public VariantGroup(string moduleName, string cmdletName, Variant[] variants, string outputFolder, string profileName = NoProfiles, bool isTest = false, bool isInternal = false) + { + ModuleName = moduleName; + CmdletName = cmdletName; + var cmdletNameParts = CmdletName.Split('-'); + CmdletVerb = cmdletNameParts.First(); + CmdletNoun = cmdletNameParts.Last(); + ProfileName = profileName; + Variants = variants; + ParameterGroups = Variants.ToParameterGroups().OrderBy(pg => pg.OrderCategory).ThenByDescending(pg => pg.IsMandatory).ToArray(); + var aliasDuplicates = ParameterGroups.SelectMany(pg => pg.Aliases) + //https://stackoverflow.com/a/18547390/294804 + .GroupBy(a => a).Where(g => g.Count() > 1).Select(g => g.Key).ToArray(); + if (aliasDuplicates.Any()) + { + throw new ParsingMetadataException($"The alias(es) [{String.Join(", ", aliasDuplicates)}] are defined on multiple parameters for cmdlet '{CmdletName}', which is not supported."); + } + ComplexInterfaceInfos = ParameterGroups.Where(pg => !pg.DontShow && pg.IsComplexInterface).OrderBy(pg => pg.ParameterName).Select(pg => pg.ComplexInterfaceInfo).ToArray(); + + Aliases = Variants.SelectMany(v => v.Attributes).ToAliasNames().ToArray(); + OutputTypes = Variants.SelectMany(v => v.Info.OutputType).Where(ot => ot.Type != null).GroupBy(ot => ot.Type).Select(otg => otg.First()).ToArray(); + SupportsShouldProcess = Variants.Any(v => v.SupportsShouldProcess); + SupportsPaging = Variants.Any(v => v.SupportsPaging); + DefaultParameterSetName = DetermineDefaultParameterSetName(); + HasMultipleVariants = Variants.Length > 1; + HelpInfo = Variants.Select(v => v.HelpInfo).FirstOrDefault() ?? new PsHelpInfo(); + IsGenerated = Variants.All(v => v.Attributes.OfType().Any()); + IsInternal = isInternal; + + OutputFolder = outputFolder; + FileName = $"{CmdletName}{(isTest ? ".Tests" : String.Empty)}.ps1"; + FilePath = Path.Combine(OutputFolder, FileName); + + CommentInfo = new CommentInfo(this); + } + + private string DetermineDefaultParameterSetName() + { + var defaultParameterSet = Variants + .Select(v => v.Metadata.DefaultParameterSetName) + .LastOrDefault(dpsn => dpsn.IsValidDefaultParameterSetName()); + + if (String.IsNullOrEmpty(defaultParameterSet)) + { + var variantParamCountGroups = Variants + .Select(v => ( + variant: v.VariantName, + paramCount: v.CmdletOnlyParameters.Count(p => p.IsMandatory), + isSimple: v.CmdletOnlyParameters.Where(p => p.IsMandatory).All(p => p.ParameterType.IsPsSimple()))) + .GroupBy(vpc => vpc.isSimple) + .ToArray(); + var variantParameterCounts = (variantParamCountGroups.Any(g => g.Key) ? variantParamCountGroups.Where(g => g.Key) : variantParamCountGroups).SelectMany(g => g).ToArray(); + var smallestParameterCount = variantParameterCounts.Min(vpc => vpc.paramCount); + defaultParameterSet = variantParameterCounts.First(vpc => vpc.paramCount == smallestParameterCount).variant; + } + + return defaultParameterSet; + } + } + + internal class Variant + { + public string CmdletName { get; } + public string VariantName { get; } + public CommandInfo Info { get; } + public CommandMetadata Metadata { get; } + public PsHelpInfo HelpInfo { get; } + public bool HasParameterSets { get; } + public bool IsFunction { get; } + public string PrivateModuleName { get; } + public string PrivateCmdletName { get; } + public bool SupportsShouldProcess { get; } + public bool SupportsPaging { get; } + + public Attribute[] Attributes { get; } + public Parameter[] Parameters { get; } + public Parameter[] CmdletOnlyParameters { get; } + public bool IsInternal { get; } + public bool IsDoNotExport { get; } + public string[] Profiles { get; } + + public Variant(string cmdletName, string variantName, CommandInfo info, CommandMetadata metadata, bool hasParameterSets = false, PsHelpInfo helpInfo = null) + { + CmdletName = cmdletName; + VariantName = variantName; + Info = info; + HelpInfo = helpInfo ?? new PsHelpInfo(); + Metadata = metadata; + HasParameterSets = hasParameterSets; + IsFunction = Info.CommandType == CommandTypes.Function; + PrivateModuleName = Info.Source; + PrivateCmdletName = Metadata.Name; + SupportsShouldProcess = Metadata.SupportsShouldProcess; + SupportsPaging = Metadata.SupportsPaging; + + Attributes = this.ToAttributes(); + Parameters = this.ToParameters().OrderBy(p => p.OrderCategory).ThenByDescending(p => p.IsMandatory).ToArray(); + IsInternal = Attributes.OfType().Any(); + IsDoNotExport = Attributes.OfType().Any(); + CmdletOnlyParameters = Parameters.Where(p => !p.Categories.Any(c => c == ParameterCategory.Azure || c == ParameterCategory.Runtime)).ToArray(); + Profiles = Attributes.OfType().SelectMany(pa => pa.Profiles).ToArray(); + } + } + + internal class ParameterGroup + { + public string ParameterName { get; } + public Parameter[] Parameters { get; } + + public string[] VariantNames { get; } + public string[] AllVariantNames { get; } + public bool HasAllVariants { get; } + public Type ParameterType { get; } + public string Description { get; } + + public string[] Aliases { get; } + public bool HasValidateNotNull { get; } + public bool HasAllowEmptyArray { get; } + public CompleterInfo CompleterInfo { get; } + public DefaultInfo DefaultInfo { get; } + public bool HasDefaultInfo { get; } + public ParameterCategory OrderCategory { get; } + public bool DontShow { get; } + public bool IsMandatory { get; } + public bool SupportsWildcards { get; } + public bool IsComplexInterface { get; } + public ComplexInterfaceInfo ComplexInterfaceInfo { get; } + public InfoAttribute InfoAttribute { get; } + + public int? FirstPosition { get; } + public bool ValueFromPipeline { get; } + public bool ValueFromPipelineByPropertyName { get; } + public bool IsInputType { get; } + + public ParameterGroup(string parameterName, Parameter[] parameters, string[] allVariantNames) + { + ParameterName = parameterName; + Parameters = parameters; + + VariantNames = Parameters.Select(p => p.VariantName).ToArray(); + AllVariantNames = allVariantNames; + HasAllVariants = VariantNames.Any(vn => vn == AllParameterSets) || !AllVariantNames.Except(VariantNames).Any(); + var types = Parameters.Select(p => p.ParameterType).Distinct().ToArray(); + if (types.Length > 1) + { + throw new ParsingMetadataException($"The parameter '{ParameterName}' has multiple parameter types [{String.Join(", ", types.Select(t => t.Name))}] defined, which is not supported."); + } + ParameterType = types.First(); + Description = Parameters.Select(p => p.Description).FirstOrDefault(d => !String.IsNullOrEmpty(d)).EmptyIfNull(); + + Aliases = Parameters.SelectMany(p => p.Attributes).ToAliasNames().ToArray(); + HasValidateNotNull = Parameters.SelectMany(p => p.Attributes.OfType()).Any(); + HasAllowEmptyArray = Parameters.SelectMany(p => p.Attributes.OfType()).Any(); + CompleterInfo = Parameters.Select(p => p.CompleterInfoAttribute).FirstOrDefault()?.ToCompleterInfo() + ?? Parameters.Select(p => p.ArgumentCompleterAttribute).FirstOrDefault()?.ToCompleterInfo(); + DefaultInfo = Parameters.Select(p => p.DefaultInfoAttribute).FirstOrDefault()?.ToDefaultInfo(this) + ?? Parameters.Select(p => p.DefaultValueAttribute).FirstOrDefault(dv => dv != null)?.ToDefaultInfo(this); + HasDefaultInfo = DefaultInfo != null && !String.IsNullOrEmpty(DefaultInfo.Script); + // When DefaultInfo is present, force all parameters from this group to be optional. + if (HasDefaultInfo) + { + foreach (var parameter in Parameters) + { + parameter.IsMandatory = false; + } + } + OrderCategory = Parameters.Select(p => p.OrderCategory).Distinct().DefaultIfEmpty(ParameterCategory.Body).Min(); + DontShow = Parameters.All(p => p.DontShow); + IsMandatory = HasAllVariants && Parameters.Any(p => p.IsMandatory); + SupportsWildcards = Parameters.Any(p => p.SupportsWildcards); + IsComplexInterface = Parameters.Any(p => p.IsComplexInterface); + ComplexInterfaceInfo = Parameters.Where(p => p.IsComplexInterface).Select(p => p.ComplexInterfaceInfo).FirstOrDefault(); + InfoAttribute = Parameters.Select(p => p.InfoAttribute).First(); + + FirstPosition = Parameters.Select(p => p.Position).FirstOrDefault(p => p != null); + ValueFromPipeline = Parameters.Any(p => p.ValueFromPipeline); + ValueFromPipelineByPropertyName = Parameters.Any(p => p.ValueFromPipelineByPropertyName); + IsInputType = ValueFromPipeline || ValueFromPipelineByPropertyName; + } + } + + internal class Parameter + { + public string VariantName { get; } + public string ParameterName { get; } + public ParameterMetadata Metadata { get; } + public PsParameterHelpInfo HelpInfo { get; } + public Type ParameterType { get; } + + public Attribute[] Attributes { get; } + public ParameterCategory[] Categories { get; } + public ParameterCategory OrderCategory { get; } + public PSDefaultValueAttribute DefaultValueAttribute { get; } + public DefaultInfoAttribute DefaultInfoAttribute { get; } + public ParameterAttribute ParameterAttribute { get; } + public bool SupportsWildcards { get; } + public CompleterInfoAttribute CompleterInfoAttribute { get; } + public ArgumentCompleterAttribute ArgumentCompleterAttribute { get; } + + public bool ValueFromPipeline { get; } + public bool ValueFromPipelineByPropertyName { get; } + public int? Position { get; } + public bool DontShow { get; } + public bool IsMandatory { get; set; } + + public InfoAttribute InfoAttribute { get; } + public ComplexInterfaceInfo ComplexInterfaceInfo { get; } + public bool IsComplexInterface { get; } + public string Description { get; } + + public Parameter(string variantName, string parameterName, ParameterMetadata metadata, PsParameterHelpInfo helpInfo = null) + { + VariantName = variantName; + ParameterName = parameterName; + Metadata = metadata; + HelpInfo = helpInfo ?? new PsParameterHelpInfo(); + + Attributes = Metadata.Attributes.ToArray(); + ParameterType = Attributes.OfType().FirstOrDefault()?.Type ?? Metadata.ParameterType; + Categories = Attributes.OfType().SelectMany(ca => ca.Categories).Distinct().ToArray(); + OrderCategory = Categories.DefaultIfEmpty(ParameterCategory.Body).Min(); + DefaultValueAttribute = Attributes.OfType().FirstOrDefault(); + DefaultInfoAttribute = Attributes.OfType().FirstOrDefault(); + ParameterAttribute = Attributes.OfType().FirstOrDefault(pa => pa.ParameterSetName == VariantName || pa.ParameterSetName == AllParameterSets); + if (ParameterAttribute == null) + { + throw new ParsingMetadataException($"The variant '{VariantName}' has multiple parameter sets defined, which is not supported."); + } + SupportsWildcards = Attributes.OfType().Any(); + CompleterInfoAttribute = Attributes.OfType().FirstOrDefault(); + ArgumentCompleterAttribute = Attributes.OfType().FirstOrDefault(); + + ValueFromPipeline = ParameterAttribute.ValueFromPipeline; + ValueFromPipelineByPropertyName = ParameterAttribute.ValueFromPipelineByPropertyName; + Position = ParameterAttribute.Position == Int32.MinValue ? (int?)null : ParameterAttribute.Position; + DontShow = ParameterAttribute.DontShow; + IsMandatory = ParameterAttribute.Mandatory; + + var complexParameterName = ParameterName.ToUpperInvariant(); + var complexMessage = $"{Environment.NewLine}To construct, see NOTES section for {complexParameterName} properties and create a hash table."; + var description = ParameterAttribute.HelpMessage.NullIfEmpty() ?? HelpInfo.Description.NullIfEmpty() ?? InfoAttribute?.Description.NullIfEmpty() ?? String.Empty; + // Remove the complex type message as it will be reinserted if this is a complex type + description = description.NormalizeNewLines().Replace(complexMessage, String.Empty).Replace(complexMessage.ToPsSingleLine(), String.Empty); + // Make an InfoAttribute for processing only if one isn't provided + InfoAttribute = Attributes.OfType().FirstOrDefault() ?? new InfoAttribute { PossibleTypes = new[] { ParameterType.Unwrap() }, Required = IsMandatory }; + // Set the description if the InfoAttribute does not have one since they are exported without a description + InfoAttribute.Description = String.IsNullOrEmpty(InfoAttribute.Description) ? description : InfoAttribute.Description; + ComplexInterfaceInfo = InfoAttribute.ToComplexInterfaceInfo(complexParameterName, ParameterType, true); + IsComplexInterface = ComplexInterfaceInfo.IsComplexInterface; + Description = $"{description}{(IsComplexInterface ? complexMessage : String.Empty)}"; + } + } + + internal class ComplexInterfaceInfo + { + public InfoAttribute InfoAttribute { get; } + + public string Name { get; } + public Type Type { get; } + public bool Required { get; } + public bool ReadOnly { get; } + public string Description { get; } + + public ComplexInterfaceInfo[] NestedInfos { get; } + public bool IsComplexInterface { get; } + + public ComplexInterfaceInfo(string name, Type type, InfoAttribute infoAttribute, bool? required, List seenTypes) + { + Name = name; + Type = type; + InfoAttribute = infoAttribute; + + Required = required ?? InfoAttribute.Required; + ReadOnly = InfoAttribute.ReadOnly; + Description = InfoAttribute.Description.ToPsSingleLine(); + + var unwrappedType = Type.Unwrap(); + var hasBeenSeen = seenTypes?.Contains(unwrappedType) ?? false; + (seenTypes ?? (seenTypes = new List())).Add(unwrappedType); + NestedInfos = hasBeenSeen ? new ComplexInterfaceInfo[]{} : + unwrappedType.GetInterfaces() + .Concat(InfoAttribute.PossibleTypes) + .SelectMany(pt => pt.GetProperties() + .SelectMany(pi => pi.GetCustomAttributes(true).OfType() + .Select(ia => ia.ToComplexInterfaceInfo(pi.Name, pi.PropertyType, seenTypes: seenTypes)))) + .Where(cii => !cii.ReadOnly).OrderByDescending(cii => cii.Required).ToArray(); + // https://stackoverflow.com/a/503359/294804 + var associativeArrayInnerType = Type.GetInterfaces() + .FirstOrDefault(i => i.IsGenericType && i.GetGenericTypeDefinition() == typeof(IAssociativeArray<>)) + ?.GetTypeInfo().GetGenericArguments().First(); + if (!hasBeenSeen && associativeArrayInnerType != null) + { + var anyInfo = new InfoAttribute { Description = "This indicates any property can be added to this object." }; + NestedInfos = NestedInfos.Prepend(anyInfo.ToComplexInterfaceInfo("(Any)", associativeArrayInnerType)).ToArray(); + } + IsComplexInterface = NestedInfos.Any(); + } + } + + internal class CommentInfo + { + public string Description { get; } + public string Synopsis { get; } + + public string[] Examples { get; } + public string[] Inputs { get; } + public string[] Outputs { get; } + + public string OnlineVersion { get; } + public string[] RelatedLinks { get; } + + private const string HelpLinkPrefix = @"https://docs.microsoft.com/en-us/powershell/module/"; + + public CommentInfo(VariantGroup variantGroup) + { + var helpInfo = variantGroup.HelpInfo; + Description = variantGroup.Variants.SelectMany(v => v.Attributes).OfType().FirstOrDefault()?.Description.NullIfEmpty() + ?? helpInfo.Description.EmptyIfNull(); + // If there is no Synopsis, PowerShell may put in the Syntax string as the Synopsis. This seems unintended, so we remove the Synopsis in this situation. + var synopsis = helpInfo.Synopsis.EmptyIfNull().Trim().StartsWith(variantGroup.CmdletName) ? String.Empty : helpInfo.Synopsis; + Synopsis = synopsis.NullIfEmpty() ?? Description; + + Examples = helpInfo.Examples.Select(rl => rl.Code).ToArray(); + + Inputs = (variantGroup.ParameterGroups.Where(pg => pg.IsInputType).Select(pg => pg.ParameterType.FullName).ToArray().NullIfEmpty() ?? + helpInfo.InputTypes.Where(it => it.Name.NullIfWhiteSpace() != null).Select(it => it.Name).ToArray()) + .Where(i => i != "None").Distinct().OrderBy(i => i).ToArray(); + Outputs = (variantGroup.OutputTypes.Select(ot => ot.Type.FullName).ToArray().NullIfEmpty() ?? + helpInfo.OutputTypes.Where(it => it.Name.NullIfWhiteSpace() != null).Select(ot => ot.Name).ToArray()) + .Where(o => o != "None").Distinct().OrderBy(o => o).ToArray(); + + // Use root module name in the help link + var moduleName = variantGroup.RootModuleName == "" ? variantGroup.ModuleName.ToLowerInvariant() : variantGroup.RootModuleName.ToLowerInvariant(); + OnlineVersion = helpInfo.OnlineVersion?.Uri.NullIfEmpty() ?? $@"{HelpLinkPrefix}{moduleName}/{variantGroup.CmdletName.ToLowerInvariant()}"; + RelatedLinks = helpInfo.RelatedLinks.Select(rl => rl.Text).ToArray(); + } + } + + internal class CompleterInfo + { + public string Name { get; } + public string Description { get; } + public string Script { get; } + public Type Type { get; } + public bool IsTypeCompleter { get; } + + public CompleterInfo(CompleterInfoAttribute infoAttribute) + { + Name = infoAttribute.Name; + Description = infoAttribute.Description; + Script = infoAttribute.Script; + } + + public CompleterInfo(ArgumentCompleterAttribute completerAttribute) + { + Script = completerAttribute.ScriptBlock?.ToString(); + if (completerAttribute.Type != null) + { + Type = completerAttribute.Type; + IsTypeCompleter = true; + } + } + } + + internal class DefaultInfo + { + public string Name { get; } + public string Description { get; } + public string Script { get; } + public ParameterGroup ParameterGroup { get; } + + public DefaultInfo(DefaultInfoAttribute infoAttribute, ParameterGroup parameterGroup) + { + Name = infoAttribute.Name; + Description = infoAttribute.Description; + Script = infoAttribute.Script; + ParameterGroup = parameterGroup; + } + + public DefaultInfo(PSDefaultValueAttribute defaultValueAttribute, ParameterGroup parameterGroup) + { + Description = defaultValueAttribute.Help; + ParameterGroup = parameterGroup; + if (defaultValueAttribute.Value != null) + { + Script = defaultValueAttribute.Value.ToString(); + } + } + } + + internal static class PsProxyTypeExtensions + { + public const string NoProfiles = "__NoProfiles"; + + public static bool IsValidDefaultParameterSetName(this string parameterSetName) => + !String.IsNullOrEmpty(parameterSetName) && parameterSetName != AllParameterSets; + + public static Variant[] ToVariants(this CommandInfo info, PsHelpInfo helpInfo) + { + var metadata = new CommandMetadata(info); + var privateCmdletName = metadata.Name.Split('!').First(); + var parts = privateCmdletName.Split('_'); + return parts.Length > 1 + ? new[] { new Variant(parts[0], parts[1], info, metadata, helpInfo: helpInfo) } + // Process multiple parameter sets, so we declare a variant per parameter set. + : info.ParameterSets.Select(ps => new Variant(privateCmdletName, ps.Name, info, metadata, true, helpInfo)).ToArray(); + } + + public static Variant[] ToVariants(this CmdletAndHelpInfo info) => info.CommandInfo.ToVariants(info.HelpInfo); + + public static Variant[] ToVariants(this CommandInfo info, PSObject helpInfo = null) => info.ToVariants(helpInfo?.ToPsHelpInfo()); + + public static Parameter[] ToParameters(this Variant variant) + { + var parameters = variant.Metadata.Parameters.AsEnumerable(); + var parameterHelp = variant.HelpInfo.Parameters.AsEnumerable(); + + if (variant.HasParameterSets) + { + parameters = parameters.Where(p => p.Value.ParameterSets.Keys.Any(k => k == variant.VariantName || k == AllParameterSets)); + parameterHelp = parameterHelp.Where(ph => (!ph.ParameterSetNames.Any() || ph.ParameterSetNames.Any(psn => psn == variant.VariantName || psn == AllParameterSets)) && ph.Name != "IncludeTotalCount"); + } + var result = parameters.Select(p => new Parameter(variant.VariantName, p.Key, p.Value, parameterHelp.FirstOrDefault(ph => ph.Name == p.Key))); + if (variant.SupportsPaging) { + // If supportsPaging is set, we will need to add First and Skip parameters since they are treated as common parameters which as not contained on Metadata>parameters + variant.Info.Parameters["First"].Attributes.OfType().FirstOrDefault(pa => pa.ParameterSetName == variant.VariantName || pa.ParameterSetName == AllParameterSets).HelpMessage = "Gets only the first 'n' objects."; + variant.Info.Parameters["Skip"].Attributes.OfType().FirstOrDefault(pa => pa.ParameterSetName == variant.VariantName || pa.ParameterSetName == AllParameterSets).HelpMessage = "Ignores the first 'n' objects and then gets the remaining objects."; + result = result.Append(new Parameter(variant.VariantName, "First", variant.Info.Parameters["First"], parameterHelp.FirstOrDefault(ph => ph.Name == "First"))); + result = result.Append(new Parameter(variant.VariantName, "Skip", variant.Info.Parameters["Skip"], parameterHelp.FirstOrDefault(ph => ph.Name == "Skip"))); + } + return result.ToArray(); + } + + public static Attribute[] ToAttributes(this Variant variant) => variant.IsFunction + ? ((FunctionInfo)variant.Info).ScriptBlock.Attributes.ToArray() + : variant.Metadata.CommandType.GetCustomAttributes(false).Cast().ToArray(); + + public static IEnumerable ToParameterGroups(this Variant[] variants) + { + var allVariantNames = variants.Select(vg => vg.VariantName).ToArray(); + return variants + .SelectMany(v => v.Parameters) + .GroupBy(p => p.ParameterName, StringComparer.InvariantCultureIgnoreCase) + .Select(pg => new ParameterGroup(pg.Key, pg.Select(p => p).ToArray(), allVariantNames)); + } + + public static ComplexInterfaceInfo ToComplexInterfaceInfo(this InfoAttribute infoAttribute, string name, Type type, bool? required = null, List seenTypes = null) + => new ComplexInterfaceInfo(name, type, infoAttribute, required, seenTypes); + + public static CompleterInfo ToCompleterInfo(this CompleterInfoAttribute infoAttribute) => new CompleterInfo(infoAttribute); + public static CompleterInfo ToCompleterInfo(this ArgumentCompleterAttribute completerAttribute) => new CompleterInfo(completerAttribute); + + public static DefaultInfo ToDefaultInfo(this DefaultInfoAttribute infoAttribute, ParameterGroup parameterGroup) => new DefaultInfo(infoAttribute, parameterGroup); + public static DefaultInfo ToDefaultInfo(this PSDefaultValueAttribute defaultValueAttribute, ParameterGroup parameterGroup) => new DefaultInfo(defaultValueAttribute, parameterGroup); + } +} diff --git a/swaggerci/eventgrid/generated/runtime/BuildTime/PsAttributes.cs b/swaggerci/eventgrid/generated/runtime/BuildTime/PsAttributes.cs new file mode 100644 index 000000000000..d20373841f91 --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/BuildTime/PsAttributes.cs @@ -0,0 +1,114 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid +{ + [AttributeUsage(AttributeTargets.Class)] + public class DescriptionAttribute : Attribute + { + public string Description { get; } + + public DescriptionAttribute(string description) + { + Description = description; + } + } + + [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property)] + public class DoNotExportAttribute : Attribute + { + } + + [AttributeUsage(AttributeTargets.Class)] + public class InternalExportAttribute : Attribute + { + } + + [AttributeUsage(AttributeTargets.Class)] + public class GeneratedAttribute : Attribute + { + } + + [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property)] + public class DoNotFormatAttribute : Attribute + { + } + + [AttributeUsage(AttributeTargets.Class)] + public class ProfileAttribute : Attribute + { + public string[] Profiles { get; } + + public ProfileAttribute(params string[] profiles) + { + Profiles = profiles; + } + } + + [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)] + public class CategoryAttribute : Attribute + { + public ParameterCategory[] Categories { get; } + + public CategoryAttribute(params ParameterCategory[] categories) + { + Categories = categories; + } + } + + [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)] + public class ExportAsAttribute : Attribute + { + public Type Type { get; set; } + + public ExportAsAttribute(Type type) + { + Type = type; + } + } + + public enum ParameterCategory + { + // Note: Order is significant + Uri = 0, + Path, + Query, + Header, + Cookie, + Body, + Azure, + Runtime + } + + [AttributeUsage(AttributeTargets.Property)] + public class OriginAttribute : Attribute + { + public PropertyOrigin Origin { get; } + + public OriginAttribute(PropertyOrigin origin) + { + Origin = origin; + } + } + + public enum PropertyOrigin + { + // Note: Order is significant + Inherited = 0, + Owned, + Inlined + } + + [AttributeUsage(AttributeTargets.Property)] + public class FormatTableAttribute : Attribute + { + public int Index { get; set; } = -1; + public bool HasIndex => Index != -1; + public string Label { get; set; } + public int Width { get; set; } = -1; + public bool HasWidth => Width != -1; + } +} diff --git a/swaggerci/eventgrid/generated/runtime/BuildTime/PsExtensions.cs b/swaggerci/eventgrid/generated/runtime/BuildTime/PsExtensions.cs new file mode 100644 index 000000000000..9d794b5c8dec --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/BuildTime/PsExtensions.cs @@ -0,0 +1,169 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Management.Automation; +using System.Reflection; + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell +{ + internal static class PsExtensions + { + // https://stackoverflow.com/a/863944/294804 + // https://stackoverflow.com/a/4452598/294804 + // https://stackoverflow.com/a/28701974/294804 + // Note: This will unwrap nested collections, but we don't generate nested collections. + public static Type Unwrap(this Type type) + { + if (type.IsArray) + { + return type.GetElementType().Unwrap(); + } + + var typeInfo = type.GetTypeInfo(); + if (typeInfo.IsGenericType + && (typeInfo.GetGenericTypeDefinition() == typeof(Nullable<>) || typeof(IEnumerable<>).IsAssignableFrom(type))) + { + return typeInfo.GetGenericArguments().First().Unwrap(); + } + + return type; + } + + // https://stackoverflow.com/a/863944/294804 + private static bool IsSimple(this Type type) + { + var typeInfo = type.GetTypeInfo(); + return typeInfo.IsPrimitive + || typeInfo.IsEnum + || type == typeof(string) + || type == typeof(decimal); + } + + // https://stackoverflow.com/a/32025393/294804 + private static bool HasImplicitConversion(this Type baseType, Type targetType) => + baseType.GetMethods(BindingFlags.Public | BindingFlags.Static) + .Where(mi => mi.Name == "op_Implicit" && mi.ReturnType == targetType) + .Any(mi => mi.GetParameters().FirstOrDefault()?.ParameterType == baseType); + + public static bool IsPsSimple(this Type type) + { + var unwrappedType = type.Unwrap(); + return unwrappedType.IsSimple() + || unwrappedType == typeof(SwitchParameter) + || unwrappedType == typeof(Hashtable) + || unwrappedType == typeof(PSCredential) + || unwrappedType == typeof(ScriptBlock) + || unwrappedType == typeof(DateTime) + || unwrappedType == typeof(Uri) + || unwrappedType.HasImplicitConversion(typeof(string)); + } + + public static string ToPsList(this IEnumerable items) => String.Join(", ", items.Select(i => $"'{i}'")); + + public static IEnumerable ToAliasNames(this IEnumerable attributes) => attributes.OfType().SelectMany(aa => aa.AliasNames).Distinct(); + + public static bool IsArrayAndElementTypeIsT(this object item) + { + var itemType = item.GetType(); + var tType = typeof(T); + return itemType.IsArray && !tType.IsArray && tType.IsAssignableFrom(itemType.GetElementType()); + } + + public static bool IsTArrayAndElementTypeIsItem(this object item) + { + var itemType = item.GetType(); + var tType = typeof(T); + return !itemType.IsArray && tType.IsArray && (tType.GetElementType()?.IsAssignableFrom(itemType) ?? false); + } + + public static bool IsTypeOrArrayOfType(this object item) => item is T || item.IsArrayAndElementTypeIsT() || item.IsTArrayAndElementTypeIsItem(); + + public static T NormalizeArrayType(this object item) + { + if (item is T result) + { + return result; + } + + if (item.IsArrayAndElementTypeIsT()) + { + var array = (T[])Convert.ChangeType(item, typeof(T[])); + return array.FirstOrDefault(); + } + + if (item.IsTArrayAndElementTypeIsItem()) + { + var tType = typeof(T); + var array = Array.CreateInstance(tType.GetElementType(), 1); + array.SetValue(item, 0); + return (T)Convert.ChangeType(array, tType); + } + + return default(T); + } + + public static T GetNestedProperty(this PSObject psObject, params string[] names) => psObject.Properties.GetNestedProperty(names); + + public static T GetNestedProperty(this PSMemberInfoCollection properties, params string[] names) + { + var lastName = names.Last(); + var nestedProperties = names.Take(names.Length - 1).Aggregate(properties, (p, n) => p?.GetProperty(n)?.Properties); + return nestedProperties != null ? nestedProperties.GetProperty(lastName) : default(T); + } + + public static T GetProperty(this PSObject psObject, string name) => psObject.Properties.GetProperty(name); + + public static T GetProperty(this PSMemberInfoCollection properties, string name) + { + switch (properties[name]?.Value) + { + case PSObject psObject when psObject.BaseObject is PSCustomObject && psObject.ImmediateBaseObject.IsTypeOrArrayOfType(): + return psObject.ImmediateBaseObject.NormalizeArrayType(); + case PSObject psObject when psObject.BaseObject.IsTypeOrArrayOfType(): + return psObject.BaseObject.NormalizeArrayType(); + case object value when value.IsTypeOrArrayOfType(): + return value.NormalizeArrayType(); + default: + return default(T); + } + } + + public static IEnumerable RunScript(this PSCmdlet cmdlet, string script) + => PsHelpers.RunScript(cmdlet.InvokeCommand, script); + + public static void RunScript(this PSCmdlet cmdlet, string script) + => cmdlet.RunScript(script); + + public static IEnumerable RunScript(this EngineIntrinsics engineIntrinsics, string script) + => PsHelpers.RunScript(engineIntrinsics.InvokeCommand, script); + + public static void RunScript(this EngineIntrinsics engineIntrinsics, string script) + => engineIntrinsics.RunScript(script); + + public static IEnumerable RunScript(this PSCmdlet cmdlet, ScriptBlock block) + => PsHelpers.RunScript(cmdlet.InvokeCommand, block.ToString()); + + public static void RunScript(this PSCmdlet cmdlet, ScriptBlock block) + => cmdlet.RunScript(block.ToString()); + + public static IEnumerable RunScript(this EngineIntrinsics engineIntrinsics, ScriptBlock block) + => PsHelpers.RunScript(engineIntrinsics.InvokeCommand, block.ToString()); + + public static void RunScript(this EngineIntrinsics engineIntrinsics, ScriptBlock block) + => engineIntrinsics.RunScript(block.ToString()); + + /// + /// Returns if a parameter should be hidden by checking for . + /// + /// A PowerShell parameter. + public static bool IsHidden(this Parameter parameter) + { + return parameter.Attributes.Any(attr => attr is DoNotExportAttribute); + } + } +} diff --git a/swaggerci/eventgrid/generated/runtime/BuildTime/PsHelpers.cs b/swaggerci/eventgrid/generated/runtime/BuildTime/PsHelpers.cs new file mode 100644 index 000000000000..1afb1fb5f898 --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/BuildTime/PsHelpers.cs @@ -0,0 +1,104 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Management.Automation; +using Pwsh = System.Management.Automation.PowerShell; + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell +{ + internal static class PsHelpers + { + public static IEnumerable RunScript(string script) + => Pwsh.Create().AddScript(script).Invoke(); + + public static void RunScript(string script) + => RunScript(script); + + public static IEnumerable RunScript(CommandInvocationIntrinsics cii, string script) + => cii.InvokeScript(script).Select(o => o?.BaseObject).Where(o => o != null).OfType(); + + public static void RunScript(CommandInvocationIntrinsics cii, string script) + => RunScript(cii, script); + + public static IEnumerable GetModuleCmdlets(PSCmdlet cmdlet, params string[] modulePaths) + { + var getCmdletsCommand = String.Join(" + ", modulePaths.Select(mp => $"(Get-Command -Module (Import-Module '{mp}' -PassThru))")); + return (cmdlet?.RunScript(getCmdletsCommand) ?? RunScript(getCmdletsCommand)) + .Where(ci => ci.CommandType != CommandTypes.Alias); + } + + public static IEnumerable GetModuleCmdlets(params string[] modulePaths) + => GetModuleCmdlets(null, modulePaths); + + public static IEnumerable GetScriptCmdlets(PSCmdlet cmdlet, string scriptFolder) + { + // https://stackoverflow.com/a/40969712/294804 + var getCmdletsCommand = $@" +$currentFunctions = Get-ChildItem function: +Get-ChildItem -Path '{scriptFolder}' -Recurse -Include '*.ps1' -File | ForEach-Object {{ . $_.FullName }} +Get-ChildItem function: | Where-Object {{ ($currentFunctions -notcontains $_) -and $_.CmdletBinding }} +"; + return cmdlet?.RunScript(getCmdletsCommand) ?? RunScript(getCmdletsCommand); + } + + public static IEnumerable GetScriptCmdlets(string scriptFolder) + => GetScriptCmdlets(null, scriptFolder); + + public static IEnumerable GetScriptHelpInfo(PSCmdlet cmdlet, params string[] modulePaths) + { + var importModules = String.Join(Environment.NewLine, modulePaths.Select(mp => $"Import-Module '{mp}'")); + var getHelpCommand = $@" +$currentFunctions = Get-ChildItem function: +{importModules} +Get-ChildItem function: | Where-Object {{ ($currentFunctions -notcontains $_) -and $_.CmdletBinding }} | ForEach-Object {{ Get-Help -Name $_.Name -Full }} +"; + return cmdlet?.RunScript(getHelpCommand) ?? RunScript(getHelpCommand); + } + + public static IEnumerable GetScriptHelpInfo(params string[] modulePaths) + => GetScriptHelpInfo(null, modulePaths); + + public static IEnumerable GetModuleCmdletsAndHelpInfo(PSCmdlet cmdlet, params string[] modulePaths) + { + var getCmdletAndHelp = String.Join(" + ", modulePaths.Select(mp => + $@"(Get-Command -Module (Import-Module '{mp}' -PassThru) | Where-Object {{ $_.CommandType -ne 'Alias' }} | ForEach-Object {{ @{{ CommandInfo = $_; HelpInfo = ( invoke-command {{ try {{ Get-Help -Name $_.Name -Full }} catch{{ '' }} }} ) }} }})" + )); + return (cmdlet?.RunScript(getCmdletAndHelp) ?? RunScript(getCmdletAndHelp)) + .Select(h => new CmdletAndHelpInfo { CommandInfo = (h["CommandInfo"] as PSObject)?.BaseObject as CommandInfo, HelpInfo = h["HelpInfo"] as PSObject }); + } + + public static IEnumerable GetModuleCmdletsAndHelpInfo(params string[] modulePaths) + => GetModuleCmdletsAndHelpInfo(null, modulePaths); + + public static CmdletAndHelpInfo ToCmdletAndHelpInfo(this CommandInfo commandInfo, PSObject helpInfo) => new CmdletAndHelpInfo { CommandInfo = commandInfo, HelpInfo = helpInfo }; + + public const string Psd1Indent = " "; + public const string GuidStart = Psd1Indent + "GUID"; + + public static Guid ReadGuidFromPsd1(string psd1Path) + { + var guid = Guid.NewGuid(); + if (File.Exists(psd1Path)) + { + var currentGuid = File.ReadAllLines(psd1Path) + .FirstOrDefault(l => l.StartsWith(GuidStart))?.Split(new[] { " = " }, StringSplitOptions.RemoveEmptyEntries) + .LastOrDefault()?.Replace("'", String.Empty); + guid = currentGuid != null ? Guid.Parse(currentGuid) : guid; + } + + return guid; + } + } + + internal class CmdletAndHelpInfo + { + public CommandInfo CommandInfo { get; set; } + public PSObject HelpInfo { get; set; } + } +} diff --git a/swaggerci/eventgrid/generated/runtime/BuildTime/StringExtensions.cs b/swaggerci/eventgrid/generated/runtime/BuildTime/StringExtensions.cs new file mode 100644 index 000000000000..199d0bfd0d43 --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/BuildTime/StringExtensions.cs @@ -0,0 +1,24 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Linq; + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell +{ + internal static class StringExtensions + { + public static string NullIfEmpty(this string text) => String.IsNullOrEmpty(text) ? null : text; + public static string NullIfWhiteSpace(this string text) => String.IsNullOrWhiteSpace(text) ? null : text; + public static string EmptyIfNull(this string text) => text ?? String.Empty; + + public static bool? ToNullableBool(this string text) => String.IsNullOrEmpty(text) ? (bool?)null : Convert.ToBoolean(text.ToLowerInvariant()); + + public static string ToUpperFirstCharacter(this string text) => String.IsNullOrEmpty(text) ? text : $"{text[0].ToString().ToUpperInvariant()}{text.Remove(0, 1)}"; + + public static string ReplaceNewLines(this string value, string replacer = " ", string[] newLineSymbols = null) + => (newLineSymbols ?? new []{ "\r\n", "\n" }).Aggregate(value.EmptyIfNull(), (current, symbol) => current.Replace(symbol, replacer)); + public static string NormalizeNewLines(this string value) => value.ReplaceNewLines("\u00A0").Replace("\u00A0", Environment.NewLine); + } +} diff --git a/swaggerci/eventgrid/generated/runtime/BuildTime/XmlExtensions.cs b/swaggerci/eventgrid/generated/runtime/BuildTime/XmlExtensions.cs new file mode 100644 index 000000000000..2eb5a4b6c55b --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/BuildTime/XmlExtensions.cs @@ -0,0 +1,28 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System.IO; +using System.Xml; +using System.Xml.Serialization; + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell +{ + internal static class XmlExtensions + { + public static string ToXmlString(this T inputObject, bool excludeDeclaration = false) + { + var serializer = new XmlSerializer(typeof(T)); + //https://stackoverflow.com/a/760290/294804 + //https://stackoverflow.com/a/3732234/294804 + var namespaces = new XmlSerializerNamespaces(new[] { XmlQualifiedName.Empty }); + var xmlSettings = new XmlWriterSettings { OmitXmlDeclaration = excludeDeclaration, Indent = true }; + using (var stringWriter = new StringWriter()) + using (var xmlWriter = XmlWriter.Create(stringWriter, xmlSettings)) + { + serializer.Serialize(xmlWriter, inputObject, namespaces); + return stringWriter.ToString(); + } + } + } +} diff --git a/swaggerci/eventgrid/generated/runtime/CmdInfoHandler.cs b/swaggerci/eventgrid/generated/runtime/CmdInfoHandler.cs new file mode 100644 index 000000000000..815b2a57a759 --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/CmdInfoHandler.cs @@ -0,0 +1,40 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Management.Automation; +using System.Net.Http; +using System.Threading; +using System.Threading.Tasks; + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime +{ + using NextDelegate = Func, Task>, Task>; + using SignalDelegate = Func, Task>; + + public class CmdInfoHandler + { + private readonly string processRecordId; + private readonly string parameterSetName; + private readonly InvocationInfo invocationInfo; + + public CmdInfoHandler(string processRecordId, InvocationInfo invocationInfo, string parameterSetName) + { + this.processRecordId = processRecordId; + this.parameterSetName = parameterSetName; + this.invocationInfo = invocationInfo; + } + + public Task SendAsync(HttpRequestMessage request, CancellationToken token, Action cancel, SignalDelegate signal, NextDelegate next) + { + request.Headers.Add("x-ms-client-request-id", processRecordId); + request.Headers.Add("CommandName", invocationInfo?.InvocationName); + request.Headers.Add("FullCommandName", invocationInfo?.MyCommand?.Name); + request.Headers.Add("ParameterSetName", parameterSetName); + + // continue with pipeline. + return next(request, token, cancel, signal); + } + } +} diff --git a/swaggerci/eventgrid/generated/runtime/Conversions/ConversionException.cs b/swaggerci/eventgrid/generated/runtime/Conversions/ConversionException.cs new file mode 100644 index 000000000000..9a90120a4c33 --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/Conversions/ConversionException.cs @@ -0,0 +1,17 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json +{ + internal class ConversionException : Exception + { + internal ConversionException(string message) + : base(message) { } + + internal ConversionException(JsonNode node, Type targetType) + : base($"Cannot convert '{node.Type}' to a {targetType.Name}") { } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/runtime/Conversions/IJsonConverter.cs b/swaggerci/eventgrid/generated/runtime/Conversions/IJsonConverter.cs new file mode 100644 index 000000000000..f25ab2223939 --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/Conversions/IJsonConverter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json +{ + internal interface IJsonConverter + { + JsonNode ToJson(object value); + + object FromJson(JsonNode node); + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/runtime/Conversions/Instances/BinaryConverter.cs b/swaggerci/eventgrid/generated/runtime/Conversions/Instances/BinaryConverter.cs new file mode 100644 index 000000000000..94956703211e --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/Conversions/Instances/BinaryConverter.cs @@ -0,0 +1,24 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json +{ + public sealed class BinaryConverter : JsonConverter + { + internal override JsonNode ToJson(byte[] value) => new XBinary(value); + + internal override byte[] FromJson(JsonNode node) + { + switch (node.Type) + { + case JsonType.String : return Convert.FromBase64String(node.ToString()); // Base64 Encoded + case JsonType.Binary : return ((XBinary)node).Value; + } + + throw new ConversionException(node, typeof(byte[])); + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/runtime/Conversions/Instances/BooleanConverter.cs b/swaggerci/eventgrid/generated/runtime/Conversions/Instances/BooleanConverter.cs new file mode 100644 index 000000000000..4557823a7497 --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/Conversions/Instances/BooleanConverter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json +{ + public sealed class BooleanConverter : JsonConverter + { + internal override JsonNode ToJson(bool value) => new JsonBoolean(value); + + internal override bool FromJson(JsonNode node) => (bool)node; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/runtime/Conversions/Instances/DateTimeConverter.cs b/swaggerci/eventgrid/generated/runtime/Conversions/Instances/DateTimeConverter.cs new file mode 100644 index 000000000000..3a9407f16d86 --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/Conversions/Instances/DateTimeConverter.cs @@ -0,0 +1,18 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json +{ + public sealed class DateTimeConverter : JsonConverter + { + internal override JsonNode ToJson(DateTime value) + { + return new JsonDate(value); + } + + internal override DateTime FromJson(JsonNode node) => (DateTime)node; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/runtime/Conversions/Instances/DateTimeOffsetConverter.cs b/swaggerci/eventgrid/generated/runtime/Conversions/Instances/DateTimeOffsetConverter.cs new file mode 100644 index 000000000000..120afe01c738 --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/Conversions/Instances/DateTimeOffsetConverter.cs @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json +{ + public sealed class DateTimeOffsetConverter : JsonConverter + { + internal override JsonNode ToJson(DateTimeOffset value) => new JsonDate(value); + + internal override DateTimeOffset FromJson(JsonNode node) => (DateTimeOffset)node; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/runtime/Conversions/Instances/DecimalConverter.cs b/swaggerci/eventgrid/generated/runtime/Conversions/Instances/DecimalConverter.cs new file mode 100644 index 000000000000..f9309c2dc710 --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/Conversions/Instances/DecimalConverter.cs @@ -0,0 +1,16 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json +{ + public sealed class DecimalConverter : JsonConverter + { + internal override JsonNode ToJson(decimal value) => new JsonNumber(value.ToString()); + + internal override decimal FromJson(JsonNode node) + { + return (decimal)node; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/runtime/Conversions/Instances/DoubleConverter.cs b/swaggerci/eventgrid/generated/runtime/Conversions/Instances/DoubleConverter.cs new file mode 100644 index 000000000000..2dcfa8030a7d --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/Conversions/Instances/DoubleConverter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json +{ + public sealed class DoubleConverter : JsonConverter + { + internal override JsonNode ToJson(double value) => new JsonNumber(value); + + internal override double FromJson(JsonNode node) => (double)node; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/runtime/Conversions/Instances/EnumConverter.cs b/swaggerci/eventgrid/generated/runtime/Conversions/Instances/EnumConverter.cs new file mode 100644 index 000000000000..319117635ef9 --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/Conversions/Instances/EnumConverter.cs @@ -0,0 +1,30 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json +{ + public sealed class EnumConverter : IJsonConverter + { + private readonly Type type; + + internal EnumConverter(Type type) + { + this.type = type ?? throw new ArgumentNullException(nameof(type)); + } + + public JsonNode ToJson(object value) => new JsonString(value.ToString()); + + public object FromJson(JsonNode node) + { + if (node.Type == JsonType.Number) + { + return Enum.ToObject(type, (int)node); + } + + return Enum.Parse(type, node.ToString(), ignoreCase: true); + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/runtime/Conversions/Instances/GuidConverter.cs b/swaggerci/eventgrid/generated/runtime/Conversions/Instances/GuidConverter.cs new file mode 100644 index 000000000000..6215fd9d4fa9 --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/Conversions/Instances/GuidConverter.cs @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json +{ + public sealed class GuidConverter : JsonConverter + { + internal override JsonNode ToJson(Guid value) => new JsonString(value.ToString()); + + internal override Guid FromJson(JsonNode node) => (Guid)node; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/runtime/Conversions/Instances/HashSet'1Converter.cs b/swaggerci/eventgrid/generated/runtime/Conversions/Instances/HashSet'1Converter.cs new file mode 100644 index 000000000000..6fc4d1b1bb6a --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/Conversions/Instances/HashSet'1Converter.cs @@ -0,0 +1,27 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json +{ + public sealed class HashSetConverter : JsonConverter> + { + internal override JsonNode ToJson(HashSet value) + { + return new XSet(value); + } + + internal override HashSet FromJson(JsonNode node) + { + var collection = node as ICollection; + + if (collection.Count == 0) return null; + + // TODO: Remove Linq depedency + return new HashSet(collection.Cast()); + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/runtime/Conversions/Instances/Int16Converter.cs b/swaggerci/eventgrid/generated/runtime/Conversions/Instances/Int16Converter.cs new file mode 100644 index 000000000000..6dfc64e81efe --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/Conversions/Instances/Int16Converter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json +{ + public sealed class Int16Converter : JsonConverter + { + internal override JsonNode ToJson(short value) => new JsonNumber(value); + + internal override short FromJson(JsonNode node) => (short)node; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/runtime/Conversions/Instances/Int32Converter.cs b/swaggerci/eventgrid/generated/runtime/Conversions/Instances/Int32Converter.cs new file mode 100644 index 000000000000..9505351fe01b --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/Conversions/Instances/Int32Converter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json +{ + public sealed class Int32Converter : JsonConverter + { + internal override JsonNode ToJson(int value) => new JsonNumber(value); + + internal override int FromJson(JsonNode node) => (int)node; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/runtime/Conversions/Instances/Int64Converter.cs b/swaggerci/eventgrid/generated/runtime/Conversions/Instances/Int64Converter.cs new file mode 100644 index 000000000000..acef0f685d07 --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/Conversions/Instances/Int64Converter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json +{ + public sealed class Int64Converter : JsonConverter + { + internal override JsonNode ToJson(long value) => new JsonNumber(value); + + internal override long FromJson(JsonNode node) => (long)node; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/runtime/Conversions/Instances/JsonArrayConverter.cs b/swaggerci/eventgrid/generated/runtime/Conversions/Instances/JsonArrayConverter.cs new file mode 100644 index 000000000000..acd53443ef54 --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/Conversions/Instances/JsonArrayConverter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json +{ + public sealed class JsonArrayConverter : JsonConverter + { + internal override JsonNode ToJson(JsonArray value) => value; + + internal override JsonArray FromJson(JsonNode node) => (JsonArray)node; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/runtime/Conversions/Instances/JsonObjectConverter.cs b/swaggerci/eventgrid/generated/runtime/Conversions/Instances/JsonObjectConverter.cs new file mode 100644 index 000000000000..3fb8ec6ee739 --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/Conversions/Instances/JsonObjectConverter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json +{ + public sealed class JsonObjectConverter : JsonConverter + { + internal override JsonNode ToJson(JsonObject value) => value; + + internal override JsonObject FromJson(JsonNode node) => (JsonObject)node; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/runtime/Conversions/Instances/SingleConverter.cs b/swaggerci/eventgrid/generated/runtime/Conversions/Instances/SingleConverter.cs new file mode 100644 index 000000000000..4cc950b37aaf --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/Conversions/Instances/SingleConverter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json +{ + public sealed class SingleConverter : JsonConverter + { + internal override JsonNode ToJson(float value) => new JsonNumber(value.ToString()); + + internal override float FromJson(JsonNode node) => (float)node; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/runtime/Conversions/Instances/StringConverter.cs b/swaggerci/eventgrid/generated/runtime/Conversions/Instances/StringConverter.cs new file mode 100644 index 000000000000..ccef130222ac --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/Conversions/Instances/StringConverter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json +{ + public sealed class StringConverter : JsonConverter + { + internal override JsonNode ToJson(string value) => new JsonString(value); + + internal override string FromJson(JsonNode node) => node.ToString(); + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/runtime/Conversions/Instances/TimeSpanConverter.cs b/swaggerci/eventgrid/generated/runtime/Conversions/Instances/TimeSpanConverter.cs new file mode 100644 index 000000000000..e09ced62640e --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/Conversions/Instances/TimeSpanConverter.cs @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json +{ + public sealed class TimeSpanConverter : JsonConverter + { + internal override JsonNode ToJson(TimeSpan value) => new JsonString(value.ToString()); + + internal override TimeSpan FromJson(JsonNode node) => (TimeSpan)node; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/runtime/Conversions/Instances/UInt16Converter.cs b/swaggerci/eventgrid/generated/runtime/Conversions/Instances/UInt16Converter.cs new file mode 100644 index 000000000000..ce1fee49e197 --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/Conversions/Instances/UInt16Converter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json +{ + public sealed class UInt16Converter : JsonConverter + { + internal override JsonNode ToJson(ushort value) => new JsonNumber(value); + + internal override ushort FromJson(JsonNode node) => (ushort)node; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/runtime/Conversions/Instances/UInt32Converter.cs b/swaggerci/eventgrid/generated/runtime/Conversions/Instances/UInt32Converter.cs new file mode 100644 index 000000000000..f6ee9d94ae13 --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/Conversions/Instances/UInt32Converter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json +{ + public sealed class UInt32Converter : JsonConverter + { + internal override JsonNode ToJson(uint value) => new JsonNumber(value); + + internal override uint FromJson(JsonNode node) => (uint)node; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/runtime/Conversions/Instances/UInt64Converter.cs b/swaggerci/eventgrid/generated/runtime/Conversions/Instances/UInt64Converter.cs new file mode 100644 index 000000000000..0e6ceeabebdd --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/Conversions/Instances/UInt64Converter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json +{ + public sealed class UInt64Converter : JsonConverter + { + internal override JsonNode ToJson(ulong value) => new JsonNumber(value.ToString()); + + internal override ulong FromJson(JsonNode node) => (ulong)node; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/runtime/Conversions/Instances/UriConverter.cs b/swaggerci/eventgrid/generated/runtime/Conversions/Instances/UriConverter.cs new file mode 100644 index 000000000000..ceab677285b1 --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/Conversions/Instances/UriConverter.cs @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json +{ + public sealed class UriConverter : JsonConverter + { + internal override JsonNode ToJson(Uri value) => new JsonString(value.AbsoluteUri); + + internal override Uri FromJson(JsonNode node) => (Uri)node; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/runtime/Conversions/JsonConverter.cs b/swaggerci/eventgrid/generated/runtime/Conversions/JsonConverter.cs new file mode 100644 index 000000000000..b721fbe8dfab --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/Conversions/JsonConverter.cs @@ -0,0 +1,21 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json +{ + public abstract class JsonConverter : IJsonConverter + { + internal abstract T FromJson(JsonNode node); + + internal abstract JsonNode ToJson(T value); + + #region IConverter + + object IJsonConverter.FromJson(JsonNode node) => FromJson(node); + + JsonNode IJsonConverter.ToJson(object value) => ToJson((T)value); + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/runtime/Conversions/JsonConverterAttribute.cs b/swaggerci/eventgrid/generated/runtime/Conversions/JsonConverterAttribute.cs new file mode 100644 index 000000000000..c4048e1e46a4 --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/Conversions/JsonConverterAttribute.cs @@ -0,0 +1,18 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json +{ + public sealed class JsonConverterAttribute : Attribute + { + internal JsonConverterAttribute(Type type) + { + Converter = (IJsonConverter)Activator.CreateInstance(type); + } + + internal IJsonConverter Converter { get; } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/runtime/Conversions/JsonConverterFactory.cs b/swaggerci/eventgrid/generated/runtime/Conversions/JsonConverterFactory.cs new file mode 100644 index 000000000000..a921b6554239 --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/Conversions/JsonConverterFactory.cs @@ -0,0 +1,91 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json +{ + public sealed class JsonConverterFactory + { + private static readonly Dictionary converters = new Dictionary(); + + static JsonConverterFactory() + { + AddInternal(new BooleanConverter()); + AddInternal(new DateTimeConverter()); + AddInternal(new DateTimeOffsetConverter()); + AddInternal(new BinaryConverter()); + AddInternal(new DecimalConverter()); + AddInternal(new DoubleConverter()); + AddInternal(new GuidConverter()); + AddInternal(new Int16Converter()); + AddInternal(new Int32Converter()); + AddInternal(new Int64Converter()); + AddInternal(new SingleConverter()); + AddInternal(new StringConverter()); + AddInternal(new TimeSpanConverter()); + AddInternal(new UInt16Converter()); + AddInternal(new UInt32Converter()); + AddInternal(new UInt64Converter()); + AddInternal(new UriConverter()); + + // Hash sets + AddInternal(new HashSetConverter()); + AddInternal(new HashSetConverter()); + AddInternal(new HashSetConverter()); + AddInternal(new HashSetConverter()); + AddInternal(new HashSetConverter()); + AddInternal(new HashSetConverter()); + + // JSON + + AddInternal(new JsonObjectConverter()); + AddInternal(new JsonArrayConverter()); + } + + internal static Dictionary Instances => converters; + + internal static IJsonConverter Get(Type type) + { + var details = TypeDetails.Get(type); + + if (details.JsonConverter == null) + { + throw new ConversionException($"No converter found for '{type.Name}'."); + } + + return details.JsonConverter; + } + + internal static bool TryGet(Type type, out IJsonConverter converter) + { + var typeDetails = TypeDetails.Get(type); + + converter = typeDetails.JsonConverter; + + return converter != null; + } + + private static void AddInternal(JsonConverter converter) + => converters.Add(typeof(T), converter); + + private static void AddInternal(IJsonConverter converter) + => converters.Add(typeof(T), converter); + + internal static void Add(JsonConverter converter) + { + if (converter == null) + { + throw new ArgumentNullException(nameof(converter)); + } + + AddInternal(converter); + + var type = TypeDetails.Get(); + + type.JsonConverter = converter; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/runtime/Conversions/StringLikeConverter.cs b/swaggerci/eventgrid/generated/runtime/Conversions/StringLikeConverter.cs new file mode 100644 index 000000000000..3faeaf117fb0 --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/Conversions/StringLikeConverter.cs @@ -0,0 +1,45 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Reflection; + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json +{ + public sealed class StringLikeConverter : IJsonConverter + { + private readonly Type type; + private readonly MethodInfo parseMethod; + + internal StringLikeConverter(Type type) + { + this.type = type ?? throw new ArgumentNullException(nameof(type)); + this.parseMethod = StringLikeHelper.GetParseMethod(type); + } + + public object FromJson(JsonNode node) => + parseMethod.Invoke(null, new[] { node.ToString() }); + + public JsonNode ToJson(object value) => new JsonString(value.ToString()); + } + + internal static class StringLikeHelper + { + private static readonly Type[] parseMethodParamaterTypes = new[] { typeof(string) }; + + internal static bool IsStringLike(Type type) + { + return GetParseMethod(type) != null; + } + + internal static MethodInfo GetParseMethod(Type type) + { + MethodInfo method = type.GetMethod("Parse", parseMethodParamaterTypes); + + if (method?.IsPublic != true) return null; + + return method; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/runtime/Customizations/IJsonSerializable.cs b/swaggerci/eventgrid/generated/runtime/Customizations/IJsonSerializable.cs new file mode 100644 index 000000000000..c04815a1d81e --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/Customizations/IJsonSerializable.cs @@ -0,0 +1,263 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json; +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime +{ + public interface IJsonSerializable + { + JsonNode ToJson(JsonObject container = null, SerializationMode serializationMode = SerializationMode.None); + } + internal static class JsonSerializable + { + /// + /// Serializes an enumerable and returns a JsonNode. + /// + /// an IEnumerable collection of items + /// A JsonNode that contains the collection of items serialized. + private static JsonNode ToJsonValue(System.Collections.IEnumerable enumerable) + { + if (enumerable != null) + { + // is it a byte array of some kind? + if (enumerable is System.Collections.Generic.IEnumerable byteEnumerable) + { + return new XBinary(System.Linq.Enumerable.ToArray(byteEnumerable)); + } + + var hasValues = false; + // just create an array of value nodes. + var result = new XNodeArray(); + foreach (var each in enumerable) + { + // we had at least one value. + hasValues = true; + + // try to serialize it. + var node = ToJsonValue(each); + if (null != node) + { + result.Add(node); + } + } + + // if we were able to add values, (or it was just empty), return it. + if (result.Count > 0 || !hasValues) + { + return result; + } + } + + // we couldn't serialize the values. Sorry. + return null; + } + + /// + /// Serializes a valuetype to a JsonNode. + /// + /// a ValueType (ie, a primitive, enum or struct) to be serialized + /// a JsonNode with the serialized value + private static JsonNode ToJsonValue(ValueType vValue) + { + // numeric type + if (vValue is SByte || vValue is Int16 || vValue is Int32 || vValue is Int64 || vValue is Byte || vValue is UInt16 || vValue is UInt32 || vValue is UInt64 || vValue is decimal || vValue is float || vValue is double) + { + return new JsonNumber(vValue.ToString()); + } + + // boolean type + if (vValue is bool bValue) + { + return new JsonBoolean(bValue); + } + + // dates + if (vValue is DateTime dtValue) + { + return new JsonDate(dtValue); + } + + // DictionaryEntity struct type + if (vValue is System.Collections.DictionaryEntry deValue) + { + return new JsonObject { { deValue.Key.ToString(), ToJsonValue(deValue.Value) } }; + } + + // sorry, no idea. + return null; + } + /// + /// Attempts to serialize an object by using ToJson() or ToJsonString() if they exist. + /// + /// the object to be serialized. + /// the serialized JsonNode (if successful), otherwise, null + private static JsonNode TryToJsonValue(dynamic oValue) + { + object jsonValue = null; + dynamic v = oValue; + try + { + jsonValue = v.ToJson().ToString(); + } + catch + { + // no harm... + try + { + jsonValue = v.ToJsonString().ToString(); + } + catch + { + // no worries here either. + } + } + + // if we got something out, let's use it. + if (null != jsonValue) + { + // JsonNumber is really a literal json value. Just don't try to cast that back to an actual number, ok? + return new JsonNumber(jsonValue.ToString()); + } + + return null; + } + + /// + /// Serialize an object by using a variety of methods. + /// + /// the object to be serialized. + /// the serialized JsonNode (if successful), otherwise, null + internal static JsonNode ToJsonValue(object value) + { + // things that implement our interface are preferred. + if (value is Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IJsonSerializable jsonSerializable) + { + return jsonSerializable.ToJson(); + } + + // strings are easy. + if (value is string || value is char) + { + return new JsonString(value.ToString()); + } + + // value types are fairly straightforward (fallback to ToJson()/ToJsonString() or literal JsonString ) + if (value is System.ValueType vValue) + { + return ToJsonValue(vValue) ?? TryToJsonValue(vValue) ?? new JsonString(vValue.ToString()); + } + + // dictionaries are objects that should be able to serialize + if (value is System.Collections.Generic.IDictionary dictionary) + { + return Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.JsonSerializable.ToJson(dictionary, null); + } + + // hashtables are converted to dictionaries for serialization + if (value is System.Collections.Hashtable hashtable) + { + var dict = new System.Collections.Generic.Dictionary(); + DictionaryExtensions.HashTableToDictionary(hashtable, dict); + return Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.JsonSerializable.ToJson(dict, null); + } + + // enumerable collections are handled like arrays (again, fallback to ToJson()/ToJsonString() or literal JsonString) + if (value is System.Collections.IEnumerable enumerableValue) + { + // some kind of enumerable value + return ToJsonValue(enumerableValue) ?? TryToJsonValue(value) ?? new JsonString(value.ToString()); + } + + // at this point, we're going to fallback to a string literal here, since we really have no idea what it is. + return new JsonString(value.ToString()); + } + + internal static JsonObject ToJson(System.Collections.Generic.Dictionary dictionary, JsonObject container) => ToJson((System.Collections.Generic.IDictionary)dictionary, container); + + /// + /// Serializes a dictionary into a JsonObject container. + /// + /// The dictionary to serailize + /// the container to serialize the dictionary into + /// the container + internal static JsonObject ToJson(System.Collections.Generic.IDictionary dictionary, JsonObject container) + { + container = container ?? new JsonObject(); + if (dictionary != null && dictionary.Count > 0) + { + foreach (var key in dictionary) + { + // currently, we don't serialize null values. + if (null != key.Value) + { + container.Add(key.Key, ToJsonValue(key.Value)); + continue; + } + } + } + return container; + } + + internal static Func> DeserializeDictionary(Func> dictionaryFactory) + { + return (node) => FromJson(node, dictionaryFactory(), (object)(DeserializeDictionary(dictionaryFactory)) as Func); + } + + internal static System.Collections.Generic.IDictionary FromJson(JsonObject json, System.Collections.Generic.Dictionary container, System.Func objectFactory, System.Collections.Generic.HashSet excludes = null) => FromJson(json, (System.Collections.Generic.IDictionary)container, objectFactory, excludes); + + + internal static System.Collections.Generic.IDictionary FromJson(JsonObject json, System.Collections.Generic.IDictionary container, System.Func objectFactory, System.Collections.Generic.HashSet excludes = null) + { + if (null == json) + { + return container; + } + + foreach (var key in json.Keys) + { + if (true == excludes?.Contains(key)) + { + continue; + } + + var value = json[key]; + try + { + switch (value.Type) + { + case JsonType.Null: + // skip null values. + continue; + + case JsonType.Array: + case JsonType.Boolean: + case JsonType.Date: + case JsonType.Binary: + case JsonType.Number: + case JsonType.String: + container.Add(key, (V)value.ToValue()); + break; + case JsonType.Object: + if (objectFactory != null) + { + var v = objectFactory(value as JsonObject); + if (null != v) + { + container.Add(key, v); + } + } + break; + } + } + catch + { + } + } + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/runtime/Customizations/JsonArray.cs b/swaggerci/eventgrid/generated/runtime/Customizations/JsonArray.cs new file mode 100644 index 000000000000..3904885f7208 --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/Customizations/JsonArray.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json +{ + public partial class JsonArray + { + internal override object ToValue() => Count == 0 ? new object[0] : System.Linq.Enumerable.ToArray(System.Linq.Enumerable.Select(this, each => each.ToValue())); + } + + +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/runtime/Customizations/JsonBoolean.cs b/swaggerci/eventgrid/generated/runtime/Customizations/JsonBoolean.cs new file mode 100644 index 000000000000..9de2b07e3a55 --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/Customizations/JsonBoolean.cs @@ -0,0 +1,16 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json +{ + internal partial class JsonBoolean + { + internal static JsonBoolean Create(bool? value) => value is bool b ? new JsonBoolean(b) : null; + internal bool ToBoolean() => Value; + + internal override object ToValue() => Value; + } + + +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/runtime/Customizations/JsonNode.cs b/swaggerci/eventgrid/generated/runtime/Customizations/JsonNode.cs new file mode 100644 index 000000000000..ada854e10cfb --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/Customizations/JsonNode.cs @@ -0,0 +1,21 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json +{ + using System; + using System.Collections.Generic; + + public partial class JsonNode + { + /// + /// Returns the content of this node as the underlying value. + /// Will default to the string representation if not overridden in child classes. + /// + /// an object with the underlying value of the node. + internal virtual object ToValue() { + return this.ToString(); + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/runtime/Customizations/JsonNumber.cs b/swaggerci/eventgrid/generated/runtime/Customizations/JsonNumber.cs new file mode 100644 index 000000000000..27a5c1d6013e --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/Customizations/JsonNumber.cs @@ -0,0 +1,78 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json +{ + using System; + + public partial class JsonNumber + { + internal static readonly DateTime EpochDate = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc); + private static long ToUnixTime(DateTime dateTime) + { + return (long)dateTime.Subtract(EpochDate).TotalSeconds; + } + private static DateTime FromUnixTime(long totalSeconds) + { + return EpochDate.AddSeconds(totalSeconds); + } + internal byte ToByte() => this; + internal int ToInt() => this; + internal long ToLong() => this; + internal short ToShort() => this; + internal UInt16 ToUInt16() => this; + internal UInt32 ToUInt32() => this; + internal UInt64 ToUInt64() => this; + internal decimal ToDecimal() => this; + internal double ToDouble() => this; + internal float ToFloat() => this; + + internal static JsonNumber Create(int? value) => value is int n ? new JsonNumber(n) : null; + internal static JsonNumber Create(long? value) => value is long n ? new JsonNumber(n) : null; + internal static JsonNumber Create(float? value) => value is float n ? new JsonNumber(n) : null; + internal static JsonNumber Create(double? value) => value is double n ? new JsonNumber(n) : null; + internal static JsonNumber Create(decimal? value) => value is decimal n ? new JsonNumber(n) : null; + internal static JsonNumber Create(DateTime? value) => value is DateTime date ? new JsonNumber(ToUnixTime(date)) : null; + + public static implicit operator DateTime(JsonNumber number) => FromUnixTime(number); + internal DateTime ToDateTime() => this; + + internal JsonNumber(decimal value) + { + this.value = value.ToString(); + } + internal override object ToValue() + { + if (IsInteger) + { + if (int.TryParse(this.value, out int iValue)) + { + return iValue; + } + if (long.TryParse(this.value, out long lValue)) + { + return lValue; + } + } + else + { + if (float.TryParse(this.value, out float fValue)) + { + return fValue; + } + if (double.TryParse(this.value, out double dValue)) + { + return dValue; + } + if (decimal.TryParse(this.value, out decimal dcValue)) + { + return dcValue; + } + } + return null; + } + } + + +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/runtime/Customizations/JsonObject.cs b/swaggerci/eventgrid/generated/runtime/Customizations/JsonObject.cs new file mode 100644 index 000000000000..d3671db82ef1 --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/Customizations/JsonObject.cs @@ -0,0 +1,183 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json +{ + using System; + using System.Collections.Generic; + + public partial class JsonObject + { + internal override object ToValue() => Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.JsonSerializable.FromJson(this, new System.Collections.Generic.Dictionary(), (obj) => obj.ToValue()); + + internal void SafeAdd(string name, Func valueFn) + { + if (valueFn != null) + { + var value = valueFn(); + if (null != value) + { + items.Add(name, value); + } + } + } + + internal void SafeAdd(string name, JsonNode value) + { + if (null != value) + { + items.Add(name, value); + } + } + + internal T NullableProperty(string propertyName) where T : JsonNode + { + if (this.TryGetValue(propertyName, out JsonNode value)) + { + if (value.IsNull) + { + return null; + } + if (value is T tval) + { + return tval; + } + /* it's present, but not the correct type... */ + //throw new Exception($"Property {propertyName} in object expected type {typeof(T).Name} but value of type {value.Type.ToString()} was found."); + } + return null; + } + + internal JsonObject Property(string propertyName) + { + return PropertyT(propertyName); + } + + internal T PropertyT(string propertyName) where T : JsonNode + { + if (this.TryGetValue(propertyName, out JsonNode value)) + { + if (value.IsNull) + { + return null; // we're going to assume that the consumer knows what to do if null is explicity returned? + } + + if (value is T tval) + { + return tval; + } + /* it's present, but not the correct type... */ + // throw new Exception($"Property {propertyName} in object expected type {typeof(T).Name} but value of type {value.Type.ToString()} was found."); + } + return null; + } + + internal int NumberProperty(string propertyName, ref int output) => output = this.PropertyT(propertyName)?.ToInt() ?? output; + internal float NumberProperty(string propertyName, ref float output) => output = this.PropertyT(propertyName)?.ToFloat() ?? output; + internal byte NumberProperty(string propertyName, ref byte output) => output = this.PropertyT(propertyName)?.ToByte() ?? output; + internal long NumberProperty(string propertyName, ref long output) => output = this.PropertyT(propertyName)?.ToLong() ?? output; + internal double NumberProperty(string propertyName, ref double output) => output = this.PropertyT(propertyName)?.ToDouble() ?? output; + internal decimal NumberProperty(string propertyName, ref decimal output) => output = this.PropertyT(propertyName)?.ToDecimal() ?? output; + internal short NumberProperty(string propertyName, ref short output) => output = this.PropertyT(propertyName)?.ToShort() ?? output; + internal DateTime NumberProperty(string propertyName, ref DateTime output) => output = this.PropertyT(propertyName)?.ToDateTime() ?? output; + + internal int? NumberProperty(string propertyName, ref int? output) => output = this.NullableProperty(propertyName)?.ToInt() ?? null; + internal float? NumberProperty(string propertyName, ref float? output) => output = this.NullableProperty(propertyName)?.ToFloat() ?? null; + internal byte? NumberProperty(string propertyName, ref byte? output) => output = this.NullableProperty(propertyName)?.ToByte() ?? null; + internal long? NumberProperty(string propertyName, ref long? output) => output = this.NullableProperty(propertyName)?.ToLong() ?? null; + internal double? NumberProperty(string propertyName, ref double? output) => output = this.NullableProperty(propertyName)?.ToDouble() ?? null; + internal decimal? NumberProperty(string propertyName, ref decimal? output) => output = this.NullableProperty(propertyName)?.ToDecimal() ?? null; + internal short? NumberProperty(string propertyName, ref short? output) => output = this.NullableProperty(propertyName)?.ToShort() ?? null; + + internal DateTime? NumberProperty(string propertyName, ref DateTime? output) => output = this.NullableProperty(propertyName)?.ToDateTime() ?? null; + + + internal string StringProperty(string propertyName) => this.PropertyT(propertyName)?.ToString(); + internal string StringProperty(string propertyName, ref string output) => output = this.PropertyT(propertyName)?.ToString() ?? output; + internal char StringProperty(string propertyName, ref char output) => output = this.PropertyT(propertyName)?.ToChar() ?? output; + internal char? StringProperty(string propertyName, ref char? output) => output = this.PropertyT(propertyName)?.ToChar() ?? null; + + internal DateTime StringProperty(string propertyName, ref DateTime output) => DateTime.TryParse(this.PropertyT(propertyName)?.ToString(), out output) ? output : output; + internal DateTime? StringProperty(string propertyName, ref DateTime? output) => output = DateTime.TryParse(this.PropertyT(propertyName)?.ToString(), out var o) ? o : output; + + + internal bool BooleanProperty(string propertyName, ref bool output) => output = this.PropertyT(propertyName)?.ToBoolean() ?? output; + internal bool? BooleanProperty(string propertyName, ref bool? output) => output = this.PropertyT(propertyName)?.ToBoolean() ?? null; + + internal T[] ArrayProperty(string propertyName, ref T[] output, Func deserializer) + { + var array = this.PropertyT(propertyName); + if (array != null) + { + output = new T[array.Count]; + for (var i = 0; i < output.Length; i++) + { + output[i] = deserializer(array[i]); + } + } + return output; + } + internal T[] ArrayProperty(string propertyName, Func deserializer) + { + var array = this.PropertyT(propertyName); + if (array != null) + { + var output = new T[array.Count]; + for (var i = 0; i < output.Length; i++) + { + output[i] = deserializer(array[i]); + } + return output; + } + return new T[0]; + } + internal void IterateArrayProperty(string propertyName, Action deserializer) + { + var array = this.PropertyT(propertyName); + if (array != null) + { + for (var i = 0; i < array.Count; i++) + { + deserializer(array[i]); + } + } + } + + internal Dictionary DictionaryProperty(string propertyName, ref Dictionary output, Func deserializer) + { + var dictionary = this.PropertyT(propertyName); + if (output == null) + { + output = new Dictionary(); + } + else + { + output.Clear(); + } + if (dictionary != null) + { + foreach (var key in dictionary.Keys) + { + output[key] = deserializer(dictionary[key]); + } + } + return output; + } + + internal static JsonObject Create(IDictionary source, Func selector) + { + if (source == null || selector == null) + { + return null; + } + var result = new JsonObject(); + + foreach (var key in source.Keys) + { + result.SafeAdd(key, selector(source[key])); + } + return result; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/runtime/Customizations/JsonString.cs b/swaggerci/eventgrid/generated/runtime/Customizations/JsonString.cs new file mode 100644 index 000000000000..3a7a6391d7fd --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/Customizations/JsonString.cs @@ -0,0 +1,34 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json +{ + using System; + using System.Globalization; + using System.Linq; + + public partial class JsonString + { + internal static string DateFormat = "yyyy-MM-dd"; + internal static string DateTimeFormat = "yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK"; + internal static string DateTimeRfc1123Format = "R"; + + internal static JsonString Create(string value) => value == null ? null : new JsonString(value); + internal static JsonString Create(char? value) => value is char c ? new JsonString(c.ToString()) : null; + + internal static JsonString CreateDate(DateTime? value) => value is DateTime date ? new JsonString(date.ToString(DateFormat, CultureInfo.CurrentCulture)) : null; + internal static JsonString CreateDateTime(DateTime? value) => value is DateTime date ? new JsonString(date.ToString(DateTimeFormat, CultureInfo.CurrentCulture)) : null; + internal static JsonString CreateDateTimeRfc1123(DateTime? value) => value is DateTime date ? new JsonString(date.ToString(DateTimeRfc1123Format, CultureInfo.CurrentCulture)) : null; + + internal char ToChar() => this.Value?.ToString()?.FirstOrDefault() ?? default(char); + public static implicit operator char(JsonString value) => value?.ToString()?.FirstOrDefault() ?? default(char); + public static implicit operator char? (JsonString value) => value?.ToString()?.FirstOrDefault(); + + public static implicit operator DateTime(JsonString value) => DateTime.TryParse(value, out var output) ? output : default(DateTime); + public static implicit operator DateTime? (JsonString value) => DateTime.TryParse(value, out var output) ? output : default(DateTime?); + + } + + +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/runtime/Customizations/XNodeArray.cs b/swaggerci/eventgrid/generated/runtime/Customizations/XNodeArray.cs new file mode 100644 index 000000000000..987c451f5033 --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/Customizations/XNodeArray.cs @@ -0,0 +1,44 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json +{ + using System; + using System.Linq; + + public partial class XNodeArray + { + internal static XNodeArray Create(T[] source, Func selector) + { + if (source == null || selector == null) + { + return null; + } + var result = new XNodeArray(); + foreach (var item in source.Select(selector)) + { + result.SafeAdd(item); + } + return result; + } + internal void SafeAdd(JsonNode item) + { + if (item != null) + { + items.Add(item); + } + } + internal void SafeAdd(Func itemFn) + { + if (itemFn != null) + { + var item = itemFn(); + if (item != null) + { + items.Add(item); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/runtime/Debugging.cs b/swaggerci/eventgrid/generated/runtime/Debugging.cs new file mode 100644 index 000000000000..844111b6c2a0 --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/Debugging.cs @@ -0,0 +1,28 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime +{ + internal static class AttachDebugger + { + internal static void Break() + { + while (!System.Diagnostics.Debugger.IsAttached) + { + System.Console.Error.WriteLine($"Waiting for debugger to attach to process {System.Diagnostics.Process.GetCurrentProcess().Id}"); + for (int i = 0; i < 50; i++) + { + if (System.Diagnostics.Debugger.IsAttached) + { + break; + } + System.Threading.Thread.Sleep(100); + System.Console.Error.Write("."); + } + System.Console.Error.WriteLine(); + } + System.Diagnostics.Debugger.Break(); + } + } +} diff --git a/swaggerci/eventgrid/generated/runtime/DictionaryExtensions.cs b/swaggerci/eventgrid/generated/runtime/DictionaryExtensions.cs new file mode 100644 index 000000000000..90801ac6be19 --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/DictionaryExtensions.cs @@ -0,0 +1,33 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime +{ + internal static class DictionaryExtensions + { + internal static void HashTableToDictionary(System.Collections.Hashtable hashtable, System.Collections.Generic.IDictionary dictionary) + { + if (null == hashtable) + { + return; + } + foreach (var each in hashtable.Keys) + { + var key = each.ToString(); + var value = hashtable[key]; + if (null != value) + { + try + { + dictionary[key] = (V)value; + } + catch + { + // Values getting dropped; not compatible with target dictionary. Not sure what to do here. + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/runtime/EventData.cs b/swaggerci/eventgrid/generated/runtime/EventData.cs new file mode 100644 index 000000000000..a0127633e8dc --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/EventData.cs @@ -0,0 +1,78 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime +{ + + using System; + using System.Threading; + + ///Represents the data in signaled event. + public partial class EventData + { + /// + /// The type of the event being signaled + /// + public string Id; + + /// + /// The user-ready message from the event. + /// + public string Message; + + /// + /// When the event is about a parameter, this is the parameter name. + /// Used in Validation Events + /// + public string Parameter; + + /// + /// This represents a numeric value associated with the event. + /// Use for progress-style events + /// + public double Value; + + /// + /// Any extended data for an event should be serialized and stored here. + /// + public string ExtendedData; + + /// + /// If the event triggers after the request message has been created, this will contain the Request Message (which in HTTP calls would be HttpRequestMessage) + /// + /// Typically you'd cast this to the expected type to use it: + /// + /// if(eventData.RequestMessgae is HttpRequestMessage httpRequest) + /// { + /// httpRequest.Headers.Add("x-request-flavor", "vanilla"); + /// } + /// + /// + public object RequestMessage; + + /// + /// If the event triggers after the response is back, this will contain the Response Message (which in HTTP calls would be HttpResponseMessage) + /// + /// Typically you'd cast this to the expected type to use it: + /// + /// if(eventData.ResponseMessage is HttpResponseMessage httpResponse){ + /// var flavor = httpResponse.Headers.GetValue("x-request-flavor"); + /// } + /// + /// + public object ResponseMessage; + + /// + /// Cancellation method for this event. + /// + /// If the event consumer wishes to cancel the request that initiated this event, call Cancel() + /// + /// + /// The original initiator of the request must provide the implementation of this. + /// + public System.Action Cancel; + } + +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/runtime/EventDataExtensions.cs b/swaggerci/eventgrid/generated/runtime/EventDataExtensions.cs new file mode 100644 index 000000000000..b33d1bbc269b --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/EventDataExtensions.cs @@ -0,0 +1,94 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime +{ + using System; + + [System.ComponentModel.TypeConverter(typeof(EventDataConverter))] + /// + /// PowerShell-specific data on top of the llc# EventData + /// + /// + /// In PowerShell, we add on the EventDataConverter to support sending events between modules. + /// Obviously, this code would need to be duplcated on both modules. + /// This is preferable to sharing a common library, as versioning makes that problematic. + /// + public partial class EventData : EventArgs + { + } + + /// + /// A PowerShell PSTypeConverter to adapt an EventData object that has been passed. + /// Usually used between modules. + /// + public class EventDataConverter : System.Management.Automation.PSTypeConverter + { + public override bool CanConvertTo(object sourceValue, Type destinationType) => false; + public override object ConvertTo(object sourceValue, Type destinationType, IFormatProvider formatProvider, bool ignoreCase) => null; + public override bool CanConvertFrom(dynamic sourceValue, Type destinationType) => destinationType == typeof(EventData) && CanConvertFrom(sourceValue); + public override object ConvertFrom(dynamic sourceValue, Type destinationType, IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Verifies that a given object has the required members to convert it to the target type (EventData) + /// + /// Uses a dynamic type so that it is able to use the simplest code without excessive checking. + /// + /// The instance to verify + /// True, if the object has all the required parameters. + public static bool CanConvertFrom(dynamic sourceValue) + { + try + { + // check if this has *required* parameters... + sourceValue?.Id?.GetType(); + sourceValue?.Message?.GetType(); + sourceValue?.Cancel?.GetType(); + + // remaining parameters are not *required*, + // and if they have values, it will copy them at conversion time. + } + catch + { + // if anything throws an exception (because it's null, or doesn't have that member) + return false; + } + return true; + } + + /// + /// Returns result of the delegate as the expected type, or default(T) + /// + /// This isolates any exceptions from the consumer. + /// + /// A delegate that returns a value + /// The desired output type + /// The value from the function if the type is correct + private static T To(Func srcValue) + { + try { return srcValue(); } + catch { return default(T); } + } + + /// + /// Converts an incoming object to the expected type by treating the incoming object as a dynamic, and coping the expected values. + /// + /// the incoming object + /// EventData + public static EventData ConvertFrom(dynamic sourceValue) + { + return new EventData + { + Id = To(() => sourceValue.Id), + Message = To(() => sourceValue.Message), + Parameter = To(() => sourceValue.Parameter), + Value = To(() => sourceValue.Value), + RequestMessage = To(() => sourceValue.RequestMessage), + ResponseMessage = To(() => sourceValue.ResponseMessage), + Cancel = To(() => sourceValue.Cancel) + }; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/runtime/EventListener.cs b/swaggerci/eventgrid/generated/runtime/EventListener.cs new file mode 100644 index 000000000000..613e9a0db27b --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/EventListener.cs @@ -0,0 +1,247 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime +{ + + using System; + using System.Linq; + using System.Collections; + using System.Collections.Generic; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + using GetEventData = System.Func; + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + public interface IValidates + { + Task Validate(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IEventListener listener); + } + + /// + /// The IEventListener Interface defines the communication mechanism for Signaling events during a remote call. + /// + /// + /// The interface is designed to be as minimal as possible, allow for quick peeking of the event type (id) + /// and the cancellation status and provides a delegate for retrieving the event details themselves. + /// + public interface IEventListener + { + Task Signal(string id, CancellationToken token, GetEventData createMessage); + CancellationToken Token { get; } + System.Action Cancel { get; } + } + + internal static partial class Extensions + { + public static Task Signal(this IEventListener instance, string id, CancellationToken token, Func createMessage) => instance.Signal(id, token, createMessage); + public static Task Signal(this IEventListener instance, string id, CancellationToken token) => instance.Signal(id, token, () => new EventData { Id = id, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, CancellationToken token, string messageText) => instance.Signal(id, token, () => new EventData { Id = id, Message = messageText, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, CancellationToken token, string messageText, HttpRequestMessage request) => instance.Signal(id, token, () => new EventData { Id = id, Message = messageText, RequestMessage = request, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, CancellationToken token, string messageText, HttpResponseMessage response) => instance.Signal(id, token, () => new EventData { Id = id, Message = messageText, RequestMessage = response.RequestMessage, ResponseMessage = response, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, CancellationToken token, string messageText, double magnitude) => instance.Signal(id, token, () => new EventData { Id = id, Message = messageText, Value = magnitude, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, CancellationToken token, string messageText, double magnitude, HttpRequestMessage request) => instance.Signal(id, token, () => new EventData { Id = id, Message = messageText, RequestMessage = request, Value = magnitude, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, CancellationToken token, string messageText, double magnitude, HttpResponseMessage response) => instance.Signal(id, token, () => new EventData { Id = id, Message = messageText, RequestMessage = response.RequestMessage, ResponseMessage = response, Value = magnitude, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, CancellationToken token, HttpRequestMessage request) => instance.Signal(id, token, () => new EventData { Id = id, RequestMessage = request, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, CancellationToken token, HttpRequestMessage request, HttpResponseMessage response) => instance.Signal(id, token, () => new EventData { Id = id, RequestMessage = request, ResponseMessage = response, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, CancellationToken token, HttpResponseMessage response) => instance.Signal(id, token, () => new EventData { Id = id, RequestMessage = response.RequestMessage, ResponseMessage = response, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, CancellationToken token, EventData message) => instance.Signal(id, token, () => { message.Id = id; message.Cancel = instance.Cancel; return message; }); + + public static Task Signal(this IEventListener instance, string id, Func createMessage) => instance.Signal(id, instance.Token, createMessage); + public static Task Signal(this IEventListener instance, string id) => instance.Signal(id, instance.Token, () => new EventData { Id = id, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, string messageText) => instance.Signal(id, instance.Token, () => new EventData { Id = id, Message = messageText, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, string messageText, HttpRequestMessage request) => instance.Signal(id, instance.Token, () => new EventData { Id = id, Message = messageText, RequestMessage = request, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, string messageText, HttpResponseMessage response) => instance.Signal(id, instance.Token, () => new EventData { Id = id, Message = messageText, RequestMessage = response.RequestMessage, ResponseMessage = response, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, string messageText, double magnitude) => instance.Signal(id, instance.Token, () => new EventData { Id = id, Message = messageText, Value = magnitude, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, string messageText, double magnitude, HttpRequestMessage request) => instance.Signal(id, instance.Token, () => new EventData { Id = id, Message = messageText, RequestMessage = request, Value = magnitude, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, string messageText, double magnitude, HttpResponseMessage response) => instance.Signal(id, instance.Token, () => new EventData { Id = id, Message = messageText, RequestMessage = response.RequestMessage, ResponseMessage = response, Value = magnitude, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, HttpRequestMessage request) => instance.Signal(id, instance.Token, () => new EventData { Id = id, RequestMessage = request, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, HttpRequestMessage request, HttpResponseMessage response) => instance.Signal(id, instance.Token, () => new EventData { Id = id, RequestMessage = request, ResponseMessage = response, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, HttpResponseMessage response) => instance.Signal(id, instance.Token, () => new EventData { Id = id, RequestMessage = response.RequestMessage, ResponseMessage = response, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, EventData message) => instance.Signal(id, instance.Token, () => { message.Id = id; message.Cancel = instance.Cancel; return message; }); + + public static Task Signal(this IEventListener instance, string id, System.Uri uri) => instance.Signal(id, instance.Token, () => new EventData { Id = id, Message = uri.ToString(), Cancel = instance.Cancel }); + + public static async Task AssertNotNull(this IEventListener instance, string parameterName, object value) + { + if (value == null) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ValidationWarning, Message = $"'{parameterName}' should not be null", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + public static async Task AssertMinimumLength(this IEventListener instance, string parameterName, string value, int length) + { + if (value != null && value.Length < length) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ValidationWarning, Message = $"Length of '{parameterName}' is less than {length}", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + public static async Task AssertMaximumLength(this IEventListener instance, string parameterName, string value, int length) + { + if (value != null && value.Length > length) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ValidationWarning, Message = $"Length of '{parameterName}' is greater than {length}", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + + public static async Task AssertRegEx(this IEventListener instance, string parameterName, string value, string regularExpression) + { + if (value != null && !System.Text.RegularExpressions.Regex.Match(value, regularExpression).Success) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ValidationWarning, Message = $"'{parameterName}' does not validate against pattern /{regularExpression}/", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + public static async Task AssertEnum(this IEventListener instance, string parameterName, string value, params string[] values) + { + if (!values.Any(each => each.Equals(value))) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ValidationWarning, Message = $"'{parameterName}' is not one of ({values.Aggregate((c, e) => $"'{e}',{c}")}", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + public static async Task AssertObjectIsValid(this IEventListener instance, string parameterName, object inst) + { + await (inst as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.IValidates)?.Validate(instance); + } + + public static async Task AssertIsLessThan(this IEventListener instance, string parameterName, T? value, T max) where T : struct, System.IComparable + { + if (null != value && ((T)value).CompareTo(max) >= 0) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ValidationWarning, Message = $"Value of '{parameterName}' must be less than {max} (value is {value})", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + public static async Task AssertIsGreaterThan(this IEventListener instance, string parameterName, T? value, T max) where T : struct, System.IComparable + { + if (null != value && ((T)value).CompareTo(max) <= 0) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ValidationWarning, Message = $"Value of '{parameterName}' must be greater than {max} (value is {value})", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + public static async Task AssertIsLessThanOrEqual(this IEventListener instance, string parameterName, T? value, T max) where T : struct, System.IComparable + { + if (null != value && ((T)value).CompareTo(max) > 0) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ValidationWarning, Message = $"Value of '{parameterName}' must be less than or equal to {max} (value is {value})", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + public static async Task AssertIsGreaterThanOrEqual(this IEventListener instance, string parameterName, T? value, T max) where T : struct, System.IComparable + { + if (null != value && ((T)value).CompareTo(max) < 0) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ValidationWarning, Message = $"Value of '{parameterName}' must be greater than or equal to {max} (value is {value})", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + public static async Task AssertIsMultipleOf(this IEventListener instance, string parameterName, Int64? value, Int64 multiple) + { + if (null != value && value % multiple != 0) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ValidationWarning, Message = $"Value of '{parameterName}' must be multiple of {multiple} (value is {value})", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + public static async Task AssertIsMultipleOf(this IEventListener instance, string parameterName, double? value, double multiple) + { + if (null != value) + { + var i = (Int64)(value / multiple); + if (i != value / multiple) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ValidationWarning, Message = $"Value of '{parameterName}' must be multiple of {multiple} (value is {value})", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + } + public static async Task AssertIsMultipleOf(this IEventListener instance, string parameterName, decimal? value, decimal multiple) + { + if (null != value) + { + var i = (Int64)(value / multiple); + if (i != value / multiple) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Events.ValidationWarning, Message = $"Value of '{parameterName}' must be multiple of {multiple} (value is {value})", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + } + } + + /// + /// An Implementation of the IEventListener that supports subscribing to events and dispatching them + /// (used for manually using the lowlevel interface) + /// + public class EventListener : CancellationTokenSource, IEnumerable>, IEventListener + { + private Dictionary calls = new Dictionary(); + public IEnumerator> GetEnumerator() => calls.GetEnumerator(); + IEnumerator IEnumerable.GetEnumerator() => calls.GetEnumerator(); + public EventListener() + { + } + + public new Action Cancel => base.Cancel; + private Event tracer; + + public EventListener(params (string name, Event callback)[] initializer) + { + foreach (var each in initializer) + { + Add(each.name, each.callback); + } + } + + public void Add(string name, SynchEvent callback) + { + Add(name, (message) => { callback(message); return Task.CompletedTask; }); + } + + public void Add(string name, Event callback) + { + if (callback != null) + { + if (string.IsNullOrEmpty(name)) + { + if (calls.ContainsKey(name)) + { + tracer += callback; + } + else + { + tracer = callback; + } + } + else + { + if (calls.ContainsKey(name)) + { + calls[name ?? System.String.Empty] += callback; + } + else + { + calls[name ?? System.String.Empty] = callback; + } + } + } + } + + + public async Task Signal(string id, CancellationToken token, GetEventData createMessage) + { + using (NoSynchronizationContext) + { + if (!string.IsNullOrEmpty(id) && (calls.TryGetValue(id, out Event listener) || tracer != null)) + { + var message = createMessage(); + message.Id = id; + + await listener?.Invoke(message); + await tracer?.Invoke(message); + + if (token.IsCancellationRequested) + { + throw new OperationCanceledException($"Canceled by event {id} ", this.Token); + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/runtime/Events.cs b/swaggerci/eventgrid/generated/runtime/Events.cs new file mode 100644 index 000000000000..7ecb04382f0a --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/Events.cs @@ -0,0 +1,27 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime +{ + public static partial class Events + { + public const string Log = nameof(Log); + public const string Validation = nameof(Validation); + public const string ValidationWarning = nameof(ValidationWarning); + public const string AfterValidation = nameof(AfterValidation); + public const string RequestCreated = nameof(RequestCreated); + public const string ResponseCreated = nameof(ResponseCreated); + public const string URLCreated = nameof(URLCreated); + public const string Finally = nameof(Finally); + public const string HeaderParametersAdded = nameof(HeaderParametersAdded); + public const string BodyContentSet = nameof(BodyContentSet); + public const string BeforeCall = nameof(BeforeCall); + public const string BeforeResponseDispatch = nameof(BeforeResponseDispatch); + public const string FollowingNextLink = nameof(FollowingNextLink); + public const string DelayBeforePolling = nameof(DelayBeforePolling); + public const string Polling = nameof(Polling); + + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/runtime/EventsExtensions.cs b/swaggerci/eventgrid/generated/runtime/EventsExtensions.cs new file mode 100644 index 000000000000..7976d4f55d2e --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/EventsExtensions.cs @@ -0,0 +1,27 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime +{ + public static partial class Events + { + public const string CmdletProcessRecordStart = nameof(CmdletProcessRecordStart); + public const string CmdletProcessRecordAsyncStart = nameof(CmdletProcessRecordAsyncStart); + public const string CmdletException = nameof(CmdletException); + public const string CmdletGetPipeline = nameof(CmdletGetPipeline); + public const string CmdletBeforeAPICall = nameof(CmdletBeforeAPICall); + public const string CmdletBeginProcessing = nameof(CmdletBeginProcessing); + public const string CmdletEndProcessing = nameof(CmdletEndProcessing); + public const string CmdletProcessRecordEnd = nameof(CmdletProcessRecordEnd); + public const string CmdletProcessRecordAsyncEnd = nameof(CmdletProcessRecordAsyncEnd); + public const string CmdletAfterAPICall = nameof(CmdletAfterAPICall); + + public const string Verbose = nameof(Verbose); + public const string Debug = nameof(Debug); + public const string Information = nameof(Information); + public const string Error = nameof(Error); + public const string Warning = nameof(Warning); + } + +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/runtime/Extensions.cs b/swaggerci/eventgrid/generated/runtime/Extensions.cs new file mode 100644 index 000000000000..db0cb3da5d1a --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/Extensions.cs @@ -0,0 +1,117 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime +{ + using System.Linq; + using System; + + internal static partial class Extensions + { + public static T[] SubArray(this T[] array, int offset, int length) + { + return new ArraySegment(array, offset, length) + .ToArray(); + } + + public static T ReadHeaders(this T instance, global::System.Net.Http.Headers.HttpResponseHeaders headers) where T : class + { + (instance as IHeaderSerializable)?.ReadHeaders(headers); + return instance; + } + + internal static bool If(T input, out T output) + { + if (null == input) + { + output = default(T); + return false; + } + output = input; + return true; + } + + internal static void AddIf(T value, System.Action addMethod) + { + // if value is present (and it's not just an empty JSON Object) + if (null != value && (value as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject)?.Keys.Count != 0) + { + addMethod(value); + } + } + + internal static void AddIf(T value, string serializedName, System.Action addMethod) + { + // if value is present (and it's not just an empty JSON Object) + if (null != value && (value as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject)?.Keys.Count != 0) + { + addMethod(serializedName, value); + } + } + + /// + /// Returns the first header value as a string from an HttpReponseMessage. + /// + /// the HttpResponseMessage to fetch a header from + /// the header name + /// the first header value as a string from an HttpReponseMessage. string.empty if there is no header value matching + internal static string GetFirstHeader(this System.Net.Http.HttpResponseMessage response, string headerName) => response.Headers.FirstOrDefault(each => string.Equals(headerName, each.Key, System.StringComparison.OrdinalIgnoreCase)).Value?.FirstOrDefault() ?? string.Empty; + + /// + /// Sets the Synchronization Context to null, and returns an IDisposable that when disposed, + /// will restore the synchonization context to the original value. + /// + /// This is used a less-invasive means to ensure that code in the library that doesn't + /// need to be continued in the original context doesn't have to have ConfigureAwait(false) + /// on every single await + /// + /// If the SynchronizationContext is null when this is used, the resulting IDisposable + /// will not do anything (this prevents excessive re-setting of the SynchronizationContext) + /// + /// Usage: + /// + /// using(NoSynchronizationContext) { + /// await SomeAsyncOperation(); + /// await SomeOtherOperation(); + /// } + /// + /// + /// + /// An IDisposable that will return the SynchronizationContext to original state + internal static System.IDisposable NoSynchronizationContext => System.Threading.SynchronizationContext.Current == null ? Dummy : new NoSyncContext(); + + /// + /// An instance of the Dummy IDispoable. + /// + /// + internal static System.IDisposable Dummy = new DummyDisposable(); + + /// + /// An IDisposable that does absolutely nothing. + /// + internal class DummyDisposable : System.IDisposable + { + public void Dispose() + { + } + } + /// + /// An IDisposable that saves the SynchronizationContext,sets it to null and + /// restores it to the original upon Dispose(). + /// + /// NOTE: This is designed to be less invasive than using .ConfigureAwait(false) + /// on every single await in library code (ie, places where we know we don't need + /// to continue in the same context as we went async) + /// + internal class NoSyncContext : System.IDisposable + { + private System.Threading.SynchronizationContext original = System.Threading.SynchronizationContext.Current; + internal NoSyncContext() + { + System.Threading.SynchronizationContext.SetSynchronizationContext(null); + } + public void Dispose() => System.Threading.SynchronizationContext.SetSynchronizationContext(original); + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/runtime/Helpers/Extensions/StringBuilderExtensions.cs b/swaggerci/eventgrid/generated/runtime/Helpers/Extensions/StringBuilderExtensions.cs new file mode 100644 index 000000000000..47216253b1f5 --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/Helpers/Extensions/StringBuilderExtensions.cs @@ -0,0 +1,23 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System.Text; + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json +{ + internal static class StringBuilderExtensions + { + /// + /// Extracts the buffered value and resets the buffer + /// + internal static string Extract(this StringBuilder builder) + { + var text = builder.ToString(); + + builder.Clear(); + + return text; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/runtime/Helpers/Extensions/TypeExtensions.cs b/swaggerci/eventgrid/generated/runtime/Helpers/Extensions/TypeExtensions.cs new file mode 100644 index 000000000000..ead773123e94 --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/Helpers/Extensions/TypeExtensions.cs @@ -0,0 +1,61 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json +{ + internal static class TypeExtensions + { + internal static bool IsNullable(this Type type) => + type.IsGenericType && type.GetGenericTypeDefinition().Equals(typeof(Nullable<>)); + + internal static Type GetOpenGenericInterface(this Type candidateType, Type openGenericInterfaceType) + { + + if (candidateType.IsGenericType && candidateType.GetGenericTypeDefinition() == openGenericInterfaceType) + { + return candidateType; + } + + // Check if it references it's own converter.... + + foreach (Type interfaceType in candidateType.GetInterfaces()) + { + if (interfaceType.IsGenericType + && interfaceType.GetGenericTypeDefinition().Equals(openGenericInterfaceType)) + { + return interfaceType; + } + } + + return null; + } + + // Author: Sebastian Good + // http://stackoverflow.com/questions/503263/how-to-determine-if-a-type-implements-a-specific-generic-interface-type + internal static bool ImplementsOpenGenericInterface(this Type candidateType, Type openGenericInterfaceType) + { + if (candidateType.Equals(openGenericInterfaceType)) + { + return true; + } + + if (candidateType.IsGenericType && candidateType.GetGenericTypeDefinition().Equals(openGenericInterfaceType)) + { + return true; + } + + foreach (Type i in candidateType.GetInterfaces()) + { + if (i.IsGenericType && i.ImplementsOpenGenericInterface(openGenericInterfaceType)) + { + return true; + } + } + + return false; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/runtime/Helpers/Seperator.cs b/swaggerci/eventgrid/generated/runtime/Helpers/Seperator.cs new file mode 100644 index 000000000000..a6791788fe04 --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/Helpers/Seperator.cs @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json +{ + internal static class Seperator + { + internal static readonly char[] Dash = { '-' }; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/runtime/Helpers/TypeDetails.cs b/swaggerci/eventgrid/generated/runtime/Helpers/TypeDetails.cs new file mode 100644 index 000000000000..cfd3ae2daeb6 --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/Helpers/TypeDetails.cs @@ -0,0 +1,116 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.Reflection; + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json +{ + + + + internal class TypeDetails + { + private readonly Type info; + + internal TypeDetails(Type info) + { + this.info = info ?? throw new ArgumentNullException(nameof(info)); + } + + internal Type NonNullType { get; set; } + + internal object DefaultValue { get; set; } + + internal bool IsNullable { get; set; } + + internal bool IsList { get; set; } + + internal bool IsStringLike { get; set; } + + internal bool IsEnum => info.IsEnum; + + internal bool IsArray => info.IsArray; + + internal bool IsValueType => info.IsValueType; + + internal Type ElementType { get; set; } + + internal IJsonConverter JsonConverter { get; set; } + + #region Creation + + private static readonly ConcurrentDictionary cache = new ConcurrentDictionary(); + + internal static TypeDetails Get() => Get(typeof(T)); + + internal static TypeDetails Get(Type type) => cache.GetOrAdd(type, Create); + + private static TypeDetails Create(Type type) + { + var isGenericList = !type.IsPrimitive && type.ImplementsOpenGenericInterface(typeof(IList<>)); + var isList = !type.IsPrimitive && (isGenericList || typeof(IList).IsAssignableFrom(type)); + + var isNullable = type.IsNullable(); + + Type elementType; + + if (type.IsArray) + { + elementType = type.GetElementType(); + } + else if (isGenericList) + { + var iList = type.GetOpenGenericInterface(typeof(IList<>)); + + elementType = iList.GetGenericArguments()[0]; + } + else + { + elementType = null; + } + + var nonNullType = isNullable ? type.GetGenericArguments()[0] : type; + + var isStringLike = false; + + IJsonConverter converter; + + var jsonConverterAttribute = type.GetCustomAttribute(); + + if (jsonConverterAttribute != null) + { + converter = jsonConverterAttribute.Converter; + } + else if (nonNullType.IsEnum) + { + converter = new EnumConverter(nonNullType); + } + else if (JsonConverterFactory.Instances.TryGetValue(nonNullType, out converter)) + { + } + else if (StringLikeHelper.IsStringLike(nonNullType)) + { + isStringLike = true; + + converter = new StringLikeConverter(nonNullType); + } + + return new TypeDetails(nonNullType) { + NonNullType = nonNullType, + DefaultValue = type.IsValueType ? Activator.CreateInstance(type) : null, + IsNullable = isNullable, + IsList = isList, + IsStringLike = isStringLike, + ElementType = elementType, + JsonConverter = converter + }; + } + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/runtime/Helpers/XHelper.cs b/swaggerci/eventgrid/generated/runtime/Helpers/XHelper.cs new file mode 100644 index 000000000000..418fa358d043 --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/Helpers/XHelper.cs @@ -0,0 +1,75 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json +{ + internal static class XHelper + { + internal static JsonNode Create(JsonType type, TypeCode code, object value) + { + switch (type) + { + case JsonType.Binary : return new XBinary((byte[])value); + case JsonType.Boolean : return new JsonBoolean((bool)value); + case JsonType.Number : return new JsonNumber(value.ToString()); + case JsonType.String : return new JsonString((string)value); + } + + throw new Exception($"JsonType '{type}' does not have a fast conversion"); + } + + internal static bool TryGetElementType(TypeCode code, out JsonType type) + { + switch (code) + { + case TypeCode.Boolean : type = JsonType.Boolean; return true; + case TypeCode.Byte : type = JsonType.Number; return true; + case TypeCode.DateTime : type = JsonType.Date; return true; + case TypeCode.Decimal : type = JsonType.Number; return true; + case TypeCode.Double : type = JsonType.Number; return true; + case TypeCode.Empty : type = JsonType.Null; return true; + case TypeCode.Int16 : type = JsonType.Number; return true; + case TypeCode.Int32 : type = JsonType.Number; return true; + case TypeCode.Int64 : type = JsonType.Number; return true; + case TypeCode.SByte : type = JsonType.Number; return true; + case TypeCode.Single : type = JsonType.Number; return true; + case TypeCode.String : type = JsonType.String; return true; + case TypeCode.UInt16 : type = JsonType.Number; return true; + case TypeCode.UInt32 : type = JsonType.Number; return true; + case TypeCode.UInt64 : type = JsonType.Number; return true; + } + + type = default; + + return false; + } + + internal static JsonType GetElementType(TypeCode code) + { + switch (code) + { + case TypeCode.Boolean : return JsonType.Boolean; + case TypeCode.Byte : return JsonType.Number; + case TypeCode.DateTime : return JsonType.Date; + case TypeCode.Decimal : return JsonType.Number; + case TypeCode.Double : return JsonType.Number; + case TypeCode.Empty : return JsonType.Null; + case TypeCode.Int16 : return JsonType.Number; + case TypeCode.Int32 : return JsonType.Number; + case TypeCode.Int64 : return JsonType.Number; + case TypeCode.SByte : return JsonType.Number; + case TypeCode.Single : return JsonType.Number; + case TypeCode.String : return JsonType.String; + case TypeCode.UInt16 : return JsonType.Number; + case TypeCode.UInt32 : return JsonType.Number; + case TypeCode.UInt64 : return JsonType.Number; + default : return JsonType.Object; + } + + throw new Exception($"TypeCode '{code}' does not have a fast converter"); + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/runtime/HttpPipeline.cs b/swaggerci/eventgrid/generated/runtime/HttpPipeline.cs new file mode 100644 index 000000000000..7c316dc12ef2 --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/HttpPipeline.cs @@ -0,0 +1,88 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime +{ + using System.Net.Http; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + using System.Collections; + using System.Linq; + + using GetEventData = System.Func; + using NextDelegate = System.Func, System.Threading.Tasks.Task>, System.Threading.Tasks.Task>; + + using SignalDelegate = System.Func, System.Threading.Tasks.Task>; + using GetParameterDelegate = System.Func, string, object>; + using SendAsyncStepDelegate = System.Func, System.Threading.Tasks.Task>, System.Func, System.Threading.Tasks.Task>, System.Threading.Tasks.Task>, System.Threading.Tasks.Task>; + using PipelineChangeDelegate = System.Action, System.Threading.Tasks.Task>, System.Func, System.Threading.Tasks.Task>, System.Threading.Tasks.Task>, System.Threading.Tasks.Task>>; + using ModuleLoadPipelineDelegate = System.Action, System.Threading.Tasks.Task>, System.Func, System.Threading.Tasks.Task>, System.Threading.Tasks.Task>, System.Threading.Tasks.Task>>, System.Action, System.Threading.Tasks.Task>, System.Func, System.Threading.Tasks.Task>, System.Threading.Tasks.Task>, System.Threading.Tasks.Task>>>; + using NewRequestPipelineDelegate = System.Action, System.Action, System.Threading.Tasks.Task>, System.Func, System.Threading.Tasks.Task>, System.Threading.Tasks.Task>, System.Threading.Tasks.Task>>, System.Action, System.Threading.Tasks.Task>, System.Func, System.Threading.Tasks.Task>, System.Threading.Tasks.Task>, System.Threading.Tasks.Task>>>; + +/* + public class DelegateBasedEventListener : IEventListener + { + private EventListenerDelegate _listener; + public DelegateBasedEventListener(EventListenerDelegate listener) + { + _listener = listener; + } + public CancellationToken Token => CancellationToken.None; + public System.Action Cancel => () => { }; + + + public Task Signal(string id, CancellationToken token, GetEventData createMessage) + { + return _listener(id, token, () => createMessage()); + } + } +*/ + /// + /// This is a necessary extension to the SendAsyncFactory to support the 'generic' delegate format. + /// + public partial class SendAsyncFactory + { + /// + /// This translates a generic-defined delegate for a listener into one that fits our ISendAsync pattern. + /// (Provided to support out-of-module delegation for Azure Cmdlets) + /// + /// The Pipeline Step as a delegate + public SendAsyncFactory(SendAsyncStepDelegate step) => this.implementation = (request, listener, next) => + step( + request, + listener.Token, + listener.Cancel, + (id, token, getEventData) => listener.Signal(id, token, () => { + var data = EventDataConverter.ConvertFrom( getEventData() ) as EventData; + data.Id = id; + data.Cancel = listener.Cancel; + data.RequestMessage = request; + return data; + }), + (req, token, cancel, listenerDelegate) => next.SendAsync(req, listener)); + } + + public partial class HttpPipeline : ISendAsync + { + public HttpPipeline Append(SendAsyncStepDelegate item) + { + if (item != null) + { + Append(new SendAsyncFactory(item)); + } + return this; + } + + public HttpPipeline Prepend(SendAsyncStepDelegate item) + { + if (item != null) + { + Prepend(new SendAsyncFactory(item)); + } + return this; + } + } +} diff --git a/swaggerci/eventgrid/generated/runtime/HttpPipelineMocking.ps1 b/swaggerci/eventgrid/generated/runtime/HttpPipelineMocking.ps1 new file mode 100644 index 000000000000..44ba22b13c6d --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/HttpPipelineMocking.ps1 @@ -0,0 +1,110 @@ +$ErrorActionPreference = "Stop" + +# get the recording path +if (-not $TestRecordingFile) { + $TestRecordingFile = Join-Path $PSScriptRoot 'recording.json' +} + +# create the Http Pipeline Recorder +$Mock = New-Object -Type Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PipelineMock $TestRecordingFile + +# set the recorder to the appropriate mode (default to 'live') +Write-Host -ForegroundColor Green "Running '$TestMode' mode..." +switch ($TestMode) { + 'record' { + Write-Host -ForegroundColor Green "Recording to $TestRecordingFile" + $Mock.SetRecord() + $null = erase -ea 0 $TestRecordingFile + } + 'playback' { + if (-not (Test-Path $TestRecordingFile)) { + Write-Host -fore:yellow "Recording file '$TestRecordingFile' is not present. Tests expecting recorded responses will fail" + } else { + Write-Host -ForegroundColor Green "Using recording $TestRecordingFile" + } + $Mock.SetPlayback() + $Mock.ForceResponseHeaders["Retry-After"] = "0"; + } + default: { + $Mock.SetLive() + } +} + +# overrides for Pester Describe/Context/It + +function Describe( + [Parameter(Mandatory = $true, Position = 0)] + [string] $Name, + + [Alias('Tags')] + [string[]] $Tag = @(), + + [Parameter(Position = 1)] + [ValidateNotNull()] + [ScriptBlock] $Fixture = $(Throw "No test script block is provided. (Have you put the open curly brace on the next line?)") +) { + $Mock.PushDescription($Name) + try { + return pester\Describe -Name $Name -Tag $Tag -Fixture $fixture + } + finally { + $Mock.PopDescription() + } +} + +function Context( + [Parameter(Mandatory = $true, Position = 0)] + [string] $Name, + + [Alias('Tags')] + [string[]] $Tag = @(), + + [Parameter(Position = 1)] + [ValidateNotNull()] + [ScriptBlock] $Fixture = $(Throw "No test script block is provided. (Have you put the open curly brace on the next line?)") +) { + $Mock.PushContext($Name) + try { + return pester\Context -Name $Name -Tag $Tag -Fixture $fixture + } + finally { + $Mock.PopContext() + } +} + +function It { + [CmdletBinding(DefaultParameterSetName = 'Normal')] + param( + [Parameter(Mandatory = $true, Position = 0)] + [string]$Name, + + [Parameter(Position = 1)] + [ScriptBlock] $Test = { }, + + [System.Collections.IDictionary[]] $TestCases, + + [Parameter(ParameterSetName = 'Pending')] + [Switch] $Pending, + + [Parameter(ParameterSetName = 'Skip')] + [Alias('Ignore')] + [Switch] $Skip + ) + $Mock.PushScenario($Name) + + try { + if ($skip) { + return pester\It -Name $Name -Test $Test -TestCases $TestCases -Skip + } + if ($pending) { + return pester\It -Name $Name -Test $Test -TestCases $TestCases -Pending + } + return pester\It -Name $Name -Test $Test -TestCases $TestCases + } + finally { + $null = $Mock.PopScenario() + } +} + +# set the HttpPipelineAppend for all the cmdlets +$PSDefaultParameterValues["*:HttpPipelinePrepend"] = $Mock diff --git a/swaggerci/eventgrid/generated/runtime/IAssociativeArray.cs b/swaggerci/eventgrid/generated/runtime/IAssociativeArray.cs new file mode 100644 index 000000000000..2ca033869473 --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/IAssociativeArray.cs @@ -0,0 +1,24 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +#define DICT_PROPERTIES +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime +{ + /// A subset of IDictionary that doesn't implement IEnumerable or IDictionary to work around PowerShell's aggressive formatter + public interface IAssociativeArray + { +#if DICT_PROPERTIES + System.Collections.Generic.IEnumerable Keys { get; } + System.Collections.Generic.IEnumerable Values { get; } + int Count { get; } +#endif + System.Collections.Generic.IDictionary AdditionalProperties { get; } + T this[string index] { get; set; } + void Add(string key, T value); + bool ContainsKey(string key); + bool Remove(string key); + bool TryGetValue(string key, out T value); + void Clear(); + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/runtime/IHeaderSerializable.cs b/swaggerci/eventgrid/generated/runtime/IHeaderSerializable.cs new file mode 100644 index 000000000000..97d632e0066e --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/IHeaderSerializable.cs @@ -0,0 +1,14 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime +{ + public interface IHeaderSerializable + { + void ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers); + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/runtime/ISendAsync.cs b/swaggerci/eventgrid/generated/runtime/ISendAsync.cs new file mode 100644 index 000000000000..4cf62d07756e --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/ISendAsync.cs @@ -0,0 +1,296 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime +{ + using System.Net.Http; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + using System.Collections; + using System.Linq; + + /// + /// The interface for sending an HTTP request across the wire. + /// + public interface ISendAsync + { + Task SendAsync(HttpRequestMessage request, IEventListener callback); + } + + public class SendAsyncTerminalFactory : ISendAsyncTerminalFactory, ISendAsync + { + SendAsync implementation; + + public SendAsyncTerminalFactory(SendAsync implementation) => this.implementation = implementation; + public SendAsyncTerminalFactory(ISendAsync implementation) => this.implementation = implementation.SendAsync; + public ISendAsync Create() => this; + public Task SendAsync(HttpRequestMessage request, IEventListener callback) => implementation(request, callback); + } + + public partial class SendAsyncFactory : ISendAsyncFactory + { + public class Sender : ISendAsync + { + internal ISendAsync next; + internal SendAsyncStep implementation; + + public Task SendAsync(HttpRequestMessage request, IEventListener callback) => implementation(request, callback, next); + } + SendAsyncStep implementation; + + public SendAsyncFactory(SendAsyncStep implementation) => this.implementation = implementation; + public ISendAsync Create(ISendAsync next) => new Sender { next = next, implementation = implementation }; + + } + + public class HttpClientFactory : ISendAsyncTerminalFactory, ISendAsync + { + HttpClient client; + public HttpClientFactory() : this(new HttpClient()) + { + } + public HttpClientFactory(HttpClient client) => this.client = client; + public ISendAsync Create() => this; + + public Task SendAsync(HttpRequestMessage request, IEventListener callback) => client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead, callback.Token); + } + + public interface ISendAsyncFactory + { + ISendAsync Create(ISendAsync next); + } + + public interface ISendAsyncTerminalFactory + { + ISendAsync Create(); + } + + public partial class HttpPipeline : ISendAsync + { + private ISendAsync pipeline; + private ISendAsyncTerminalFactory terminal; + private List steps = new List(); + + public HttpPipeline() : this(new HttpClientFactory()) + { + } + + public HttpPipeline(ISendAsyncTerminalFactory terminalStep) + { + if (terminalStep == null) + { + throw new System.ArgumentNullException(nameof(terminalStep), "Terminal Step Factory in HttpPipeline may not be null"); + } + TerminalFactory = terminalStep; + } + + /// + /// Returns an HttpPipeline with the current state of this pipeline. + /// + public HttpPipeline Clone() => new HttpPipeline(terminal) { steps = this.steps.ToList(), pipeline = this.pipeline }; + + public ISendAsyncTerminalFactory TerminalFactory + { + get => terminal; + set + { + if (value == null) + { + throw new System.ArgumentNullException("TerminalFactory in HttpPipeline may not be null"); + } + terminal = value; + } + } + + public ISendAsync Pipeline + { + get + { + // if the pipeline has been created and not invalidated, return it. + if (this.pipeline != null) + { + return this.pipeline; + } + + // create the pipeline from scratch. + var next = terminal.Create(); + foreach (var factory in steps) + { + // skip factories that return null. + next = factory.Create(next) ?? next; + } + return this.pipeline = next; + } + } + + public int Count => steps.Count; + + public HttpPipeline Prepend(ISendAsyncFactory item) + { + if (item != null) + { + steps.Add(item); + pipeline = null; + } + return this; + } + + public HttpPipeline Append(SendAsyncStep item) + { + if (item != null) + { + Append(new SendAsyncFactory(item)); + } + return this; + } + + public HttpPipeline Prepend(SendAsyncStep item) + { + if (item != null) + { + Prepend(new SendAsyncFactory(item)); + } + return this; + } + public HttpPipeline Append(IEnumerable items) + { + if (items != null) + { + foreach (var item in items) + { + Append(new SendAsyncFactory(item)); + } + } + return this; + } + + public HttpPipeline Prepend(IEnumerable items) + { + if (items != null) + { + foreach (var item in items) + { + Prepend(new SendAsyncFactory(item)); + } + } + return this; + } + + public HttpPipeline Append(ISendAsyncFactory item) + { + if (item != null) + { + steps.Insert(0, item); + pipeline = null; + } + return this; + } + public HttpPipeline Prepend(IEnumerable items) + { + if (items != null) + { + foreach (var item in items) + { + Prepend(item); + } + } + return this; + } + + public HttpPipeline Append(IEnumerable items) + { + if (items != null) + { + foreach (var item in items) + { + Append(item); + } + } + return this; + } + + // you can use this as the ISendAsync Implementation + public Task SendAsync(HttpRequestMessage request, IEventListener callback) => Pipeline.SendAsync(request, callback); + } + + internal static partial class Extensions + { + internal static HttpRequestMessage CloneAndDispose(this HttpRequestMessage original, System.Uri requestUri = null, System.Net.Http.HttpMethod method = null) + { + using (original) + { + return original.Clone(requestUri, method); + } + } + + internal static Task CloneWithContentAndDispose(this HttpRequestMessage original, System.Uri requestUri = null, System.Net.Http.HttpMethod method = null) + { + using (original) + { + return original.CloneWithContent(requestUri, method); + } + } + + /// + /// Clones an HttpRequestMessage (without the content) + /// + /// Original HttpRequestMessage (Will be diposed before returning) + /// A clone of the HttpRequestMessage + internal static HttpRequestMessage Clone(this HttpRequestMessage original, System.Uri requestUri = null, System.Net.Http.HttpMethod method = null) + { + var clone = new HttpRequestMessage + { + Method = method ?? original.Method, + RequestUri = requestUri ?? original.RequestUri, + Version = original.Version, + }; + + foreach (KeyValuePair prop in original.Properties) + { + clone.Properties.Add(prop); + } + + foreach (KeyValuePair> header in original.Headers) + { + /* + **temporarily skip cloning telemetry related headers** + clone.Headers.TryAddWithoutValidation(header.Key, header.Value); + */ + if (!"x-ms-unique-id".Equals(header.Key) && !"x-ms-client-request-id".Equals(header.Key) && !"CommandName".Equals(header.Key) && !"FullCommandName".Equals(header.Key) && !"ParameterSetName".Equals(header.Key) && !"User-Agent".Equals(header.Key)) + { + clone.Headers.TryAddWithoutValidation(header.Key, header.Value); + } + } + + return clone; + } + + /// + /// Clones an HttpRequestMessage (including the content stream and content headers) + /// + /// Original HttpRequestMessage (Will be diposed before returning) + /// A clone of the HttpRequestMessage + internal static async Task CloneWithContent(this HttpRequestMessage original, System.Uri requestUri = null, System.Net.Http.HttpMethod method = null) + { + var clone = original.Clone(requestUri, method); + var stream = new System.IO.MemoryStream(); + if (original.Content != null) + { + await original.Content.CopyToAsync(stream).ConfigureAwait(false); + stream.Position = 0; + clone.Content = new StreamContent(stream); + if (original.Content.Headers != null) + { + foreach (var h in original.Content.Headers) + { + clone.Content.Headers.Add(h.Key, h.Value); + } + } + } + return clone; + } + } +} diff --git a/swaggerci/eventgrid/generated/runtime/InfoAttribute.cs b/swaggerci/eventgrid/generated/runtime/InfoAttribute.cs new file mode 100644 index 000000000000..2a4daf268a4e --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/InfoAttribute.cs @@ -0,0 +1,34 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime +{ + using System; + + [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Class)] + public class InfoAttribute : Attribute + { + public bool Required { get; set; } = false; + public bool ReadOnly { get; set; } = false; + public Type[] PossibleTypes { get; set; } = new Type[0]; + public string Description { get; set; } = ""; + public string SerializedName { get; set; } = ""; + } + + [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)] + public class CompleterInfoAttribute : Attribute + { + public string Script { get; set; } = ""; + public string Name { get; set; } = ""; + public string Description { get; set; } = ""; + } + + [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)] + public class DefaultInfoAttribute : Attribute + { + public string Script { get; set; } = ""; + public string Name { get; set; } = ""; + public string Description { get; set; } = ""; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/runtime/Iso/IsoDate.cs b/swaggerci/eventgrid/generated/runtime/Iso/IsoDate.cs new file mode 100644 index 000000000000..1519d011cd38 --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/Iso/IsoDate.cs @@ -0,0 +1,214 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Text; + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json +{ + internal struct IsoDate + { + internal int Year { get; set; } // 0-3000 + + internal int Month { get; set; } // 1-12 + + internal int Day { get; set; } // 1-31 + + internal int Hour { get; set; } // 0-24 + + internal int Minute { get; set; } // 0-60 (60 is a special case) + + internal int Second { get; set; } // 0-60 (60 is used for leap seconds) + + internal double Millisecond { get; set; } // 0-999.9... + + internal TimeSpan Offset { get; set; } + + internal DateTimeKind Kind { get; set; } + + internal TimeSpan TimeOfDay => new TimeSpan(Hour, Minute, Second); + + internal DateTime ToDateTime() + { + if (Kind == DateTimeKind.Utc || Offset == TimeSpan.Zero) + { + return new DateTime(Year, Month, Day, Hour, Minute, Second, (int)Millisecond, DateTimeKind.Utc); + } + + return ToDateTimeOffset().DateTime; + } + + internal DateTimeOffset ToDateTimeOffset() + { + return new DateTimeOffset( + Year, + Month, + Day, + Hour, + Minute, + Second, + (int)Millisecond, + Offset + ); + } + + internal DateTime ToUtcDateTime() + { + return ToDateTimeOffset().UtcDateTime; + } + + public override string ToString() + { + var sb = new StringBuilder(); + + // yyyy-MM-dd + sb.Append($"{Year}-{Month:00}-{Day:00}"); + + if (TimeOfDay > new TimeSpan(0)) + { + sb.Append($"T{Hour:00}:{Minute:00}"); + + if (TimeOfDay.Seconds > 0) + { + sb.Append($":{Second:00}"); + } + } + + if (Offset.Ticks == 0) + { + sb.Append('Z'); // UTC + } + else + { + if (Offset.Ticks >= 0) + { + sb.Append('+'); + } + + sb.Append($"{Offset.Hours:00}:{Offset.Minutes:00}"); + } + + return sb.ToString(); + } + + internal static IsoDate FromDateTimeOffset(DateTimeOffset date) + { + return new IsoDate { + Year = date.Year, + Month = date.Month, + Day = date.Day, + Hour = date.Hour, + Minute = date.Minute, + Second = date.Second, + Offset = date.Offset, + Kind = date.Offset == TimeSpan.Zero ? DateTimeKind.Utc : DateTimeKind.Unspecified + }; + } + + private static readonly char[] timeSeperators = { ':', '.' }; + + internal static IsoDate Parse(string text) + { + var tzIndex = -1; + var timeIndex = text.IndexOf('T'); + + var builder = new IsoDate { Day = 1, Month = 1 }; + + // TODO: strip the time zone offset off the end + string dateTime = text; + string timeZone = null; + + if (dateTime.IndexOf('Z') > -1) + { + tzIndex = dateTime.LastIndexOf('Z'); + + builder.Kind = DateTimeKind.Utc; + } + else if (dateTime.LastIndexOf('+') > 10) + { + tzIndex = dateTime.LastIndexOf('+'); + } + else if (dateTime.LastIndexOf('-') > 10) + { + tzIndex = dateTime.LastIndexOf('-'); + } + + if (tzIndex > -1) + { + timeZone = dateTime.Substring(tzIndex); + dateTime = dateTime.Substring(0, tzIndex); + } + + string date = (timeIndex == -1) ? dateTime : dateTime.Substring(0, timeIndex); + + var dateParts = date.Split(Seperator.Dash); // '-' + + for (int i = 0; i < dateParts.Length; i++) + { + var part = dateParts[i]; + + switch (i) + { + case 0: builder.Year = int.Parse(part); break; + case 1: builder.Month = int.Parse(part); break; + case 2: builder.Day = int.Parse(part); break; + } + } + + if (timeIndex > -1) + { + string[] timeParts = dateTime.Substring(timeIndex + 1).Split(timeSeperators); + + for (int i = 0; i < timeParts.Length; i++) + { + var part = timeParts[i]; + + switch (i) + { + case 0: builder.Hour = int.Parse(part); break; + case 1: builder.Minute = int.Parse(part); break; + case 2: builder.Second = int.Parse(part); break; + case 3: builder.Millisecond = double.Parse("0." + part) * 1000; break; + } + } + } + + if (timeZone != null && timeZone != "Z") + { + var hours = int.Parse(timeZone.Substring(1, 2)); + var minutes = int.Parse(timeZone.Substring(4, 2)); + + if (timeZone[0] == '-') + { + hours = -hours; + minutes = -minutes; + } + + builder.Offset = new TimeSpan(hours, minutes, 0); + } + + return builder; + } + } + + /* + YYYY # eg 1997 + YYYY-MM # eg 1997-07 + YYYY-MM-DD # eg 1997-07-16 + YYYY-MM-DDThh:mmTZD # eg 1997-07-16T19:20+01:00 + YYYY-MM-DDThh:mm:ssTZD # eg 1997-07-16T19:20:30+01:00 + YYYY-MM-DDThh:mm:ss.sTZD # eg 1997-07-16T19:20:30.45+01:00 + + where: + + YYYY = four-digit year + MM = two-digit month (01=January, etc.) + DD = two-digit day of month (01 through 31) + hh = two digits of hour (00 through 23) (am/pm NOT allowed) + mm = two digits of minute (00 through 59) + ss = two digits of second (00 through 59) + s = one or more digits representing a decimal fraction of a second + TZD = time zone designator (Z or +hh:mm or -hh:mm) + */ +} diff --git a/swaggerci/eventgrid/generated/runtime/JsonType.cs b/swaggerci/eventgrid/generated/runtime/JsonType.cs new file mode 100644 index 000000000000..c96711df57f4 --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/JsonType.cs @@ -0,0 +1,18 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json +{ + internal enum JsonType + { + Null = 0, + Object = 1, + Array = 2, + Binary = 3, + Boolean = 4, + Date = 5, + Number = 6, + String = 7 + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/runtime/MessageAttribute.cs b/swaggerci/eventgrid/generated/runtime/MessageAttribute.cs new file mode 100644 index 000000000000..c9b60ad9ffde --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/MessageAttribute.cs @@ -0,0 +1,360 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.generated.runtime.Properties; + using System; + using System.Collections.Generic; + using System.Globalization; + using System.Linq; + using System.Management.Automation; + using System.Text; + + [AttributeUsage(AttributeTargets.All)] + public class GenericBreakingChangeAttribute : Attribute + { + private string _message; + //A dexcription of what the change is about, non mandatory + public string ChangeDescription { get; set; } = null; + + //The version the change is effective from, non mandatory + public string DeprecateByVersion { get; } + public bool DeprecateByVersionSet { get; } = false; + + //The date on which the change comes in effect + public DateTime ChangeInEfectByDate { get; } + public bool ChangeInEfectByDateSet { get; } = false; + + //Old way of calling the cmdlet + public string OldWay { get; set; } + //New way fo calling the cmdlet + public string NewWay { get; set; } + + public GenericBreakingChangeAttribute(string message) + { + _message = message; + } + + public GenericBreakingChangeAttribute(string message, string deprecateByVersion) + { + _message = message; + this.DeprecateByVersion = deprecateByVersion; + this.DeprecateByVersionSet = true; + } + + public GenericBreakingChangeAttribute(string message, string deprecateByVersion, string changeInEfectByDate) + { + _message = message; + this.DeprecateByVersion = deprecateByVersion; + this.DeprecateByVersionSet = true; + + if (DateTime.TryParse(changeInEfectByDate, new CultureInfo("en-US"), DateTimeStyles.None, out DateTime result)) + { + this.ChangeInEfectByDate = result; + this.ChangeInEfectByDateSet = true; + } + } + + public DateTime getInEffectByDate() + { + return this.ChangeInEfectByDate.Date; + } + + + /** + * This function prints out the breaking change message for the attribute on the cmdline + * */ + public void PrintCustomAttributeInfo(Action writeOutput) + { + + if (!GetAttributeSpecificMessage().StartsWith(Environment.NewLine)) + { + writeOutput(Environment.NewLine); + } + writeOutput(string.Format(Resources.BreakingChangesAttributesDeclarationMessage, GetAttributeSpecificMessage())); + + + if (!string.IsNullOrWhiteSpace(ChangeDescription)) + { + writeOutput(string.Format(Resources.BreakingChangesAttributesChangeDescriptionMessage, this.ChangeDescription)); + } + + if (ChangeInEfectByDateSet) + { + writeOutput(string.Format(Resources.BreakingChangesAttributesInEffectByDateMessage, this.ChangeInEfectByDate.ToString("d"))); + } + + if (DeprecateByVersionSet) + { + writeOutput(string.Format(Resources.BreakingChangesAttributesInEffectByVersion, this.DeprecateByVersion)); + } + + if (OldWay != null && NewWay != null) + { + writeOutput(string.Format(Resources.BreakingChangesAttributesUsageChangeMessageConsole, OldWay, NewWay)); + } + } + + public virtual bool IsApplicableToInvocation(InvocationInfo invocation) + { + return true; + } + + protected virtual string GetAttributeSpecificMessage() + { + return _message; + } + } + + [AttributeUsage(AttributeTargets.All)] + public class CmdletBreakingChangeAttribute : GenericBreakingChangeAttribute + { + + public string ReplacementCmdletName { get; set; } + + public CmdletBreakingChangeAttribute() : + base(string.Empty) + { + } + + public CmdletBreakingChangeAttribute(string deprecateByVersione) : + base(string.Empty, deprecateByVersione) + { + } + + public CmdletBreakingChangeAttribute(string deprecateByVersion, string changeInEfectByDate) : + base(string.Empty, deprecateByVersion, changeInEfectByDate) + { + } + + protected override string GetAttributeSpecificMessage() + { + if (string.IsNullOrWhiteSpace(ReplacementCmdletName)) + { + return Resources.BreakingChangesAttributesCmdLetDeprecationMessageNoReplacement; + } + else + { + return string.Format(Resources.BreakingChangesAttributesCmdLetDeprecationMessageWithReplacement, ReplacementCmdletName); + } + } + } + + [AttributeUsage(AttributeTargets.All)] + public class ParameterSetBreakingChangeAttribute : GenericBreakingChangeAttribute + { + public string[] ChangedParameterSet { set; get; } + public ParameterSetBreakingChangeAttribute(string[] changedParameterSet) : + base(string.Empty) + { + ChangedParameterSet = changedParameterSet; + } + + public ParameterSetBreakingChangeAttribute(string[] changedParameterSet, string deprecateByVersione) : + base(string.Empty, deprecateByVersione) + { + ChangedParameterSet = changedParameterSet; + } + + public ParameterSetBreakingChangeAttribute(string[] changedParameterSet, string deprecateByVersion, string changeInEfectByDate) : + base(string.Empty, deprecateByVersion, changeInEfectByDate) + { + ChangedParameterSet = changedParameterSet; + } + + protected override string GetAttributeSpecificMessage() + { + + return Resources.BreakingChangesAttributesParameterSetDeprecationMessageNoReplacement; + + } + + public bool IsApplicableToInvocation(InvocationInfo invocation, string parameterSetName) + { + if (ChangedParameterSet != null) + return ChangedParameterSet.Contains(parameterSetName); + return false; + } + + } + + [AttributeUsage(AttributeTargets.All)] + public class PreviewMessageAttribute : Attribute + { + public string _message; + + public PreviewMessageAttribute() + { + this._message = Resources.PreviewCmdletMessage; + } + + public PreviewMessageAttribute(string message) + { + this._message = message; + } + + public void PrintCustomAttributeInfo(System.Management.Automation.PSCmdlet psCmdlet) + { + psCmdlet.WriteWarning(this._message); + } + + public virtual bool IsApplicableToInvocation(InvocationInfo invocation) + { + return true; + } + } + + [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)] + public class ParameterBreakingChangeAttribute : GenericBreakingChangeAttribute + { + public string NameOfParameterChanging { get; } + + public string ReplaceMentCmdletParameterName { get; set; } = null; + + public bool IsBecomingMandatory { get; set; } = false; + + public String OldParamaterType { get; set; } + + public String NewParameterType { get; set; } + + public ParameterBreakingChangeAttribute(string nameOfParameterChanging) : + base(string.Empty) + { + this.NameOfParameterChanging = nameOfParameterChanging; + } + + public ParameterBreakingChangeAttribute(string nameOfParameterChanging, string deprecateByVersion) : + base(string.Empty, deprecateByVersion) + { + this.NameOfParameterChanging = nameOfParameterChanging; + } + + public ParameterBreakingChangeAttribute(string nameOfParameterChanging, string deprecateByVersion, string changeInEfectByDate) : + base(string.Empty, deprecateByVersion, changeInEfectByDate) + { + this.NameOfParameterChanging = nameOfParameterChanging; + } + + protected override string GetAttributeSpecificMessage() + { + StringBuilder message = new StringBuilder(); + if (!string.IsNullOrWhiteSpace(ReplaceMentCmdletParameterName)) + { + if (IsBecomingMandatory) + { + message.Append(string.Format(Resources.BreakingChangeAttributeParameterReplacedMandatory, NameOfParameterChanging, ReplaceMentCmdletParameterName)); + } + else + { + message.Append(string.Format(Resources.BreakingChangeAttributeParameterReplaced, NameOfParameterChanging, ReplaceMentCmdletParameterName)); + } + } + else + { + if (IsBecomingMandatory) + { + message.Append(string.Format(Resources.BreakingChangeAttributeParameterMandatoryNow, NameOfParameterChanging)); + } + else + { + message.Append(string.Format(Resources.BreakingChangeAttributeParameterChanging, NameOfParameterChanging)); + } + } + + //See if the type of the param is changing + if (OldParamaterType != null && !string.IsNullOrWhiteSpace(NewParameterType)) + { + message.Append(string.Format(Resources.BreakingChangeAttributeParameterTypeChange, OldParamaterType, NewParameterType)); + } + return message.ToString(); + } + + /// + /// See if the bound parameters contain the current parameter, if they do + /// then the attribbute is applicable + /// If the invocationInfo is null we return true + /// + /// + /// bool + public override bool IsApplicableToInvocation(InvocationInfo invocationInfo) + { + bool? applicable = invocationInfo == null ? true : invocationInfo.BoundParameters?.Keys?.Contains(this.NameOfParameterChanging); + return applicable.HasValue ? applicable.Value : false; + } + } + + [AttributeUsage(AttributeTargets.All)] + public class OutputBreakingChangeAttribute : GenericBreakingChangeAttribute + { + public string DeprecatedCmdLetOutputType { get; } + + //This is still a String instead of a Type as this + //might be undefined at the time of adding the attribute + public string ReplacementCmdletOutputType { get; set; } + + public string[] DeprecatedOutputProperties { get; set; } + + public string[] NewOutputProperties { get; set; } + + public OutputBreakingChangeAttribute(string deprecatedCmdletOutputType) : + base(string.Empty) + { + this.DeprecatedCmdLetOutputType = deprecatedCmdletOutputType; + } + + public OutputBreakingChangeAttribute(string deprecatedCmdletOutputType, string deprecateByVersion) : + base(string.Empty, deprecateByVersion) + { + this.DeprecatedCmdLetOutputType = deprecatedCmdletOutputType; + } + + public OutputBreakingChangeAttribute(string deprecatedCmdletOutputType, string deprecateByVersion, string changeInEfectByDate) : + base(string.Empty, deprecateByVersion, changeInEfectByDate) + { + this.DeprecatedCmdLetOutputType = deprecatedCmdletOutputType; + } + + protected override string GetAttributeSpecificMessage() + { + StringBuilder message = new StringBuilder(); + + //check for the deprecation scenario + if (string.IsNullOrWhiteSpace(ReplacementCmdletOutputType) && NewOutputProperties == null && DeprecatedOutputProperties == null && string.IsNullOrWhiteSpace(ChangeDescription)) + { + message.Append(string.Format(Resources.BreakingChangesAttributesCmdLetOutputTypeDeprecated, DeprecatedCmdLetOutputType)); + } + else + { + if (!string.IsNullOrWhiteSpace(ReplacementCmdletOutputType)) + { + message.Append(string.Format(Resources.BreakingChangesAttributesCmdLetOutputChange1, DeprecatedCmdLetOutputType, ReplacementCmdletOutputType)); + } + else + { + message.Append(string.Format(Resources.BreakingChangesAttributesCmdLetOutputChange2, DeprecatedCmdLetOutputType)); + } + + if (DeprecatedOutputProperties != null && DeprecatedOutputProperties.Length > 0) + { + message.Append(Resources.BreakingChangesAttributesCmdLetOutputPropertiesRemoved); + foreach (string property in DeprecatedOutputProperties) + { + message.Append(" '" + property + "'"); + } + } + + if (NewOutputProperties != null && NewOutputProperties.Length > 0) + { + message.Append(Resources.BreakingChangesAttributesCmdLetOutputPropertiesAdded); + foreach (string property in NewOutputProperties) + { + message.Append(" '" + property + "'"); + } + } + } + return message.ToString(); + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/runtime/MessageAttributeHelper.cs b/swaggerci/eventgrid/generated/runtime/MessageAttributeHelper.cs new file mode 100644 index 000000000000..e3c1840f0d82 --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/MessageAttributeHelper.cs @@ -0,0 +1,161 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ---------------------------------------------------------------------------------- +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime +{ + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.generated.runtime.Properties; + using System; + using System.Collections.Generic; + using System.Linq; + using System.Management.Automation; + using System.Reflection; + using System.Text; + using System.Threading.Tasks; + public class MessageAttributeHelper + { + public const string BREAKING_CHANGE_ATTRIBUTE_INFORMATION_LINK = "https://aka.ms/azps-changewarnings"; + public const string SUPPRESS_ERROR_OR_WARNING_MESSAGE_ENV_VARIABLE_NAME = "SuppressAzurePowerShellBreakingChangeWarnings"; + + /** + * This function takes in a CommandInfo (CmdletInfo or FunctionInfo) + * And reads all the deprecation attributes attached to it + * Prints a message on the cmdline For each of the attribute found + * + * the boundParameterNames is a list of parameters bound to the cmdlet at runtime, + * We only process the Parameter beaking change attributes attached only params listed in this list (if present) + * */ + public static void ProcessCustomAttributesAtRuntime(CommandInfo commandInfo, InvocationInfo invocationInfo, String parameterSet, System.Management.Automation.PSCmdlet psCmdlet) + { + bool supressWarningOrError = false; + + try + { + supressWarningOrError = bool.Parse(System.Environment.GetEnvironmentVariable(SUPPRESS_ERROR_OR_WARNING_MESSAGE_ENV_VARIABLE_NAME)); + } + catch (Exception) + { + //no action + } + + if (supressWarningOrError) + { + //Do not process the attributes at runtime... The env variable to override the warning messages is set + return; + } + + List attributes = new List(GetAllBreakingChangeAttributesInType(commandInfo, invocationInfo, parameterSet)); + StringBuilder sb = new StringBuilder(); + Action appendBreakingChangeInfo = (string s) => sb.Append(s); + + if (attributes != null && attributes.Count > 0) + { + appendBreakingChangeInfo(string.Format(Resources.BreakingChangesAttributesHeaderMessage, commandInfo.Name.Split('_')[0])); + + foreach (GenericBreakingChangeAttribute attribute in attributes) + { + attribute.PrintCustomAttributeInfo(appendBreakingChangeInfo); + } + + appendBreakingChangeInfo(string.Format(Resources.BreakingChangesAttributesFooterMessage, BREAKING_CHANGE_ATTRIBUTE_INFORMATION_LINK)); + + psCmdlet.WriteWarning(sb.ToString()); + } + + List previewAttributes = new List(GetAllPreviewAttributesInType(commandInfo, invocationInfo)); + + if (previewAttributes != null && previewAttributes.Count > 0) + { + foreach (PreviewMessageAttribute attribute in previewAttributes) + { + attribute.PrintCustomAttributeInfo(psCmdlet); + } + } + } + + + /** + * This function takes in a CommandInfo (CmdletInfo or FunctionInfo) + * And returns all the deprecation attributes attached to it + * + * the boundParameterNames is a list of parameters bound to the cmdlet at runtime, + * We only process the Parameter beaking change attributes attached only params listed in this list (if present) + **/ + private static IEnumerable GetAllBreakingChangeAttributesInType(CommandInfo commandInfo, InvocationInfo invocationInfo, String parameterSet) + { + List attributeList = new List(); + + if (commandInfo.GetType() == typeof(CmdletInfo)) + { + var type = ((CmdletInfo)commandInfo).ImplementingType; + attributeList.AddRange(type.GetCustomAttributes(typeof(GenericBreakingChangeAttribute), false).Cast()); + + foreach (MethodInfo m in type.GetRuntimeMethods()) + { + attributeList.AddRange((m.GetCustomAttributes(typeof(GenericBreakingChangeAttribute), false).Cast())); + } + + foreach (FieldInfo f in type.GetRuntimeFields()) + { + attributeList.AddRange(f.GetCustomAttributes(typeof(GenericBreakingChangeAttribute), false).Cast()); + } + + foreach (PropertyInfo p in type.GetRuntimeProperties()) + { + attributeList.AddRange(p.GetCustomAttributes(typeof(GenericBreakingChangeAttribute), false).Cast()); + } + } + else if (commandInfo.GetType() == typeof(FunctionInfo)) + { + attributeList.AddRange(((FunctionInfo)commandInfo).ScriptBlock.Attributes.Where(e => typeof(GenericBreakingChangeAttribute).IsAssignableFrom(e.GetType())).Cast()); + foreach (var parameter in ((FunctionInfo)commandInfo).Parameters) + { + attributeList.AddRange(parameter.Value.Attributes.Where(e => typeof(GenericBreakingChangeAttribute).IsAssignableFrom(e.GetType())).Cast()); + } + } + return invocationInfo == null ? attributeList : attributeList.Where(e => e.GetType() == typeof(ParameterSetBreakingChangeAttribute) ? ((ParameterSetBreakingChangeAttribute)e).IsApplicableToInvocation(invocationInfo, parameterSet) : e.IsApplicableToInvocation(invocationInfo)); + } + private static IEnumerable GetAllPreviewAttributesInType(CommandInfo commandInfo, InvocationInfo invocationInfo) + { + List attributeList = new List(); + if (commandInfo.GetType() == typeof(CmdletInfo)) + { + var type = ((CmdletInfo)commandInfo).ImplementingType; + attributeList.AddRange(type.GetCustomAttributes(typeof(PreviewMessageAttribute), false).Cast()); + + foreach (MethodInfo m in type.GetRuntimeMethods()) + { + attributeList.AddRange((m.GetCustomAttributes(typeof(PreviewMessageAttribute), false).Cast())); + } + + foreach (FieldInfo f in type.GetRuntimeFields()) + { + attributeList.AddRange(f.GetCustomAttributes(typeof(PreviewMessageAttribute), false).Cast()); + } + + foreach (PropertyInfo p in type.GetRuntimeProperties()) + { + attributeList.AddRange(p.GetCustomAttributes(typeof(PreviewMessageAttribute), false).Cast()); + } + } + else if (commandInfo.GetType() == typeof(FunctionInfo)) + { + attributeList.AddRange(((FunctionInfo)commandInfo).ScriptBlock.Attributes.Where(e => typeof(PreviewMessageAttribute).IsAssignableFrom(e.GetType())).Cast()); + foreach (var parameter in ((FunctionInfo)commandInfo).Parameters) + { + attributeList.AddRange(parameter.Value.Attributes.Where(e => typeof(PreviewMessageAttribute).IsAssignableFrom(e.GetType())).Cast()); + } + } + return invocationInfo == null ? attributeList : attributeList.Where(e => e.IsApplicableToInvocation(invocationInfo)); + } + } +} diff --git a/swaggerci/eventgrid/generated/runtime/Method.cs b/swaggerci/eventgrid/generated/runtime/Method.cs new file mode 100644 index 000000000000..58e967054081 --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/Method.cs @@ -0,0 +1,19 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime +{ + internal static class Method + { + internal static System.Net.Http.HttpMethod Get = System.Net.Http.HttpMethod.Get; + internal static System.Net.Http.HttpMethod Put = System.Net.Http.HttpMethod.Put; + internal static System.Net.Http.HttpMethod Head = System.Net.Http.HttpMethod.Head; + internal static System.Net.Http.HttpMethod Post = System.Net.Http.HttpMethod.Post; + internal static System.Net.Http.HttpMethod Delete = System.Net.Http.HttpMethod.Delete; + internal static System.Net.Http.HttpMethod Options = System.Net.Http.HttpMethod.Options; + internal static System.Net.Http.HttpMethod Trace = System.Net.Http.HttpMethod.Trace; + internal static System.Net.Http.HttpMethod Patch = new System.Net.Http.HttpMethod("PATCH"); + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/runtime/Models/JsonMember.cs b/swaggerci/eventgrid/generated/runtime/Models/JsonMember.cs new file mode 100644 index 000000000000..676f8f2db4ca --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/Models/JsonMember.cs @@ -0,0 +1,83 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Reflection; +using System.Runtime.Serialization; + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json +{ + + + internal sealed class JsonMember + { + private readonly TypeDetails type; + + private readonly Func getter; + private readonly Action setter; + + internal JsonMember(PropertyInfo property, int defaultOrder) + { + getter = property.GetValue; + setter = property.SetValue; + + var dataMember = property.GetCustomAttribute(); + + Name = dataMember?.Name ?? property.Name; + Order = dataMember?.Order ?? defaultOrder; + EmitDefaultValue = dataMember?.EmitDefaultValue ?? true; + + this.type = TypeDetails.Get(property.PropertyType); + + CanRead = property.CanRead; + } + + internal JsonMember(FieldInfo field, int defaultOrder) + { + getter = field.GetValue; + setter = field.SetValue; + + var dataMember = field.GetCustomAttribute(); + + Name = dataMember?.Name ?? field.Name; + Order = dataMember?.Order ?? defaultOrder; + EmitDefaultValue = dataMember?.EmitDefaultValue ?? true; + + this.type = TypeDetails.Get(field.FieldType); + + CanRead = true; + } + + internal string Name { get; } + + internal int Order { get; } + + internal TypeDetails TypeDetails => type; + + internal Type Type => type.NonNullType; + + internal bool IsList => type.IsList; + + // Arrays, Sets, ... + internal Type ElementType => type.ElementType; + + internal IJsonConverter Converter => type.JsonConverter; + + internal bool EmitDefaultValue { get; } + + internal bool IsStringLike => type.IsStringLike; + + internal object DefaultValue => type.DefaultValue; + + internal bool CanRead { get; } + + #region Helpers + + internal object GetValue(object instance) => getter(instance); + + internal void SetValue(object instance, object value) => setter(instance, value); + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/runtime/Models/JsonModel.cs b/swaggerci/eventgrid/generated/runtime/Models/JsonModel.cs new file mode 100644 index 000000000000..37646823c051 --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/Models/JsonModel.cs @@ -0,0 +1,89 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.Runtime.Serialization; +using System.Reflection; + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json +{ + internal class JsonModel + { + private Dictionary map; + private readonly object _sync = new object(); + + private JsonModel(Type type, List members) + { + Type = type ?? throw new ArgumentNullException(nameof(type)); + Members = members ?? throw new ArgumentNullException(nameof(members)); + } + + internal string Name => Type.Name; + + internal Type Type { get; } + + internal List Members { get; } + + internal JsonMember this[string name] + { + get + { + if (map == null) + { + lock (_sync) + { + if (map == null) + { + map = new Dictionary(); + + foreach (JsonMember m in Members) + { + map[m.Name.ToLower()] = m; + } + } + } + } + + + map.TryGetValue(name.ToLower(), out JsonMember member); + + return member; + } + } + + internal static JsonModel FromType(Type type) + { + var members = new List(); + + int i = 0; + + // BindingFlags.Instance | BindingFlags.Public + + foreach (var member in type.GetFields()) + { + if (member.IsStatic) continue; + + if (member.IsDefined(typeof(IgnoreDataMemberAttribute))) continue; + + members.Add(new JsonMember(member, i)); + + i++; + } + + foreach (var member in type.GetProperties(BindingFlags.Public | BindingFlags.Instance)) + { + if (member.IsDefined(typeof(IgnoreDataMemberAttribute))) continue; + + members.Add(new JsonMember(member, i)); + + i++; + } + + members.Sort((a, b) => a.Order.CompareTo(b.Order)); // inline sort + + return new JsonModel(type, members); + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/runtime/Models/JsonModelCache.cs b/swaggerci/eventgrid/generated/runtime/Models/JsonModelCache.cs new file mode 100644 index 000000000000..e52b59992705 --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/Models/JsonModelCache.cs @@ -0,0 +1,19 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Runtime.CompilerServices; + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json +{ + internal static class JsonModelCache + { + private static readonly ConditionalWeakTable cache + = new ConditionalWeakTable(); + + internal static JsonModel Get(Type type) => cache.GetValue(type, Create); + + private static JsonModel Create(Type type) => JsonModel.FromType(type); + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/runtime/Nodes/Collections/JsonArray.cs b/swaggerci/eventgrid/generated/runtime/Nodes/Collections/JsonArray.cs new file mode 100644 index 000000000000..7ae42ef74ccc --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/Nodes/Collections/JsonArray.cs @@ -0,0 +1,65 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json +{ + public abstract partial class JsonArray : JsonNode, IEnumerable + { + internal override JsonType Type => JsonType.Array; + + internal abstract JsonType? ElementType { get; } + + public abstract int Count { get; } + + internal virtual bool IsSet => false; + + internal bool IsEmpty => Count == 0; + + #region IEnumerable + + IEnumerator IEnumerable.GetEnumerator() + { + throw new NotImplementedException(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + throw new NotImplementedException(); + } + + #endregion + + #region Static Helpers + + internal static JsonArray Create(short[] values) + => new XImmutableArray(values); + + internal static JsonArray Create(int[] values) + => new XImmutableArray(values); + + internal static JsonArray Create(long[] values) + => new XImmutableArray(values); + + internal static JsonArray Create(decimal[] values) + => new XImmutableArray(values); + + internal static JsonArray Create(float[] values) + => new XImmutableArray(values); + + internal static JsonArray Create(string[] values) + => new XImmutableArray(values); + + internal static JsonArray Create(XBinary[] values) + => new XImmutableArray(values); + + #endregion + + internal static new JsonArray Parse(string text) + => (JsonArray)JsonNode.Parse(text); + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/runtime/Nodes/Collections/XImmutableArray.cs b/swaggerci/eventgrid/generated/runtime/Nodes/Collections/XImmutableArray.cs new file mode 100644 index 000000000000..f334e25d77d6 --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/Nodes/Collections/XImmutableArray.cs @@ -0,0 +1,62 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json +{ + internal sealed class XImmutableArray : JsonArray, IEnumerable + { + private readonly T[] values; + private readonly JsonType elementType; + private readonly TypeCode elementCode; + + internal XImmutableArray(T[] values) + { + this.values = values ?? throw new ArgumentNullException(nameof(values)); + this.elementCode = System.Type.GetTypeCode(typeof(T)); + this.elementType = XHelper.GetElementType(this.elementCode); + } + + public override JsonNode this[int index] => + XHelper.Create(elementType, elementCode, values[index]); + + internal override JsonType? ElementType => elementType; + + public override int Count => values.Length; + + public bool IsReadOnly => true; + + #region IEnumerable Members + + IEnumerator IEnumerable.GetEnumerator() + { + foreach (T value in values) + { + yield return XHelper.Create(elementType, elementCode, value); + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + foreach (T value in values) + { + yield return XHelper.Create(elementType, elementCode, value); + } + } + + #endregion + + #region Static Constructor + + internal XImmutableArray Create(T[] items) + { + return new XImmutableArray(items); + } + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/runtime/Nodes/Collections/XList.cs b/swaggerci/eventgrid/generated/runtime/Nodes/Collections/XList.cs new file mode 100644 index 000000000000..60d984f45a41 --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/Nodes/Collections/XList.cs @@ -0,0 +1,64 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json +{ + internal sealed class XList : JsonArray, IEnumerable + { + private readonly IList values; + private readonly JsonType elementType; + private readonly TypeCode elementCode; + + internal XList(IList values) + { + this.values = values ?? throw new ArgumentNullException(nameof(values)); + this.elementCode = System.Type.GetTypeCode(typeof(T)); + this.elementType = XHelper.GetElementType(this.elementCode); + } + + public override JsonNode this[int index] => + XHelper.Create(elementType, elementCode, values[index]); + + internal override JsonType? ElementType => elementType; + + public override int Count => values.Count; + + public bool IsReadOnly => values.IsReadOnly; + + #region IList + + public void Add(T value) + { + values.Add(value); + } + + public bool Contains(T value) => values.Contains(value); + + #endregion + + #region IEnumerable Members + + IEnumerator IEnumerable.GetEnumerator() + { + foreach (var value in values) + { + yield return XHelper.Create(elementType, elementCode, value); + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + foreach (var value in values) + { + yield return XHelper.Create(elementType, elementCode, value); + } + } + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/runtime/Nodes/Collections/XNodeArray.cs b/swaggerci/eventgrid/generated/runtime/Nodes/Collections/XNodeArray.cs new file mode 100644 index 000000000000..8565639ec358 --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/Nodes/Collections/XNodeArray.cs @@ -0,0 +1,68 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System.Collections; +using System.Collections.Generic; + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json +{ + public sealed partial class XNodeArray : JsonArray, ICollection + { + private readonly List items; + + internal XNodeArray() + { + items = new List(); + } + + internal XNodeArray(params JsonNode[] values) + { + items = new List(values); + } + + public override JsonNode this[int index] => items[index]; + + internal override JsonType? ElementType => null; + + public bool IsReadOnly => false; + + public override int Count => items.Count; + + #region ICollection Members + + public void Add(JsonNode item) + { + items.Add(item); + } + + void ICollection.Clear() + { + items.Clear(); + } + + public bool Contains(JsonNode item) => items.Contains(item); + + void ICollection.CopyTo(JsonNode[] array, int arrayIndex) + { + items.CopyTo(array, arrayIndex); + } + + public bool Remove(JsonNode item) + { + return items.Remove(item); + } + + #endregion + + #region IEnumerable Members + + IEnumerator IEnumerable.GetEnumerator() + => items.GetEnumerator(); + + IEnumerator IEnumerable.GetEnumerator() + => items.GetEnumerator(); + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/runtime/Nodes/Collections/XSet.cs b/swaggerci/eventgrid/generated/runtime/Nodes/Collections/XSet.cs new file mode 100644 index 000000000000..105eb74bb3b8 --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/Nodes/Collections/XSet.cs @@ -0,0 +1,60 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json +{ + internal sealed class XSet : JsonArray, IEnumerable + { + private readonly HashSet values; + private readonly JsonType elementType; + private readonly TypeCode elementCode; + + internal XSet(IEnumerable values) + : this(new HashSet(values)) + { } + + internal XSet(HashSet values) + { + this.values = values ?? throw new ArgumentNullException(nameof(values)); + this.elementCode = System.Type.GetTypeCode(typeof(T)); + this.elementType = XHelper.GetElementType(this.elementCode); + } + + internal override JsonType Type => JsonType.Array; + + internal override JsonType? ElementType => elementType; + + public bool IsReadOnly => true; + + public override int Count => values.Count; + + internal override bool IsSet => true; + + #region IEnumerable Members + + IEnumerator IEnumerable.GetEnumerator() + { + foreach (var value in values) + { + yield return XHelper.Create(elementType, elementCode, value); + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + foreach (var value in values) + { + yield return XHelper.Create(elementType, elementCode, value); + } + } + + #endregion + + internal HashSet AsHashSet() => values; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/runtime/Nodes/JsonBoolean.cs b/swaggerci/eventgrid/generated/runtime/Nodes/JsonBoolean.cs new file mode 100644 index 000000000000..c0604c265112 --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/Nodes/JsonBoolean.cs @@ -0,0 +1,42 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json +{ + internal sealed partial class JsonBoolean : JsonNode + { + internal static readonly JsonBoolean True = new JsonBoolean(true); + internal static readonly JsonBoolean False = new JsonBoolean(false); + + internal JsonBoolean(bool value) + { + Value = value; + } + + internal bool Value { get; } + + internal override JsonType Type => JsonType.Boolean; + + internal static new JsonBoolean Parse(string text) + { + switch (text) + { + case "false": return False; + case "true": return True; + + default: throw new ArgumentException($"Expected true or false. Was {text}."); + } + } + + #region Implicit Casts + + public static implicit operator bool(JsonBoolean data) => data.Value; + + public static implicit operator JsonBoolean(bool data) => new JsonBoolean(data); + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/runtime/Nodes/JsonDate.cs b/swaggerci/eventgrid/generated/runtime/Nodes/JsonDate.cs new file mode 100644 index 000000000000..d468abf877ac --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/Nodes/JsonDate.cs @@ -0,0 +1,173 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json +{ + + + internal sealed partial class JsonDate : JsonNode, IEquatable, IComparable + { + internal static bool AssumeUtcWhenKindIsUnspecified = true; + + private readonly DateTimeOffset value; + + internal JsonDate(DateTime value) + { + if (value.Kind == DateTimeKind.Unspecified && AssumeUtcWhenKindIsUnspecified) + { + value = DateTime.SpecifyKind(value, DateTimeKind.Utc); + } + + this.value = value; + } + + internal JsonDate(DateTimeOffset value) + { + this.value = value; + } + + internal override JsonType Type => JsonType.Date; + + #region Helpers + + internal DateTimeOffset ToDateTimeOffset() + { + return value; + } + + internal DateTime ToDateTime() + { + if (value.Offset == TimeSpan.Zero) + { + return value.UtcDateTime; + } + + return value.DateTime; + } + + internal DateTime ToUtcDateTime() => value.UtcDateTime; + + internal int ToUnixTimeSeconds() + { + return (int)value.ToUnixTimeSeconds(); + } + + internal long ToUnixTimeMilliseconds() + { + return (int)value.ToUnixTimeMilliseconds(); + } + + internal string ToIsoString() + { + return IsoDate.FromDateTimeOffset(value).ToString(); + } + + #endregion + + public override string ToString() + { + return ToIsoString(); + } + + internal static new JsonDate Parse(string text) + { + if (text == null) throw new ArgumentNullException(nameof(text)); + + // TODO support: unixtimeseconds.partialseconds + + if (text.Length > 4 && _IsNumber(text)) // UnixTime + { + var date = DateTimeOffset.FromUnixTimeSeconds(long.Parse(text)); + + return new JsonDate(date); + } + else if (text.Length <= 4 || text[4] == '-') // ISO: 2012- + { + return new JsonDate(IsoDate.Parse(text).ToDateTimeOffset()); + } + else + { + // NOT ISO ENCODED + // "Thu, 5 Apr 2012 16:59:01 +0200", + return new JsonDate(DateTimeOffset.Parse(text)); + } + } + + private static bool _IsNumber(string text) + { + foreach (var c in text) + { + if (!char.IsDigit(c)) return false; + } + + return true; + } + + internal static JsonDate FromUnixTime(int seconds) + { + return new JsonDate(DateTimeOffset.FromUnixTimeSeconds(seconds)); + } + + internal static JsonDate FromUnixTime(double seconds) + { + var milliseconds = (long)(seconds * 1000d); + + return new JsonDate(DateTimeOffset.FromUnixTimeMilliseconds(milliseconds)); + } + + #region Implicit Casts + + public static implicit operator DateTimeOffset(JsonDate value) + => value.ToDateTimeOffset(); + + public static implicit operator DateTime(JsonDate value) + => value.ToDateTime(); + + // From Date + public static implicit operator JsonDate(DateTimeOffset value) + { + return new JsonDate(value); + } + + public static implicit operator JsonDate(DateTime value) + { + return new JsonDate(value); + } + + // From String + public static implicit operator JsonDate(string value) + { + return Parse(value); + } + + #endregion + + #region Equality + + public override bool Equals(object obj) + { + return obj is JsonDate date && date.value == this.value; + } + + public bool Equals(JsonDate other) + { + return this.value == other.value; + } + + public override int GetHashCode() => value.GetHashCode(); + + #endregion + + #region IComparable Members + + int IComparable.CompareTo(JsonDate other) + { + return value.CompareTo(other.value); + } + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/runtime/Nodes/JsonNode.cs b/swaggerci/eventgrid/generated/runtime/Nodes/JsonNode.cs new file mode 100644 index 000000000000..09f319614712 --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/Nodes/JsonNode.cs @@ -0,0 +1,250 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.IO; +using System.Text; + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json +{ + + + public abstract partial class JsonNode + { + internal abstract JsonType Type { get; } + + public virtual JsonNode this[int index] => throw new NotImplementedException(); + + public virtual JsonNode this[string name] + { + get => throw new NotImplementedException(); + set => throw new NotImplementedException(); + } + + #region Type Helpers + + internal bool IsArray => Type == JsonType.Array; + + internal bool IsDate => Type == JsonType.Date; + + internal bool IsObject => Type == JsonType.Object; + + internal bool IsNumber => Type == JsonType.Number; + + internal bool IsNull => Type == JsonType.Null; + + #endregion + + internal void WriteTo(TextWriter textWriter, bool pretty = true) + { + var writer = new JsonWriter(textWriter, pretty); + + writer.WriteNode(this); + } + + internal T As() + where T : new() + => new JsonSerializer().Deseralize((JsonObject)this); + + internal T[] ToArrayOf() + { + return (T[])new JsonSerializer().DeserializeArray(typeof(T[]), (JsonArray)this); + } + + #region ToString Overrides + + public override string ToString() => ToString(pretty: true); + + internal string ToString(bool pretty) + { + var sb = new StringBuilder(); + + using (var writer = new StringWriter(sb)) + { + WriteTo(writer, pretty); + + return sb.ToString(); + } + } + + #endregion + + #region Static Constructors + + internal static JsonNode Parse(string text) + { + return Parse(new SourceReader(new StringReader(text))); + } + + internal static JsonNode Parse(TextReader textReader) + => Parse(new SourceReader(textReader)); + + private static JsonNode Parse(SourceReader sourceReader) + { + using (var parser = new JsonParser(sourceReader)) + { + return parser.ReadNode(); + } + } + + internal static JsonNode FromObject(object instance) + => new JsonSerializer().Serialize(instance); + + #endregion + + #region Implict Casts + + public static implicit operator string(JsonNode node) => node.ToString(); + + #endregion + + #region Explict Casts + + public static explicit operator DateTime(JsonNode node) + { + switch (node.Type) + { + case JsonType.Date: + return ((JsonDate)node).ToDateTime(); + + case JsonType.String: + return JsonDate.Parse(node.ToString()).ToDateTime(); + + case JsonType.Number: + var num = (JsonNumber)node; + + if (num.IsInteger) + { + return DateTimeOffset.FromUnixTimeSeconds(num).UtcDateTime; + } + else + { + return DateTimeOffset.FromUnixTimeMilliseconds((long)((double)num * 1000)).UtcDateTime; + } + } + + throw new ConversionException(node, typeof(DateTime)); + } + + public static explicit operator DateTimeOffset(JsonNode node) + { + switch (node.Type) + { + case JsonType.Date : return ((JsonDate)node).ToDateTimeOffset(); + case JsonType.String : return JsonDate.Parse(node.ToString()).ToDateTimeOffset(); + + case JsonType.Number: + var num = (JsonNumber)node; + + if (num.IsInteger) + { + return DateTimeOffset.FromUnixTimeSeconds(num); + } + else + { + return DateTimeOffset.FromUnixTimeMilliseconds((long)((double)num * 1000)); + } + + } + + throw new ConversionException(node, typeof(DateTimeOffset)); + } + + public static explicit operator float(JsonNode node) + { + switch (node.Type) + { + case JsonType.Number : return (JsonNumber)node; + case JsonType.String : return float.Parse(node.ToString()); + } + + throw new ConversionException(node, typeof(float)); + } + + public static explicit operator double(JsonNode node) + { + switch (node.Type) + { + case JsonType.Number : return (JsonNumber)node; + case JsonType.String : return double.Parse(node.ToString()); + } + + throw new ConversionException(node, typeof(double)); + } + + public static explicit operator decimal(JsonNode node) + { + switch (node.Type) + { + case JsonType.Number: return (JsonNumber)node; + case JsonType.String: return decimal.Parse(node.ToString()); + } + + throw new ConversionException(node, typeof(decimal)); + } + + public static explicit operator Guid(JsonNode node) + => new Guid(node.ToString()); + + public static explicit operator short(JsonNode node) + { + switch (node.Type) + { + case JsonType.Number : return (JsonNumber)node; + case JsonType.String : return short.Parse(node.ToString()); + } + + throw new ConversionException(node, typeof(short)); + } + + public static explicit operator int(JsonNode node) + { + switch (node.Type) + { + case JsonType.Number : return (JsonNumber)node; + case JsonType.String : return int.Parse(node.ToString()); + } + + throw new ConversionException(node, typeof(int)); + } + + public static explicit operator long(JsonNode node) + { + switch (node.Type) + { + case JsonType.Number: return (JsonNumber)node; + case JsonType.String: return long.Parse(node.ToString()); + } + + throw new ConversionException(node, typeof(long)); + } + + public static explicit operator bool(JsonNode node) + => ((JsonBoolean)node).Value; + + public static explicit operator ushort(JsonNode node) + => (JsonNumber)node; + + public static explicit operator uint(JsonNode node) + => (JsonNumber)node; + + public static explicit operator ulong(JsonNode node) + => (JsonNumber)node; + + public static explicit operator TimeSpan(JsonNode node) + => TimeSpan.Parse(node.ToString()); + + public static explicit operator Uri(JsonNode node) + { + if (node.Type == JsonType.String) + { + return new Uri(node.ToString()); + } + + throw new ConversionException(node, typeof(Uri)); + } + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/runtime/Nodes/JsonNumber.cs b/swaggerci/eventgrid/generated/runtime/Nodes/JsonNumber.cs new file mode 100644 index 000000000000..2b81d4c99ec1 --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/Nodes/JsonNumber.cs @@ -0,0 +1,109 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json +{ + public sealed partial class JsonNumber : JsonNode + { + private readonly string value; + private readonly bool overflows = false; + + internal JsonNumber(string value) + { + this.value = value ?? throw new ArgumentNullException(nameof(value)); + } + + internal JsonNumber(int value) + { + this.value = value.ToString(); + } + + internal JsonNumber(long value) + { + this.value = value.ToString(); + + if (value > 9007199254740991) + { + overflows = true; + } + } + + internal JsonNumber(float value) + { + this.value = value.ToString(System.Globalization.CultureInfo.InvariantCulture); + } + + internal JsonNumber(double value) + { + this.value = value.ToString(System.Globalization.CultureInfo.InvariantCulture); + } + + internal override JsonType Type => JsonType.Number; + + internal string Value => value; + + #region Helpers + + internal bool Overflows => overflows; + + internal bool IsInteger => !value.Contains("."); + + internal bool IsFloat => value.Contains("."); + + #endregion + + #region Casting + + public static implicit operator byte(JsonNumber number) + => byte.Parse(number.Value); + + public static implicit operator short(JsonNumber number) + => short.Parse(number.Value); + + public static implicit operator int(JsonNumber number) + => int.Parse(number.Value); + + public static implicit operator long(JsonNumber number) + => long.Parse(number.value); + + public static implicit operator UInt16(JsonNumber number) + => ushort.Parse(number.Value); + + public static implicit operator UInt32(JsonNumber number) + => uint.Parse(number.Value); + + public static implicit operator UInt64(JsonNumber number) + => ulong.Parse(number.Value); + + public static implicit operator decimal(JsonNumber number) + => decimal.Parse(number.Value, System.Globalization.CultureInfo.InvariantCulture); + + public static implicit operator Double(JsonNumber number) + => double.Parse(number.value, System.Globalization.CultureInfo.InvariantCulture); + + public static implicit operator float(JsonNumber number) + => float.Parse(number.value, System.Globalization.CultureInfo.InvariantCulture); + + public static implicit operator JsonNumber(short data) + => new JsonNumber(data.ToString()); + + public static implicit operator JsonNumber(int data) + => new JsonNumber(data); + + public static implicit operator JsonNumber(long data) + => new JsonNumber(data); + + public static implicit operator JsonNumber(Single data) + => new JsonNumber(data.ToString()); + + public static implicit operator JsonNumber(double data) + => new JsonNumber(data.ToString()); + + #endregion + + public override string ToString() => value; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/runtime/Nodes/JsonObject.cs b/swaggerci/eventgrid/generated/runtime/Nodes/JsonObject.cs new file mode 100644 index 000000000000..c21b8a14002c --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/Nodes/JsonObject.cs @@ -0,0 +1,172 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections; +using System.Collections.Generic; +using System.IO; + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json +{ + public partial class JsonObject : JsonNode, IDictionary + { + private readonly Dictionary items; + + internal JsonObject() + { + items = new Dictionary(); + } + + internal JsonObject(IEnumerable> properties) + { + if (properties == null) throw new ArgumentNullException(nameof(properties)); + + items = new Dictionary(); + + foreach (var field in properties) + { + items.Add(field.Key, field.Value); + } + } + + #region IDictionary Constructors + + internal JsonObject(IDictionary dic) + { + items = new Dictionary(dic.Count); + + foreach (var pair in dic) + { + Add(pair.Key, pair.Value); + } + } + + #endregion + + internal override JsonType Type => JsonType.Object; + + #region Add Overloads + + public void Add(string name, JsonNode value) => + items.Add(name, value); + + public void Add(string name, byte[] value) => + items.Add(name, new XBinary(value)); + + public void Add(string name, DateTime value) => + items.Add(name, new JsonDate(value)); + + public void Add(string name, int value) => + items.Add(name, new JsonNumber(value.ToString())); + + public void Add(string name, long value) => + items.Add(name, new JsonNumber(value.ToString())); + + public void Add(string name, float value) => + items.Add(name, new JsonNumber(value.ToString())); + + public void Add(string name, double value) => + items.Add(name, new JsonNumber(value.ToString())); + + public void Add(string name, string value) => + items.Add(name, new JsonString(value)); + + public void Add(string name, bool value) => + items.Add(name, new JsonBoolean(value)); + + public void Add(string name, Uri url) => + items.Add(name, new JsonString(url.AbsoluteUri)); + + public void Add(string name, string[] values) => + items.Add(name, new XImmutableArray(values)); + + public void Add(string name, int[] values) => + items.Add(name, new XImmutableArray(values)); + + #endregion + + #region ICollection> Members + + void ICollection>.Add(KeyValuePair item) + { + items.Add(item.Key, item.Value); + } + + void ICollection>.Clear() + { + items.Clear(); + } + + bool ICollection>.Contains(KeyValuePair item) => + throw new NotImplementedException(); + + void ICollection>.CopyTo(KeyValuePair[] array, int arrayIndex) => + throw new NotImplementedException(); + + + int ICollection>.Count => items.Count; + + bool ICollection>.IsReadOnly => false; + + bool ICollection>.Remove(KeyValuePair item) => + throw new NotImplementedException(); + + #endregion + + #region IDictionary Members + + public bool ContainsKey(string key) => items.ContainsKey(key); + + public ICollection Keys => items.Keys; + + public bool Remove(string key) => items.Remove(key); + + public bool TryGetValue(string key, out JsonNode value) => + items.TryGetValue(key, out value); + + public ICollection Values => items.Values; + + public override JsonNode this[string key] + { + get => items[key]; + set => items[key] = value; + } + + #endregion + + #region IEnumerable + + IEnumerator> IEnumerable>.GetEnumerator() + => items.GetEnumerator(); + + IEnumerator IEnumerable.GetEnumerator() + => items.GetEnumerator(); + + #endregion + + #region Helpers + + internal static new JsonObject FromObject(object instance) => + (JsonObject)new JsonSerializer().Serialize(instance); + + #endregion + + #region Static Constructors + + internal static JsonObject FromStream(Stream stream) + { + using (var tr = new StreamReader(stream)) + { + return (JsonObject)Parse(tr); + } + } + + internal static new JsonObject Parse(string text) + { + return (JsonObject)JsonNode.Parse(text); + } + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/runtime/Nodes/JsonString.cs b/swaggerci/eventgrid/generated/runtime/Nodes/JsonString.cs new file mode 100644 index 000000000000..59ea3f5495a9 --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/Nodes/JsonString.cs @@ -0,0 +1,42 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json +{ + public sealed partial class JsonString : JsonNode, IEquatable + { + private readonly string value; + + internal JsonString(string value) + { + this.value = value ?? throw new ArgumentNullException(nameof(value)); + } + + internal override JsonType Type => JsonType.String; + + internal string Value => value; + + internal int Length => value.Length; + + #region #region Implicit Casts + + public static implicit operator string(JsonString data) => data.Value; + + public static implicit operator JsonString(string value) => new JsonString(value); + + #endregion + + public override int GetHashCode() => value.GetHashCode(); + + public override string ToString() => value; + + #region IEquatable + + bool IEquatable.Equals(JsonString other) => this.Value == other.Value; + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/runtime/Nodes/XBinary.cs b/swaggerci/eventgrid/generated/runtime/Nodes/XBinary.cs new file mode 100644 index 000000000000..b9930732c2d0 --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/Nodes/XBinary.cs @@ -0,0 +1,40 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json +{ + internal sealed class XBinary : JsonNode + { + private readonly byte[] _value; + private readonly string _base64; + + internal XBinary(byte[] value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + internal XBinary(string base64EncodedString) + { + _base64 = base64EncodedString ?? throw new ArgumentNullException(nameof(base64EncodedString)); + } + + internal override JsonType Type => JsonType.Binary; + + internal byte[] Value => _value ?? Convert.FromBase64String(_base64); + + #region #region Implicit Casts + + public static implicit operator byte[] (XBinary data) => data.Value; + + public static implicit operator XBinary(byte[] data) => new XBinary(data); + + #endregion + + public override int GetHashCode() => Value.GetHashCode(); + + public override string ToString() => _base64 ?? Convert.ToBase64String(_value); + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/runtime/Nodes/XNull.cs b/swaggerci/eventgrid/generated/runtime/Nodes/XNull.cs new file mode 100644 index 000000000000..ff378cc8815c --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/Nodes/XNull.cs @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json +{ + internal sealed class XNull : JsonNode + { + internal static readonly XNull Instance = new XNull(); + + private XNull() { } + + internal override JsonType Type => JsonType.Null; + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/runtime/Parser/Exceptions/ParseException.cs b/swaggerci/eventgrid/generated/runtime/Parser/Exceptions/ParseException.cs new file mode 100644 index 000000000000..4e8bd94b0513 --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/Parser/Exceptions/ParseException.cs @@ -0,0 +1,24 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json +{ + internal class ParserException : Exception + { + internal ParserException(string message) + : base(message) + { } + + internal ParserException(string message, SourceLocation location) + : base(message) + { + + Location = location; + } + + internal SourceLocation Location { get; } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/runtime/Parser/JsonParser.cs b/swaggerci/eventgrid/generated/runtime/Parser/JsonParser.cs new file mode 100644 index 000000000000..e773c64fd240 --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/Parser/JsonParser.cs @@ -0,0 +1,180 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.IO; + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json +{ + public class JsonParser : IDisposable + { + private readonly TokenReader reader; + + internal JsonParser(TextReader reader) + : this(new SourceReader(reader)) { } + + internal JsonParser(SourceReader sourceReader) + { + if (sourceReader == null) + throw new ArgumentNullException(nameof(sourceReader)); + + this.reader = new TokenReader(new JsonTokenizer(sourceReader)); + + this.reader.Next(); // Start with the first token + } + + internal IEnumerable ReadNodes() + { + JsonNode node; + + while ((node = ReadNode()) != null) yield return node; + } + + internal JsonNode ReadNode() + { + if (reader.Current.Kind == TokenKind.Eof || reader.Current.IsTerminator) + { + return null; + } + + switch (reader.Current.Kind) + { + case TokenKind.LeftBrace : return ReadObject(); // { + case TokenKind.LeftBracket : return ReadArray(); // [ + + default: throw new ParserException($"Expected '{{' or '['. Was {reader.Current}."); + } + } + + private JsonNode ReadFieldValue() + { + // Boolean, Date, Null, Number, String, Uri + if (reader.Current.IsLiteral) + { + return ReadLiteral(); + } + else + { + switch (reader.Current.Kind) + { + case TokenKind.LeftBracket: return ReadArray(); + case TokenKind.LeftBrace : return ReadObject(); + + default: throw new ParserException($"Unexpected token reading field value. Was {reader.Current}."); + } + } + } + + private JsonNode ReadLiteral() + { + var literal = reader.Current; + + reader.Next(); // Read the literal token + + switch (literal.Kind) + { + case TokenKind.Boolean : return JsonBoolean.Parse(literal.Value); + case TokenKind.Null : return XNull.Instance; + case TokenKind.Number : return new JsonNumber(literal.Value); + case TokenKind.String : return new JsonString(literal.Value); + + default: throw new ParserException($"Unexpected token reading literal. Was {literal}."); + } + } + + internal JsonObject ReadObject() + { + reader.Ensure(TokenKind.LeftBrace, "object"); + + reader.Next(); // Read '{' (Object start) + + var jsonObject = new JsonObject(); + + // Read the object's fields until we reach the end of the object ('}') + while (reader.Current.Kind != TokenKind.RightBrace) + { + if (reader.Current.Kind == TokenKind.Comma) + { + reader.Next(); // Read ',' (Seperator) + } + + // Ensure we have a field name + reader.Ensure(TokenKind.String, "Expected field name"); + + var field = ReadField(); + + jsonObject.Add(field.Key, field.Value); + } + + reader.Next(); // Read '}' (Object end) + + return jsonObject; + } + + + // TODO: Use ValueTuple in C#7 + private KeyValuePair ReadField() + { + var fieldName = reader.Current.Value; + + reader.Next(); // Read the field name + + reader.Ensure(TokenKind.Colon, "field"); + + reader.Next(); // Read ':' (Field value indicator) + + return new KeyValuePair(fieldName, ReadFieldValue()); + } + + + internal JsonArray ReadArray() + { + reader.Ensure(TokenKind.LeftBracket, "array"); + + var array = new XNodeArray(); + + reader.Next(); // Read the '[' (Array start) + + // Read the array's items + while (reader.Current.Kind != TokenKind.RightBracket) + { + if (reader.Current.Kind == TokenKind.Comma) + { + reader.Next(); // Read the ',' (Seperator) + } + + if (reader.Current.IsLiteral) + { + array.Add(ReadLiteral()); // Boolean, Date, Number, Null, String, Uri + } + else if (reader.Current.Kind == TokenKind.LeftBracket) + { + array.Add(ReadArray()); // Array + } + else if (reader.Current.Kind == TokenKind.LeftBrace) + { + array.Add(ReadObject()); // Object + } + else + { + throw new ParserException($"Expected comma, literal, or object. Was {reader.Current}."); + } + } + + reader.Next(); // Read the ']' (Array end) + + return array; + } + + #region IDisposable + + public void Dispose() + { + reader.Dispose(); + } + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/runtime/Parser/JsonToken.cs b/swaggerci/eventgrid/generated/runtime/Parser/JsonToken.cs new file mode 100644 index 000000000000..0ddd6d7682d8 --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/Parser/JsonToken.cs @@ -0,0 +1,66 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json +{ + internal enum TokenKind + { + LeftBrace, // { Object start + RightBrace, // } Object end + + LeftBracket, // [ Array start + RightBracket, // ] Array end + + Comma, // , Comma + Colon, // : Value indicator + Dot, // . Access field indicator + Terminator, // \0 Stream terminator + + Boolean = 31, // true or false + Null = 33, // null + Number = 34, // i.e. -1.93, -1, 0, 1, 1.1 + String = 35, // i.e. "text" + + Eof = 50 + } + + internal /* readonly */ struct JsonToken + { + internal static readonly JsonToken BraceOpen = new JsonToken(TokenKind.LeftBrace, "{"); + internal static readonly JsonToken BraceClose = new JsonToken(TokenKind.RightBrace, "}"); + + internal static readonly JsonToken BracketOpen = new JsonToken(TokenKind.LeftBracket, "["); + internal static readonly JsonToken BracketClose = new JsonToken(TokenKind.RightBracket, "]"); + + internal static readonly JsonToken Colon = new JsonToken(TokenKind.Colon, ":"); + internal static readonly JsonToken Comma = new JsonToken(TokenKind.Comma, ","); + internal static readonly JsonToken Terminator = new JsonToken(TokenKind.Terminator, "\0"); + + internal static readonly JsonToken True = new JsonToken(TokenKind.Boolean, "true"); + internal static readonly JsonToken False = new JsonToken(TokenKind.Boolean, "false"); + internal static readonly JsonToken Null = new JsonToken(TokenKind.Null, "null"); + + internal static readonly JsonToken Eof = new JsonToken(TokenKind.Eof, null); + + internal JsonToken(TokenKind kind, string value) + { + Kind = kind; + Value = value; + } + + internal readonly TokenKind Kind; + + internal readonly string Value; + + public override string ToString() => Kind + ": " + Value; + + #region Helpers + + internal bool IsLiteral => (byte)Kind > 30 && (byte)Kind < 40; + + internal bool IsTerminator => Kind == TokenKind.Terminator; + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/runtime/Parser/JsonTokenizer.cs b/swaggerci/eventgrid/generated/runtime/Parser/JsonTokenizer.cs new file mode 100644 index 000000000000..dc3d283bb3be --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/Parser/JsonTokenizer.cs @@ -0,0 +1,177 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Text; + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json +{ + using System.IO; + + + public class JsonTokenizer : IDisposable + { + private readonly StringBuilder sb = new StringBuilder(); + + private readonly SourceReader reader; + + internal JsonTokenizer(TextReader reader) + : this(new SourceReader(reader)) { } + + internal JsonTokenizer(SourceReader reader) + { + this.reader = reader; + + reader.Next(); // Start with the first char + } + + internal JsonToken ReadNext() + { + reader.SkipWhitespace(); + + if (reader.IsEof) return JsonToken.Eof; + + switch (reader.Current) + { + case '"': return ReadQuotedString(); + + // Symbols + case '[' : reader.Next(); return JsonToken.BracketOpen; // Array start + case ']' : reader.Next(); return JsonToken.BracketClose; // Array end + case ',' : reader.Next(); return JsonToken.Comma; // Value seperator + case ':' : reader.Next(); return JsonToken.Colon; // Field value indicator + case '{' : reader.Next(); return JsonToken.BraceOpen; // Object start + case '}' : reader.Next(); return JsonToken.BraceClose; // Object end + case '\0' : reader.Next(); return JsonToken.Terminator; // Stream terminiator + + default: return ReadLiteral(); + } + } + + private JsonToken ReadQuotedString() + { + Expect('"', "quoted string indicator"); + + reader.Next(); // Read '"' (Starting quote) + + // Read until we reach an unescaped quote char + while (reader.Current != '"') + { + EnsureNotEof("quoted string"); + + if (reader.Current == '\\') + { + char escapedCharacter = reader.ReadEscapeCode(); + + sb.Append(escapedCharacter); + + continue; + } + + StoreCurrentCharacterAndReadNext(); + } + + reader.Next(); // Read '"' (Ending quote) + + return new JsonToken(TokenKind.String, value: sb.Extract()); + } + + private JsonToken ReadLiteral() + { + if (char.IsDigit(reader.Current) || + reader.Current == '-' || + reader.Current == '+') + { + return ReadNumber(); + } + + return ReadIdentifer(); + } + + private JsonToken ReadNumber() + { + // Read until we hit a non-numeric character + // -6.247737e-06 + // E + + while (char.IsDigit(reader.Current) + || reader.Current == '.' + || reader.Current == 'e' + || reader.Current == 'E' + || reader.Current == '-' + || reader.Current == '+') + { + StoreCurrentCharacterAndReadNext(); + } + + return new JsonToken(TokenKind.Number, value: sb.Extract()); + } + + int count = 0; + + private JsonToken ReadIdentifer() + { + count++; + + if (!char.IsLetter(reader.Current)) + { + throw new ParserException( + message : $"Expected literal (number, boolean, or null). Was '{reader.Current}'.", + location : reader.Location + ); + } + + // Read letters, numbers, and underscores '_' + while (char.IsLetterOrDigit(reader.Current) || reader.Current == '_') + { + StoreCurrentCharacterAndReadNext(); + } + + string text = sb.Extract(); + + switch (text) + { + case "true": return JsonToken.True; + case "false": return JsonToken.False; + case "null": return JsonToken.Null; + + default: return new JsonToken(TokenKind.String, text); + } + } + + private void Expect(char character, string description) + { + if (reader.Current != character) + { + throw new ParserException( + message: $"Expected {description} ('{character}'). Was '{reader.Current}'.", + location: reader.Location + ); + } + } + + private void EnsureNotEof(string tokenType) + { + if (reader.IsEof) + { + throw new ParserException( + message: $"Unexpected EOF while reading {tokenType}.", + location: reader.Location + ); + } + } + + private void StoreCurrentCharacterAndReadNext() + { + sb.Append(reader.Current); + + reader.Next(); + } + + public void Dispose() + { + reader.Dispose(); + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/runtime/Parser/Location.cs b/swaggerci/eventgrid/generated/runtime/Parser/Location.cs new file mode 100644 index 000000000000..4314c66405a2 --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/Parser/Location.cs @@ -0,0 +1,43 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json +{ + internal struct SourceLocation + { + private int line; + private int column; + private int position; + + internal SourceLocation(int line = 0, int column = 0, int position = 0) + { + this.line = line; + this.column = column; + this.position = position; + } + + internal int Line => line; + + internal int Column => column; + + internal int Position => position; + + internal void Advance() + { + this.column++; + this.position++; + } + + internal void MarkNewLine() + { + this.line++; + this.column = 0; + } + + internal SourceLocation Clone() + { + return new SourceLocation(line, column, position); + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/runtime/Parser/Readers/SourceReader.cs b/swaggerci/eventgrid/generated/runtime/Parser/Readers/SourceReader.cs new file mode 100644 index 000000000000..9ee64d0fe319 --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/Parser/Readers/SourceReader.cs @@ -0,0 +1,130 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Globalization; +using System.IO; + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json +{ + public sealed class SourceReader : IDisposable + { + private readonly TextReader source; + + private char current; + + private readonly SourceLocation location = new SourceLocation(); + + private bool isEof = false; + + internal SourceReader(TextReader textReader) + { + this.source = textReader ?? throw new ArgumentNullException(nameof(textReader)); + } + + /// + /// Advances to the next character + /// + internal void Next() + { + // Advance to the new line when we see a new line '\n'. + // A new line may be prefixed by a carriage return '\r'. + + if (current == '\n') + { + location.MarkNewLine(); + } + + int charCode = source.Read(); // -1 for end + + if (charCode >= 0) + { + current = (char)charCode; + } + else + { + // If we've already marked this as the EOF, throw an exception + if (isEof) + { + throw new EndOfStreamException("Cannot advance past end of stream."); + } + + isEof = true; + + current = '\0'; + } + + location.Advance(); + } + + internal void SkipWhitespace() + { + while (char.IsWhiteSpace(current)) + { + Next(); + } + } + + internal char ReadEscapeCode() + { + Next(); + + char escapedChar = current; + + Next(); // Consume escaped character + + switch (escapedChar) + { + // Special escape codes + case '"': return '"'; // " (Quotation mark) U+0022 + case '/': return '/'; // / (Solidus) U+002F + case '\\': return '\\'; // \ (Reverse solidus) U+005C + + // Control Characters + case '0': return '\0'; // Nul (0) U+0000 + case 'a': return '\a'; // Alert (7) + case 'b': return '\b'; // Backspace (8) U+0008 + case 'f': return '\f'; // Form feed (12) U+000C + case 'n': return '\n'; // Line feed (10) U+000A + case 'r': return '\r'; // Carriage return (13) U+000D + case 't': return '\t'; // Horizontal tab (9) U+0009 + case 'v': return '\v'; // Vertical tab + + // Unicode escape sequence + case 'u': return ReadUnicodeEscapeSequence(); // U+XXXX + + default: throw new Exception($"Unrecognized escape sequence '\\{escapedChar}'"); + } + } + + private readonly char[] hexCode = new char[4]; + + private char ReadUnicodeEscapeSequence() + { + hexCode[0] = current; Next(); + hexCode[1] = current; Next(); + hexCode[2] = current; Next(); + hexCode[3] = current; Next(); + + return Convert.ToChar(int.Parse( + s : new string(hexCode), + style : NumberStyles.HexNumber, + provider: NumberFormatInfo.InvariantInfo + )); + } + + internal char Current => current; + + internal bool IsEof => isEof; + + internal char Peek() => (char)source.Peek(); + + internal SourceLocation Location => location; + + public void Dispose() + { + source.Dispose(); + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/runtime/Parser/TokenReader.cs b/swaggerci/eventgrid/generated/runtime/Parser/TokenReader.cs new file mode 100644 index 000000000000..a08afe48aff9 --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/Parser/TokenReader.cs @@ -0,0 +1,39 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json +{ + public class TokenReader : IDisposable + { + private readonly JsonTokenizer tokenizer; + private JsonToken current; + + internal TokenReader(JsonTokenizer tokenizer) + { + this.tokenizer = tokenizer ?? throw new ArgumentNullException(nameof(tokenizer)); + } + + internal void Next() + { + current = tokenizer.ReadNext(); + } + + internal JsonToken Current => current; + + internal void Ensure(TokenKind kind, string readerName) + { + if (current.Kind != kind) + { + throw new ParserException($"Expected {kind} while reading {readerName}). Was {current}."); + } + } + + public void Dispose() + { + tokenizer.Dispose(); + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/runtime/PipelineMocking.cs b/swaggerci/eventgrid/generated/runtime/PipelineMocking.cs new file mode 100644 index 000000000000..dcedd3fcc072 --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/PipelineMocking.cs @@ -0,0 +1,262 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime +{ + using System.Threading.Tasks; + using System.Collections.Generic; + using System.Net.Http; + using System.Linq; + using System.Net; + using Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json; + + public enum MockMode + { + Live, + Record, + Playback, + + } + + public class PipelineMock + { + + private System.Collections.Generic.Stack scenario = new System.Collections.Generic.Stack(); + private System.Collections.Generic.Stack context = new System.Collections.Generic.Stack(); + private System.Collections.Generic.Stack description = new System.Collections.Generic.Stack(); + + private readonly string recordingPath; + private int counter = 0; + + public static implicit operator Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep(PipelineMock instance) => instance.SendAsync; + + public MockMode Mode { get; set; } = MockMode.Live; + public PipelineMock(string recordingPath) + { + this.recordingPath = recordingPath; + } + + public void PushContext(string text) => context.Push(text); + + public void PushDescription(string text) => description.Push(text); + + + public void PushScenario(string it) + { + // reset counter too + counter = 0; + + scenario.Push(it); + } + + public void PopContext() => context.Pop(); + + public void PopDescription() => description.Pop(); + + public void PopScenario() => scenario.Pop(); + + public void SetRecord() => Mode = MockMode.Record; + + public void SetPlayback() => Mode = MockMode.Playback; + + public void SetLive() => Mode = MockMode.Live; + + public string Scenario => (scenario.Count > 0 ? scenario.Peek() : "[NoScenario]"); + public string Description => (description.Count > 0 ? description.Peek() : "[NoDescription]"); + public string Context => (context.Count > 0 ? context.Peek() : "[NoContext]"); + + /// + /// Headers that we substitute out blank values for in the recordings + /// Add additional headers as necessary + /// + public static HashSet Blacklist = new HashSet(System.StringComparer.CurrentCultureIgnoreCase) { + "Authorization", + }; + + public Dictionary ForceResponseHeaders = new Dictionary(); + + internal static XImmutableArray Removed = new XImmutableArray(new string[] { "[Filtered]" }); + + internal static IEnumerable> FilterHeaders(IEnumerable>> headers) => headers.Select(header => new KeyValuePair(header.Key, Blacklist.Contains(header.Key) ? Removed : new XImmutableArray(header.Value.ToArray()))); + + internal static JsonNode SerializeContent(HttpContent content, ref bool isBase64) => content == null ? XNull.Instance : SerializeContent(content.ReadAsByteArrayAsync().Result, ref isBase64); + + internal static JsonNode SerializeContent(byte[] content, ref bool isBase64) + { + if (null == content || content.Length == 0) + { + return XNull.Instance; + } + var first = content[0]; + var last = content[content.Length - 1]; + + // plaintext for JSON/SGML/XML/HTML/STRINGS/ARRAYS + if ((first == '{' && last == '}') || (first == '<' && last == '>') || (first == '[' && last == ']') || (first == '"' && last == '"')) + { + return new JsonString(System.Text.Encoding.UTF8.GetString(content)); + } + + // base64 for everyone else + return new JsonString(System.Convert.ToBase64String(content)); + } + + internal static byte[] DeserializeContent(string content, bool isBase64) + { + if (string.IsNullOrWhiteSpace(content)) + { + return new byte[0]; + } + + if (isBase64) + { + try + { + return System.Convert.FromBase64String(content); + } + catch + { + // hmm. didn't work, return it as a string I guess. + } + } + return System.Text.Encoding.UTF8.GetBytes(content); + } + + public void SaveMessage(string rqKey, HttpRequestMessage request, HttpResponseMessage response) + { + var messages = System.IO.File.Exists(this.recordingPath) ? Load() : new JsonObject() ?? new JsonObject(); + bool isBase64Request = false; + bool isBase64Response = false; + messages[rqKey] = new JsonObject { + { "Request",new JsonObject { + { "Method", request.Method.Method }, + { "RequestUri", request.RequestUri }, + { "Content", SerializeContent( request.Content, ref isBase64Request) }, + { "isContentBase64", isBase64Request }, + { "Headers", new JsonObject(FilterHeaders(request.Headers)) }, + { "ContentHeaders", request.Content == null ? new JsonObject() : new JsonObject(FilterHeaders(request.Content.Headers))} + } }, + {"Response", new JsonObject { + { "StatusCode", (int)response.StatusCode}, + { "Headers", new JsonObject(FilterHeaders(response.Headers))}, + { "ContentHeaders", new JsonObject(FilterHeaders(response.Content.Headers))}, + { "Content", SerializeContent(response.Content, ref isBase64Response) }, + { "isContentBase64", isBase64Response }, + }} + }; + System.IO.File.WriteAllText(this.recordingPath, messages.ToString()); + } + + private JsonObject Load() + { + if (System.IO.File.Exists(this.recordingPath)) + { + try + { + return JsonObject.FromStream(System.IO.File.OpenRead(this.recordingPath)); + } + catch + { + throw new System.Exception($"Invalid recording file: '{recordingPath}'"); + } + } + + throw new System.ArgumentException($"Missing recording file: '{recordingPath}'", nameof(recordingPath)); + } + + public HttpResponseMessage LoadMessage(string rqKey) + { + var responses = Load(); + var message = responses.Property(rqKey); + + if (null == message) + { + throw new System.ArgumentException($"Missing Request '{rqKey}' in recording file", nameof(rqKey)); + } + + var sc = 0; + var reqMessage = message.Property("Request"); + var respMessage = message.Property("Response"); + + // --------------------------- deserialize response ---------------------------------------------------------------- + bool isBase64Response = false; + respMessage.BooleanProperty("isContentBase64", ref isBase64Response); + var response = new HttpResponseMessage + { + StatusCode = (HttpStatusCode)respMessage.NumberProperty("StatusCode", ref sc), + Content = new System.Net.Http.ByteArrayContent(DeserializeContent(respMessage.StringProperty("Content"), isBase64Response)) + }; + + foreach (var each in respMessage.Property("Headers")) + { + response.Headers.TryAddWithoutValidation(each.Key, each.Value.ToArrayOf()); + } + + foreach (var frh in ForceResponseHeaders) + { + response.Headers.Remove(frh.Key); + response.Headers.TryAddWithoutValidation(frh.Key, frh.Value); + } + + foreach (var each in respMessage.Property("ContentHeaders")) + { + response.Content.Headers.TryAddWithoutValidation(each.Key, each.Value.ToArrayOf()); + } + + // --------------------------- deserialize request ---------------------------------------------------------------- + bool isBase64Request = false; + reqMessage.BooleanProperty("isContentBase64", ref isBase64Request); + response.RequestMessage = new HttpRequestMessage + { + Method = new HttpMethod(reqMessage.StringProperty("Method")), + RequestUri = new System.Uri(reqMessage.StringProperty("RequestUri")), + Content = new System.Net.Http.ByteArrayContent(DeserializeContent(reqMessage.StringProperty("Content"), isBase64Request)) + }; + + foreach (var each in reqMessage.Property("Headers")) + { + response.RequestMessage.Headers.TryAddWithoutValidation(each.Key, each.Value.ToArrayOf()); + } + foreach (var each in reqMessage.Property("ContentHeaders")) + { + response.RequestMessage.Content.Headers.TryAddWithoutValidation(each.Key, each.Value.ToArrayOf()); + } + + return response; + } + + public async Task SendAsync(HttpRequestMessage request, IEventListener callback, ISendAsync next) + { + counter++; + var rqkey = $"{Description}+{Context}+{Scenario}+${request.Method.Method}+{request.RequestUri}+{counter}"; + + switch (Mode) + { + case MockMode.Record: + //Add following code since the request.Content will be released after sendAsync + var requestClone = request; + if (requestClone.Content != null) + { + requestClone = await request.CloneWithContent(request.RequestUri, request.Method); + } + // make the call + var response = await next.SendAsync(request, callback); + + // save the message to the recording file + SaveMessage(rqkey, requestClone, response); + + // return the response. + return response; + + case MockMode.Playback: + // load and return the response. + return LoadMessage(rqkey); + + default: + // pass-thru, do nothing + return await next.SendAsync(request, callback); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/runtime/Properties/Resources.Designer.cs b/swaggerci/eventgrid/generated/runtime/Properties/Resources.Designer.cs new file mode 100644 index 000000000000..da658cf024f6 --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/Properties/Resources.Designer.cs @@ -0,0 +1,5633 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.generated.runtime.Properties +{ + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + public class Resources + { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() + { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Resources.ResourceManager ResourceManager + { + get + { + if (object.ReferenceEquals(resourceMan, null)) + { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Microsoft.Azure.PowerShell.Cmdlets.EventGrid.generated.runtime.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Globalization.CultureInfo Culture + { + get + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to The remote server returned an error: (401) Unauthorized.. + /// + public static string AccessDeniedExceptionMessage + { + get + { + return ResourceManager.GetString("AccessDeniedExceptionMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Account id doesn't match one in subscription.. + /// + public static string AccountIdDoesntMatchSubscription + { + get + { + return ResourceManager.GetString("AccountIdDoesntMatchSubscription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Account needs to be specified. + /// + public static string AccountNeedsToBeSpecified + { + get + { + return ResourceManager.GetString("AccountNeedsToBeSpecified", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Account "{0}" has been added.. + /// + public static string AddAccountAdded + { + get + { + return ResourceManager.GetString("AddAccountAdded", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to To switch to a different subscription, please use Select-AzureSubscription.. + /// + public static string AddAccountChangeSubscription + { + get + { + return ResourceManager.GetString("AddAccountChangeSubscription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Skipping external tenant {0}, because you are using a guest or a foreign principal object identity. In order to access this tenant, please run Add-AzureAccount without "-Credential".. + /// + public static string AddAccountNonInteractiveGuestOrFpo + { + get + { + return ResourceManager.GetString("AddAccountNonInteractiveGuestOrFpo", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Subscription "{0}" is selected as the default subscription.. + /// + public static string AddAccountShowDefaultSubscription + { + get + { + return ResourceManager.GetString("AddAccountShowDefaultSubscription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to To view all the subscriptions, please use Get-AzureSubscription.. + /// + public static string AddAccountViewSubscriptions + { + get + { + return ResourceManager.GetString("AddAccountViewSubscriptions", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Add-On {0} is created successfully.. + /// + public static string AddOnCreatedMessage + { + get + { + return ResourceManager.GetString("AddOnCreatedMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Add-on name {0} is already used.. + /// + public static string AddOnNameAlreadyUsed + { + get + { + return ResourceManager.GetString("AddOnNameAlreadyUsed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Add-On {0} not found.. + /// + public static string AddOnNotFound + { + get + { + return ResourceManager.GetString("AddOnNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Add-on {0} is removed successfully.. + /// + public static string AddOnRemovedMessage + { + get + { + return ResourceManager.GetString("AddOnRemovedMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Add-On {0} is updated successfully.. + /// + public static string AddOnUpdatedMessage + { + get + { + return ResourceManager.GetString("AddOnUpdatedMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Role has been created at {0}\{1}.. + /// + public static string AddRoleMessageCreate + { + get + { + return ResourceManager.GetString("AddRoleMessageCreate", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Role has been created at {0}\{1}. For easy access to Microsoft Azure services from your application code, install the Microsoft Azure client library for Node.js by running ‘npm install azure’.. + /// + public static string AddRoleMessageCreateNode + { + get + { + return ResourceManager.GetString("AddRoleMessageCreateNode", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Role has been created at {0}\{1}. For easy access to Microsoft Azure services from your application code, install the Microsoft Azure client library for PHP by running "pear WindowsAzure/WindowsAzure".. + /// + public static string AddRoleMessageCreatePHP + { + get + { + return ResourceManager.GetString("AddRoleMessageCreatePHP", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unable to set role permissions. Please give the 'Network Service' user 'Read & execute' and 'Modify' permissions to the role folder, or run PowerShell as an Administrator. + /// + public static string AddRoleMessageInsufficientPermissions + { + get + { + return ResourceManager.GetString("AddRoleMessageInsufficientPermissions", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A role name '{0}' already exists. + /// + public static string AddRoleMessageRoleExists + { + get + { + return ResourceManager.GetString("AddRoleMessageRoleExists", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Profile {0} already has an endpoint with name {1}. + /// + public static string AddTrafficManagerEndpointFailed + { + get + { + return ResourceManager.GetString("AddTrafficManagerEndpointFailed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Azure PowerShell collects usage data in order to improve your experience. + ///The data is anonymous and does not include commandline argument values. + ///The data is collected by Microsoft. + /// + ///Use the Disable-AzDataCollection cmdlet to turn the feature Off. The cmdlet can be found in the Az.Accounts module. To disable data collection: PS > Disable-AzDataCollection. + ///Use the Enable-AzDataCollection cmdlet to turn the feature On. The cmdlet can be found in the Az.Accounts module. To enable [rest of string was truncated]";. + /// + public static string ARMDataCollectionMessage + { + get + { + return ResourceManager.GetString("ARMDataCollectionMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to [Common.Authentication]: Authenticating for account {0} with single tenant {1}.. + /// + public static string AuthenticatingForSingleTenant + { + get + { + return ResourceManager.GetString("AuthenticatingForSingleTenant", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Windows Azure Powershell\. + /// + public static string AzureDirectory + { + get + { + return ResourceManager.GetString("AzureDirectory", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to https://manage.windowsazure.com. + /// + public static string AzurePortalUrl + { + get + { + return ResourceManager.GetString("AzurePortalUrl", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to AZURE_PORTAL_URL. + /// + public static string AzurePortalUrlEnv + { + get + { + return ResourceManager.GetString("AzurePortalUrlEnv", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Selected profile must not be null.. + /// + public static string AzureProfileMustNotBeNull + { + get + { + return ResourceManager.GetString("AzureProfileMustNotBeNull", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Azure SDK\{0}\. + /// + public static string AzureSdkDirectory + { + get + { + return ResourceManager.GetString("AzureSdkDirectory", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to File '{0}' already exists. Use the -Force parameter to overwrite it.. + /// + public static string AzureVMDscArchiveAlreadyExists + { + get + { + return ResourceManager.GetString("AzureVMDscArchiveAlreadyExists", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot find configuration data file: {0}. + /// + public static string AzureVMDscCannotFindConfigurationDataFile + { + get + { + return ResourceManager.GetString("AzureVMDscCannotFindConfigurationDataFile", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Create Archive. + /// + public static string AzureVMDscCreateArchiveAction + { + get + { + return ResourceManager.GetString("AzureVMDscCreateArchiveAction", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The configuration data must be a .psd1 file. + /// + public static string AzureVMDscInvalidConfigurationDataFile + { + get + { + return ResourceManager.GetString("AzureVMDscInvalidConfigurationDataFile", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Parsing configuration script: {0}. + /// + public static string AzureVMDscParsingConfiguration + { + get + { + return ResourceManager.GetString("AzureVMDscParsingConfiguration", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Storage Blob '{0}' already exists. Use the -Force parameter to overwrite it.. + /// + public static string AzureVMDscStorageBlobAlreadyExists + { + get + { + return ResourceManager.GetString("AzureVMDscStorageBlobAlreadyExists", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Upload '{0}'. + /// + public static string AzureVMDscUploadToBlobStorageAction + { + get + { + return ResourceManager.GetString("AzureVMDscUploadToBlobStorageAction", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Execution failed because a background thread could not prompt the user.. + /// + public static string BaseShouldMethodFailureReason + { + get + { + return ResourceManager.GetString("BaseShouldMethodFailureReason", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Base Uri was empty.. + /// + public static string BaseUriEmpty + { + get + { + return ResourceManager.GetString("BaseUriEmpty", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} begin processing without ParameterSet.. + /// + public static string BeginProcessingWithoutParameterSetLog + { + get + { + return ResourceManager.GetString("BeginProcessingWithoutParameterSetLog", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} begin processing with ParameterSet '{1}'.. + /// + public static string BeginProcessingWithParameterSetLog + { + get + { + return ResourceManager.GetString("BeginProcessingWithParameterSetLog", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Blob with the name {0} already exists in the account.. + /// + public static string BlobAlreadyExistsInTheAccount + { + get + { + return ResourceManager.GetString("BlobAlreadyExistsInTheAccount", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to https://{0}.blob.core.windows.net/. + /// + public static string BlobEndpointUri + { + get + { + return ResourceManager.GetString("BlobEndpointUri", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to AZURE_BLOBSTORAGE_TEMPLATE. + /// + public static string BlobEndpointUriEnv + { + get + { + return ResourceManager.GetString("BlobEndpointUriEnv", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The parameter : '{0}' is changing.. + /// + public static string BreakingChangeAttributeParameterChanging + { + get + { + return ResourceManager.GetString("BreakingChangeAttributeParameterChanging", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The parameter : '{0}' is becoming mandatory.. + /// + public static string BreakingChangeAttributeParameterMandatoryNow + { + get + { + return ResourceManager.GetString("BreakingChangeAttributeParameterMandatoryNow", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The parameter : '{0}' is being replaced by parameter : '{1}'.. + /// + public static string BreakingChangeAttributeParameterReplaced + { + get + { + return ResourceManager.GetString("BreakingChangeAttributeParameterReplaced", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The parameter : '{0}' is being replaced by mandatory parameter : '{1}'.. + /// + public static string BreakingChangeAttributeParameterReplacedMandatory + { + get + { + return ResourceManager.GetString("BreakingChangeAttributeParameterReplacedMandatory", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The type of the parameter is changing from '{0}' to '{1}'.. + /// + public static string BreakingChangeAttributeParameterTypeChange + { + get + { + return ResourceManager.GetString("BreakingChangeAttributeParameterTypeChange", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Change description : {0} + ///. + /// + public static string BreakingChangesAttributesChangeDescriptionMessage + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesChangeDescriptionMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The cmdlet is being deprecated. There will be no replacement for it.. + /// + public static string BreakingChangesAttributesCmdLetDeprecationMessageNoReplacement + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesCmdLetDeprecationMessageNoReplacement", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The cmdlet is being deprecated. There will be no replacement for it.. + /// + public static string BreakingChangesAttributesParameterSetDeprecationMessageNoReplacement + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesParameterSetDeprecationMessageNoReplacement", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The cmdlet '{0}' is replacing this cmdlet.. + /// + public static string BreakingChangesAttributesCmdLetDeprecationMessageWithReplacement + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesCmdLetDeprecationMessageWithReplacement", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The output type is changing from the existing type :'{0}' to the new type :'{1}'. + /// + public static string BreakingChangesAttributesCmdLetOutputChange1 + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesCmdLetOutputChange1", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to "The output type '{0}' is changing". + /// + public static string BreakingChangesAttributesCmdLetOutputChange2 + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesCmdLetOutputChange2", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to + ///- The following properties are being added to the output type : + ///. + /// + public static string BreakingChangesAttributesCmdLetOutputPropertiesAdded + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesCmdLetOutputPropertiesAdded", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to + /// - The following properties in the output type are being deprecated : + ///. + /// + public static string BreakingChangesAttributesCmdLetOutputPropertiesRemoved + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesCmdLetOutputPropertiesRemoved", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The output type '{0}' is being deprecated without a replacement.. + /// + public static string BreakingChangesAttributesCmdLetOutputTypeDeprecated + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesCmdLetOutputTypeDeprecated", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to - {0} + /// + ///. + /// + public static string BreakingChangesAttributesDeclarationMessage + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesDeclarationMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to - Cmdlet : '{0}' + /// - {1} + ///. + /// + public static string BreakingChangesAttributesDeclarationMessageWithCmdletName + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesDeclarationMessageWithCmdletName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to NOTE : Go to {0} for steps to suppress (and other related information on) the breaking change messages.. + /// + public static string BreakingChangesAttributesFooterMessage + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesFooterMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Breaking changes in the cmdlet '{0}' :. + /// + public static string BreakingChangesAttributesHeaderMessage + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesHeaderMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Note : This change will take effect on '{0}' + ///. + /// + public static string BreakingChangesAttributesInEffectByDateMessage + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesInEffectByDateMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Note :The change is expected to take effect from the version : '{0}' + /// + ///. + /// + public static string BreakingChangesAttributesInEffectByVersion + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesInEffectByVersion", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ```powershell + ///# Old + ///{0} + /// + ///# New + ///{1} + ///``` + /// + ///. + /// + public static string BreakingChangesAttributesUsageChangeMessage + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesUsageChangeMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cmdlet invocation changes : + /// Old Way : {0} + /// New Way : {1}. + /// + public static string BreakingChangesAttributesUsageChangeMessageConsole + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesUsageChangeMessageConsole", resourceCulture); + } + } + + /// + /// The cmdlet is in experimental stage. The function may not be enabled in current subscription. + /// + public static string ExperimentalCmdletMessage + { + get + { + return ResourceManager.GetString("ExperimentalCmdletMessage", resourceCulture); + } + } + + + + /// + /// Looks up a localized string similar to CACHERUNTIMEURL. + /// + public static string CacheRuntimeUrl + { + get + { + return ResourceManager.GetString("CacheRuntimeUrl", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to cache. + /// + public static string CacheRuntimeValue + { + get + { + return ResourceManager.GetString("CacheRuntimeValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to CacheRuntimeVersion. + /// + public static string CacheRuntimeVersionKey + { + get + { + return ResourceManager.GetString("CacheRuntimeVersionKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Installing caching version {0} for Role '{1}' (the caching version locally installed is: {2}). + /// + public static string CacheVersionWarningText + { + get + { + return ResourceManager.GetString("CacheVersionWarningText", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot change built-in environment {0}.. + /// + public static string CannotChangeBuiltinEnvironment + { + get + { + return ResourceManager.GetString("CannotChangeBuiltinEnvironment", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot find {0} with name {1}.. + /// + public static string CannotFind + { + get + { + return ResourceManager.GetString("CannotFind", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Deployment for service {0} with {1} slot doesn't exist. + /// + public static string CannotFindDeployment + { + get + { + return ResourceManager.GetString("CannotFindDeployment", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Can't find valid Microsoft Azure role in current directory {0}. + /// + public static string CannotFindRole + { + get + { + return ResourceManager.GetString("CannotFindRole", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to service {0} configuration file (ServiceConfiguration.Cloud.cscfg) is either null or doesn't exist. + /// + public static string CannotFindServiceConfigurationFile + { + get + { + return ResourceManager.GetString("CannotFindServiceConfigurationFile", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid service path! Cannot locate ServiceDefinition.csdef in current folder or parent folders.. + /// + public static string CannotFindServiceRoot + { + get + { + return ResourceManager.GetString("CannotFindServiceRoot", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The subscription named {0} with id {1} is not currently imported. You must import this subscription before it can be updated.. + /// + public static string CannotUpdateUnknownSubscription + { + get + { + return ResourceManager.GetString("CannotUpdateUnknownSubscription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ManagementCertificate. + /// + public static string CertificateElementName + { + get + { + return ResourceManager.GetString("CertificateElementName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to certificate.pfx. + /// + public static string CertificateFileName + { + get + { + return ResourceManager.GetString("CertificateFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Certificate imported into CurrentUser\My\{0}. + /// + public static string CertificateImportedMessage + { + get + { + return ResourceManager.GetString("CertificateImportedMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No certificate was found in the certificate store with thumbprint {0}. + /// + public static string CertificateNotFoundInStore + { + get + { + return ResourceManager.GetString("CertificateNotFoundInStore", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Your account does not have access to the private key for certificate {0}. + /// + public static string CertificatePrivateKeyAccessError + { + get + { + return ResourceManager.GetString("CertificatePrivateKeyAccessError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} {1} deployment for {2} service. + /// + public static string ChangeDeploymentStateWaitMessage + { + get + { + return ResourceManager.GetString("ChangeDeploymentStateWaitMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cloud service {0} is in {1} state.. + /// + public static string ChangeDeploymentStatusCompleteMessage + { + get + { + return ResourceManager.GetString("ChangeDeploymentStatusCompleteMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Changing/Removing public environment '{0}' is not allowed.. + /// + public static string ChangePublicEnvironmentMessage + { + get + { + return ResourceManager.GetString("ChangePublicEnvironmentMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Service {0} is set to value {1}. + /// + public static string ChangeSettingsElementMessage + { + get + { + return ResourceManager.GetString("ChangeSettingsElementMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Changing public environment is not supported.. + /// + public static string ChangingDefaultEnvironmentNotSupported + { + get + { + return ResourceManager.GetString("ChangingDefaultEnvironmentNotSupported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Choose which publish settings file to use:. + /// + public static string ChoosePublishSettingsFile + { + get + { + return ResourceManager.GetString("ChoosePublishSettingsFile", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Microsoft.WindowsAzure.Plugins.Caching.ClientDiagnosticLevel. + /// + public static string ClientDiagnosticLevelName + { + get + { + return ResourceManager.GetString("ClientDiagnosticLevelName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 1. + /// + public static string ClientDiagnosticLevelValue + { + get + { + return ResourceManager.GetString("ClientDiagnosticLevelValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to cloud_package.cspkg. + /// + public static string CloudPackageFileName + { + get + { + return ResourceManager.GetString("CloudPackageFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ServiceConfiguration.Cloud.cscfg. + /// + public static string CloudServiceConfigurationFileName + { + get + { + return ResourceManager.GetString("CloudServiceConfigurationFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Add-ons for {0}. + /// + public static string CloudServiceDescription + { + get + { + return ResourceManager.GetString("CloudServiceDescription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Communication could not be established. This could be due to an invalid subscription ID. Note that subscription IDs are case sensitive.. + /// + public static string CommunicationCouldNotBeEstablished + { + get + { + return ResourceManager.GetString("CommunicationCouldNotBeEstablished", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Complete. + /// + public static string CompleteMessage + { + get + { + return ResourceManager.GetString("CompleteMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to OperationID : '{0}'. + /// + public static string ComputeCloudExceptionOperationIdMessage + { + get + { + return ResourceManager.GetString("ComputeCloudExceptionOperationIdMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to config.json. + /// + public static string ConfigurationFileName + { + get + { + return ResourceManager.GetString("ConfigurationFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to VirtualMachine creation failed.. + /// + public static string CreateFailedErrorMessage + { + get + { + return ResourceManager.GetString("CreateFailedErrorMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Creating the website failed. If this is the first website for this subscription, please create it using the management portal instead.. + /// + public static string CreateWebsiteFailed + { + get + { + return ResourceManager.GetString("CreateWebsiteFailed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Microsoft.ApplicationServer.Caching.DataCacheClientsSection, Microsoft.ApplicationServer.Caching.Core. + /// + public static string DataCacheClientsType + { + get + { + return ResourceManager.GetString("DataCacheClientsType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to //blobcontainer[@datacenter='{0}']. + /// + public static string DatacenterBlobQuery + { + get + { + return ResourceManager.GetString("DatacenterBlobQuery", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Microsoft Azure PowerShell Data Collection Confirmation. + /// + public static string DataCollectionActivity + { + get + { + return ResourceManager.GetString("DataCollectionActivity", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to You choose not to participate in Microsoft Azure PowerShell data collection.. + /// + public static string DataCollectionConfirmNo + { + get + { + return ResourceManager.GetString("DataCollectionConfirmNo", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to This confirmation message will be dismissed in '{0}' second(s).... + /// + public static string DataCollectionConfirmTime + { + get + { + return ResourceManager.GetString("DataCollectionConfirmTime", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to You choose to participate in Microsoft Azure PowerShell data collection.. + /// + public static string DataCollectionConfirmYes + { + get + { + return ResourceManager.GetString("DataCollectionConfirmYes", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The setting profile has been saved to the following path '{0}'.. + /// + public static string DataCollectionSaveFileInformation + { + get + { + return ResourceManager.GetString("DataCollectionSaveFileInformation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Setting: {0} as the default and current subscription. To view other subscriptions use Get-AzureSubscription. + /// + public static string DefaultAndCurrentSubscription + { + get + { + return ResourceManager.GetString("DefaultAndCurrentSubscription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to none. + /// + public static string DefaultFileVersion + { + get + { + return ResourceManager.GetString("DefaultFileVersion", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to There are no hostnames which could be used for validation.. + /// + public static string DefaultHostnamesValidation + { + get + { + return ResourceManager.GetString("DefaultHostnamesValidation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 8080. + /// + public static string DefaultPort + { + get + { + return ResourceManager.GetString("DefaultPort", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 1000. + /// + public static string DefaultRoleCachingInMB + { + get + { + return ResourceManager.GetString("DefaultRoleCachingInMB", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Auto. + /// + public static string DefaultUpgradeMode + { + get + { + return ResourceManager.GetString("DefaultUpgradeMode", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 80. + /// + public static string DefaultWebPort + { + get + { + return ResourceManager.GetString("DefaultWebPort", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Delete. + /// + public static string Delete + { + get + { + return ResourceManager.GetString("Delete", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The {0} slot for service {1} is already in {2} state. + /// + public static string DeploymentAlreadyInState + { + get + { + return ResourceManager.GetString("DeploymentAlreadyInState", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The deployment in {0} slot for service {1} is removed. + /// + public static string DeploymentRemovedMessage + { + get + { + return ResourceManager.GetString("DeploymentRemovedMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Microsoft.WindowsAzure.Plugins.Caching.DiagnosticLevel. + /// + public static string DiagnosticLevelName + { + get + { + return ResourceManager.GetString("DiagnosticLevelName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 1. + /// + public static string DiagnosticLevelValue + { + get + { + return ResourceManager.GetString("DiagnosticLevelValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The key to add already exists in the dictionary.. + /// + public static string DictionaryAddAlreadyContainsKey + { + get + { + return ResourceManager.GetString("DictionaryAddAlreadyContainsKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The array index cannot be less than zero.. + /// + public static string DictionaryCopyToArrayIndexLessThanZero + { + get + { + return ResourceManager.GetString("DictionaryCopyToArrayIndexLessThanZero", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The supplied array does not have enough room to contain the copied elements.. + /// + public static string DictionaryCopyToArrayTooShort + { + get + { + return ResourceManager.GetString("DictionaryCopyToArrayTooShort", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provided dns {0} doesn't exist. + /// + public static string DnsDoesNotExist + { + get + { + return ResourceManager.GetString("DnsDoesNotExist", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Microsoft Azure Certificate. + /// + public static string EnableRemoteDesktop_FriendlyCertificateName + { + get + { + return ResourceManager.GetString("EnableRemoteDesktop_FriendlyCertificateName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Endpoint can't be retrieved for storage account. + /// + public static string EndPointNotFoundForBlobStorage + { + get + { + return ResourceManager.GetString("EndPointNotFoundForBlobStorage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} end processing.. + /// + public static string EndProcessingLog + { + get + { + return ResourceManager.GetString("EndProcessingLog", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to To use Active Directory authentication, you must configure the ActiveDirectoryEndpoint, ActiveDirectoryTenantId, and ActiveDirectorServiceEndpointResourceId for environment of '{0}'. You can configure these properties for this environment using the Set-AzureEnvironment cmdlet.. + /// + public static string EnvironmentDoesNotSupportActiveDirectory + { + get + { + return ResourceManager.GetString("EnvironmentDoesNotSupportActiveDirectory", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The environment '{0}' already exists.. + /// + public static string EnvironmentExists + { + get + { + return ResourceManager.GetString("EnvironmentExists", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Environment name doesn't match one in subscription.. + /// + public static string EnvironmentNameDoesntMatchSubscription + { + get + { + return ResourceManager.GetString("EnvironmentNameDoesntMatchSubscription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Environment name needs to be specified.. + /// + public static string EnvironmentNameNeedsToBeSpecified + { + get + { + return ResourceManager.GetString("EnvironmentNameNeedsToBeSpecified", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Environment needs to be specified.. + /// + public static string EnvironmentNeedsToBeSpecified + { + get + { + return ResourceManager.GetString("EnvironmentNeedsToBeSpecified", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The environment name '{0}' is not found.. + /// + public static string EnvironmentNotFound + { + get + { + return ResourceManager.GetString("EnvironmentNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to environments.xml. + /// + public static string EnvironmentsFileName + { + get + { + return ResourceManager.GetString("EnvironmentsFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Error creating VirtualMachine. + /// + public static string ErrorCreatingVirtualMachine + { + get + { + return ResourceManager.GetString("ErrorCreatingVirtualMachine", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unable to download available runtimes for location '{0}'. + /// + public static string ErrorRetrievingRuntimesForLocation + { + get + { + return ResourceManager.GetString("ErrorRetrievingRuntimesForLocation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Error updating VirtualMachine. + /// + public static string ErrorUpdatingVirtualMachine + { + get + { + return ResourceManager.GetString("ErrorUpdatingVirtualMachine", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Job Id {0} failed. Error: {1}, ExceptionDetails: {2}. + /// + public static string FailedJobErrorMessage + { + get + { + return ResourceManager.GetString("FailedJobErrorMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to File path is not valid.. + /// + public static string FilePathIsNotValid + { + get + { + return ResourceManager.GetString("FilePathIsNotValid", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The HTTP request was forbidden with client authentication scheme 'Anonymous'.. + /// + public static string FirstPurchaseErrorMessage + { + get + { + return ResourceManager.GetString("FirstPurchaseErrorMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to This add-on requires you to purchase the first instance through the Microsoft Azure Portal. Subsequent purchases can be performed through PowerShell.. + /// + public static string FirstPurchaseMessage + { + get + { + return ResourceManager.GetString("FirstPurchaseMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Operation Status:. + /// + public static string GatewayOperationStatus + { + get + { + return ResourceManager.GetString("GatewayOperationStatus", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Resources\Scaffolding\General. + /// + public static string GeneralScaffolding + { + get + { + return ResourceManager.GetString("GeneralScaffolding", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Getting all available Microsoft Azure Add-Ons, this may take few minutes.... + /// + public static string GetAllAddOnsWaitMessage + { + get + { + return ResourceManager.GetString("GetAllAddOnsWaitMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Name{0}Primary Key{0}Seconday Key. + /// + public static string GetStorageKeysHeader + { + get + { + return ResourceManager.GetString("GetStorageKeysHeader", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Git not found. Please install git and place it in your command line path.. + /// + public static string GitNotFound + { + get + { + return ResourceManager.GetString("GitNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Could not find publish settings. Please run Import-AzurePublishSettingsFile.. + /// + public static string GlobalSettingsManager_Load_PublishSettingsNotFound + { + get + { + return ResourceManager.GetString("GlobalSettingsManager_Load_PublishSettingsNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot find the WadCfg end element in the config.. + /// + public static string IaasDiagnosticsBadConfigNoEndWadCfg + { + get + { + return ResourceManager.GetString("IaasDiagnosticsBadConfigNoEndWadCfg", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to WadCfg start element in the config is not matching the end element.. + /// + public static string IaasDiagnosticsBadConfigNoMatchingWadCfg + { + get + { + return ResourceManager.GetString("IaasDiagnosticsBadConfigNoMatchingWadCfg", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot find the WadCfg element in the config.. + /// + public static string IaasDiagnosticsBadConfigNoWadCfg + { + get + { + return ResourceManager.GetString("IaasDiagnosticsBadConfigNoWadCfg", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to iisnode.dll. + /// + public static string IISNodeDll + { + get + { + return ResourceManager.GetString("IISNodeDll", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to iisnode. + /// + public static string IISNodeEngineKey + { + get + { + return ResourceManager.GetString("IISNodeEngineKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to iisnode-dev\\release\\x64. + /// + public static string IISNodePath + { + get + { + return ResourceManager.GetString("IISNodePath", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to iisnode. + /// + public static string IISNodeRuntimeValue + { + get + { + return ResourceManager.GetString("IISNodeRuntimeValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Installing IISNode version {0} in Azure for WebRole '{1}' (the version locally installed is: {2}). + /// + public static string IISNodeVersionWarningText + { + get + { + return ResourceManager.GetString("IISNodeVersionWarningText", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Illegal characters in path.. + /// + public static string IllegalPath + { + get + { + return ResourceManager.GetString("IllegalPath", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Internal Server Error. + /// + public static string InternalServerErrorMessage + { + get + { + return ResourceManager.GetString("InternalServerErrorMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot enable memcach protocol on a cache worker role {0}.. + /// + public static string InvalidCacheRoleName + { + get + { + return ResourceManager.GetString("InvalidCacheRoleName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid certificate format. Publish settings may be corrupted. Use Get-AzurePublishSettingsFile to download updated settings. + /// + public static string InvalidCertificate + { + get + { + return ResourceManager.GetString("InvalidCertificate", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid certificate format.. + /// + public static string InvalidCertificateSingle + { + get + { + return ResourceManager.GetString("InvalidCertificateSingle", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provided configuration path is invalid or doesn't exist. + /// + public static string InvalidConfigPath + { + get + { + return ResourceManager.GetString("InvalidConfigPath", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The country name is invalid, please use a valid two character country code, as described in ISO 3166-1 alpha-2.. + /// + public static string InvalidCountryNameMessage + { + get + { + return ResourceManager.GetString("InvalidCountryNameMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No default subscription has been designated. Use Select-AzureSubscription -Default <subscriptionName> to set the default subscription.. + /// + public static string InvalidDefaultSubscription + { + get + { + return ResourceManager.GetString("InvalidDefaultSubscription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Deployment with {0} does not exist. + /// + public static string InvalidDeployment + { + get + { + return ResourceManager.GetString("InvalidDeployment", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The deployment slot name {0} is invalid. Slot name must be either "Staging" or "Production".. + /// + public static string InvalidDeploymentSlot + { + get + { + return ResourceManager.GetString("InvalidDeploymentSlot", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to "{0}" is an invalid DNS name for {1}. + /// + public static string InvalidDnsName + { + get + { + return ResourceManager.GetString("InvalidDnsName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid service endpoint.. + /// + public static string InvalidEndpoint + { + get + { + return ResourceManager.GetString("InvalidEndpoint", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provided file in {0} must be have {1} extension. + /// + public static string InvalidFileExtension + { + get + { + return ResourceManager.GetString("InvalidFileExtension", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to File {0} has invalid characters. + /// + public static string InvalidFileName + { + get + { + return ResourceManager.GetString("InvalidFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to You must create your git publishing credentials using the Microsoft Azure portal. + ///Please follow these steps in the portal: + ///1. On the left side open "Web Sites" + ///2. Click on any website + ///3. Choose "Setup Git Publishing" or "Reset deployment credentials" + ///4. Back in the PowerShell window, rerun this command by typing "New-AzureWebSite {site name} -Git -PublishingUsername {username}. + /// + public static string InvalidGitCredentials + { + get + { + return ResourceManager.GetString("InvalidGitCredentials", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The value {0} provided is not a valid GUID. Please provide a valid GUID.. + /// + public static string InvalidGuid + { + get + { + return ResourceManager.GetString("InvalidGuid", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The specified hostname does not exist. Please specify a valid hostname for the site.. + /// + public static string InvalidHostnameValidation + { + get + { + return ResourceManager.GetString("InvalidHostnameValidation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Role {0} instances must be greater than or equal 0 and less than or equal 20. + /// + public static string InvalidInstancesCount + { + get + { + return ResourceManager.GetString("InvalidInstancesCount", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to There was an error creating your webjob. Please make sure that the script is in the root folder of the zip file.. + /// + public static string InvalidJobFile + { + get + { + return ResourceManager.GetString("InvalidJobFile", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Could not download a valid runtime manifest, Please check your internet connection and try again.. + /// + public static string InvalidManifestError + { + get + { + return ResourceManager.GetString("InvalidManifestError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The account {0} was not found. Please specify a valid account name.. + /// + public static string InvalidMediaServicesAccount + { + get + { + return ResourceManager.GetString("InvalidMediaServicesAccount", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provided name "{0}" does not match the service bus namespace naming rules.. + /// + public static string InvalidNamespaceName + { + get + { + return ResourceManager.GetString("InvalidNamespaceName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Path must specify a valid path to an Azure profile.. + /// + public static string InvalidNewProfilePath + { + get + { + return ResourceManager.GetString("InvalidNewProfilePath", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Value cannot be null. Parameter name: '{0}'. + /// + public static string InvalidNullArgument + { + get + { + return ResourceManager.GetString("InvalidNullArgument", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} is invalid or empty. + /// + public static string InvalidOrEmptyArgumentMessage + { + get + { + return ResourceManager.GetString("InvalidOrEmptyArgumentMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provided package path is invalid or doesn't exist. + /// + public static string InvalidPackagePath + { + get + { + return ResourceManager.GetString("InvalidPackagePath", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to '{0}' is an invalid parameter set name.. + /// + public static string InvalidParameterSetName + { + get + { + return ResourceManager.GetString("InvalidParameterSetName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} doesn't exist in {1} or you've not passed valid value for it. + /// + public static string InvalidPath + { + get + { + return ResourceManager.GetString("InvalidPath", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Path {0} has invalid characters. + /// + public static string InvalidPathName + { + get + { + return ResourceManager.GetString("InvalidPathName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Property bag Hashtable must contain one of the following sets of properties: {SubscriptionId, Certificate}, {SubscriptionId, Username, Password}, {SubscriptionId, ServicePrincipal, Password, Tenant}, {SubscriptionId, AccountId, Token}. + /// + public static string InvalidProfileProperties + { + get + { + return ResourceManager.GetString("InvalidProfileProperties", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provided publish settings file {0} has invalid content. Please get valid by running cmdlet Get-AzurePublishSettingsFile. + /// + public static string InvalidPublishSettingsSchema + { + get + { + return ResourceManager.GetString("InvalidPublishSettingsSchema", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provided role name "{0}" has invalid characters. + /// + public static string InvalidRoleNameMessage + { + get + { + return ResourceManager.GetString("InvalidRoleNameMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A valid name for the service root folder is required. + /// + public static string InvalidRootNameMessage + { + get + { + return ResourceManager.GetString("InvalidRootNameMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} is not a recognized runtime type. + /// + public static string InvalidRuntimeError + { + get + { + return ResourceManager.GetString("InvalidRuntimeError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A valid language is required. + /// + public static string InvalidScaffoldingLanguageArg + { + get + { + return ResourceManager.GetString("InvalidScaffoldingLanguageArg", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No subscription is currently selected. Use Select-Subscription to activate a subscription.. + /// + public static string InvalidSelectedSubscription + { + get + { + return ResourceManager.GetString("InvalidSelectedSubscription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provided location "{0}" does not exist in the available locations use Get-AzureSBLocation for listing available locations.. + /// + public static string InvalidServiceBusLocation + { + get + { + return ResourceManager.GetString("InvalidServiceBusLocation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Please provide a service name or run this command from inside a service project directory.. + /// + public static string InvalidServiceName + { + get + { + return ResourceManager.GetString("InvalidServiceName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to You must provide valid value for {0}. + /// + public static string InvalidServiceSettingElement + { + get + { + return ResourceManager.GetString("InvalidServiceSettingElement", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to settings.json is invalid or doesn't exist. + /// + public static string InvalidServiceSettingMessage + { + get + { + return ResourceManager.GetString("InvalidServiceSettingMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The subscription named '{0}' cannot be found. Use Set-AzureSubscription to initialize the subscription data.. + /// + public static string InvalidSubscription + { + get + { + return ResourceManager.GetString("InvalidSubscription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provided subscription id {0} is not valid. + /// + public static string InvalidSubscriptionId + { + get + { + return ResourceManager.GetString("InvalidSubscriptionId", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Must specify a non-null subscription name.. + /// + public static string InvalidSubscriptionName + { + get + { + return ResourceManager.GetString("InvalidSubscriptionName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A valid subscription name is required. This can be provided using the -Subscription parameter or by setting the subscription via the Set-AzureSubscription cmdlet. + /// + public static string InvalidSubscriptionNameMessage + { + get + { + return ResourceManager.GetString("InvalidSubscriptionNameMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provided subscriptions file {0} has invalid content.. + /// + public static string InvalidSubscriptionsDataSchema + { + get + { + return ResourceManager.GetString("InvalidSubscriptionsDataSchema", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Role {0} VM size should be ExtraSmall, Small, Medium, Large or ExtraLarge.. + /// + public static string InvalidVMSize + { + get + { + return ResourceManager.GetString("InvalidVMSize", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The web job file must have *.zip extension. + /// + public static string InvalidWebJobFile + { + get + { + return ResourceManager.GetString("InvalidWebJobFile", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Singleton option works for continuous jobs only.. + /// + public static string InvalidWebJobSingleton + { + get + { + return ResourceManager.GetString("InvalidWebJobSingleton", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The website {0} was not found. Please specify a valid website name.. + /// + public static string InvalidWebsite + { + get + { + return ResourceManager.GetString("InvalidWebsite", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No job for id: {0} was found.. + /// + public static string JobNotFound + { + get + { + return ResourceManager.GetString("JobNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to engines. + /// + public static string JsonEnginesSectionName + { + get + { + return ResourceManager.GetString("JsonEnginesSectionName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Scaffolding for this language is not yet supported. + /// + public static string LanguageScaffoldingIsNotSupported + { + get + { + return ResourceManager.GetString("LanguageScaffoldingIsNotSupported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Link already established. + /// + public static string LinkAlreadyEstablished + { + get + { + return ResourceManager.GetString("LinkAlreadyEstablished", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to local_package.csx. + /// + public static string LocalPackageFileName + { + get + { + return ResourceManager.GetString("LocalPackageFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ServiceConfiguration.Local.cscfg. + /// + public static string LocalServiceConfigurationFileName + { + get + { + return ResourceManager.GetString("LocalServiceConfigurationFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Looking for {0} deployment for {1} cloud service.... + /// + public static string LookingForDeploymentMessage + { + get + { + return ResourceManager.GetString("LookingForDeploymentMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Looking for cloud service {0}.... + /// + public static string LookingForServiceMessage + { + get + { + return ResourceManager.GetString("LookingForServiceMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Azure Long-Running Job. + /// + public static string LROJobName + { + get + { + return ResourceManager.GetString("LROJobName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The cmdlet failed in background execution. The returned error was '{0}'. Please execute the cmdlet again. You may need to execute this cmdlet synchronously, by omitting the '-AsJob' parameter.. + /// + public static string LROTaskExceptionMessage + { + get + { + return ResourceManager.GetString("LROTaskExceptionMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to managementCertificate.pem. + /// + public static string ManagementCertificateFileName + { + get + { + return ResourceManager.GetString("ManagementCertificateFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ?whr={0}. + /// + public static string ManagementPortalRealmFormat + { + get + { + return ResourceManager.GetString("ManagementPortalRealmFormat", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to //baseuri. + /// + public static string ManifestBaseUriQuery + { + get + { + return ResourceManager.GetString("ManifestBaseUriQuery", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to uri. + /// + public static string ManifestBlobUriKey + { + get + { + return ResourceManager.GetString("ManifestBlobUriKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to http://az413943.vo.msecnd.net/node/runtimemanifest_0.7.5.2.xml. + /// + public static string ManifestUri + { + get + { + return ResourceManager.GetString("ManifestUri", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Property bag Hashtable must contain a 'Certificate' of type 'X509Certificate2'.. + /// + public static string MissingCertificateInProfileProperties + { + get + { + return ResourceManager.GetString("MissingCertificateInProfileProperties", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Property bag Hashtable must contain a 'Password' with an associated 'Username' or 'ServicePrincipal'.. + /// + public static string MissingPasswordInProfileProperties + { + get + { + return ResourceManager.GetString("MissingPasswordInProfileProperties", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Property bag Hashtable must contain a 'SubscriptionId'.. + /// + public static string MissingSubscriptionInProfileProperties + { + get + { + return ResourceManager.GetString("MissingSubscriptionInProfileProperties", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Multiple Add-Ons found holding name {0}. + /// + public static string MultipleAddOnsFoundMessage + { + get + { + return ResourceManager.GetString("MultipleAddOnsFoundMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Multiple possible publishing users. Please go to the Portal and use the listed deployment user, or click 'set/reset deployment credentials' to set up a new user account, then reurn this cmdlet and specify PublishingUsername.. + /// + public static string MultiplePublishingUsernames + { + get + { + return ResourceManager.GetString("MultiplePublishingUsernames", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The first publish settings file "{0}" is used. If you want to use another file specify the file name.. + /// + public static string MultiplePublishSettingsFilesFoundMessage + { + get + { + return ResourceManager.GetString("MultiplePublishSettingsFilesFoundMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Microsoft.WindowsAzure.Plugins.Caching.NamedCaches. + /// + public static string NamedCacheSettingName + { + get + { + return ResourceManager.GetString("NamedCacheSettingName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {"caches":[{"name":"default","policy":{"eviction":{"type":0},"expiration":{"defaultTTL":10,"isExpirable":true,"type":1},"serverNotification":{"isEnabled":false}},"secondaries":0}]}. + /// + public static string NamedCacheSettingValue + { + get + { + return ResourceManager.GetString("NamedCacheSettingValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A publishing username is required. Please specify one using the argument PublishingUsername.. + /// + public static string NeedPublishingUsernames + { + get + { + return ResourceManager.GetString("NeedPublishingUsernames", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to New Add-On Confirmation. + /// + public static string NewAddOnConformation + { + get + { + return ResourceManager.GetString("NewAddOnConformation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to By typing "Yes", I (a) authorize Microsoft to charge my current payment method on a monthly basis + ///for the amount indicated at {0} for {1} until my service is cancelled or terminated, and (b) + ///agree to the {2}'s terms of user and privacy statement at {0} and (c) agree to sharing my + ///contact information with {2}.. + /// + public static string NewMicrosoftAddOnMessage + { + get + { + return ResourceManager.GetString("NewMicrosoftAddOnMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Internal Server Error. This could happen because the namespace name is already used or due to an incorrect location name. Use Get-AzureSBLocation cmdlet to list valid names.. + /// + public static string NewNamespaceErrorMessage + { + get + { + return ResourceManager.GetString("NewNamespaceErrorMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to By typing "Yes", I (a) authorize Microsoft to charge my current payment method on a monthly basis + ///for the amount indicated at {0} for {1} until my service is cancelled or terminated, and (b) + ///acknowledge the offering is provided by {2}, not Microsoft, and agree to {2}'s terms of + ///use and privacy statement at {0} and (c) agree to sharing my contact information with {2}.. + /// + public static string NewNonMicrosoftAddOnMessage + { + get + { + return ResourceManager.GetString("NewNonMicrosoftAddOnMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Service has been created at {0}. + /// + public static string NewServiceCreatedMessage + { + get + { + return ResourceManager.GetString("NewServiceCreatedMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No. + /// + public static string No + { + get + { + return ResourceManager.GetString("No", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to There is no access token cached for subscription {0}, user id {1}. Use the Add-AzureAccount cmdlet to log in again and get a token for this subscription.. + /// + public static string NoCachedToken + { + get + { + return ResourceManager.GetString("NoCachedToken", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The service does not have any cache worker roles, add one first by running cmdlet Add-AzureCacheWorkerRole.. + /// + public static string NoCacheWorkerRoles + { + get + { + return ResourceManager.GetString("NoCacheWorkerRoles", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No clouds available. + /// + public static string NoCloudsAvailable + { + get + { + return ResourceManager.GetString("NoCloudsAvailable", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to "There is no current context, please log in using Connect-AzAccount.". + /// + public static string NoCurrentContextForDataCmdlet + { + get + { + return ResourceManager.GetString("NoCurrentContextForDataCmdlet", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to nodejs. + /// + public static string NodeDirectory + { + get + { + return ResourceManager.GetString("NodeDirectory", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to node. + /// + public static string NodeEngineKey + { + get + { + return ResourceManager.GetString("NodeEngineKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to node.exe. + /// + public static string NodeExe + { + get + { + return ResourceManager.GetString("NodeExe", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to There is no default subscription set, please set a default subscription by running Set-AzureSubscription -Default <subscription name>. + /// + public static string NoDefaultSubscriptionMessage + { + get + { + return ResourceManager.GetString("NoDefaultSubscriptionMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Microsoft SDKs\Azure\Nodejs\Nov2011. + /// + public static string NodeModulesPath + { + get + { + return ResourceManager.GetString("NodeModulesPath", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to nodejs. + /// + public static string NodeProgramFilesFolderName + { + get + { + return ResourceManager.GetString("NodeProgramFilesFolderName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to node. + /// + public static string NodeRuntimeValue + { + get + { + return ResourceManager.GetString("NodeRuntimeValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Resources\Scaffolding\Node. + /// + public static string NodeScaffolding + { + get + { + return ResourceManager.GetString("NodeScaffolding", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Microsoft.WindowsAzure.Commands.CloudService.ScaffoldingResources.Node. + /// + public static string NodeScaffoldingResources + { + get + { + return ResourceManager.GetString("NodeScaffoldingResources", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Installing Node version {0} in Azure for Role '{1}' (the Node version locally installed is: {2}). + /// + public static string NodeVersionWarningText + { + get + { + return ResourceManager.GetString("NodeVersionWarningText", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No, I do not agree. + /// + public static string NoHint + { + get + { + return ResourceManager.GetString("NoHint", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Please connect to internet before executing this cmdlet. + /// + public static string NoInternetConnection + { + get + { + return ResourceManager.GetString("NoInternetConnection", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to <NONE>. + /// + public static string None + { + get + { + return ResourceManager.GetString("None", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No publish settings files with extension *.publishsettings are found in the directory "{0}".. + /// + public static string NoPublishSettingsFilesFoundMessage + { + get + { + return ResourceManager.GetString("NoPublishSettingsFilesFoundMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to There is no subscription associated with account {0}.. + /// + public static string NoSubscriptionAddedMessage + { + get + { + return ResourceManager.GetString("NoSubscriptionAddedMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No subscriptions are associated with the logged in account in Azure Service Management (RDFE). This means that the logged in user is not an administrator or co-administrator for any account.\r\nDid you mean to execute Connect-AzAccount?. + /// + public static string NoSubscriptionFoundForTenant + { + get + { + return ResourceManager.GetString("NoSubscriptionFoundForTenant", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to '{0}' must be a cache worker role. Verify that it has proper cache worker role configuration.. + /// + public static string NotCacheWorkerRole + { + get + { + return ResourceManager.GetString("NotCacheWorkerRole", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Certificate can't be null.. + /// + public static string NullCertificateMessage + { + get + { + return ResourceManager.GetString("NullCertificateMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} could not be null or empty. + /// + public static string NullObjectMessage + { + get + { + return ResourceManager.GetString("NullObjectMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unable to add a null RoleSettings to {0}. + /// + public static string NullRoleSettingsMessage + { + get + { + return ResourceManager.GetString("NullRoleSettingsMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unable to add new role to null service definition. + /// + public static string NullServiceDefinitionMessage + { + get + { + return ResourceManager.GetString("NullServiceDefinitionMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The request offer '{0}' is not found.. + /// + public static string OfferNotFoundMessage + { + get + { + return ResourceManager.GetString("OfferNotFoundMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Operation "{0}" failed on VM with ID: {1}. + /// + public static string OperationFailedErrorMessage + { + get + { + return ResourceManager.GetString("OperationFailedErrorMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The REST operation failed with message '{0}' and error code '{1}'. + /// + public static string OperationFailedMessage + { + get + { + return ResourceManager.GetString("OperationFailedMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Job Id {0} did not complete within expected time or it is in Failed/Canceled/Invalid state.. + /// + public static string OperationTimedOutOrError + { + get + { + return ResourceManager.GetString("OperationTimedOutOrError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to package. + /// + public static string Package + { + get + { + return ResourceManager.GetString("Package", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Package is created at service root path {0}.. + /// + public static string PackageCreated + { + get + { + return ResourceManager.GetString("PackageCreated", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {{ + /// "author": "", + /// + /// "name": "{0}", + /// "version": "0.0.0", + /// "dependencies":{{}}, + /// "devDependencies":{{}}, + /// "optionalDependencies": {{}}, + /// "engines": {{ + /// "node": "*", + /// "iisnode": "*" + /// }} + /// + ///}} + ///. + /// + public static string PackageJsonDefaultFile + { + get + { + return ResourceManager.GetString("PackageJsonDefaultFile", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to package.json. + /// + public static string PackageJsonFileName + { + get + { + return ResourceManager.GetString("PackageJsonFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Path {0} doesn't exist.. + /// + public static string PathDoesNotExist + { + get + { + return ResourceManager.GetString("PathDoesNotExist", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Path for {0} doesn't exist in {1}.. + /// + public static string PathDoesNotExistForElement + { + get + { + return ResourceManager.GetString("PathDoesNotExistForElement", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A value for the Peer Asn has to be provided.. + /// + public static string PeerAsnRequired + { + get + { + return ResourceManager.GetString("PeerAsnRequired", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 5.4.0. + /// + public static string PHPDefaultRuntimeVersion + { + get + { + return ResourceManager.GetString("PHPDefaultRuntimeVersion", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to php. + /// + public static string PhpRuntimeValue + { + get + { + return ResourceManager.GetString("PhpRuntimeValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Resources\Scaffolding\PHP. + /// + public static string PHPScaffolding + { + get + { + return ResourceManager.GetString("PHPScaffolding", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Microsoft.WindowsAzure.Commands.CloudService.ScaffoldingResources.PHP. + /// + public static string PHPScaffoldingResources + { + get + { + return ResourceManager.GetString("PHPScaffoldingResources", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Installing PHP version {0} for Role '{1}' (the PHP version locally installed is: {2}). + /// + public static string PHPVersionWarningText + { + get + { + return ResourceManager.GetString("PHPVersionWarningText", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to You must create your first web site using the Microsoft Azure portal. + ///Please follow these steps in the portal: + ///1. At the bottom of the page, click on New > Web Site > Quick Create + ///2. Type {0} in the URL field + ///3. Click on "Create Web Site" + ///4. Once the site has been created, click on the site name + ///5. Click on "Set up Git publishing" or "Reset deployment credentials" and setup a publishing username and password. Use those credentials for all new websites you create.. + /// + public static string PortalInstructions + { + get + { + return ResourceManager.GetString("PortalInstructions", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 6. Back in the console window, rerun this command by typing "New-AzureWebsite <site name> -Git". + /// + public static string PortalInstructionsGit + { + get + { + return ResourceManager.GetString("PortalInstructionsGit", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to This cmdlet is in preview. The functionality may not be available in the selected subscription. + /// + public static string PreviewCmdletMessage + { + get + { + return ResourceManager.GetString("PreviewCmdletMessage", resourceCulture); + } + } + + + /// + /// Looks up a localized string similar to A value for the Primary Peer Subnet has to be provided.. + /// + public static string PrimaryPeerSubnetRequired + { + get + { + return ResourceManager.GetString("PrimaryPeerSubnetRequired", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Promotion code can be used only when updating to a new plan.. + /// + public static string PromotionCodeWithCurrentPlanMessage + { + get + { + return ResourceManager.GetString("PromotionCodeWithCurrentPlanMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Service not published at user request.. + /// + public static string PublishAbortedAtUserRequest + { + get + { + return ResourceManager.GetString("PublishAbortedAtUserRequest", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Complete.. + /// + public static string PublishCompleteMessage + { + get + { + return ResourceManager.GetString("PublishCompleteMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Connecting.... + /// + public static string PublishConnectingMessage + { + get + { + return ResourceManager.GetString("PublishConnectingMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Created Deployment ID: {0}.. + /// + public static string PublishCreatedDeploymentMessage + { + get + { + return ResourceManager.GetString("PublishCreatedDeploymentMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Created hosted service '{0}'.. + /// + public static string PublishCreatedServiceMessage + { + get + { + return ResourceManager.GetString("PublishCreatedServiceMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Created Website URL: {0}.. + /// + public static string PublishCreatedWebsiteMessage + { + get + { + return ResourceManager.GetString("PublishCreatedWebsiteMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Creating.... + /// + public static string PublishCreatingServiceMessage + { + get + { + return ResourceManager.GetString("PublishCreatingServiceMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Initializing.... + /// + public static string PublishInitializingMessage + { + get + { + return ResourceManager.GetString("PublishInitializingMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to busy. + /// + public static string PublishInstanceStatusBusy + { + get + { + return ResourceManager.GetString("PublishInstanceStatusBusy", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to creating the virtual machine. + /// + public static string PublishInstanceStatusCreating + { + get + { + return ResourceManager.GetString("PublishInstanceStatusCreating", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Instance {0} of role {1} is {2}.. + /// + public static string PublishInstanceStatusMessage + { + get + { + return ResourceManager.GetString("PublishInstanceStatusMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ready. + /// + public static string PublishInstanceStatusReady + { + get + { + return ResourceManager.GetString("PublishInstanceStatusReady", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Preparing deployment for {0} with Subscription ID: {1}.... + /// + public static string PublishPreparingDeploymentMessage + { + get + { + return ResourceManager.GetString("PublishPreparingDeploymentMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Publishing {0} to Microsoft Azure. This may take several minutes.... + /// + public static string PublishServiceStartMessage + { + get + { + return ResourceManager.GetString("PublishServiceStartMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to publish settings. + /// + public static string PublishSettings + { + get + { + return ResourceManager.GetString("PublishSettings", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Azure. + /// + public static string PublishSettingsElementName + { + get + { + return ResourceManager.GetString("PublishSettingsElementName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to .PublishSettings. + /// + public static string PublishSettingsFileExtention + { + get + { + return ResourceManager.GetString("PublishSettingsFileExtention", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to publishSettings.xml. + /// + public static string PublishSettingsFileName + { + get + { + return ResourceManager.GetString("PublishSettingsFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to &whr={0}. + /// + public static string PublishSettingsFileRealmFormat + { + get + { + return ResourceManager.GetString("PublishSettingsFileRealmFormat", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Publish settings imported. + /// + public static string PublishSettingsSetSuccessfully + { + get + { + return ResourceManager.GetString("PublishSettingsSetSuccessfully", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to AZURE_PUBLISHINGPROFILE_URL. + /// + public static string PublishSettingsUrlEnv + { + get + { + return ResourceManager.GetString("PublishSettingsUrlEnv", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Starting.... + /// + public static string PublishStartingMessage + { + get + { + return ResourceManager.GetString("PublishStartingMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Upgrading.... + /// + public static string PublishUpgradingMessage + { + get + { + return ResourceManager.GetString("PublishUpgradingMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Uploading Package to storage service {0}.... + /// + public static string PublishUploadingPackageMessage + { + get + { + return ResourceManager.GetString("PublishUploadingPackageMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Verifying storage account '{0}'.... + /// + public static string PublishVerifyingStorageMessage + { + get + { + return ResourceManager.GetString("PublishVerifyingStorageMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Path '{0}' not found.. + /// + public static string PublishVMDscExtensionAdditionalContentPathNotExist + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionAdditionalContentPathNotExist", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Configuration published to {0}. + /// + public static string PublishVMDscExtensionArchiveUploadedMessage + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionArchiveUploadedMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Copy '{0}' to '{1}'.. + /// + public static string PublishVMDscExtensionCopyFileVerbose + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionCopyFileVerbose", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Copy the module '{0}' to '{1}'.. + /// + public static string PublishVMDscExtensionCopyModuleVerbose + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionCopyModuleVerbose", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid configuration file: {0}. + ///The file needs to be a PowerShell script (.ps1 or .psm1).. + /// + public static string PublishVMDscExtensionCreateArchiveConfigFileInvalidExtension + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionCreateArchiveConfigFileInvalidExtension", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Deleted '{0}'. + /// + public static string PublishVMDscExtensionDeletedFileMessage + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionDeletedFileMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot delete '{0}': {1}. + /// + public static string PublishVMDscExtensionDeleteErrorMessage + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionDeleteErrorMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Path '{0}' not found.. + /// + public static string PublishVMDscExtensionDirectoryNotExist + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionDirectoryNotExist", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot get module for DscResource '{0}'. Possible solutions: + ///1) Specify -ModuleName for Import-DscResource in your configuration. + ///2) Unblock module that contains resource. + ///3) Move Import-DscResource inside Node block. + ///. + /// + public static string PublishVMDscExtensionGetDscResourceFailed + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionGetDscResourceFailed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to List of required modules: [{0}].. + /// + public static string PublishVMDscExtensionRequiredModulesVerbose + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionRequiredModulesVerbose", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Your current PowerShell version {1} is less then required by this cmdlet {0}. Consider download and install latest PowerShell version.. + /// + public static string PublishVMDscExtensionRequiredPsVersion + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionRequiredPsVersion", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Configuration script '{0}' contained parse errors: + ///{1}. + /// + public static string PublishVMDscExtensionStorageParserErrors + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionStorageParserErrors", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Temp folder '{0}' created.. + /// + public static string PublishVMDscExtensionTempFolderVerbose + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionTempFolderVerbose", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid configuration file: {0}. + ///The file needs to be a PowerShell script (.ps1 or .psm1) or a ZIP archive (.zip).. + /// + public static string PublishVMDscExtensionUploadArchiveConfigFileInvalidExtension + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionUploadArchiveConfigFileInvalidExtension", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Configuration file '{0}' not found.. + /// + public static string PublishVMDscExtensionUploadArchiveConfigFileNotExist + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionUploadArchiveConfigFileNotExist", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Azure PowerShell collects usage data in order to improve your experience. + ///The data is anonymous and does not include commandline argument values. + ///The data is collected by Microsoft. + /// + ///Use the Disable-AzureDataCollection cmdlet to turn the feature Off. The cmdlet can be found in the Azure module. To disable data collection: PS > Disable-AzureDataCollection. + ///Use the Enable-AzureDataCollection cmdlet to turn the feature On. The cmdlet can be found in the Azure module. To enable data collection: PS > Enab [rest of string was truncated]";. + /// + public static string RDFEDataCollectionMessage + { + get + { + return ResourceManager.GetString("RDFEDataCollectionMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Replace current deployment with '{0}' Id ?. + /// + public static string RedeployCommit + { + get + { + return ResourceManager.GetString("RedeployCommit", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to regenerate key?. + /// + public static string RegenerateKeyWarning + { + get + { + return ResourceManager.GetString("RegenerateKeyWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Generate new key.. + /// + public static string RegenerateKeyWhatIfMessage + { + get + { + return ResourceManager.GetString("RegenerateKeyWhatIfMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove account '{0}'?. + /// + public static string RemoveAccountConfirmation + { + get + { + return ResourceManager.GetString("RemoveAccountConfirmation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing account. + /// + public static string RemoveAccountMessage + { + get + { + return ResourceManager.GetString("RemoveAccountMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Remove Add-On Confirmation. + /// + public static string RemoveAddOnConformation + { + get + { + return ResourceManager.GetString("RemoveAddOnConformation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to If you delete this add-on, your data may be deleted and the operation may not be undone. You may have to purchase it again from the Microsoft Azure Store to use it. The price of the add-on may not be refunded. Are you sure you want to delete this add-on? Enter “Yes” to confirm.. + /// + public static string RemoveAddOnMessage + { + get + { + return ResourceManager.GetString("RemoveAddOnMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Remove-AzureBGPPeering Operation failed.. + /// + public static string RemoveAzureBGPPeeringFailed + { + get + { + return ResourceManager.GetString("RemoveAzureBGPPeeringFailed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing Bgp Peering. + /// + public static string RemoveAzureBGPPeeringMessage + { + get + { + return ResourceManager.GetString("RemoveAzureBGPPeeringMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Successfully removed Azure Bgp Peering with Service Key {0}.. + /// + public static string RemoveAzureBGPPeeringSucceeded + { + get + { + return ResourceManager.GetString("RemoveAzureBGPPeeringSucceeded", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove the Bgp Peering with service key '{0}'?. + /// + public static string RemoveAzureBGPPeeringWarning + { + get + { + return ResourceManager.GetString("RemoveAzureBGPPeeringWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove the Dedicated Circuit with service key '{0}'?. + /// + public static string RemoveAzureDedicatdCircuitWarning + { + get + { + return ResourceManager.GetString("RemoveAzureDedicatdCircuitWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Remove-AzureDedicatedCircuit Operation failed.. + /// + public static string RemoveAzureDedicatedCircuitFailed + { + get + { + return ResourceManager.GetString("RemoveAzureDedicatedCircuitFailed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Remove-AzureDedicatedCircuitLink Operation failed.. + /// + public static string RemoveAzureDedicatedCircuitLinkFailed + { + get + { + return ResourceManager.GetString("RemoveAzureDedicatedCircuitLinkFailed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing Dedicated Circui Link. + /// + public static string RemoveAzureDedicatedCircuitLinkMessage + { + get + { + return ResourceManager.GetString("RemoveAzureDedicatedCircuitLinkMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Successfully removed Azure Dedicated Circuit Link with Service Key {0} and Vnet Name {1}. + /// + public static string RemoveAzureDedicatedCircuitLinkSucceeded + { + get + { + return ResourceManager.GetString("RemoveAzureDedicatedCircuitLinkSucceeded", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove the Dedicated Circuit Link with service key '{0}' and virtual network name '{1}'?. + /// + public static string RemoveAzureDedicatedCircuitLinkWarning + { + get + { + return ResourceManager.GetString("RemoveAzureDedicatedCircuitLinkWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing Dedicated Circuit. + /// + public static string RemoveAzureDedicatedCircuitMessage + { + get + { + return ResourceManager.GetString("RemoveAzureDedicatedCircuitMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Successfully removed Azure Dedicated Circuit with Service Key {0}.. + /// + public static string RemoveAzureDedicatedCircuitSucceeded + { + get + { + return ResourceManager.GetString("RemoveAzureDedicatedCircuitSucceeded", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing cloud service {0}.... + /// + public static string RemoveAzureServiceWaitMessage + { + get + { + return ResourceManager.GetString("RemoveAzureServiceWaitMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The default subscription is being removed. Use Select-AzureSubscription -Default <subscriptionName> to select a new default subscription.. + /// + public static string RemoveDefaultSubscription + { + get + { + return ResourceManager.GetString("RemoveDefaultSubscription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing {0} deployment for {1} service. + /// + public static string RemoveDeploymentWaitMessage + { + get + { + return ResourceManager.GetString("RemoveDeploymentWaitMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing an environment will remove all associated subscriptions and accounts. Are you sure you want to remove an environment '{0}'?. + /// + public static string RemoveEnvironmentConfirmation + { + get + { + return ResourceManager.GetString("RemoveEnvironmentConfirmation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing environment. + /// + public static string RemoveEnvironmentMessage + { + get + { + return ResourceManager.GetString("RemoveEnvironmentMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing job collection. + /// + public static string RemoveJobCollectionMessage + { + get + { + return ResourceManager.GetString("RemoveJobCollectionMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove the job collection "{0}". + /// + public static string RemoveJobCollectionWarning + { + get + { + return ResourceManager.GetString("RemoveJobCollectionWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing job. + /// + public static string RemoveJobMessage + { + get + { + return ResourceManager.GetString("RemoveJobMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove the job "{0}". + /// + public static string RemoveJobWarning + { + get + { + return ResourceManager.GetString("RemoveJobWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove the account?. + /// + public static string RemoveMediaAccountWarning + { + get + { + return ResourceManager.GetString("RemoveMediaAccountWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Account removed.. + /// + public static string RemoveMediaAccountWhatIfMessage + { + get + { + return ResourceManager.GetString("RemoveMediaAccountWhatIfMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Internal Server Error. This could happen because the namespace does not exist or it does not exist under your subscription.. + /// + public static string RemoveNamespaceErrorMessage + { + get + { + return ResourceManager.GetString("RemoveNamespaceErrorMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing old package {0}.... + /// + public static string RemovePackage + { + get + { + return ResourceManager.GetString("RemovePackage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing the Azure profile will remove all associated environments, subscriptions, and accounts. Are you sure you want to remove the Azure profile?. + /// + public static string RemoveProfileConfirmation + { + get + { + return ResourceManager.GetString("RemoveProfileConfirmation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing the Azure profile. + /// + public static string RemoveProfileMessage + { + get + { + return ResourceManager.GetString("RemoveProfileMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to delete the namespace '{0}'?. + /// + public static string RemoveServiceBusNamespaceConfirmation + { + get + { + return ResourceManager.GetString("RemoveServiceBusNamespaceConfirmation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove cloud service?. + /// + public static string RemoveServiceWarning + { + get + { + return ResourceManager.GetString("RemoveServiceWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Remove cloud service and all it's deployments. + /// + public static string RemoveServiceWhatIfMessage + { + get + { + return ResourceManager.GetString("RemoveServiceWhatIfMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove subscription '{0}'?. + /// + public static string RemoveSubscriptionConfirmation + { + get + { + return ResourceManager.GetString("RemoveSubscriptionConfirmation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing subscription. + /// + public static string RemoveSubscriptionMessage + { + get + { + return ResourceManager.GetString("RemoveSubscriptionMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The endpoint {0} cannot be removed from profile {1} because it's not in the profile.. + /// + public static string RemoveTrafficManagerEndpointMissing + { + get + { + return ResourceManager.GetString("RemoveTrafficManagerEndpointMissing", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Remove-AzureTrafficManagerProfile Operation failed.. + /// + public static string RemoveTrafficManagerProfileFailed + { + get + { + return ResourceManager.GetString("RemoveTrafficManagerProfileFailed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Successfully removed Traffic Manager profile with name {0}.. + /// + public static string RemoveTrafficManagerProfileSucceeded + { + get + { + return ResourceManager.GetString("RemoveTrafficManagerProfileSucceeded", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove the Traffic Manager profile "{0}"?. + /// + public static string RemoveTrafficManagerProfileWarning + { + get + { + return ResourceManager.GetString("RemoveTrafficManagerProfileWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to delete the VM '{0}'?. + /// + public static string RemoveVMConfirmationMessage + { + get + { + return ResourceManager.GetString("RemoveVMConfirmationMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Deleting VM.. + /// + public static string RemoveVMMessage + { + get + { + return ResourceManager.GetString("RemoveVMMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing WebJob.... + /// + public static string RemoveWebJobMessage + { + get + { + return ResourceManager.GetString("RemoveWebJobMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove job '{0}'?. + /// + public static string RemoveWebJobWarning + { + get + { + return ResourceManager.GetString("RemoveWebJobWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing website. + /// + public static string RemoveWebsiteMessage + { + get + { + return ResourceManager.GetString("RemoveWebsiteMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove the website "{0}". + /// + public static string RemoveWebsiteWarning + { + get + { + return ResourceManager.GetString("RemoveWebsiteWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing public environment is not supported.. + /// + public static string RemovingDefaultEnvironmentsNotSupported + { + get + { + return ResourceManager.GetString("RemovingDefaultEnvironmentsNotSupported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Deleting namespace. + /// + public static string RemovingNamespaceMessage + { + get + { + return ResourceManager.GetString("RemovingNamespaceMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Repository is not setup. You need to pass a valid site name.. + /// + public static string RepositoryNotSetup + { + get + { + return ResourceManager.GetString("RepositoryNotSetup", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Reserved IP with the Name:'{0}' will no longer be in use after the deployment is deleted, and it is still reserved for later use.. + /// + public static string ReservedIPNameNoLongerInUseButStillBeingReserved + { + get + { + return ResourceManager.GetString("ReservedIPNameNoLongerInUseButStillBeingReserved", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Resource with ID : {0} does not exist.. + /// + public static string ResourceNotFound + { + get + { + return ResourceManager.GetString("ResourceNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Restart. + /// + public static string Restart + { + get + { + return ResourceManager.GetString("Restart", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Resume. + /// + public static string Resume + { + get + { + return ResourceManager.GetString("Resume", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to /role:{0};"{1}/{0}" . + /// + public static string RoleArgTemplate + { + get + { + return ResourceManager.GetString("RoleArgTemplate", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to bin. + /// + public static string RoleBinFolderName + { + get + { + return ResourceManager.GetString("RoleBinFolderName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Role {0} is {1}. + /// + public static string RoleInstanceWaitMsg + { + get + { + return ResourceManager.GetString("RoleInstanceWaitMsg", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 20. + /// + public static string RoleMaxInstances + { + get + { + return ResourceManager.GetString("RoleMaxInstances", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to role name. + /// + public static string RoleName + { + get + { + return ResourceManager.GetString("RoleName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provided role name {0} doesn't exist. + /// + public static string RoleNotFoundMessage + { + get + { + return ResourceManager.GetString("RoleNotFoundMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to RoleSettings.xml. + /// + public static string RoleSettingsTemplateFileName + { + get + { + return ResourceManager.GetString("RoleSettingsTemplateFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Role type {0} doesn't exist. + /// + public static string RoleTypeDoesNotExist + { + get + { + return ResourceManager.GetString("RoleTypeDoesNotExist", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to public static Dictionary<string, Location> ReverseLocations { get; private set; }. + /// + public static string RuntimeDeploymentLocationError + { + get + { + return ResourceManager.GetString("RuntimeDeploymentLocationError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Preparing runtime deployment for service '{0}'. + /// + public static string RuntimeDeploymentStart + { + get + { + return ResourceManager.GetString("RuntimeDeploymentStart", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to WARNING Runtime Mismatch: Are you sure that you want to publish service '{0}' using an Azure runtime version that does not match your local runtime version?. + /// + public static string RuntimeMismatchWarning + { + get + { + return ResourceManager.GetString("RuntimeMismatchWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to RUNTIMEOVERRIDEURL. + /// + public static string RuntimeOverrideKey + { + get + { + return ResourceManager.GetString("RuntimeOverrideKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to /runtimemanifest/runtimes/runtime. + /// + public static string RuntimeQuery + { + get + { + return ResourceManager.GetString("RuntimeQuery", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to RUNTIMEID. + /// + public static string RuntimeTypeKey + { + get + { + return ResourceManager.GetString("RuntimeTypeKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to RUNTIMEURL. + /// + public static string RuntimeUrlKey + { + get + { + return ResourceManager.GetString("RuntimeUrlKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to RUNTIMEVERSIONPRIMARYKEY. + /// + public static string RuntimeVersionPrimaryKey + { + get + { + return ResourceManager.GetString("RuntimeVersionPrimaryKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to scaffold.xml. + /// + public static string ScaffoldXml + { + get + { + return ResourceManager.GetString("ScaffoldXml", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid location entered. Pick one of the locations from Get-AzureSchedulerLocation. + /// + public static string SchedulerInvalidLocation + { + get + { + return ResourceManager.GetString("SchedulerInvalidLocation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A value for the Secondary Peer Subnet has to be provided.. + /// + public static string SecondaryPeerSubnetRequired + { + get + { + return ResourceManager.GetString("SecondaryPeerSubnetRequired", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Service {0} already exists on disk in location {1}. + /// + public static string ServiceAlreadyExistsOnDisk + { + get + { + return ResourceManager.GetString("ServiceAlreadyExistsOnDisk", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No ServiceBus authorization rule with the given characteristics was found. + /// + public static string ServiceBusAuthorizationRuleNotFound + { + get + { + return ResourceManager.GetString("ServiceBusAuthorizationRuleNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The service bus entity '{0}' is not found.. + /// + public static string ServiceBusEntityTypeNotFound + { + get + { + return ResourceManager.GetString("ServiceBusEntityTypeNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Internal Server Error. This could happen due to an incorrect/missing namespace. + /// + public static string ServiceBusNamespaceMissingMessage + { + get + { + return ResourceManager.GetString("ServiceBusNamespaceMissingMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to service configuration. + /// + public static string ServiceConfiguration + { + get + { + return ResourceManager.GetString("ServiceConfiguration", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to service definition. + /// + public static string ServiceDefinition + { + get + { + return ResourceManager.GetString("ServiceDefinition", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ServiceDefinition.csdef. + /// + public static string ServiceDefinitionFileName + { + get + { + return ResourceManager.GetString("ServiceDefinitionFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0}Deploy. + /// + public static string ServiceDeploymentName + { + get + { + return ResourceManager.GetString("ServiceDeploymentName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The specified cloud service "{0}" does not exist.. + /// + public static string ServiceDoesNotExist + { + get + { + return ResourceManager.GetString("ServiceDoesNotExist", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} slot for service {1} is in {2} state, please wait until it finish and update it's status. + /// + public static string ServiceIsInTransitionState + { + get + { + return ResourceManager.GetString("ServiceIsInTransitionState", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to "An exception occurred when calling the ServiceManagement API. HTTP Status Code: {0}. Service Management Error Code: {1}. Message: {2}. Operation Tracking ID: {3}.". + /// + public static string ServiceManagementClientExceptionStringFormat + { + get + { + return ResourceManager.GetString("ServiceManagementClientExceptionStringFormat", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Begin Operation: {0}. + /// + public static string ServiceManagementExecuteClientActionBeginOperation + { + get + { + return ResourceManager.GetString("ServiceManagementExecuteClientActionBeginOperation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Completed Operation: {0}. + /// + public static string ServiceManagementExecuteClientActionCompletedOperation + { + get + { + return ResourceManager.GetString("ServiceManagementExecuteClientActionCompletedOperation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Begin Operation: {0}. + /// + public static string ServiceManagementExecuteClientActionInOCSBeginOperation + { + get + { + return ResourceManager.GetString("ServiceManagementExecuteClientActionInOCSBeginOperation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Completed Operation: {0}. + /// + public static string ServiceManagementExecuteClientActionInOCSCompletedOperation + { + get + { + return ResourceManager.GetString("ServiceManagementExecuteClientActionInOCSCompletedOperation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to service name. + /// + public static string ServiceName + { + get + { + return ResourceManager.GetString("ServiceName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provided service name {0} already exists, please pick another name. + /// + public static string ServiceNameExists + { + get + { + return ResourceManager.GetString("ServiceNameExists", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Please provide name for the hosted service. + /// + public static string ServiceNameMissingMessage + { + get + { + return ResourceManager.GetString("ServiceNameMissingMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to service parent directory. + /// + public static string ServiceParentDirectory + { + get + { + return ResourceManager.GetString("ServiceParentDirectory", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Service {0} removed successfully. + /// + public static string ServiceRemovedMessage + { + get + { + return ResourceManager.GetString("ServiceRemovedMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to service directory. + /// + public static string ServiceRoot + { + get + { + return ResourceManager.GetString("ServiceRoot", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to service settings. + /// + public static string ServiceSettings + { + get + { + return ResourceManager.GetString("ServiceSettings", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The storage account name '{0}' is invalid. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.. + /// + public static string ServiceSettings_ValidateStorageAccountName_InvalidName + { + get + { + return ResourceManager.GetString("ServiceSettings_ValidateStorageAccountName_InvalidName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The {0} slot for cloud service {1} doesn't exist.. + /// + public static string ServiceSlotDoesNotExist + { + get + { + return ResourceManager.GetString("ServiceSlotDoesNotExist", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} slot for service {1} is {2}. + /// + public static string ServiceStatusChanged + { + get + { + return ResourceManager.GetString("ServiceStatusChanged", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Set Add-On Confirmation. + /// + public static string SetAddOnConformation + { + get + { + return ResourceManager.GetString("SetAddOnConformation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Profile {0} does not contain endpoint {1}. Adding it.. + /// + public static string SetInexistentTrafficManagerEndpointMessage + { + get + { + return ResourceManager.GetString("SetInexistentTrafficManagerEndpointMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Note - You will be charged the amount for the new plan, without being refunded for time remaining + ///in the existing plan. + ///By typing "Yes", I (a) authorize Microsoft to charge my current payment method on a monthly basis + ///for the amount indicated at {0} for {1} until my service is cancelled or terminated, and (b) + ///agree to the {2}'s terms of user and privacy statement at {0} and (c) agree to sharing my + ///contact information with {2}.. + /// + public static string SetMicrosoftAddOnMessage + { + get + { + return ResourceManager.GetString("SetMicrosoftAddOnMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Note - You will be charged the amount for the new plan, without being refunded for time remaining + ///in the existing plan. + ///By typing "Yes", I (a) authorize Microsoft to charge my current payment method on a monthly basis + ///for the amount indicated at {0} for {1} until my service is cancelled or terminated, and (b) + ///acknowledge the offering is provided by {2}, not Microsoft, and agree to {2}'s terms of + ///use and privacy statement at <url> and (c) agree to sharing my contact information with {2}.. + /// + public static string SetNonMicrosoftAddOnMessage + { + get + { + return ResourceManager.GetString("SetNonMicrosoftAddOnMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Role {0} instances are set to {1}. + /// + public static string SetRoleInstancesMessage + { + get + { + return ResourceManager.GetString("SetRoleInstancesMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {"Slot":"","Location":"","Subscription":"","StorageAccountName":""}. + /// + public static string SettingsFileEmptyContent + { + get + { + return ResourceManager.GetString("SettingsFileEmptyContent", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to deploymentSettings.json. + /// + public static string SettingsFileName + { + get + { + return ResourceManager.GetString("SettingsFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Insufficient parameters passed to create a new endpoint.. + /// + public static string SetTrafficManagerEndpointNeedsParameters + { + get + { + return ResourceManager.GetString("SetTrafficManagerEndpointNeedsParameters", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Ambiguous operation: the profile name specified doesn't match the name of the profile object.. + /// + public static string SetTrafficManagerProfileAmbiguous + { + get + { + return ResourceManager.GetString("SetTrafficManagerProfileAmbiguous", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Please execute the cmdlet again and include the 'Force' parameter, if available, to avoid unnecessary prompts.. + /// + public static string ShouldContinueFail + { + get + { + return ResourceManager.GetString("ShouldContinueFail", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Confirm. + /// + public static string ShouldProcessCaption + { + get + { + return ResourceManager.GetString("ShouldProcessCaption", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Please execute the cmdlet again and omit the 'Confirm' parameter when using the 'AsJob' parameter.. + /// + public static string ShouldProcessFailConfirm + { + get + { + return ResourceManager.GetString("ShouldProcessFailConfirm", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Please increase the user $ConfirmPreference setting, or include turn off confirmation using '-Confirm:$false' when using the 'AsJob' parameter and execute the cmdet again.. + /// + public static string ShouldProcessFailImpact + { + get + { + return ResourceManager.GetString("ShouldProcessFailImpact", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Please execute the cmdlet again and omit the 'WhatIf' parameter when using the 'AsJob' parameter.. + /// + public static string ShouldProcessFailWhatIf + { + get + { + return ResourceManager.GetString("ShouldProcessFailWhatIf", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Shutdown. + /// + public static string Shutdown + { + get + { + return ResourceManager.GetString("Shutdown", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to /sites:{0};{1};"{2}/{0}" . + /// + public static string SitesArgTemplate + { + get + { + return ResourceManager.GetString("SitesArgTemplate", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 1000. + /// + public static string StandardRetryDelayInMs + { + get + { + return ResourceManager.GetString("StandardRetryDelayInMs", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Start. + /// + public static string Start + { + get + { + return ResourceManager.GetString("Start", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Started. + /// + public static string StartedEmulator + { + get + { + return ResourceManager.GetString("StartedEmulator", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Starting Emulator.... + /// + public static string StartingEmulator + { + get + { + return ResourceManager.GetString("StartingEmulator", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to start. + /// + public static string StartStorageEmulatorCommandArgument + { + get + { + return ResourceManager.GetString("StartStorageEmulatorCommandArgument", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Stop. + /// + public static string Stop + { + get + { + return ResourceManager.GetString("Stop", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Stopping emulator.... + /// + public static string StopEmulatorMessage + { + get + { + return ResourceManager.GetString("StopEmulatorMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Stopped. + /// + public static string StoppedEmulatorMessage + { + get + { + return ResourceManager.GetString("StoppedEmulatorMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to stop. + /// + public static string StopStorageEmulatorCommandArgument + { + get + { + return ResourceManager.GetString("StopStorageEmulatorCommandArgument", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Account Name:. + /// + public static string StorageAccountName + { + get + { + return ResourceManager.GetString("StorageAccountName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot find storage account '{0}' please type the name of an existing storage account.. + /// + public static string StorageAccountNotFound + { + get + { + return ResourceManager.GetString("StorageAccountNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to AzureStorageEmulator.exe. + /// + public static string StorageEmulatorExe + { + get + { + return ResourceManager.GetString("StorageEmulatorExe", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to InstallPath. + /// + public static string StorageEmulatorInstallPathRegistryKeyValue + { + get + { + return ResourceManager.GetString("StorageEmulatorInstallPathRegistryKeyValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SOFTWARE\Microsoft\Windows Azure Storage Emulator. + /// + public static string StorageEmulatorRegistryKey + { + get + { + return ResourceManager.GetString("StorageEmulatorRegistryKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Primary Key:. + /// + public static string StoragePrimaryKey + { + get + { + return ResourceManager.GetString("StoragePrimaryKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Secondary Key:. + /// + public static string StorageSecondaryKey + { + get + { + return ResourceManager.GetString("StorageSecondaryKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The subscription named {0} already exists.. + /// + public static string SubscriptionAlreadyExists + { + get + { + return ResourceManager.GetString("SubscriptionAlreadyExists", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The SubscriptionDataFile parameter is deprecated. This parameter will be removed in a future release. See https://github.com/Azure/azure-powershell/wiki/Proposed-Design-Stateless-Azure-Profile for a description of the upcoming mechanism for providing alternate sources of subscription information.. + /// + public static string SubscriptionDataFileDeprecated + { + get + { + return ResourceManager.GetString("SubscriptionDataFileDeprecated", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to DefaultSubscriptionData.xml. + /// + public static string SubscriptionDataFileName + { + get + { + return ResourceManager.GetString("SubscriptionDataFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The subscription data file {0} does not exist.. + /// + public static string SubscriptionDataFileNotFound + { + get + { + return ResourceManager.GetString("SubscriptionDataFileNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The subscription id {0} doesn't exist.. + /// + public static string SubscriptionIdNotFoundMessage + { + get + { + return ResourceManager.GetString("SubscriptionIdNotFoundMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Subscription must not be null. + /// + public static string SubscriptionMustNotBeNull + { + get + { + return ResourceManager.GetString("SubscriptionMustNotBeNull", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Subscription name needs to be specified.. + /// + public static string SubscriptionNameNeedsToBeSpecified + { + get + { + return ResourceManager.GetString("SubscriptionNameNeedsToBeSpecified", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The subscription name {0} doesn't exist.. + /// + public static string SubscriptionNameNotFoundMessage + { + get + { + return ResourceManager.GetString("SubscriptionNameNotFoundMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Subscription needs to be specified.. + /// + public static string SubscriptionNeedsToBeSpecified + { + get + { + return ResourceManager.GetString("SubscriptionNeedsToBeSpecified", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Suspend. + /// + public static string Suspend + { + get + { + return ResourceManager.GetString("Suspend", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Swapping website production slot .... + /// + public static string SwappingWebsite + { + get + { + return ResourceManager.GetString("SwappingWebsite", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to swap the website '{0}' production slot with slot '{1}'?. + /// + public static string SwapWebsiteSlotWarning + { + get + { + return ResourceManager.GetString("SwapWebsiteSlotWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The Switch-AzureMode cmdlet is deprecated and will be removed in a future release.. + /// + public static string SwitchAzureModeDeprecated + { + get + { + return ResourceManager.GetString("SwitchAzureModeDeprecated", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to [AzureLongRunningJob]: Starting cmdlet execution, setting for cmdlet confirmation required: '{0}'. + /// + public static string TraceBeginLROJob + { + get + { + return ResourceManager.GetString("TraceBeginLROJob", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to [AzureLongRunningJob]: Blocking job for ShouldMethod '{0}'. + /// + public static string TraceBlockLROThread + { + get + { + return ResourceManager.GetString("TraceBlockLROThread", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to [AzureLongRunningJob]: Completing cmdlet execution in RunJob. + /// + public static string TraceEndLROJob + { + get + { + return ResourceManager.GetString("TraceEndLROJob", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to [AzureLongRunningJob]: State change from '{0}' to '{1}' because '{2}'. + /// + public static string TraceHandleLROStateChange + { + get + { + return ResourceManager.GetString("TraceHandleLROStateChange", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to [AzureLongRunningJob]: Unblocking job due to stoppage or failure. + /// + public static string TraceHandlerCancelJob + { + get + { + return ResourceManager.GetString("TraceHandlerCancelJob", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to [AzureLongRunningJob]: Unblocking job that was previously blocked.. + /// + public static string TraceHandlerUnblockJob + { + get + { + return ResourceManager.GetString("TraceHandlerUnblockJob", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to [AzureLongRunningJob]: Error in cmdlet execution. + /// + public static string TraceLROJobException + { + get + { + return ResourceManager.GetString("TraceLROJobException", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to [AzureLongRunningJob]: Removing state changed event handler, exception '{0}'. + /// + public static string TraceRemoveLROEventHandler + { + get + { + return ResourceManager.GetString("TraceRemoveLROEventHandler", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to [AzureLongRunningJob]: ShouldMethod '{0}' unblocked.. + /// + public static string TraceUnblockLROThread + { + get + { + return ResourceManager.GetString("TraceUnblockLROThread", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unable to decode string from base 64. Please make sure the string is correctly encoded: {0}.. + /// + public static string UnableToDecodeBase64String + { + get + { + return ResourceManager.GetString("UnableToDecodeBase64String", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unable to update mismatching Json structured: {0} {1}.. + /// + public static string UnableToPatchJson + { + get + { + return ResourceManager.GetString("UnableToPatchJson", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provider {0} is unknown.. + /// + public static string UnknownProviderMessage + { + get + { + return ResourceManager.GetString("UnknownProviderMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Update. + /// + public static string Update + { + get + { + return ResourceManager.GetString("Update", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Updated settings for subscription '{0}'. Current subscription is '{1}'.. + /// + public static string UpdatedSettings + { + get + { + return ResourceManager.GetString("UpdatedSettings", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to User name is not valid.. + /// + public static string UserNameIsNotValid + { + get + { + return ResourceManager.GetString("UserNameIsNotValid", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to User name needs to be specified.. + /// + public static string UserNameNeedsToBeSpecified + { + get + { + return ResourceManager.GetString("UserNameNeedsToBeSpecified", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A value for the VLan Id has to be provided.. + /// + public static string VlanIdRequired + { + get + { + return ResourceManager.GetString("VlanIdRequired", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Please wait.... + /// + public static string WaitMessage + { + get + { + return ResourceManager.GetString("WaitMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The azure storage emulator is not installed, skip launching.... + /// + public static string WarningWhenStorageEmulatorIsMissing + { + get + { + return ResourceManager.GetString("WarningWhenStorageEmulatorIsMissing", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Web.cloud.config. + /// + public static string WebCloudConfig + { + get + { + return ResourceManager.GetString("WebCloudConfig", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to web.config. + /// + public static string WebConfigTemplateFileName + { + get + { + return ResourceManager.GetString("WebConfigTemplateFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to MSDeploy. + /// + public static string WebDeployKeywordInWebSitePublishProfile + { + get + { + return ResourceManager.GetString("WebDeployKeywordInWebSitePublishProfile", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot build the project successfully. Please see logs in {0}.. + /// + public static string WebProjectBuildFailTemplate + { + get + { + return ResourceManager.GetString("WebProjectBuildFailTemplate", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to WebRole. + /// + public static string WebRole + { + get + { + return ResourceManager.GetString("WebRole", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to setup_web.cmd > log.txt. + /// + public static string WebRoleStartupTaskCommandLine + { + get + { + return ResourceManager.GetString("WebRoleStartupTaskCommandLine", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to WebRole.xml. + /// + public static string WebRoleTemplateFileName + { + get + { + return ResourceManager.GetString("WebRoleTemplateFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to WebSite with given name {0} already exists in the specified Subscription and Webspace.. + /// + public static string WebsiteAlreadyExists + { + get + { + return ResourceManager.GetString("WebsiteAlreadyExists", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to WebSite with given name {0} already exists in the specified Subscription and Location.. + /// + public static string WebsiteAlreadyExistsReplacement + { + get + { + return ResourceManager.GetString("WebsiteAlreadyExistsReplacement", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Site {0} already has repository created for it.. + /// + public static string WebsiteRepositoryAlreadyExists + { + get + { + return ResourceManager.GetString("WebsiteRepositoryAlreadyExists", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Workspaces/WebsiteExtension/Website/{0}/dashboard/. + /// + public static string WebsiteSufixUrl + { + get + { + return ResourceManager.GetString("WebsiteSufixUrl", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to https://{0}/msdeploy.axd?site={1}. + /// + public static string WebSiteWebDeployUriTemplate + { + get + { + return ResourceManager.GetString("WebSiteWebDeployUriTemplate", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to WorkerRole. + /// + public static string WorkerRole + { + get + { + return ResourceManager.GetString("WorkerRole", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to setup_worker.cmd > log.txt. + /// + public static string WorkerRoleStartupTaskCommandLine + { + get + { + return ResourceManager.GetString("WorkerRoleStartupTaskCommandLine", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to WorkerRole.xml. + /// + public static string WorkerRoleTemplateFileName + { + get + { + return ResourceManager.GetString("WorkerRoleTemplateFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to (x86). + /// + public static string x86InProgramFiles + { + get + { + return ResourceManager.GetString("x86InProgramFiles", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Yes. + /// + public static string Yes + { + get + { + return ResourceManager.GetString("Yes", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Yes, I agree. + /// + public static string YesHint + { + get + { + return ResourceManager.GetString("YesHint", resourceCulture); + } + } + } +} diff --git a/swaggerci/eventgrid/generated/runtime/Properties/Resources.resx b/swaggerci/eventgrid/generated/runtime/Properties/Resources.resx new file mode 100644 index 000000000000..598cd53e958a --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/Properties/Resources.resx @@ -0,0 +1,1741 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + The remote server returned an error: (401) Unauthorized. + + + Account "{0}" has been added. + + + To switch to a different subscription, please use Select-AzureSubscription. + + + Subscription "{0}" is selected as the default subscription. + + + To view all the subscriptions, please use Get-AzureSubscription. + + + Add-On {0} is created successfully. + + + Add-on name {0} is already used. + + + Add-On {0} not found. + + + Add-on {0} is removed successfully. + + + Add-On {0} is updated successfully. + + + Role has been created at {0}\{1}. + + + Role has been created at {0}\{1}. For easy access to Microsoft Azure services from your application code, install the Microsoft Azure client library for Node.js by running ‘npm install azure’. + + + Role has been created at {0}\{1}. For easy access to Microsoft Azure services from your application code, install the Microsoft Azure client library for PHP by running "pear WindowsAzure/WindowsAzure". + + + Unable to set role permissions. Please give the 'Network Service' user 'Read & execute' and 'Modify' permissions to the role folder, or run PowerShell as an Administrator + + + A role name '{0}' already exists + + + Windows Azure Powershell\ + + + https://manage.windowsazure.com + + + AZURE_PORTAL_URL + + + Azure SDK\{0}\ + + + Base Uri was empty. + WAPackIaaS + + + {0} begin processing without ParameterSet. + + + {0} begin processing with ParameterSet '{1}'. + + + Blob with the name {0} already exists in the account. + + + https://{0}.blob.core.windows.net/ + + + AZURE_BLOBSTORAGE_TEMPLATE + + + CACHERUNTIMEURL + + + cache + + + CacheRuntimeVersion + + + Installing caching version {0} for Role '{1}' (the caching version locally installed is: {2}) + + + Cannot find {0} with name {1}. + + + Deployment for service {0} with {1} slot doesn't exist + + + Can't find valid Microsoft Azure role in current directory {0} + + + service {0} configuration file (ServiceConfiguration.Cloud.cscfg) is either null or doesn't exist + + + Invalid service path! Cannot locate ServiceDefinition.csdef in current folder or parent folders. + + + The subscription named {0} with id {1} is not currently imported. You must import this subscription before it can be updated. + + + ManagementCertificate + + + certificate.pfx + + + Certificate imported into CurrentUser\My\{0} + + + Your account does not have access to the private key for certificate {0} + + + {0} {1} deployment for {2} service + + + Cloud service {0} is in {1} state. + + + Changing/Removing public environment '{0}' is not allowed. + + + Service {0} is set to value {1} + + + Choose which publish settings file to use: + + + Microsoft.WindowsAzure.Plugins.Caching.ClientDiagnosticLevel + + + 1 + + + cloud_package.cspkg + + + ServiceConfiguration.Cloud.cscfg + + + Add-ons for {0} + + + Communication could not be established. This could be due to an invalid subscription ID. Note that subscription IDs are case sensitive. + + + Complete + + + config.json + + + VirtualMachine creation failed. + WAPackIaaS + + + Creating the website failed. If this is the first website for this subscription, please create it using the management portal instead. + + + Microsoft.ApplicationServer.Caching.DataCacheClientsSection, Microsoft.ApplicationServer.Caching.Core + + + //blobcontainer[@datacenter='{0}'] + + + Setting: {0} as the default and current subscription. To view other subscriptions use Get-AzureSubscription + + + none + + + There are no hostnames which could be used for validation. + + + 8080 + + + 1000 + + + Auto + + + 80 + + + Delete + WAPackIaaS + + + The {0} slot for service {1} is already in {2} state + + + The deployment in {0} slot for service {1} is removed + + + Microsoft.WindowsAzure.Plugins.Caching.DiagnosticLevel + + + 1 + + + The key to add already exists in the dictionary. + + + The array index cannot be less than zero. + + + The supplied array does not have enough room to contain the copied elements. + + + The provided dns {0} doesn't exist + + + Microsoft Azure Certificate + + + Endpoint can't be retrieved for storage account + + + {0} end processing. + + + To use Active Directory authentication, you must configure the ActiveDirectoryEndpoint, ActiveDirectoryTenantId, and ActiveDirectorServiceEndpointResourceId for environment of '{0}'. You can configure these properties for this environment using the Set-AzureEnvironment cmdlet. + + + The environment '{0}' already exists. + + + environments.xml + + + Error creating VirtualMachine + WAPackIaaS + + + Unable to download available runtimes for location '{0}' + + + Error updating VirtualMachine + WAPackIaaS + + + Job Id {0} failed. Error: {1}, ExceptionDetails: {2} + WAPackIaaS + + + The HTTP request was forbidden with client authentication scheme 'Anonymous'. + + + This add-on requires you to purchase the first instance through the Microsoft Azure Portal. Subsequent purchases can be performed through PowerShell. + + + Operation Status: + + + Resources\Scaffolding\General + + + Getting all available Microsoft Azure Add-Ons, this may take few minutes... + + + Name{0}Primary Key{0}Seconday Key + + + Git not found. Please install git and place it in your command line path. + + + Could not find publish settings. Please run Import-AzurePublishSettingsFile. + + + iisnode.dll + + + iisnode + + + iisnode-dev\\release\\x64 + + + iisnode + + + Installing IISNode version {0} in Azure for WebRole '{1}' (the version locally installed is: {2}) + + + Internal Server Error + + + Cannot enable memcach protocol on a cache worker role {0}. + + + Invalid certificate format. + + + The provided configuration path is invalid or doesn't exist + + + The country name is invalid, please use a valid two character country code, as described in ISO 3166-1 alpha-2. + + + Deployment with {0} does not exist + + + The deployment slot name {0} is invalid. Slot name must be either "Staging" or "Production". + + + Invalid service endpoint. + + + File {0} has invalid characters + + + You must create your git publishing credentials using the Microsoft Azure portal. +Please follow these steps in the portal: +1. On the left side open "Web Sites" +2. Click on any website +3. Choose "Setup Git Publishing" or "Reset deployment credentials" +4. Back in the PowerShell window, rerun this command by typing "New-AzureWebSite {site name} -Git -PublishingUsername {username} + + + The value {0} provided is not a valid GUID. Please provide a valid GUID. + + + The specified hostname does not exist. Please specify a valid hostname for the site. + + + Role {0} instances must be greater than or equal 0 and less than or equal 20 + + + There was an error creating your webjob. Please make sure that the script is in the root folder of the zip file. + + + Could not download a valid runtime manifest, Please check your internet connection and try again. + + + The account {0} was not found. Please specify a valid account name. + + + The provided name "{0}" does not match the service bus namespace naming rules. + + + Value cannot be null. Parameter name: '{0}' + + + The provided package path is invalid or doesn't exist + + + '{0}' is an invalid parameter set name. + + + {0} doesn't exist in {1} or you've not passed valid value for it + + + Path {0} has invalid characters + + + The provided publish settings file {0} has invalid content. Please get valid by running cmdlet Get-AzurePublishSettingsFile + + + The provided role name "{0}" has invalid characters + + + A valid name for the service root folder is required + + + {0} is not a recognized runtime type + + + A valid language is required + + + No subscription is currently selected. Use Select-Subscription to activate a subscription. + + + The provided location "{0}" does not exist in the available locations use Get-AzureSBLocation for listing available locations. + + + Please provide a service name or run this command from inside a service project directory. + + + You must provide valid value for {0} + + + settings.json is invalid or doesn't exist + + + The subscription named '{0}' cannot be found. Use Set-AzureSubscription to initialize the subscription data. + + + The provided subscription id {0} is not valid + + + A valid subscription name is required. This can be provided using the -Subscription parameter or by setting the subscription via the Set-AzureSubscription cmdlet + + + The provided subscriptions file {0} has invalid content. + + + Role {0} VM size should be ExtraSmall, Small, Medium, Large or ExtraLarge. + + + The web job file must have *.zip extension + + + Singleton option works for continuous jobs only. + + + The website {0} was not found. Please specify a valid website name. + + + No job for id: {0} was found. + WAPackIaaS + + + engines + + + Scaffolding for this language is not yet supported + + + Link already established + + + local_package.csx + + + ServiceConfiguration.Local.cscfg + + + Looking for {0} deployment for {1} cloud service... + + + Looking for cloud service {0}... + + + managementCertificate.pem + + + ?whr={0} + + + //baseuri + + + uri + + + http://az413943.vo.msecnd.net/node/runtimemanifest_0.7.5.2.xml + + + Multiple Add-Ons found holding name {0} + + + Multiple possible publishing users. Please go to the Portal and use the listed deployment user, or click 'set/reset deployment credentials' to set up a new user account, then reurn this cmdlet and specify PublishingUsername. + + + The first publish settings file "{0}" is used. If you want to use another file specify the file name. + + + Microsoft.WindowsAzure.Plugins.Caching.NamedCaches + + + {"caches":[{"name":"default","policy":{"eviction":{"type":0},"expiration":{"defaultTTL":10,"isExpirable":true,"type":1},"serverNotification":{"isEnabled":false}},"secondaries":0}]} + + + A publishing username is required. Please specify one using the argument PublishingUsername. + + + New Add-On Confirmation + + + By typing "Yes", I (a) authorize Microsoft to charge my current payment method on a monthly basis +for the amount indicated at {0} for {1} until my service is cancelled or terminated, and (b) +agree to the {2}'s terms of user and privacy statement at {0} and (c) agree to sharing my +contact information with {2}. + + + Internal Server Error. This could happen because the namespace name is already used or due to an incorrect location name. Use Get-AzureSBLocation cmdlet to list valid names. + + + By typing "Yes", I (a) authorize Microsoft to charge my current payment method on a monthly basis +for the amount indicated at {0} for {1} until my service is cancelled or terminated, and (b) +acknowledge the offering is provided by {2}, not Microsoft, and agree to {2}'s terms of +use and privacy statement at {0} and (c) agree to sharing my contact information with {2}. + + + Service has been created at {0} + + + No + + + There is no access token cached for subscription {0}, user id {1}. Use the Add-AzureAccount cmdlet to log in again and get a token for this subscription. + + + The service does not have any cache worker roles, add one first by running cmdlet Add-AzureCacheWorkerRole. + + + No clouds available + WAPackIaaS + + + nodejs + + + node + + + node.exe + + + There is no default subscription set, please set a default subscription by running Set-AzureSubscription -Default <subscription name> + + + Microsoft SDKs\Azure\Nodejs\Nov2011 + + + nodejs + + + node + + + Resources\Scaffolding\Node + + + Microsoft.WindowsAzure.Commands.CloudService.ScaffoldingResources.Node + + + Installing Node version {0} in Azure for Role '{1}' (the Node version locally installed is: {2}) + + + No, I do not agree + + + No publish settings files with extension *.publishsettings are found in the directory "{0}". + + + '{0}' must be a cache worker role. Verify that it has proper cache worker role configuration. + + + Certificate can't be null. + + + {0} could not be null or empty + + + Unable to add a null RoleSettings to {0} + + + Unable to add new role to null service definition + + + The request offer '{0}' is not found. + + + Operation "{0}" failed on VM with ID: {1} + WAPackIaaS + + + The REST operation failed with message '{0}' and error code '{1}' + + + Job Id {0} did not complete within expected time or it is in Failed/Canceled/Invalid state. + WAPackIaaS + + + package + + + Package is created at service root path {0}. + + + {{ + "author": "", + + "name": "{0}", + "version": "0.0.0", + "dependencies":{{}}, + "devDependencies":{{}}, + "optionalDependencies": {{}}, + "engines": {{ + "node": "*", + "iisnode": "*" + }} + +}} + + + + package.json + + + A value for the Peer Asn has to be provided. + + + 5.4.0 + + + php + + + Resources\Scaffolding\PHP + + + Microsoft.WindowsAzure.Commands.CloudService.ScaffoldingResources.PHP + + + Installing PHP version {0} for Role '{1}' (the PHP version locally installed is: {2}) + + + You must create your first web site using the Microsoft Azure portal. +Please follow these steps in the portal: +1. At the bottom of the page, click on New > Web Site > Quick Create +2. Type {0} in the URL field +3. Click on "Create Web Site" +4. Once the site has been created, click on the site name +5. Click on "Set up Git publishing" or "Reset deployment credentials" and setup a publishing username and password. Use those credentials for all new websites you create. + + + 6. Back in the console window, rerun this command by typing "New-AzureWebsite <site name> -Git" + + + A value for the Primary Peer Subnet has to be provided. + + + Promotion code can be used only when updating to a new plan. + + + Service not published at user request. + + + Complete. + + + Connecting... + + + Created Deployment ID: {0}. + + + Created hosted service '{0}'. + + + Created Website URL: {0}. + + + Creating... + + + Initializing... + + + busy + + + creating the virtual machine + + + Instance {0} of role {1} is {2}. + + + ready + + + Preparing deployment for {0} with Subscription ID: {1}... + + + Publishing {0} to Microsoft Azure. This may take several minutes... + + + publish settings + + + Azure + + + .PublishSettings + + + publishSettings.xml + + + Publish settings imported + + + AZURE_PUBLISHINGPROFILE_URL + + + Starting... + + + Upgrading... + + + Uploading Package to storage service {0}... + + + Verifying storage account '{0}'... + + + Replace current deployment with '{0}' Id ? + + + Are you sure you want to regenerate key? + + + Generate new key. + + + Are you sure you want to remove account '{0}'? + + + Removing account + + + Remove Add-On Confirmation + + + If you delete this add-on, your data may be deleted and the operation may not be undone. You may have to purchase it again from the Microsoft Azure Store to use it. The price of the add-on may not be refunded. Are you sure you want to delete this add-on? Enter “Yes” to confirm. + + + Remove-AzureBGPPeering Operation failed. + + + Removing Bgp Peering + + + Successfully removed Azure Bgp Peering with Service Key {0}. + + + Are you sure you want to remove the Bgp Peering with service key '{0}'? + + + Are you sure you want to remove the Dedicated Circuit with service key '{0}'? + + + Remove-AzureDedicatedCircuit Operation failed. + + + Remove-AzureDedicatedCircuitLink Operation failed. + + + Removing Dedicated Circui Link + + + Successfully removed Azure Dedicated Circuit Link with Service Key {0} and Vnet Name {1} + + + Are you sure you want to remove the Dedicated Circuit Link with service key '{0}' and virtual network name '{1}'? + + + Removing Dedicated Circuit + + + Successfully removed Azure Dedicated Circuit with Service Key {0}. + + + Removing cloud service {0}... + + + Removing {0} deployment for {1} service + + + Removing job collection + + + Are you sure you want to remove the job collection "{0}" + + + Removing job + + + Are you sure you want to remove the job "{0}" + + + Are you sure you want to remove the account? + + + Account removed. + + + Internal Server Error. This could happen because the namespace does not exist or it does not exist under your subscription. + + + Removing old package {0}... + + + Are you sure you want to delete the namespace '{0}'? + + + Are you sure you want to remove cloud service? + + + Remove cloud service and all it's deployments + + + Are you sure you want to remove subscription '{0}'? + + + Removing subscription + + + Are you sure you want to delete the VM '{0}'? + + + Deleting VM. + + + Removing WebJob... + + + Are you sure you want to remove job '{0}'? + + + Removing website + + + Are you sure you want to remove the website "{0}" + + + Deleting namespace + + + Repository is not setup. You need to pass a valid site name. + + + Reserved IP with the Name:'{0}' will no longer be in use after the deployment is deleted, and it is still reserved for later use. + + + Resource with ID : {0} does not exist. + WAPackIaaS + + + Restart + WAPackIaaS + + + Resume + WAPackIaaS + + + /role:{0};"{1}/{0}" + + + bin + + + Role {0} is {1} + + + 20 + + + role name + + + The provided role name {0} doesn't exist + + + RoleSettings.xml + + + Role type {0} doesn't exist + + + public static Dictionary<string, Location> ReverseLocations { get; private set; } + + + Preparing runtime deployment for service '{0}' + + + WARNING Runtime Mismatch: Are you sure that you want to publish service '{0}' using an Azure runtime version that does not match your local runtime version? + + + RUNTIMEOVERRIDEURL + + + /runtimemanifest/runtimes/runtime + + + RUNTIMEID + + + RUNTIMEURL + + + RUNTIMEVERSIONPRIMARYKEY + + + scaffold.xml + + + Invalid location entered. Pick one of the locations from Get-AzureSchedulerLocation + + + A value for the Secondary Peer Subnet has to be provided. + + + Service {0} already exists on disk in location {1} + + + No ServiceBus authorization rule with the given characteristics was found + + + The service bus entity '{0}' is not found. + + + Internal Server Error. This could happen due to an incorrect/missing namespace + + + service configuration + + + service definition + + + ServiceDefinition.csdef + + + {0}Deploy + + + The specified cloud service "{0}" does not exist. + + + {0} slot for service {1} is in {2} state, please wait until it finish and update it's status + + + Begin Operation: {0} + + + Completed Operation: {0} + + + Begin Operation: {0} + + + Completed Operation: {0} + + + service name + + + Please provide name for the hosted service + + + service parent directory + + + Service {0} removed successfully + + + service directory + + + service settings + + + The storage account name '{0}' is invalid. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + + + The {0} slot for cloud service {1} doesn't exist. + + + {0} slot for service {1} is {2} + + + Set Add-On Confirmation + + + Note - You will be charged the amount for the new plan, without being refunded for time remaining +in the existing plan. +By typing "Yes", I (a) authorize Microsoft to charge my current payment method on a monthly basis +for the amount indicated at {0} for {1} until my service is cancelled or terminated, and (b) +agree to the {2}'s terms of user and privacy statement at {0} and (c) agree to sharing my +contact information with {2}. + + + Note - You will be charged the amount for the new plan, without being refunded for time remaining +in the existing plan. +By typing "Yes", I (a) authorize Microsoft to charge my current payment method on a monthly basis +for the amount indicated at {0} for {1} until my service is cancelled or terminated, and (b) +acknowledge the offering is provided by {2}, not Microsoft, and agree to {2}'s terms of +use and privacy statement at <url> and (c) agree to sharing my contact information with {2}. + + + Role {0} instances are set to {1} + + + {"Slot":"","Location":"","Subscription":"","StorageAccountName":""} + + + deploymentSettings.json + + + Confirm + + + Shutdown + WAPackIaaS + + + /sites:{0};{1};"{2}/{0}" + + + 1000 + + + Start + WAPackIaaS + + + Started + + + Starting Emulator... + + + start + + + Stop + WAPackIaaS + + + Stopping emulator... + + + Stopped + + + stop + + + Account Name: + + + Cannot find storage account '{0}' please type the name of an existing storage account. + + + AzureStorageEmulator.exe + + + InstallPath + + + SOFTWARE\Microsoft\Windows Azure Storage Emulator + + + Primary Key: + + + Secondary Key: + + + The subscription named {0} already exists. + + + DefaultSubscriptionData.xml + + + The subscription data file {0} does not exist. + + + Subscription must not be null + WAPackIaaS + + + Suspend + WAPackIaaS + + + Swapping website production slot ... + + + Are you sure you want to swap the website '{0}' production slot with slot '{1}'? + + + The provider {0} is unknown. + + + Update + WAPackIaaS + + + Updated settings for subscription '{0}'. Current subscription is '{1}'. + + + A value for the VLan Id has to be provided. + + + Please wait... + + + The azure storage emulator is not installed, skip launching... + + + Web.cloud.config + + + web.config + + + MSDeploy + + + Cannot build the project successfully. Please see logs in {0}. + + + WebRole + + + setup_web.cmd > log.txt + + + WebRole.xml + + + WebSite with given name {0} already exists in the specified Subscription and Webspace. + + + WebSite with given name {0} already exists in the specified Subscription and Location. + + + Site {0} already has repository created for it. + + + Workspaces/WebsiteExtension/Website/{0}/dashboard/ + + + https://{0}/msdeploy.axd?site={1} + + + WorkerRole + + + setup_worker.cmd > log.txt + + + WorkerRole.xml + + + Yes + + + Yes, I agree + + + Remove-AzureTrafficManagerProfile Operation failed. + + + Successfully removed Traffic Manager profile with name {0}. + + + Are you sure you want to remove the Traffic Manager profile "{0}"? + + + Profile {0} already has an endpoint with name {1} + + + Profile {0} does not contain endpoint {1}. Adding it. + + + The endpoint {0} cannot be removed from profile {1} because it's not in the profile. + + + Insufficient parameters passed to create a new endpoint. + + + Ambiguous operation: the profile name specified doesn't match the name of the profile object. + + + <NONE> + + + "An exception occurred when calling the ServiceManagement API. HTTP Status Code: {0}. Service Management Error Code: {1}. Message: {2}. Operation Tracking ID: {3}." + {0} is the HTTP status code. {1} is the Service Management Error Code. {2} is the Service Management Error message. {3} is the operation tracking ID. + + + Unable to decode string from base 64. Please make sure the string is correctly encoded: {0}. + {0} is the string that is not in a valid base 64 format. + + + Skipping external tenant {0}, because you are using a guest or a foreign principal object identity. In order to access this tenant, please run Add-AzureAccount without "-Credential". + + + Removing an environment will remove all associated subscriptions and accounts. Are you sure you want to remove an environment '{0}'? + + + Removing environment + + + There is no subscription associated with account {0}. + + + Account id doesn't match one in subscription. + + + Environment name doesn't match one in subscription. + + + Removing the Azure profile will remove all associated environments, subscriptions, and accounts. Are you sure you want to remove the Azure profile? + + + Removing the Azure profile + + + The SubscriptionDataFile parameter is deprecated. This parameter will be removed in a future release. See https://github.com/Azure/azure-powershell/wiki/Proposed-Design-Stateless-Azure-Profile for a description of the upcoming mechanism for providing alternate sources of subscription information. + + + Account needs to be specified + + + No default subscription has been designated. Use Select-AzureSubscription -Default <subscriptionName> to set the default subscription. + + + Path must specify a valid path to an Azure profile. + + + Property bag Hashtable must contain one of the following sets of properties: {SubscriptionId, Certificate}, {SubscriptionId, Username, Password}, {SubscriptionId, ServicePrincipal, Password, Tenant}, {SubscriptionId, AccountId, Token} + + + Property bag Hashtable must contain a 'Certificate' of type 'X509Certificate2'. + + + Property bag Hashtable must contain a 'Password' with an associated 'Username' or 'ServicePrincipal'. + + + Property bag Hashtable must contain a 'SubscriptionId'. + + + Selected profile must not be null. + + + The Switch-AzureMode cmdlet is deprecated and will be removed in a future release. + + + OperationID : '{0}' + + + Cannot get module for DscResource '{0}'. Possible solutions: +1) Specify -ModuleName for Import-DscResource in your configuration. +2) Unblock module that contains resource. +3) Move Import-DscResource inside Node block. + + 0 = name of DscResource + + + Your current PowerShell version {1} is less then required by this cmdlet {0}. Consider download and install latest PowerShell version. + {0} = minimal required PS version, {1} = current PS version + + + Parsing configuration script: {0} + {0} is the path to a script file + + + Configuration script '{0}' contained parse errors: +{1} + 0 = path to the configuration script, 1 = parser errors + + + List of required modules: [{0}]. + {0} = list of modules + + + Temp folder '{0}' created. + {0} = temp folder path + + + Copy '{0}' to '{1}'. + {0} = source, {1} = destination + + + Copy the module '{0}' to '{1}'. + {0} = source, {1} = destination + + + File '{0}' already exists. Use the -Force parameter to overwrite it. + {0} is the path to a file + + + Configuration file '{0}' not found. + 0 = path to the configuration file + + + Path '{0}' not found. + 0 = path to the additional content file/directory + + + Path '{0}' not found. + 0 = path to the additional content file/directory + + + Invalid configuration file: {0}. +The file needs to be a PowerShell script (.ps1 or .psm1) or a ZIP archive (.zip). + 0 = path to the configuration file + + + Invalid configuration file: {0}. +The file needs to be a PowerShell script (.ps1 or .psm1). + 0 = path to the configuration file + + + Create Archive + + + Upload '{0}' + {0} is the name of an storage blob + + + Storage Blob '{0}' already exists. Use the -Force parameter to overwrite it. + {0} is the name of an storage blob + + + Configuration published to {0} + {0} is an URI + + + Deleted '{0}' + {0} is the path of a file + + + Cannot delete '{0}': {1} + {0} is the path of a file, {1} is an error message + + + Cannot find the WadCfg end element in the config. + + + WadCfg start element in the config is not matching the end element. + + + Cannot find the WadCfg element in the config. + + + Cannot find configuration data file: {0} + + + The configuration data must be a .psd1 file + + + Cannot change built-in environment {0}. + + + Azure PowerShell collects usage data in order to improve your experience. +The data is anonymous and does not include commandline argument values. +The data is collected by Microsoft. + +Use the Disable-AzDataCollection cmdlet to turn the feature Off. The cmdlet can be found in the Az.Accounts module. To disable data collection: PS > Disable-AzDataCollection. +Use the Enable-AzDataCollection cmdlet to turn the feature On. The cmdlet can be found in the Az.Accounts module. To enable data collection: PS > Enable-AzDataCollection. + + + Microsoft Azure PowerShell Data Collection Confirmation + + + You choose not to participate in Microsoft Azure PowerShell data collection. + + + This confirmation message will be dismissed in '{0}' second(s)... + + + You choose to participate in Microsoft Azure PowerShell data collection. + + + The setting profile has been saved to the following path '{0}'. + + + [Common.Authentication]: Authenticating for account {0} with single tenant {1}. + + + Changing public environment is not supported. + + + Environment name needs to be specified. + + + Environment needs to be specified. + + + The environment name '{0}' is not found. + + + File path is not valid. + + + Must specify a non-null subscription name. + + + The default subscription is being removed. Use Select-AzureSubscription -Default <subscriptionName> to select a new default subscription. + + + Removing public environment is not supported. + + + The subscription id {0} doesn't exist. + + + Subscription name needs to be specified. + + + The subscription name {0} doesn't exist. + + + Subscription needs to be specified. + + + User name is not valid. + + + User name needs to be specified. + + + "There is no current context, please log in using Connect-AzAccount." + + + No subscriptions are associated with the logged in account in Azure Service Management (RDFE). This means that the logged in user is not an administrator or co-administrator for any account.\r\nDid you mean to execute Connect-AzAccount? + + + No certificate was found in the certificate store with thumbprint {0} + + + Illegal characters in path. + + + Invalid certificate format. Publish settings may be corrupted. Use Get-AzurePublishSettingsFile to download updated settings + + + "{0}" is an invalid DNS name for {1} + + + The provided file in {0} must be have {1} extension + + + {0} is invalid or empty + + + Please connect to internet before executing this cmdlet + + + Path {0} doesn't exist. + + + Path for {0} doesn't exist in {1}. + + + &whr={0} + + + The provided service name {0} already exists, please pick another name + + + Unable to update mismatching Json structured: {0} {1}. + + + (x86) + + + Azure PowerShell collects usage data in order to improve your experience. +The data is anonymous and does not include commandline argument values. +The data is collected by Microsoft. + +Use the Disable-AzureDataCollection cmdlet to turn the feature Off. The cmdlet can be found in the Azure module. To disable data collection: PS > Disable-AzureDataCollection. +Use the Enable-AzureDataCollection cmdlet to turn the feature On. The cmdlet can be found in the Azure module. To enable data collection: PS > Enable-AzureDataCollection. + + + Execution failed because a background thread could not prompt the user. + + + Azure Long-Running Job + + + The cmdlet failed in background execution. The returned error was '{0}'. Please execute the cmdlet again. You may need to execute this cmdlet synchronously, by omitting the '-AsJob' parameter. + 0(string): exception message in background task + + + Please execute the cmdlet again and include the 'Force' parameter, if available, to avoid unnecessary prompts. + + + Please execute the cmdlet again and omit the 'Confirm' parameter when using the 'AsJob' parameter. + + + Please increase the user $ConfirmPreference setting, or include turn off confirmation using '-Confirm:$false' when using the 'AsJob' parameter and execute the cmdet again. + + + Please execute the cmdlet again and omit the 'WhatIf' parameter when using the 'AsJob' parameter. + + + [AzureLongRunningJob]: Starting cmdlet execution, setting for cmdlet confirmation required: '{0}' + 0(bool): whether cmdlet confirmation is required + + + [AzureLongRunningJob]: Blocking job for ShouldMethod '{0}' + 0(string): method type + + + [AzureLongRunningJob]: Completing cmdlet execution in RunJob + + + [AzureLongRunningJob]: State change from '{0}' to '{1}' because '{2}' + 0(string): last state, 1(string): new state, 2(string): state change reason + + + [AzureLongRunningJob]: Unblocking job due to stoppage or failure + + + [AzureLongRunningJob]: Unblocking job that was previously blocked. + + + [AzureLongRunningJob]: Error in cmdlet execution + + + [AzureLongRunningJob]: Removing state changed event handler, exception '{0}' + 0(string): exception message + + + [AzureLongRunningJob]: ShouldMethod '{0}' unblocked. + 0(string): methodType + + + +- The parameter : '{0}' is changing. + + + +- The parameter : '{0}' is becoming mandatory. + + + +- The parameter : '{0}' is being replaced by parameter : '{1}'. + + + +- The parameter : '{0}' is being replaced by mandatory parameter : '{1}'. + + + +- Change description : {0} + + + The cmdlet is being deprecated. There will be no replacement for it. + + + The cmdlet parameter set is being deprecated. There will be no replacement for it. + + + The cmdlet '{0}' is replacing this cmdlet. + + + +- The output type is changing from the existing type :'{0}' to the new type :'{1}' + + + +- The output type '{0}' is changing + + + +- The following properties are being added to the output type : + + + +- The following properties in the output type are being deprecated : + + + {0} + + + +- Cmdlet : '{0}' + - {1} + + + Upcoming breaking changes in the cmdlet '{0}' : + + + +- This change will take effect on '{0}' + + + +- The change is expected to take effect from the version : '{0}' + + + ```powershell +# Old +{0} + +# New +{1} +``` + + + + +Cmdlet invocation changes : + Old Way : {0} + New Way : {1} + + + +The output type '{0}' is being deprecated without a replacement. + + + +The type of the parameter is changing from '{0}' to '{1}'. + + + +Note : Go to {0} for steps to suppress this breaking change warning, and other information on breaking changes in Azure PowerShell. + + + This cmdlet is in preview. The functionality may not be available in the selected subscription. + + \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/runtime/Response.cs b/swaggerci/eventgrid/generated/runtime/Response.cs new file mode 100644 index 000000000000..31ca428a7fd0 --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/Response.cs @@ -0,0 +1,27 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime +{ + using System; + using System.Threading.Tasks; + public class Response : EventData + { + public Response() : base() + { + } + } + + public class Response : Response + { + private Func> _resultDelegate; + private Task _resultValue; + + public Response(T value) : base() => _resultValue = Task.FromResult(value); + public Response(Func value) : base() => _resultDelegate = () => Task.FromResult(value()); + public Response(Func> value) : base() => _resultDelegate = value; + public Task Result => _resultValue ?? (_resultValue = this._resultDelegate()); + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/runtime/Serialization/JsonSerializer.cs b/swaggerci/eventgrid/generated/runtime/Serialization/JsonSerializer.cs new file mode 100644 index 000000000000..0d01873189fc --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/Serialization/JsonSerializer.cs @@ -0,0 +1,350 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json +{ + internal class JsonSerializer + { + private int depth = 0; + + private SerializationOptions options = new SerializationOptions(); + + #region Deserialization + + internal T Deseralize(JsonObject json) + where T : new() + { + var contract = JsonModelCache.Get(typeof(T)); + + return (T)DeserializeObject(contract, json); + } + + internal object DeserializeObject(JsonModel contract, JsonObject json) + { + var instance = Activator.CreateInstance(contract.Type); + + depth++; + + // Ensure we don't recurse forever + if (depth > 5) throw new Exception("Depth greater than 5"); + + foreach (var field in json) + { + var member = contract[field.Key]; + + if (member != null) + { + var value = DeserializeValue(member, field.Value); + + member.SetValue(instance, value); + } + } + + depth--; + + return instance; + } + + private object DeserializeValue(JsonMember member, JsonNode value) + { + if (value.Type == JsonType.Null) return null; + + var type = member.Type; + + if (member.IsStringLike && value.Type != JsonType.String) + { + // Take the long path... + return DeserializeObject(JsonModelCache.Get(type), (JsonObject)value); + } + else if (member.Converter != null) + { + return member.Converter.FromJson(value); + } + else if (type.IsArray) + { + return DeserializeArray(type, (JsonArray)value); + } + else if (member.IsList) + { + return DeserializeList(type, (JsonArray)value); + } + else + { + var contract = JsonModelCache.Get(type); + + return DeserializeObject(contract, (JsonObject)value); + } + } + + private object DeserializeValue(Type type, JsonNode value) + { + if (type == null) throw new ArgumentNullException(nameof(type)); + + if (value.Type == JsonType.Null) return null; + + var typeDetails = TypeDetails.Get(type); + + if (typeDetails.JsonConverter != null) + { + return typeDetails.JsonConverter.FromJson(value); + } + else if (typeDetails.IsEnum) + { + return Enum.Parse(type, value.ToString(), ignoreCase: true); + } + else if (type.IsArray) + { + return DeserializeArray(type, (JsonArray)value); + } + else if (typeDetails.IsList) + { + return DeserializeList(type, (JsonArray)value); + } + else + { + var contract = JsonModelCache.Get(type); + + return DeserializeObject(contract, (JsonObject)value); + } + } + + internal Array DeserializeArray(Type type, JsonArray elements) + { + var elementType = type.GetElementType(); + + var elementTypeDetails = TypeDetails.Get(elementType); + + var array = Array.CreateInstance(elementType, elements.Count); + + int i = 0; + + if (elementTypeDetails.JsonConverter != null) + { + foreach (var value in elements) + { + array.SetValue(elementTypeDetails.JsonConverter.FromJson(value), i); + + i++; + } + } + else + { + foreach (var value in elements) + { + array.SetValue(DeserializeValue(elementType, value), i); + + i++; + } + } + + return array; + } + + internal IList DeserializeList(Type type, JsonArray jsonArray) + { + // TODO: Handle non-generic types + if (!type.IsGenericType) + throw new ArgumentException("Must be a generic type", nameof(type)); + + var elementType = type.GetGenericArguments()[0]; + + IList list; + + if (type.IsInterface) + { + // Create a concrete generic list + list = (IList)Activator.CreateInstance(typeof(List<>).MakeGenericType(elementType)); + } + else + { + list = (IList)Activator.CreateInstance(type); + } + + foreach (var value in jsonArray) + { + list.Add(DeserializeValue(elementType, value)); + } + + return list; + } + + #endregion + + #region Serialization + + internal JsonNode Serialize(object instance) => + Serialize(instance, SerializationOptions.Default); + + internal JsonNode Serialize(object instance, string[] include) => + Serialize(instance, new SerializationOptions { Include = include }); + + internal JsonNode Serialize(object instance, SerializationOptions options) + { + this.options = options; + + if (instance == null) + { + return XNull.Instance; + } + + return ReadValue(instance.GetType(), instance); + } + + #region Readers + + internal JsonArray ReadArray(IEnumerable collection) + { + var array = new XNodeArray(); + + foreach (var item in collection) + { + array.Add(ReadValue(item.GetType(), item)); + } + + return array; + } + + internal IEnumerable> ReadProperties(object instance) + { + var contract = JsonModelCache.Get(instance.GetType()); + + foreach (var member in contract.Members) + { + string name = member.Name; + + if (options.PropertyNameTransformer != null) + { + name = options.PropertyNameTransformer.Invoke(name); + } + + // Skip the field if it's not included + if ((depth == 1 && !options.IsIncluded(name))) + { + continue; + } + + var value = member.GetValue(instance); + + if (!member.EmitDefaultValue && (value == null || (member.IsList && ((IList)value).Count == 0) || value.Equals(member.DefaultValue))) + { + continue; + } + else if (options.IgnoreNullValues && value == null) // Ignore null values + { + continue; + } + + // Transform the value if there is one + if (options.Transformations != null) + { + var transform = options.GetTransformation(name); + + if (transform != null) + { + value = transform.Transformer(value); + } + } + + yield return new KeyValuePair(name, ReadValue(member.TypeDetails, value)); + } + } + + private JsonObject ReadObject(object instance) + { + depth++; + + // TODO: Guard against a self referencing graph + if (depth > options.MaxDepth) + { + depth--; + + return new JsonObject(); + } + + var node = new JsonObject(ReadProperties(instance)); + + depth--; + + return node; + } + + private JsonNode ReadValue(Type type, object value) + { + if (value == null) + { + return XNull.Instance; + } + + var member = TypeDetails.Get(type); + + return ReadValue(member, value); + } + + private JsonNode ReadValue(TypeDetails type, object value) + { + if (value == null) + { + return XNull.Instance; + } + + if (type.JsonConverter != null) + { + return type.JsonConverter.ToJson(value); + } + else if (type.IsArray) + { + switch (Type.GetTypeCode(type.ElementType)) + { + case TypeCode.String: return CreateArray((string[])value); + case TypeCode.UInt16: return CreateArray((ushort[])value); + case TypeCode.UInt32: return CreateArray((uint[])value); + case TypeCode.UInt64: return CreateArray((ulong[])value); + case TypeCode.Int16: return CreateArray((short[])value); + case TypeCode.Int32: return CreateArray((int[])value); + case TypeCode.Int64: return CreateArray((long[])value); + case TypeCode.Single: return CreateArray((float[])value); + case TypeCode.Double: return CreateArray((double[])value); + default: return ReadArray((IEnumerable)value); + } + } + else if (value is IEnumerable) + { + if (type.IsList && type.ElementType != null) + { + switch (Type.GetTypeCode(type.ElementType)) + { + case TypeCode.String: return CreateList(value); + case TypeCode.UInt16: return CreateList(value); + case TypeCode.UInt32: return CreateList(value); + case TypeCode.UInt64: return CreateList(value); + case TypeCode.Int16: return CreateList(value); + case TypeCode.Int32: return CreateList(value); + case TypeCode.Int64: return CreateList(value); + case TypeCode.Single: return CreateList(value); + case TypeCode.Double: return CreateList(value); + } + } + + return ReadArray((IEnumerable)value); + } + else + { + // Complex object + return ReadObject(value); + } + } + + private XList CreateList(object value) => new XList((IList)value); + + private XImmutableArray CreateArray(T[] array) => new XImmutableArray(array); + + #endregion + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/runtime/Serialization/PropertyTransformation.cs b/swaggerci/eventgrid/generated/runtime/Serialization/PropertyTransformation.cs new file mode 100644 index 000000000000..949a78665758 --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/Serialization/PropertyTransformation.cs @@ -0,0 +1,21 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json +{ + internal class PropertyTransformation + { + internal PropertyTransformation(string name, Func transformer) + { + Name = name ?? throw new ArgumentNullException(nameof(name)); + Transformer = transformer ?? throw new ArgumentNullException(nameof(transformer)); + } + + internal string Name { get; } + + internal Func Transformer { get; } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/runtime/Serialization/SerializationOptions.cs b/swaggerci/eventgrid/generated/runtime/Serialization/SerializationOptions.cs new file mode 100644 index 000000000000..a4fb8f363d12 --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/Serialization/SerializationOptions.cs @@ -0,0 +1,65 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Linq; + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json +{ + internal class SerializationOptions + { + internal static readonly SerializationOptions Default = new SerializationOptions(); + + internal SerializationOptions() { } + + internal SerializationOptions( + string[] include = null, + bool ingoreNullValues = false) + { + Include = include; + IgnoreNullValues = ingoreNullValues; + } + + internal string[] Include { get; set; } + + internal string[] Exclude { get; set; } + + internal bool IgnoreNullValues { get; set; } + + internal PropertyTransformation[] Transformations { get; set; } + + internal Func PropertyNameTransformer { get; set; } + + internal int MaxDepth { get; set; } = 5; + + internal bool IsIncluded(string name) + { + if (Exclude != null) + { + return !Exclude.Any(exclude => exclude.Equals(name, StringComparison.OrdinalIgnoreCase)); + } + else if (Include != null) + { + return Include.Any(exclude => exclude.Equals(name, StringComparison.OrdinalIgnoreCase)); + } + + return true; + } + + internal PropertyTransformation GetTransformation(string propertyName) + { + if (Transformations == null) return null; + + foreach (var t in Transformations) + { + if (t.Name.Equals(propertyName, StringComparison.OrdinalIgnoreCase)) + { + return t; + } + } + + return null; + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/runtime/SerializationMode.cs b/swaggerci/eventgrid/generated/runtime/SerializationMode.cs new file mode 100644 index 000000000000..c153489abeaf --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/SerializationMode.cs @@ -0,0 +1,16 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime +{ + [System.Flags] + public enum SerializationMode + { + None = 0, + IncludeHeaders = 1 << 0, + IncludeReadOnly = 1 << 1, + + IncludeAll = IncludeHeaders | IncludeReadOnly + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/runtime/TypeConverterExtensions.cs b/swaggerci/eventgrid/generated/runtime/TypeConverterExtensions.cs new file mode 100644 index 000000000000..0e86bee20932 --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/TypeConverterExtensions.cs @@ -0,0 +1,211 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System.IO; +using System.Linq; +using System.Xml; +using System.Xml.Serialization; + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.PowerShell +{ + internal static class TypeConverterExtensions + { + internal static T[] SelectToArray(object source, System.Func converter) + { + // null begets null + if (source == null) + { + return null; + } + + // single values and strings are just encapsulated in the array. + if (source is string || !(source is System.Collections.IEnumerable)) + { + try + { + return new T[] { (T)converter(source) }; + } +#if DEBUG + catch (System.Exception E) + { + System.Console.Error.WriteLine($"{E.GetType().Name}/{E.Message}/{E.StackTrace}"); + } +#else + catch + { + // silent conversion fail + } +#endif + return new T[0]; // empty result if couldn't convert. + } + + var result = new System.Collections.Generic.List(); + foreach (var each in (System.Collections.IEnumerable)source) + { + try + { + result.Add((T)converter(each)); + } +#if DEBUG + catch (System.Exception E) + { + System.Console.Error.WriteLine($"{E.GetType().Name}/{E.Message}/{E.StackTrace}"); + } +#else + catch + { + // silent conversion fail + } +#endif + } + return result.ToArray(); + } + + internal static System.Collections.Generic.IEnumerable GetPropertyKeys(this System.Collections.Generic.IDictionary dictionary) + { + if (null != dictionary) + { + foreach (var each in dictionary.Keys) + { + yield return each; + } + } + } + internal static System.Collections.Generic.IEnumerable GetPropertyKeys(this System.Collections.IDictionary dictionary) + { + if (null != dictionary) + { + foreach (var each in dictionary.Keys) + { + yield return each; + } + } + } + internal static System.Collections.Generic.IEnumerable GetPropertyKeys(this System.Management.Automation.PSObject instance) + { + if (null != instance) + { + foreach (var each in instance.Properties) + { + yield return each; + } + } + } + + internal static System.Collections.Generic.IEnumerable> GetFilteredProperties(this System.Collections.Generic.IDictionary instance, global::System.Collections.Generic.HashSet exclusions = null, global::System.Collections.Generic.HashSet inclusions = null) + { + return (null == instance || instance.Count == 0) ? + Enumerable.Empty>() : + instance.Keys + .Where(key => + !(true == exclusions?.Contains(key?.ToString())) + && (false != inclusions?.Contains(key?.ToString()))) + .Select(key => new System.Collections.Generic.KeyValuePair(key, instance[key])); + } + + internal static System.Collections.Generic.IEnumerable> GetFilteredProperties(this System.Collections.IDictionary instance, global::System.Collections.Generic.HashSet exclusions = null, global::System.Collections.Generic.HashSet inclusions = null) + { + return (null == instance || instance.Count == 0) ? + Enumerable.Empty>() : + instance.Keys.OfType() + .Where(key => + !(true == exclusions?.Contains(key?.ToString())) + && (false != inclusions?.Contains(key?.ToString()))) + .Select(key => new System.Collections.Generic.KeyValuePair(key, instance[key])); + } + + internal static System.Collections.Generic.IEnumerable> GetFilteredProperties(this System.Management.Automation.PSObject instance, global::System.Collections.Generic.HashSet exclusions = null, global::System.Collections.Generic.HashSet inclusions = null) + { + // new global::System.Collections.Generic.HashSet(System.StringComparer.InvariantCultureIgnoreCase) + return (null == instance || !instance.Properties.Any()) ? + Enumerable.Empty>() : + instance.Properties + .Where(property => + !(true == exclusions?.Contains(property.Name)) + && (false != inclusions?.Contains(property.Name))) + .Select(property => new System.Collections.Generic.KeyValuePair(property.Name, property.Value)); + } + + + internal static T GetValueForProperty(this System.Collections.Generic.IDictionary dictionary, string propertyName, T defaultValue, System.Func converter) + { + try + { + var key = System.Linq.Enumerable.FirstOrDefault(dictionary.Keys, each => System.String.Equals(each.ToString(), propertyName, System.StringComparison.CurrentCultureIgnoreCase)); + return key == null ? defaultValue : (T)converter(dictionary[key]); + } +#if DEBUG + catch (System.Exception E) + { + System.Console.Error.WriteLine($"{E.GetType().Name}/{E.Message}/{E.StackTrace}"); + } +#else + catch + { + } +#endif + return defaultValue; + } + internal static T GetValueForProperty(this System.Collections.IDictionary dictionary, string propertyName, T defaultValue, System.Func converter) + { + try + { + var key = System.Linq.Enumerable.FirstOrDefault(dictionary.Keys.OfType(), each => System.String.Equals(each.ToString(), propertyName, System.StringComparison.CurrentCultureIgnoreCase)); + return key == null ? defaultValue : (T)converter(dictionary[key]); + } +#if DEBUG + catch (System.Exception E) + { + System.Console.Error.WriteLine($"{E.GetType().Name}/{E.Message}/{E.StackTrace}"); + } +#else + catch + { + } +#endif + return defaultValue; + } + + internal static T GetValueForProperty(this System.Management.Automation.PSObject psObject, string propertyName, T defaultValue, System.Func converter) + { + try + { + var property = System.Linq.Enumerable.FirstOrDefault(psObject.Properties, each => System.String.Equals(each.Name.ToString(), propertyName, System.StringComparison.CurrentCultureIgnoreCase)); + return property == null ? defaultValue : (T)converter(property.Value); + } +#if DEBUG + catch (System.Exception E) + { + System.Console.Error.WriteLine($"{E.GetType().Name}/{E.Message}/{E.StackTrace}"); + } +#else + catch + { + } +#endif + return defaultValue; + } + + internal static bool Contains(this System.Management.Automation.PSObject psObject, string propertyName) + { + bool result = false; + try + { + var property = System.Linq.Enumerable.FirstOrDefault(psObject.Properties, each => System.String.Equals(each.Name.ToString(), propertyName, System.StringComparison.CurrentCultureIgnoreCase)); + result = property == null ? false : true; + } +#if DEBUG + catch (System.Exception E) + { + System.Console.Error.WriteLine($"{E.GetType().Name}/{E.Message}/{E.StackTrace}"); + } +#else + catch + { + } +#endif + return result; + } + } +} diff --git a/swaggerci/eventgrid/generated/runtime/UndeclaredResponseException.cs b/swaggerci/eventgrid/generated/runtime/UndeclaredResponseException.cs new file mode 100644 index 000000000000..7197390115cb --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/UndeclaredResponseException.cs @@ -0,0 +1,112 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime +{ + using System; + using System.Net.Http; + using System.Net.Http.Headers; + using static Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Extensions; + + public class RestException : Exception, IDisposable + { + public System.Net.HttpStatusCode StatusCode { get; set; } + public string Code { get; protected set; } + protected string message; + public HttpRequestMessage RequestMessage { get; protected set; } + public HttpResponseHeaders ResponseHeaders { get; protected set; } + + public string ResponseBody { get; protected set; } + public string ClientRequestId { get; protected set; } + public string RequestId { get; protected set; } + + public override string Message => message; + public string Action { get; protected set; } + + public RestException(System.Net.Http.HttpResponseMessage response) + { + StatusCode = response.StatusCode; + //CloneWithContent will not work here since the content is disposed after sendAsync + //Besides, it seems there is no need for the request content cloned here. + RequestMessage = response.RequestMessage.Clone(); + ResponseBody = response.Content.ReadAsStringAsync().Result; + ResponseHeaders = response.Headers; + + RequestId = response.GetFirstHeader("x-ms-request-id"); + ClientRequestId = response.GetFirstHeader("x-ms-client-request-id"); + + try + { + // try to parse the body as JSON, and see if a code and message are in there. + var json = Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonNode.Parse(ResponseBody) as Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json.JsonObject; + + // error message could be in properties.statusMessage + { message = If(json?.Property("properties"), out var p) + && If(p?.PropertyT("statusMessage"), out var sm) + ? (string)sm : (string)Message; } + + // see if there is an error block in the body + json = json?.Property("error") ?? json; + + { Code = If(json?.PropertyT("code"), out var c) ? (string)c : (string)StatusCode.ToString(); } + { message = If(json?.PropertyT("message"), out var m) ? (string)m : (string)Message; } + { Action = If(json?.PropertyT("action"), out var a) ? (string)a : (string)Action; } + } +#if DEBUG + catch (System.Exception E) + { + System.Console.Error.WriteLine($"{E.GetType().Name}/{E.Message}/{E.StackTrace}"); + } +#else + catch + { + // couldn't get the code/message from the body response. + // In this case, we will assume the response is the expected error message + if(!string.IsNullOrEmpty(ResponseBody)) { + message = ResponseBody; + } + } +#endif + if (string.IsNullOrEmpty(message)) + { + if (StatusCode >= System.Net.HttpStatusCode.BadRequest && StatusCode < System.Net.HttpStatusCode.InternalServerError) + { + message = $"The server responded with a Request Error, Status: {StatusCode}"; + } + else if (StatusCode >= System.Net.HttpStatusCode.InternalServerError) + { + message = $"The server responded with a Server Error, Status: {StatusCode}"; + } + else + { + message = $"The server responded with an unrecognized response, Status: {StatusCode}"; + } + } + } + + public void Dispose() + { + ((IDisposable)RequestMessage).Dispose(); + } + } + + public class RestException : RestException + { + public T Error { get; protected set; } + public RestException(System.Net.Http.HttpResponseMessage response, T error) : base(response) + { + Error = error; + } + } + + + public class UndeclaredResponseException : RestException + { + public UndeclaredResponseException(System.Net.Http.HttpResponseMessage response) : base(response) + { + + } + } +} \ No newline at end of file diff --git a/swaggerci/eventgrid/generated/runtime/Writers/JsonWriter.cs b/swaggerci/eventgrid/generated/runtime/Writers/JsonWriter.cs new file mode 100644 index 000000000000..38a9e584036a --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/Writers/JsonWriter.cs @@ -0,0 +1,223 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.IO; +using System.Web; + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.Json +{ + internal class JsonWriter + { + const string indentation = " "; // 2 spaces + + private readonly bool pretty; + private readonly TextWriter writer; + + protected int currentLevel = 0; + + internal JsonWriter(TextWriter writer, bool pretty = true) + { + this.writer = writer ?? throw new ArgumentNullException(nameof(writer)); + this.pretty = pretty; + } + + internal void WriteNode(JsonNode node) + { + switch (node.Type) + { + case JsonType.Array: WriteArray((IEnumerable)node); break; + case JsonType.Object: WriteObject((JsonObject)node); break; + + // Primitives + case JsonType.Binary: WriteBinary((XBinary)node); break; + case JsonType.Boolean: WriteBoolean((bool)node); break; + case JsonType.Date: WriteDate((JsonDate)node); break; + case JsonType.Null: WriteNull(); break; + case JsonType.Number: WriteNumber((JsonNumber)node); break; + case JsonType.String: WriteString(node); break; + } + } + + internal void WriteArray(IEnumerable array) + { + currentLevel++; + + writer.Write('['); + + bool doIndentation = false; + + if (pretty) + { + foreach (var node in array) + { + if (node.Type == JsonType.Object || node.Type == JsonType.Array) + { + doIndentation = true; + + break; + } + } + } + + bool isFirst = true; + + foreach (JsonNode node in array) + { + if (!isFirst) writer.Write(','); + + if (doIndentation) + { + WriteIndent(); + } + else if (pretty) + { + writer.Write(' '); + } + + WriteNode(node); + + isFirst = false; + } + + currentLevel--; + + if (doIndentation) + { + WriteIndent(); + } + else if (pretty) + { + writer.Write(' '); + } + + writer.Write(']'); + } + + internal void WriteIndent() + { + if (pretty) + { + writer.Write(Environment.NewLine); + + for (int level = 0; level < currentLevel; level++) + { + writer.Write(indentation); + } + } + } + + internal void WriteObject(JsonObject obj) + { + currentLevel++; + + writer.Write('{'); + + bool isFirst = true; + + foreach (var field in obj) + { + if (!isFirst) writer.Write(','); + + WriteIndent(); + + WriteFieldName(field.Key); + + writer.Write(':'); + + if (pretty) + { + writer.Write(' '); + } + + // Write the field value + WriteNode(field.Value); + + isFirst = false; + } + + currentLevel--; + + WriteIndent(); + + writer.Write('}'); + } + + internal void WriteFieldName(string fieldName) + { + writer.Write('"'); + writer.Write(HttpUtility.JavaScriptStringEncode(fieldName)); + writer.Write('"'); + } + + #region Primitives + + internal void WriteBinary(XBinary value) + { + writer.Write('"'); + writer.Write(value.ToString()); + writer.Write('"'); + } + + internal void WriteBoolean(bool value) + { + writer.Write(value ? "true" : "false"); + } + + internal void WriteDate(JsonDate date) + { + if (date.ToDateTime().Year == 1) + { + WriteNull(); + } + else + { + writer.Write('"'); + writer.Write(date.ToIsoString()); + writer.Write('"'); + } + } + + internal void WriteNull() + { + writer.Write("null"); + } + + internal void WriteNumber(JsonNumber number) + { + if (number.Overflows) + { + writer.Write('"'); + writer.Write(number.Value); + writer.Write('"'); + } + else + { + writer.Write(number.Value); + } + } + + internal void WriteString(string text) + { + if (text == null) + { + WriteNull(); + } + else + { + writer.Write('"'); + + writer.Write(HttpUtility.JavaScriptStringEncode(text)); + + writer.Write('"'); + } + } + + #endregion + } +} + + +// TODO: Replace with System.Text.Json when available diff --git a/swaggerci/eventgrid/generated/runtime/delegates.cs b/swaggerci/eventgrid/generated/runtime/delegates.cs new file mode 100644 index 000000000000..a3816213034d --- /dev/null +++ b/swaggerci/eventgrid/generated/runtime/delegates.cs @@ -0,0 +1,23 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +namespace Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime +{ + using System; + using System.Collections; + using System.Collections.Generic; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + using GetEventData=System.Func; + + public delegate Task SendAsync(HttpRequestMessage request, IEventListener callback); + public delegate Task SendAsyncStep(HttpRequestMessage request, IEventListener callback, ISendAsync next); + public delegate Task SignalEvent(string id, CancellationToken token, GetEventData getEventData); + public delegate Task Event(EventData message); + public delegate void SynchEvent(EventData message); + public delegate Task OnResponse(Response message); + public delegate Task OnResponse(Response message); +} \ No newline at end of file diff --git a/swaggerci/eventgrid/how-to.md b/swaggerci/eventgrid/how-to.md new file mode 100644 index 000000000000..4c1c75d4ed96 --- /dev/null +++ b/swaggerci/eventgrid/how-to.md @@ -0,0 +1,58 @@ +# How-To +This document describes how to develop for `Az.EventGrid`. + +## Building `Az.EventGrid` +To build, run the `build-module.ps1` at the root of the module directory. This will generate the proxy script cmdlets that are the cmdlets being exported by this module. After the build completes, the proxy script cmdlets will be output to the `exports` folder. To read more about the proxy script cmdlets, look at the [README.md](exports/README.md) in the `exports` folder. + +## Creating custom cmdlets +To add cmdlets that were not generated by the REST specification, use the `custom` folder. This folder allows you to add handwritten `.ps1` and `.cs` files. Currently, we support using `.ps1` scripts as new cmdlets or as additional low-level variants (via `ParameterSet`), and `.cs` files as low-level (variants) cmdlets that the exported script cmdlets call. We do not support exporting any `.cs` (dll) cmdlets directly. To read more about custom cmdlets, look at the [README.md](custom/README.md) in the `custom` folder. + +## Generating documentation +To generate documentation, the process is now integrated into the `build-module.ps1` script. If you don't want to run this process as part of `build-module.ps1`, you can provide the `-NoDocs` switch. If you want to run documentation generation after the build process, you may still run the `generate-help.ps1` script. Overall, the process will look at the documentation comments in the generated and custom cmdlets and types, and create `.md` files into the `docs` folder. Additionally, this pulls in any examples from the `examples` folder and adds them to the generated help markdown documents. To read more about examples, look at the [README.md](examples/README.md) in the `examples` folder. To read more about documentation, look at the [README.md](docs/README.md) in the `docs` folder. + +## Testing `Az.EventGrid` +To test the cmdlets, we use [Pester](https://github.com/pester/Pester). Tests scripts (`.ps1`) should be added to the `test` folder. To execute the Pester tests, run the `test-module.ps1` script. This will run all tests in `playback` mode within the `test` folder. To read more about testing cmdlets, look at the [README.md](examples/README.md) in the `examples` folder. + +## Packing `Az.EventGrid` +To pack `Az.EventGrid` for distribution, run the `pack-module.ps1` script. This will take the contents of multiple directories and certain root-folder files to create a `.nupkg`. The structure of the `.nupkg` is created so it can be loaded part of a [PSRepository](https://docs.microsoft.com/powershell/module/powershellget/register-psrepository). Additionally, this package is in a format for distribution to the [PSGallery](https://www.powershellgallery.com/). For signing an Azure module, please contact the [Azure PowerShell](https://github.com/Azure/azure-powershell) team. + +## Module Script Details +There are multiple scripts created for performing different actions for developing `Az.EventGrid`. +- `build-module.ps1` + - Builds the module DLL (`./bin/Az.EventGrid.private.dll`), creates the exported cmdlets and documentation, generates custom cmdlet test stubs and exported cmdlet example stubs, and updates `./Az.EventGrid.psd1` with Azure profile information. + - **Parameters**: [`Switch` parameters] + - `-Run`: After building, creates an isolated PowerShell session and loads `Az.EventGrid`. + - `-Test`: After building, runs the `Pester` tests defined in the `test` folder. + - `-Docs`: After building, generates the Markdown documents for the modules into the `docs` folder. + - `-Pack`: After building, packages the module into a `.nupkg`. + - `-Code`: After building, opens a VSCode window with the module's directory and runs (see `-Run`) the module. + - `-Release`: Builds the module in `Release` configuration (as opposed to `Debug` configuration). + - `-NoDocs`: Supresses writing the documentation markdown files as part of the cmdlet exporting process. + - `-Debugger`: Used when attaching the debugger in Visual Studio to the PowerShell session, and running the build process without recompiling the DLL. This suppresses running the script as an isolated process. +- `run-module.ps1` + - Creates an isolated PowerShell session and loads `Az.EventGrid` into the session. + - Same as `-Run` in `build-module.ps1`. + - **Parameters**: [`Switch` parameters] + - `-Code`: Opens a VSCode window with the module's directory. + - Same as `-Code` in `build-module.ps1`. +- `generate-help.ps1` + - Generates the Markdown documents for the modules into the `docs` folder. + - Same as `-Docs` in `build-module.ps1`. +- `test-module.ps1` + - Runs the `Pester` tests defined in the `test` folder. + - Same as `-Test` in `build-module.ps1`. +- `pack-module.ps1` + - Packages the module into a `.nupkg` for distribution. + - Same as `-Pack` in `build-module.ps1`. +- `generate-help.ps1` + - Generates the Markdown documents for the modules into the `docs` folder. + - Same as `-Docs` in `build-module.ps1`. + - This process is now integrated into `build-module.ps1` automatically. To disable, use `-NoDocs` when running `build-module.ps1`. +- `export-surface.ps1` + - Generates Markdown documents for both the cmdlet surface and the model (class) surface of the module. + - These files are placed into the `resources` folder. + - Used for investigating the surface of your module. These are *not* documentation for distribution. +- `check-dependencies.ps1` + - Used in `run-module.ps1` and `test-module.ps1` to verify dependent modules are available to run those tasks. + - It will download local (within the module's directory structure) versions of those modules as needed. + - This script *does not* need to be ran by-hand. \ No newline at end of file diff --git a/swaggerci/eventgrid/internal/Az.EventGrid.internal.psm1 b/swaggerci/eventgrid/internal/Az.EventGrid.internal.psm1 new file mode 100644 index 000000000000..6bd338ddf46e --- /dev/null +++ b/swaggerci/eventgrid/internal/Az.EventGrid.internal.psm1 @@ -0,0 +1,38 @@ +# region Generated + # Load the private module dll + $null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '../bin/Az.EventGrid.private.dll') + + # Get the private module's instance + $instance = [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module]::Instance + + # Export nothing to clear implicit exports + Export-ModuleMember + + # Export proxy cmdlet scripts + $exportsPath = $PSScriptRoot + $directories = Get-ChildItem -Directory -Path $exportsPath + $profileDirectory = $null + if($instance.ProfileName) { + if(($directories | ForEach-Object { $_.Name }) -contains $instance.ProfileName) { + $profileDirectory = $directories | Where-Object { $_.Name -eq $instance.ProfileName } + } else { + # Don't export anything if the profile doesn't exist for the module + $exportsPath = $null + Write-Warning "Selected Azure profile '$($instance.ProfileName)' does not exist for module '$($instance.Name)'. No cmdlets were loaded." + } + } elseif(($directories | Measure-Object).Count -gt 0) { + # Load the last folder if no profile is selected + $profileDirectory = $directories | Select-Object -Last 1 + } + + if($profileDirectory) { + Write-Information "Loaded Azure profile '$($profileDirectory.Name)' for module '$($instance.Name)'" + $exportsPath = $profileDirectory.FullName + } + + if($exportsPath) { + Get-ChildItem -Path $exportsPath -Recurse -Include '*.ps1' -File | ForEach-Object { . $_.FullName } + $cmdletNames = Get-ScriptCmdlet -ScriptFolder $exportsPath + Export-ModuleMember -Function $cmdletNames -Alias (Get-ScriptCmdlet -ScriptFolder $exportsPath -AsAlias) + } +# endregion diff --git a/swaggerci/eventgrid/internal/Get-AzEventGridOperation.ps1 b/swaggerci/eventgrid/internal/Get-AzEventGridOperation.ps1 new file mode 100644 index 000000000000..14c75eb2e729 --- /dev/null +++ b/swaggerci/eventgrid/internal/Get-AzEventGridOperation.ps1 @@ -0,0 +1,122 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +List the available operations supported by the Microsoft.EventGrid resource provider. +.Description +List the available operations supported by the Microsoft.EventGrid resource provider. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperation +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgridoperation +#> +function Get-AzEventGridOperation { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperation])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + $mapping = @{ + List = 'Az.EventGrid.private\Get-AzEventGridOperation_List'; + } + + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + + throw + } + +} +end { + try { + $steppablePipeline.End() + + } catch { + + throw + } +} +} diff --git a/swaggerci/eventgrid/internal/ProxyCmdletDefinitions.ps1 b/swaggerci/eventgrid/internal/ProxyCmdletDefinitions.ps1 new file mode 100644 index 000000000000..14c75eb2e729 --- /dev/null +++ b/swaggerci/eventgrid/internal/ProxyCmdletDefinitions.ps1 @@ -0,0 +1,122 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +List the available operations supported by the Microsoft.EventGrid resource provider. +.Description +List the available operations supported by the Microsoft.EventGrid resource provider. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperation +.Link +https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/get-azeventgridoperation +#> +function Get-AzEventGridOperation { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Models.Api20211015Preview.IOperation])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + $mapping = @{ + List = 'Az.EventGrid.private\Get-AzEventGridOperation_List'; + } + + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + + throw + } + +} +end { + try { + $steppablePipeline.End() + + } catch { + + throw + } +} +} diff --git a/swaggerci/eventgrid/internal/README.md b/swaggerci/eventgrid/internal/README.md new file mode 100644 index 000000000000..b3d6b31a18a5 --- /dev/null +++ b/swaggerci/eventgrid/internal/README.md @@ -0,0 +1,14 @@ +# Internal +This directory contains a module to handle *internal only* cmdlets. Cmdlets that you **hide** in configuration are created here. For more information on hiding, see [cmdlet hiding](https://github.com/Azure/autorest.powershell/blob/main/docs/directives.md#cmdlet-hiding-exportation-suppression). The cmdlets in this directory are generated at **build-time**. Do not put any custom code, files, cmdlets, etc. into this directory. Please use `../custom` for all custom implementation. + +## Info +- Modifiable: no +- Generated: all +- Committed: no +- Packaged: yes + +## Details +The `Az.EventGrid.internal.psm1` file is generated to this folder. This module file handles the hidden cmdlets. These cmdlets will not be exported by `Az.EventGrid`. Instead, this sub-module is imported by the `../custom/Az.EventGrid.custom.psm1` module, allowing you to use hidden cmdlets in your custom, exposed cmdlets. To call these cmdlets in your custom scripts, simply use [module-qualified calls](https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_command_precedence?view=powershell-6#qualified-names). For example, `Az.EventGrid.internal\Get-Example` would call an internal cmdlet named `Get-Example`. + +## Purpose +This allows you to include REST specifications for services that you *do not wish to expose from your module*, but simply want to call within custom cmdlets. For example, if you want to make a custom cmdlet that uses `Storage` services, you could include a simplified `Storage` REST specification that has only the operations you need. When you run the generator and build this module, note the generated `Storage` cmdlets. Then, in your readme configuration, use [cmdlet hiding](https://github.com/Azure/autorest/blob/master/docs/powershell/options.md#cmdlet-hiding-exportation-suppression) on the `Storage` cmdlets and they will *only be exposed to the custom cmdlets* you want to write, and not be exported as part of `Az.EventGrid`. diff --git a/swaggerci/eventgrid/license.txt b/swaggerci/eventgrid/license.txt new file mode 100644 index 000000000000..b9f3180fb9af --- /dev/null +++ b/swaggerci/eventgrid/license.txt @@ -0,0 +1,227 @@ +MICROSOFT SOFTWARE LICENSE TERMS + +MICROSOFT AZURE POWERSHELL + +These license terms are an agreement between Microsoft Corporation (or based on where you live, one of its affiliates) and you. Please read them. They apply to the software named above, which includes the media on which you received it, if any. + +BY USING THE SOFTWARE, YOU ACCEPT THESE TERMS. IF YOU DO NOT ACCEPT THEM, DO NOT USE THE SOFTWARE. + + +-----------------START OF LICENSE-------------------------- + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +-------------------END OF LICENSE------------------------------------------ + + +----------------START OF THIRD PARTY NOTICE-------------------------------- + + +The software includes the AutoMapper library ("AutoMapper"). The MIT License set out below is provided for informational purposes only. It is not the license that governs any part of the software. + +Provided for Informational Purposes Only + +AutoMapper + +The MIT License (MIT) +Copyright (c) 2010 Jimmy Bogard + + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + + + + + +*************** + +The software includes Newtonsoft.Json. The MIT License set out below is provided for informational purposes only. It is not the license that governs any part of the software. + +Newtonsoft.Json + +The MIT License (MIT) +Copyright (c) 2007 James Newton-King +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +-------------END OF THIRD PARTY NOTICE---------------------------------------- + diff --git a/swaggerci/eventgrid/pack-module.ps1 b/swaggerci/eventgrid/pack-module.ps1 new file mode 100644 index 000000000000..8ed48957e579 --- /dev/null +++ b/swaggerci/eventgrid/pack-module.ps1 @@ -0,0 +1,9 @@ +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- +Write-Host -ForegroundColor Green 'Packing module...' +dotnet pack $PSScriptRoot --no-build /nologo +Write-Host -ForegroundColor Green '-------------Done-------------' \ No newline at end of file diff --git a/swaggerci/eventgrid/readme.md b/swaggerci/eventgrid/readme.md new file mode 100644 index 000000000000..68150ef64523 --- /dev/null +++ b/swaggerci/eventgrid/readme.md @@ -0,0 +1,10 @@ +### AutoRest Configuration +> see https://aka.ms/autorest + +``` yaml +require: + - $(this-folder)/../../tools/SwaggerCI/readme.azure.noprofile.md + - $(this-folder)/../../../azure-rest-api-specs/specification/eventgrid/resource-manager/readme.md +try-require: + - $(this-folder)/../../../azure-rest-api-specs/specification/eventgrid/resource-manager/readme.powershell.md +``` diff --git a/swaggerci/eventgrid/resources/README.md b/swaggerci/eventgrid/resources/README.md new file mode 100644 index 000000000000..736492341e3d --- /dev/null +++ b/swaggerci/eventgrid/resources/README.md @@ -0,0 +1,11 @@ +# Resources +This directory can contain any additional resources for module that are not required at runtime. This directory **does not** get packaged with the module. If you have assets for custom implementation, place them into the `../custom` folder. + +## Info +- Modifiable: yes +- Generated: no +- Committed: yes +- Packaged: no + +## Purpose +Use this folder to put anything you want to keep around as part of the repository for the module, but is not something that is required for the module. For example, development files, packaged builds, or additional information. This is only intended to be used in repositories where the module's output directory is cleaned, but tangential resources for the module want to remain intact. \ No newline at end of file diff --git a/swaggerci/eventgrid/run-module.ps1 b/swaggerci/eventgrid/run-module.ps1 new file mode 100644 index 000000000000..983a205f5688 --- /dev/null +++ b/swaggerci/eventgrid/run-module.ps1 @@ -0,0 +1,54 @@ +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- +param([switch]$Isolated, [switch]$Code) +$ErrorActionPreference = 'Stop' + +if(-not $Isolated) { + Write-Host -ForegroundColor Green 'Creating isolated process...' + $pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path + & "$pwsh" -NoExit -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -Isolated + return +} + +$isAzure = $true +if($isAzure) { + . (Join-Path $PSScriptRoot 'check-dependencies.ps1') -Isolated -Accounts + # Load the latest version of Az.Accounts installed + Import-Module -Name Az.Accounts -RequiredVersion (Get-Module -Name Az.Accounts -ListAvailable | Sort-Object -Property Version -Descending)[0].Version +} + +$localModulesPath = Join-Path $PSScriptRoot 'generated/modules' +if(Test-Path -Path $localModulesPath) { + $env:PSModulePath = "$localModulesPath$([IO.Path]::PathSeparator)$env:PSModulePath" +} + +$modulePsd1 = Get-Item -Path (Join-Path $PSScriptRoot './Az.EventGrid.psd1') +$modulePath = $modulePsd1.FullName +$moduleName = $modulePsd1.BaseName + +function Prompt { + Write-Host -NoNewline -ForegroundColor Green "PS $(Get-Location)" + Write-Host -NoNewline -ForegroundColor Gray ' [' + Write-Host -NoNewline -ForegroundColor White -BackgroundColor DarkCyan $moduleName + ']> ' +} + +# where we would find the launch.json file +$vscodeDirectory = New-Item -ItemType Directory -Force -Path (Join-Path $PSScriptRoot '.vscode') +$launchJson = Join-Path $vscodeDirectory 'launch.json' + +# if there is a launch.json file, let's just assume -Code, and update the file +if(($Code) -or (test-Path $launchJson) ) { + $launchContent = '{ "version": "0.2.0", "configurations":[{ "name":"Attach to PowerShell", "type":"coreclr", "request":"attach", "processId":"' + ([System.Diagnostics.Process]::GetCurrentProcess().Id) + '", "justMyCode":false }] }' + Set-Content -Path $launchJson -Value $launchContent + if($Code) { + # only launch vscode if they say -code + code $PSScriptRoot + } +} + +Import-Module -Name $modulePath \ No newline at end of file diff --git a/swaggerci/eventgrid/test-module.ps1 b/swaggerci/eventgrid/test-module.ps1 new file mode 100644 index 000000000000..4517789949db --- /dev/null +++ b/swaggerci/eventgrid/test-module.ps1 @@ -0,0 +1,86 @@ +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- +param([switch]$Isolated, [switch]$Live, [switch]$Record, [switch]$Playback, [switch]$RegenerateSupportModule, [switch]$UsePreviousConfigForRecord, [string[]]$TestName) +$ErrorActionPreference = 'Stop' + +if(-not $Isolated) +{ + Write-Host -ForegroundColor Green 'Creating isolated process...' + if ($PSBoundParameters.ContainsKey("TestName")) { + $PSBoundParameters["TestName"] = $PSBoundParameters["TestName"] -join "," + } + $pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path + & "$pwsh" -NonInteractive -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -Isolated + return +} + +# This is a workaround, since for string array parameter, pwsh -File will only take the first element +if ($PSBoundParameters.ContainsKey("TestName") -and ($TestName.count -eq 1) -and ($TestName[0].Contains(','))) { + $TestName = $TestName[0].Split(",") +} + +$ProgressPreference = 'SilentlyContinue' +$baseName = $PSScriptRoot.BaseName +$requireResourceModule = (($baseName -ne "Resources") -and ($Record.IsPresent -or $Live.IsPresent)) +. (Join-Path $PSScriptRoot 'check-dependencies.ps1') -Isolated -Accounts:$false -Pester -Resources:$requireResourceModule -RegenerateSupportModule:$RegenerateSupportModule +. ("$PSScriptRoot\test\utils.ps1") + +if ($requireResourceModule) +{ + # Load the latest Az.Accounts installed + Import-Module -Name Az.Accounts -RequiredVersion (Get-Module -Name Az.Accounts -ListAvailable | Sort-Object -Property Version -Descending)[0].Version + $resourceModulePSD = Get-Item -Path (Join-Path $HOME '.PSSharedModules\Resources\Az.Resources.TestSupport.psd1') + Import-Module -Name $resourceModulePSD.FullName +} + +$localModulesPath = Join-Path $PSScriptRoot 'generated/modules' +if(Test-Path -Path $localModulesPath) +{ + $env:PSModulePath = "$localModulesPath$([IO.Path]::PathSeparator)$env:PSModulePath" +} + +$modulePsd1 = Get-Item -Path (Join-Path $PSScriptRoot './Az.EventGrid.psd1') +$modulePath = $modulePsd1.FullName +$moduleName = $modulePsd1.BaseName + +Import-Module -Name Pester +Import-Module -Name $modulePath + +$TestMode = 'playback' +$ExcludeTag = @("LiveOnly") +if($Live) +{ + $TestMode = 'live' + $ExcludeTag = @() +} +if($Record) +{ + $TestMode = 'record' +} +try +{ + if ($TestMode -ne 'playback') + { + setupEnv + } + $testFolder = Join-Path $PSScriptRoot 'test' + if ($null -ne $TestName) + { + Invoke-Pester -Script @{ Path = $testFolder } -TestName $TestName -ExcludeTag $ExcludeTag -EnableExit -OutputFile (Join-Path $testFolder "$moduleName-TestResults.xml") + } else + { + Invoke-Pester -Script @{ Path = $testFolder } -ExcludeTag $ExcludeTag -EnableExit -OutputFile (Join-Path $testFolder "$moduleName-TestResults.xml") + } +} Finally +{ + if ($TestMode -ne 'playback') + { + cleanupEnv + } +} + +Write-Host -ForegroundColor Green '-------------Done-------------' \ No newline at end of file diff --git a/swaggerci/eventgrid/test/Get-AzEventGridChannel.Tests.ps1 b/swaggerci/eventgrid/test/Get-AzEventGridChannel.Tests.ps1 new file mode 100644 index 000000000000..f07b1dcd636e --- /dev/null +++ b/swaggerci/eventgrid/test/Get-AzEventGridChannel.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzEventGridChannel')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzEventGridChannel.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzEventGridChannel' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/Get-AzEventGridChannelFullUrl.Tests.ps1 b/swaggerci/eventgrid/test/Get-AzEventGridChannelFullUrl.Tests.ps1 new file mode 100644 index 000000000000..7c703525472a --- /dev/null +++ b/swaggerci/eventgrid/test/Get-AzEventGridChannelFullUrl.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzEventGridChannelFullUrl')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzEventGridChannelFullUrl.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzEventGridChannelFullUrl' { + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/Get-AzEventGridDomain.Tests.ps1 b/swaggerci/eventgrid/test/Get-AzEventGridDomain.Tests.ps1 new file mode 100644 index 000000000000..7790d51aca8c --- /dev/null +++ b/swaggerci/eventgrid/test/Get-AzEventGridDomain.Tests.ps1 @@ -0,0 +1,33 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzEventGridDomain')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzEventGridDomain.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzEventGridDomain' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'List1' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/Get-AzEventGridDomainEventSubscription.Tests.ps1 b/swaggerci/eventgrid/test/Get-AzEventGridDomainEventSubscription.Tests.ps1 new file mode 100644 index 000000000000..10d9f274c587 --- /dev/null +++ b/swaggerci/eventgrid/test/Get-AzEventGridDomainEventSubscription.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzEventGridDomainEventSubscription')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzEventGridDomainEventSubscription.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzEventGridDomainEventSubscription' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/Get-AzEventGridDomainEventSubscriptionDeliveryAttribute.Tests.ps1 b/swaggerci/eventgrid/test/Get-AzEventGridDomainEventSubscriptionDeliveryAttribute.Tests.ps1 new file mode 100644 index 000000000000..8aab1b48e36e --- /dev/null +++ b/swaggerci/eventgrid/test/Get-AzEventGridDomainEventSubscriptionDeliveryAttribute.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzEventGridDomainEventSubscriptionDeliveryAttribute')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzEventGridDomainEventSubscriptionDeliveryAttribute.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzEventGridDomainEventSubscriptionDeliveryAttribute' { + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/Get-AzEventGridDomainEventSubscriptionFullUrl.Tests.ps1 b/swaggerci/eventgrid/test/Get-AzEventGridDomainEventSubscriptionFullUrl.Tests.ps1 new file mode 100644 index 000000000000..ddcd96491b28 --- /dev/null +++ b/swaggerci/eventgrid/test/Get-AzEventGridDomainEventSubscriptionFullUrl.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzEventGridDomainEventSubscriptionFullUrl')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzEventGridDomainEventSubscriptionFullUrl.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzEventGridDomainEventSubscriptionFullUrl' { + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/Get-AzEventGridDomainSharedAccessKey.Tests.ps1 b/swaggerci/eventgrid/test/Get-AzEventGridDomainSharedAccessKey.Tests.ps1 new file mode 100644 index 000000000000..65bba8eeba48 --- /dev/null +++ b/swaggerci/eventgrid/test/Get-AzEventGridDomainSharedAccessKey.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzEventGridDomainSharedAccessKey')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzEventGridDomainSharedAccessKey.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzEventGridDomainSharedAccessKey' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/Get-AzEventGridDomainTopic.Tests.ps1 b/swaggerci/eventgrid/test/Get-AzEventGridDomainTopic.Tests.ps1 new file mode 100644 index 000000000000..5d70bfc59513 --- /dev/null +++ b/swaggerci/eventgrid/test/Get-AzEventGridDomainTopic.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzEventGridDomainTopic')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzEventGridDomainTopic.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzEventGridDomainTopic' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/Get-AzEventGridDomainTopicEventSubscription.Tests.ps1 b/swaggerci/eventgrid/test/Get-AzEventGridDomainTopicEventSubscription.Tests.ps1 new file mode 100644 index 000000000000..49080168467f --- /dev/null +++ b/swaggerci/eventgrid/test/Get-AzEventGridDomainTopicEventSubscription.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzEventGridDomainTopicEventSubscription')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzEventGridDomainTopicEventSubscription.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzEventGridDomainTopicEventSubscription' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/Get-AzEventGridDomainTopicEventSubscriptionDeliveryAttribute.Tests.ps1 b/swaggerci/eventgrid/test/Get-AzEventGridDomainTopicEventSubscriptionDeliveryAttribute.Tests.ps1 new file mode 100644 index 000000000000..e933a0492ff6 --- /dev/null +++ b/swaggerci/eventgrid/test/Get-AzEventGridDomainTopicEventSubscriptionDeliveryAttribute.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzEventGridDomainTopicEventSubscriptionDeliveryAttribute')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzEventGridDomainTopicEventSubscriptionDeliveryAttribute.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzEventGridDomainTopicEventSubscriptionDeliveryAttribute' { + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/Get-AzEventGridDomainTopicEventSubscriptionFullUrl.Tests.ps1 b/swaggerci/eventgrid/test/Get-AzEventGridDomainTopicEventSubscriptionFullUrl.Tests.ps1 new file mode 100644 index 000000000000..601f2f947927 --- /dev/null +++ b/swaggerci/eventgrid/test/Get-AzEventGridDomainTopicEventSubscriptionFullUrl.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzEventGridDomainTopicEventSubscriptionFullUrl')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzEventGridDomainTopicEventSubscriptionFullUrl.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzEventGridDomainTopicEventSubscriptionFullUrl' { + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/Get-AzEventGridEventChannel.Tests.ps1 b/swaggerci/eventgrid/test/Get-AzEventGridEventChannel.Tests.ps1 new file mode 100644 index 000000000000..52c243d51c60 --- /dev/null +++ b/swaggerci/eventgrid/test/Get-AzEventGridEventChannel.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzEventGridEventChannel')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzEventGridEventChannel.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzEventGridEventChannel' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/Get-AzEventGridEventSubscription.Tests.ps1 b/swaggerci/eventgrid/test/Get-AzEventGridEventSubscription.Tests.ps1 new file mode 100644 index 000000000000..567459d26698 --- /dev/null +++ b/swaggerci/eventgrid/test/Get-AzEventGridEventSubscription.Tests.ps1 @@ -0,0 +1,33 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzEventGridEventSubscription')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzEventGridEventSubscription.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzEventGridEventSubscription' { + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'List1' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/Get-AzEventGridEventSubscriptionDeliveryAttribute.Tests.ps1 b/swaggerci/eventgrid/test/Get-AzEventGridEventSubscriptionDeliveryAttribute.Tests.ps1 new file mode 100644 index 000000000000..fa2abd749e05 --- /dev/null +++ b/swaggerci/eventgrid/test/Get-AzEventGridEventSubscriptionDeliveryAttribute.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzEventGridEventSubscriptionDeliveryAttribute')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzEventGridEventSubscriptionDeliveryAttribute.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzEventGridEventSubscriptionDeliveryAttribute' { + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/Get-AzEventGridEventSubscriptionFullUrl.Tests.ps1 b/swaggerci/eventgrid/test/Get-AzEventGridEventSubscriptionFullUrl.Tests.ps1 new file mode 100644 index 000000000000..040e255be555 --- /dev/null +++ b/swaggerci/eventgrid/test/Get-AzEventGridEventSubscriptionFullUrl.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzEventGridEventSubscriptionFullUrl')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzEventGridEventSubscriptionFullUrl.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzEventGridEventSubscriptionFullUrl' { + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/Get-AzEventGridEventSubscriptionGlobal.Tests.ps1 b/swaggerci/eventgrid/test/Get-AzEventGridEventSubscriptionGlobal.Tests.ps1 new file mode 100644 index 000000000000..92f1a91e6994 --- /dev/null +++ b/swaggerci/eventgrid/test/Get-AzEventGridEventSubscriptionGlobal.Tests.ps1 @@ -0,0 +1,33 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzEventGridEventSubscriptionGlobal')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzEventGridEventSubscriptionGlobal.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzEventGridEventSubscriptionGlobal' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'List3' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'List1' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'List2' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/Get-AzEventGridEventSubscriptionRegional.Tests.ps1 b/swaggerci/eventgrid/test/Get-AzEventGridEventSubscriptionRegional.Tests.ps1 new file mode 100644 index 000000000000..a31e64de0023 --- /dev/null +++ b/swaggerci/eventgrid/test/Get-AzEventGridEventSubscriptionRegional.Tests.ps1 @@ -0,0 +1,33 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzEventGridEventSubscriptionRegional')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzEventGridEventSubscriptionRegional.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzEventGridEventSubscriptionRegional' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'List3' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'List1' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'List2' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/Get-AzEventGridExtensionTopic.Tests.ps1 b/swaggerci/eventgrid/test/Get-AzEventGridExtensionTopic.Tests.ps1 new file mode 100644 index 000000000000..c7cd6c9b21c7 --- /dev/null +++ b/swaggerci/eventgrid/test/Get-AzEventGridExtensionTopic.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzEventGridExtensionTopic')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzEventGridExtensionTopic.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzEventGridExtensionTopic' { + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/Get-AzEventGridPartnerConfiguration.Tests.ps1 b/swaggerci/eventgrid/test/Get-AzEventGridPartnerConfiguration.Tests.ps1 new file mode 100644 index 000000000000..883674d47ab5 --- /dev/null +++ b/swaggerci/eventgrid/test/Get-AzEventGridPartnerConfiguration.Tests.ps1 @@ -0,0 +1,33 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzEventGridPartnerConfiguration')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzEventGridPartnerConfiguration.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzEventGridPartnerConfiguration' { + It 'List1' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/Get-AzEventGridPartnerDestination.Tests.ps1 b/swaggerci/eventgrid/test/Get-AzEventGridPartnerDestination.Tests.ps1 new file mode 100644 index 000000000000..290d745ca8c6 --- /dev/null +++ b/swaggerci/eventgrid/test/Get-AzEventGridPartnerDestination.Tests.ps1 @@ -0,0 +1,33 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzEventGridPartnerDestination')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzEventGridPartnerDestination.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzEventGridPartnerDestination' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'List1' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/Get-AzEventGridPartnerNamespace.Tests.ps1 b/swaggerci/eventgrid/test/Get-AzEventGridPartnerNamespace.Tests.ps1 new file mode 100644 index 000000000000..51a457fdbdff --- /dev/null +++ b/swaggerci/eventgrid/test/Get-AzEventGridPartnerNamespace.Tests.ps1 @@ -0,0 +1,33 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzEventGridPartnerNamespace')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzEventGridPartnerNamespace.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzEventGridPartnerNamespace' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'List1' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/Get-AzEventGridPartnerNamespaceSharedAccessKey.Tests.ps1 b/swaggerci/eventgrid/test/Get-AzEventGridPartnerNamespaceSharedAccessKey.Tests.ps1 new file mode 100644 index 000000000000..e3d2459323de --- /dev/null +++ b/swaggerci/eventgrid/test/Get-AzEventGridPartnerNamespaceSharedAccessKey.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzEventGridPartnerNamespaceSharedAccessKey')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzEventGridPartnerNamespaceSharedAccessKey.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzEventGridPartnerNamespaceSharedAccessKey' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/Get-AzEventGridPartnerRegistration.Tests.ps1 b/swaggerci/eventgrid/test/Get-AzEventGridPartnerRegistration.Tests.ps1 new file mode 100644 index 000000000000..438412ae3ef5 --- /dev/null +++ b/swaggerci/eventgrid/test/Get-AzEventGridPartnerRegistration.Tests.ps1 @@ -0,0 +1,33 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzEventGridPartnerRegistration')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzEventGridPartnerRegistration.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzEventGridPartnerRegistration' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'List1' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/Get-AzEventGridPartnerTopic.Tests.ps1 b/swaggerci/eventgrid/test/Get-AzEventGridPartnerTopic.Tests.ps1 new file mode 100644 index 000000000000..c3e5c6f6a2cb --- /dev/null +++ b/swaggerci/eventgrid/test/Get-AzEventGridPartnerTopic.Tests.ps1 @@ -0,0 +1,33 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzEventGridPartnerTopic')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzEventGridPartnerTopic.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzEventGridPartnerTopic' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'List1' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/Get-AzEventGridPartnerTopicEventSubscription.Tests.ps1 b/swaggerci/eventgrid/test/Get-AzEventGridPartnerTopicEventSubscription.Tests.ps1 new file mode 100644 index 000000000000..32af86bdf4db --- /dev/null +++ b/swaggerci/eventgrid/test/Get-AzEventGridPartnerTopicEventSubscription.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzEventGridPartnerTopicEventSubscription')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzEventGridPartnerTopicEventSubscription.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzEventGridPartnerTopicEventSubscription' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/Get-AzEventGridPartnerTopicEventSubscriptionDeliveryAttribute.Tests.ps1 b/swaggerci/eventgrid/test/Get-AzEventGridPartnerTopicEventSubscriptionDeliveryAttribute.Tests.ps1 new file mode 100644 index 000000000000..3ef4abca81b8 --- /dev/null +++ b/swaggerci/eventgrid/test/Get-AzEventGridPartnerTopicEventSubscriptionDeliveryAttribute.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzEventGridPartnerTopicEventSubscriptionDeliveryAttribute')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzEventGridPartnerTopicEventSubscriptionDeliveryAttribute.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzEventGridPartnerTopicEventSubscriptionDeliveryAttribute' { + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/Get-AzEventGridPartnerTopicEventSubscriptionFullUrl.Tests.ps1 b/swaggerci/eventgrid/test/Get-AzEventGridPartnerTopicEventSubscriptionFullUrl.Tests.ps1 new file mode 100644 index 000000000000..13d87728743b --- /dev/null +++ b/swaggerci/eventgrid/test/Get-AzEventGridPartnerTopicEventSubscriptionFullUrl.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzEventGridPartnerTopicEventSubscriptionFullUrl')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzEventGridPartnerTopicEventSubscriptionFullUrl.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzEventGridPartnerTopicEventSubscriptionFullUrl' { + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/Get-AzEventGridPrivateEndpointConnection.Tests.ps1 b/swaggerci/eventgrid/test/Get-AzEventGridPrivateEndpointConnection.Tests.ps1 new file mode 100644 index 000000000000..547605d1e176 --- /dev/null +++ b/swaggerci/eventgrid/test/Get-AzEventGridPrivateEndpointConnection.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzEventGridPrivateEndpointConnection')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzEventGridPrivateEndpointConnection.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzEventGridPrivateEndpointConnection' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/Get-AzEventGridPrivateLinkResource.Tests.ps1 b/swaggerci/eventgrid/test/Get-AzEventGridPrivateLinkResource.Tests.ps1 new file mode 100644 index 000000000000..496b5fdd38a4 --- /dev/null +++ b/swaggerci/eventgrid/test/Get-AzEventGridPrivateLinkResource.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzEventGridPrivateLinkResource')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzEventGridPrivateLinkResource.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzEventGridPrivateLinkResource' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/Get-AzEventGridSystemTopic.Tests.ps1 b/swaggerci/eventgrid/test/Get-AzEventGridSystemTopic.Tests.ps1 new file mode 100644 index 000000000000..2e61b6637387 --- /dev/null +++ b/swaggerci/eventgrid/test/Get-AzEventGridSystemTopic.Tests.ps1 @@ -0,0 +1,33 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzEventGridSystemTopic')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzEventGridSystemTopic.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzEventGridSystemTopic' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'List1' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/Get-AzEventGridSystemTopicEventSubscription.Tests.ps1 b/swaggerci/eventgrid/test/Get-AzEventGridSystemTopicEventSubscription.Tests.ps1 new file mode 100644 index 000000000000..8bbe450510b9 --- /dev/null +++ b/swaggerci/eventgrid/test/Get-AzEventGridSystemTopicEventSubscription.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzEventGridSystemTopicEventSubscription')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzEventGridSystemTopicEventSubscription.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzEventGridSystemTopicEventSubscription' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/Get-AzEventGridSystemTopicEventSubscriptionDeliveryAttribute.Tests.ps1 b/swaggerci/eventgrid/test/Get-AzEventGridSystemTopicEventSubscriptionDeliveryAttribute.Tests.ps1 new file mode 100644 index 000000000000..f54aeacc28bb --- /dev/null +++ b/swaggerci/eventgrid/test/Get-AzEventGridSystemTopicEventSubscriptionDeliveryAttribute.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzEventGridSystemTopicEventSubscriptionDeliveryAttribute')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzEventGridSystemTopicEventSubscriptionDeliveryAttribute.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzEventGridSystemTopicEventSubscriptionDeliveryAttribute' { + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/Get-AzEventGridSystemTopicEventSubscriptionFullUrl.Tests.ps1 b/swaggerci/eventgrid/test/Get-AzEventGridSystemTopicEventSubscriptionFullUrl.Tests.ps1 new file mode 100644 index 000000000000..d2bd81ee65b6 --- /dev/null +++ b/swaggerci/eventgrid/test/Get-AzEventGridSystemTopicEventSubscriptionFullUrl.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzEventGridSystemTopicEventSubscriptionFullUrl')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzEventGridSystemTopicEventSubscriptionFullUrl.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzEventGridSystemTopicEventSubscriptionFullUrl' { + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/Get-AzEventGridTopic.Tests.ps1 b/swaggerci/eventgrid/test/Get-AzEventGridTopic.Tests.ps1 new file mode 100644 index 000000000000..02f9193f7e53 --- /dev/null +++ b/swaggerci/eventgrid/test/Get-AzEventGridTopic.Tests.ps1 @@ -0,0 +1,33 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzEventGridTopic')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzEventGridTopic.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzEventGridTopic' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'List1' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/Get-AzEventGridTopicEventSubscription.Tests.ps1 b/swaggerci/eventgrid/test/Get-AzEventGridTopicEventSubscription.Tests.ps1 new file mode 100644 index 000000000000..2a6b3ee6734e --- /dev/null +++ b/swaggerci/eventgrid/test/Get-AzEventGridTopicEventSubscription.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzEventGridTopicEventSubscription')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzEventGridTopicEventSubscription.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzEventGridTopicEventSubscription' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/Get-AzEventGridTopicEventSubscriptionDeliveryAttribute.Tests.ps1 b/swaggerci/eventgrid/test/Get-AzEventGridTopicEventSubscriptionDeliveryAttribute.Tests.ps1 new file mode 100644 index 000000000000..daa8fd401a72 --- /dev/null +++ b/swaggerci/eventgrid/test/Get-AzEventGridTopicEventSubscriptionDeliveryAttribute.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzEventGridTopicEventSubscriptionDeliveryAttribute')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzEventGridTopicEventSubscriptionDeliveryAttribute.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzEventGridTopicEventSubscriptionDeliveryAttribute' { + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/Get-AzEventGridTopicEventSubscriptionFullUrl.Tests.ps1 b/swaggerci/eventgrid/test/Get-AzEventGridTopicEventSubscriptionFullUrl.Tests.ps1 new file mode 100644 index 000000000000..da9455825c54 --- /dev/null +++ b/swaggerci/eventgrid/test/Get-AzEventGridTopicEventSubscriptionFullUrl.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzEventGridTopicEventSubscriptionFullUrl')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzEventGridTopicEventSubscriptionFullUrl.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzEventGridTopicEventSubscriptionFullUrl' { + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/Get-AzEventGridTopicEventType.Tests.ps1 b/swaggerci/eventgrid/test/Get-AzEventGridTopicEventType.Tests.ps1 new file mode 100644 index 000000000000..10c83149a47a --- /dev/null +++ b/swaggerci/eventgrid/test/Get-AzEventGridTopicEventType.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzEventGridTopicEventType')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzEventGridTopicEventType.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzEventGridTopicEventType' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/Get-AzEventGridTopicSharedAccessKey.Tests.ps1 b/swaggerci/eventgrid/test/Get-AzEventGridTopicSharedAccessKey.Tests.ps1 new file mode 100644 index 000000000000..42c77365365d --- /dev/null +++ b/swaggerci/eventgrid/test/Get-AzEventGridTopicSharedAccessKey.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzEventGridTopicSharedAccessKey')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzEventGridTopicSharedAccessKey.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzEventGridTopicSharedAccessKey' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/Get-AzEventGridTopicType.Tests.ps1 b/swaggerci/eventgrid/test/Get-AzEventGridTopicType.Tests.ps1 new file mode 100644 index 000000000000..38c332ec70cc --- /dev/null +++ b/swaggerci/eventgrid/test/Get-AzEventGridTopicType.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzEventGridTopicType')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzEventGridTopicType.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzEventGridTopicType' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/Get-AzEventGridTopicTypeEventType.Tests.ps1 b/swaggerci/eventgrid/test/Get-AzEventGridTopicTypeEventType.Tests.ps1 new file mode 100644 index 000000000000..92ccd9a5aa53 --- /dev/null +++ b/swaggerci/eventgrid/test/Get-AzEventGridTopicTypeEventType.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzEventGridTopicTypeEventType')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzEventGridTopicTypeEventType.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzEventGridTopicTypeEventType' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/Get-AzEventGridVerifiedPartner.Tests.ps1 b/swaggerci/eventgrid/test/Get-AzEventGridVerifiedPartner.Tests.ps1 new file mode 100644 index 000000000000..90bc5c20b84b --- /dev/null +++ b/swaggerci/eventgrid/test/Get-AzEventGridVerifiedPartner.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzEventGridVerifiedPartner')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzEventGridVerifiedPartner.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzEventGridVerifiedPartner' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/Grant-AzEventGridPartnerConfigurationPartner.Tests.ps1 b/swaggerci/eventgrid/test/Grant-AzEventGridPartnerConfigurationPartner.Tests.ps1 new file mode 100644 index 000000000000..92f2ee7ce0c4 --- /dev/null +++ b/swaggerci/eventgrid/test/Grant-AzEventGridPartnerConfigurationPartner.Tests.ps1 @@ -0,0 +1,33 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Grant-AzEventGridPartnerConfigurationPartner')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Grant-AzEventGridPartnerConfigurationPartner.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Grant-AzEventGridPartnerConfigurationPartner' { + It 'AuthorizeExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Authorize' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'AuthorizeViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'AuthorizeViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/Initialize-AzEventGridPartnerDestination.Tests.ps1 b/swaggerci/eventgrid/test/Initialize-AzEventGridPartnerDestination.Tests.ps1 new file mode 100644 index 000000000000..51ea27ffaa34 --- /dev/null +++ b/swaggerci/eventgrid/test/Initialize-AzEventGridPartnerDestination.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Initialize-AzEventGridPartnerDestination')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Initialize-AzEventGridPartnerDestination.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Initialize-AzEventGridPartnerDestination' { + It 'Activate' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'ActivateViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/Initialize-AzEventGridPartnerTopic.Tests.ps1 b/swaggerci/eventgrid/test/Initialize-AzEventGridPartnerTopic.Tests.ps1 new file mode 100644 index 000000000000..28e2941784a8 --- /dev/null +++ b/swaggerci/eventgrid/test/Initialize-AzEventGridPartnerTopic.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Initialize-AzEventGridPartnerTopic')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Initialize-AzEventGridPartnerTopic.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Initialize-AzEventGridPartnerTopic' { + It 'Activate' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'ActivateViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/Invoke-AzEventGridDeactivatePartnerTopic.Tests.ps1 b/swaggerci/eventgrid/test/Invoke-AzEventGridDeactivatePartnerTopic.Tests.ps1 new file mode 100644 index 000000000000..76f89af497d3 --- /dev/null +++ b/swaggerci/eventgrid/test/Invoke-AzEventGridDeactivatePartnerTopic.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Invoke-AzEventGridDeactivatePartnerTopic')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Invoke-AzEventGridDeactivatePartnerTopic.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Invoke-AzEventGridDeactivatePartnerTopic' { + It 'Deactivate' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeactivateViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/Invoke-AzEventGridPartnerConfigurationUnauthorize.Tests.ps1 b/swaggerci/eventgrid/test/Invoke-AzEventGridPartnerConfigurationUnauthorize.Tests.ps1 new file mode 100644 index 000000000000..5c1d3a84e96d --- /dev/null +++ b/swaggerci/eventgrid/test/Invoke-AzEventGridPartnerConfigurationUnauthorize.Tests.ps1 @@ -0,0 +1,33 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Invoke-AzEventGridPartnerConfigurationUnauthorize')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Invoke-AzEventGridPartnerConfigurationUnauthorize.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Invoke-AzEventGridPartnerConfigurationUnauthorize' { + It 'PartnerExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Partner' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'PartnerViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'PartnerViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/New-AzEventGridChannel.Tests.ps1 b/swaggerci/eventgrid/test/New-AzEventGridChannel.Tests.ps1 new file mode 100644 index 000000000000..b65c4c6fe1dd --- /dev/null +++ b/swaggerci/eventgrid/test/New-AzEventGridChannel.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzEventGridChannel')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzEventGridChannel.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'New-AzEventGridChannel' { + It 'CreateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/New-AzEventGridDomain.Tests.ps1 b/swaggerci/eventgrid/test/New-AzEventGridDomain.Tests.ps1 new file mode 100644 index 000000000000..e1f5529a2ba9 --- /dev/null +++ b/swaggerci/eventgrid/test/New-AzEventGridDomain.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzEventGridDomain')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzEventGridDomain.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'New-AzEventGridDomain' { + It 'CreateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/New-AzEventGridDomainEventSubscription.Tests.ps1 b/swaggerci/eventgrid/test/New-AzEventGridDomainEventSubscription.Tests.ps1 new file mode 100644 index 000000000000..f3301e6d686e --- /dev/null +++ b/swaggerci/eventgrid/test/New-AzEventGridDomainEventSubscription.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzEventGridDomainEventSubscription')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzEventGridDomainEventSubscription.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'New-AzEventGridDomainEventSubscription' { + It 'CreateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/New-AzEventGridDomainKey.Tests.ps1 b/swaggerci/eventgrid/test/New-AzEventGridDomainKey.Tests.ps1 new file mode 100644 index 000000000000..1167f09b4323 --- /dev/null +++ b/swaggerci/eventgrid/test/New-AzEventGridDomainKey.Tests.ps1 @@ -0,0 +1,33 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzEventGridDomainKey')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzEventGridDomainKey.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'New-AzEventGridDomainKey' { + It 'RegenerateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Regenerate' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'RegenerateViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'RegenerateViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/New-AzEventGridDomainTopicEventSubscription.Tests.ps1 b/swaggerci/eventgrid/test/New-AzEventGridDomainTopicEventSubscription.Tests.ps1 new file mode 100644 index 000000000000..9e5ca83b157f --- /dev/null +++ b/swaggerci/eventgrid/test/New-AzEventGridDomainTopicEventSubscription.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzEventGridDomainTopicEventSubscription')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzEventGridDomainTopicEventSubscription.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'New-AzEventGridDomainTopicEventSubscription' { + It 'CreateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/New-AzEventGridEventChannel.Tests.ps1 b/swaggerci/eventgrid/test/New-AzEventGridEventChannel.Tests.ps1 new file mode 100644 index 000000000000..2ed3204565c3 --- /dev/null +++ b/swaggerci/eventgrid/test/New-AzEventGridEventChannel.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzEventGridEventChannel')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzEventGridEventChannel.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'New-AzEventGridEventChannel' { + It 'CreateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/New-AzEventGridEventSubscription.Tests.ps1 b/swaggerci/eventgrid/test/New-AzEventGridEventSubscription.Tests.ps1 new file mode 100644 index 000000000000..e8e58234e529 --- /dev/null +++ b/swaggerci/eventgrid/test/New-AzEventGridEventSubscription.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzEventGridEventSubscription')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzEventGridEventSubscription.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'New-AzEventGridEventSubscription' { + It 'CreateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/New-AzEventGridPartnerConfiguration.Tests.ps1 b/swaggerci/eventgrid/test/New-AzEventGridPartnerConfiguration.Tests.ps1 new file mode 100644 index 000000000000..03feb077b4e4 --- /dev/null +++ b/swaggerci/eventgrid/test/New-AzEventGridPartnerConfiguration.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzEventGridPartnerConfiguration')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzEventGridPartnerConfiguration.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'New-AzEventGridPartnerConfiguration' { + It 'CreateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/New-AzEventGridPartnerDestination.Tests.ps1 b/swaggerci/eventgrid/test/New-AzEventGridPartnerDestination.Tests.ps1 new file mode 100644 index 000000000000..33d5e6b277c6 --- /dev/null +++ b/swaggerci/eventgrid/test/New-AzEventGridPartnerDestination.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzEventGridPartnerDestination')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzEventGridPartnerDestination.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'New-AzEventGridPartnerDestination' { + It 'CreateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/New-AzEventGridPartnerNamespace.Tests.ps1 b/swaggerci/eventgrid/test/New-AzEventGridPartnerNamespace.Tests.ps1 new file mode 100644 index 000000000000..598b744c7315 --- /dev/null +++ b/swaggerci/eventgrid/test/New-AzEventGridPartnerNamespace.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzEventGridPartnerNamespace')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzEventGridPartnerNamespace.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'New-AzEventGridPartnerNamespace' { + It 'CreateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/New-AzEventGridPartnerNamespaceKey.Tests.ps1 b/swaggerci/eventgrid/test/New-AzEventGridPartnerNamespaceKey.Tests.ps1 new file mode 100644 index 000000000000..f6bc1eac9d66 --- /dev/null +++ b/swaggerci/eventgrid/test/New-AzEventGridPartnerNamespaceKey.Tests.ps1 @@ -0,0 +1,33 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzEventGridPartnerNamespaceKey')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzEventGridPartnerNamespaceKey.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'New-AzEventGridPartnerNamespaceKey' { + It 'RegenerateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Regenerate' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'RegenerateViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'RegenerateViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/New-AzEventGridPartnerRegistration.Tests.ps1 b/swaggerci/eventgrid/test/New-AzEventGridPartnerRegistration.Tests.ps1 new file mode 100644 index 000000000000..1c8465861fa9 --- /dev/null +++ b/swaggerci/eventgrid/test/New-AzEventGridPartnerRegistration.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzEventGridPartnerRegistration')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzEventGridPartnerRegistration.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'New-AzEventGridPartnerRegistration' { + It 'CreateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/New-AzEventGridPartnerTopic.Tests.ps1 b/swaggerci/eventgrid/test/New-AzEventGridPartnerTopic.Tests.ps1 new file mode 100644 index 000000000000..e70e64f7ab13 --- /dev/null +++ b/swaggerci/eventgrid/test/New-AzEventGridPartnerTopic.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzEventGridPartnerTopic')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzEventGridPartnerTopic.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'New-AzEventGridPartnerTopic' { + It 'CreateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/New-AzEventGridPartnerTopicEventSubscription.Tests.ps1 b/swaggerci/eventgrid/test/New-AzEventGridPartnerTopicEventSubscription.Tests.ps1 new file mode 100644 index 000000000000..def83a9e33e8 --- /dev/null +++ b/swaggerci/eventgrid/test/New-AzEventGridPartnerTopicEventSubscription.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzEventGridPartnerTopicEventSubscription')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzEventGridPartnerTopicEventSubscription.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'New-AzEventGridPartnerTopicEventSubscription' { + It 'CreateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/New-AzEventGridSystemTopic.Tests.ps1 b/swaggerci/eventgrid/test/New-AzEventGridSystemTopic.Tests.ps1 new file mode 100644 index 000000000000..6b1e4d487a37 --- /dev/null +++ b/swaggerci/eventgrid/test/New-AzEventGridSystemTopic.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzEventGridSystemTopic')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzEventGridSystemTopic.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'New-AzEventGridSystemTopic' { + It 'CreateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/New-AzEventGridSystemTopicEventSubscription.Tests.ps1 b/swaggerci/eventgrid/test/New-AzEventGridSystemTopicEventSubscription.Tests.ps1 new file mode 100644 index 000000000000..c50a9026de22 --- /dev/null +++ b/swaggerci/eventgrid/test/New-AzEventGridSystemTopicEventSubscription.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzEventGridSystemTopicEventSubscription')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzEventGridSystemTopicEventSubscription.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'New-AzEventGridSystemTopicEventSubscription' { + It 'CreateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/New-AzEventGridTopic.Tests.ps1 b/swaggerci/eventgrid/test/New-AzEventGridTopic.Tests.ps1 new file mode 100644 index 000000000000..ed07d7a79af9 --- /dev/null +++ b/swaggerci/eventgrid/test/New-AzEventGridTopic.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzEventGridTopic')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzEventGridTopic.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'New-AzEventGridTopic' { + It 'CreateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/New-AzEventGridTopicEventSubscription.Tests.ps1 b/swaggerci/eventgrid/test/New-AzEventGridTopicEventSubscription.Tests.ps1 new file mode 100644 index 000000000000..2908111605f7 --- /dev/null +++ b/swaggerci/eventgrid/test/New-AzEventGridTopicEventSubscription.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzEventGridTopicEventSubscription')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzEventGridTopicEventSubscription.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'New-AzEventGridTopicEventSubscription' { + It 'CreateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/New-AzEventGridTopicKey.Tests.ps1 b/swaggerci/eventgrid/test/New-AzEventGridTopicKey.Tests.ps1 new file mode 100644 index 000000000000..e180217be4b7 --- /dev/null +++ b/swaggerci/eventgrid/test/New-AzEventGridTopicKey.Tests.ps1 @@ -0,0 +1,33 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzEventGridTopicKey')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzEventGridTopicKey.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'New-AzEventGridTopicKey' { + It 'RegenerateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Regenerate' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'RegenerateViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'RegenerateViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/README.md b/swaggerci/eventgrid/test/README.md new file mode 100644 index 000000000000..1969200c6a09 --- /dev/null +++ b/swaggerci/eventgrid/test/README.md @@ -0,0 +1,17 @@ +# Test +This directory contains the [Pester](https://www.powershellgallery.com/packages/Pester) tests to run for the module. We use Pester as it is the unofficial standard for PowerShell unit testing. Test stubs for custom cmdlets (created in `../custom`) will be generated into this folder when `build-module.ps1` is ran. These test stubs will fail automatically, to indicate that tests should be written for custom cmdlets. + +## Info +- Modifiable: yes +- Generated: partial +- Committed: yes +- Packaged: no + +## Details +We allow three testing modes: *live*, *record*, and *playback*. These can be selected using the `-Live`, `-Record`, and `-Playback` switches respectively on the `test-module.ps1` script. This script will run through any `.Tests.ps1` scripts in the `test` folder. If you choose the *record* mode, it will create a `.Recording.json` file of the REST calls between the client and server. Then, when you choose *playback* mode, it will use the `.Recording.json` file to mock the communication between server and client. The *live* mode runs the same as the *record* mode; however, it doesn't create the `.Recording.json` file. + +## Purpose +Custom cmdlets generally encompass additional functionality not described in the REST specification, or combines functionality generated from the REST spec. To validate this functionality continues to operate as intended, creating tests that can be ran and re-ran against custom cmdlets is part of the framework. + +## Usage +To execute tests, run the `test-module.ps1`. To write tests, [this example](https://github.com/pester/Pester/blob/8b9cf4248315e44f1ac6673be149f7e0d7f10466/Examples/Planets/Get-Planet.Tests.ps1#L1) from the Pester repository is very useful for getting started. \ No newline at end of file diff --git a/swaggerci/eventgrid/test/Remove-AzEventGridChannel.Tests.ps1 b/swaggerci/eventgrid/test/Remove-AzEventGridChannel.Tests.ps1 new file mode 100644 index 000000000000..70ae8917f04c --- /dev/null +++ b/swaggerci/eventgrid/test/Remove-AzEventGridChannel.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzEventGridChannel')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzEventGridChannel.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Remove-AzEventGridChannel' { + It 'Delete' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/Remove-AzEventGridDomain.Tests.ps1 b/swaggerci/eventgrid/test/Remove-AzEventGridDomain.Tests.ps1 new file mode 100644 index 000000000000..28ebe1cda118 --- /dev/null +++ b/swaggerci/eventgrid/test/Remove-AzEventGridDomain.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzEventGridDomain')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzEventGridDomain.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Remove-AzEventGridDomain' { + It 'Delete' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/Remove-AzEventGridDomainEventSubscription.Tests.ps1 b/swaggerci/eventgrid/test/Remove-AzEventGridDomainEventSubscription.Tests.ps1 new file mode 100644 index 000000000000..67788b53a45c --- /dev/null +++ b/swaggerci/eventgrid/test/Remove-AzEventGridDomainEventSubscription.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzEventGridDomainEventSubscription')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzEventGridDomainEventSubscription.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Remove-AzEventGridDomainEventSubscription' { + It 'Delete' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/Remove-AzEventGridDomainTopic.Tests.ps1 b/swaggerci/eventgrid/test/Remove-AzEventGridDomainTopic.Tests.ps1 new file mode 100644 index 000000000000..5341328c13bb --- /dev/null +++ b/swaggerci/eventgrid/test/Remove-AzEventGridDomainTopic.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzEventGridDomainTopic')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzEventGridDomainTopic.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Remove-AzEventGridDomainTopic' { + It 'Delete' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/Remove-AzEventGridDomainTopicEventSubscription.Tests.ps1 b/swaggerci/eventgrid/test/Remove-AzEventGridDomainTopicEventSubscription.Tests.ps1 new file mode 100644 index 000000000000..0c6de16fbf7d --- /dev/null +++ b/swaggerci/eventgrid/test/Remove-AzEventGridDomainTopicEventSubscription.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzEventGridDomainTopicEventSubscription')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzEventGridDomainTopicEventSubscription.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Remove-AzEventGridDomainTopicEventSubscription' { + It 'Delete' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/Remove-AzEventGridEventChannel.Tests.ps1 b/swaggerci/eventgrid/test/Remove-AzEventGridEventChannel.Tests.ps1 new file mode 100644 index 000000000000..0b181674bc2f --- /dev/null +++ b/swaggerci/eventgrid/test/Remove-AzEventGridEventChannel.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzEventGridEventChannel')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzEventGridEventChannel.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Remove-AzEventGridEventChannel' { + It 'Delete' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/Remove-AzEventGridEventSubscription.Tests.ps1 b/swaggerci/eventgrid/test/Remove-AzEventGridEventSubscription.Tests.ps1 new file mode 100644 index 000000000000..96d819aa6881 --- /dev/null +++ b/swaggerci/eventgrid/test/Remove-AzEventGridEventSubscription.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzEventGridEventSubscription')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzEventGridEventSubscription.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Remove-AzEventGridEventSubscription' { + It 'Delete' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/Remove-AzEventGridPartnerConfiguration.Tests.ps1 b/swaggerci/eventgrid/test/Remove-AzEventGridPartnerConfiguration.Tests.ps1 new file mode 100644 index 000000000000..fe316cebd208 --- /dev/null +++ b/swaggerci/eventgrid/test/Remove-AzEventGridPartnerConfiguration.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzEventGridPartnerConfiguration')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzEventGridPartnerConfiguration.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Remove-AzEventGridPartnerConfiguration' { + It 'Delete' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/Remove-AzEventGridPartnerDestination.Tests.ps1 b/swaggerci/eventgrid/test/Remove-AzEventGridPartnerDestination.Tests.ps1 new file mode 100644 index 000000000000..49d0785f2606 --- /dev/null +++ b/swaggerci/eventgrid/test/Remove-AzEventGridPartnerDestination.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzEventGridPartnerDestination')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzEventGridPartnerDestination.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Remove-AzEventGridPartnerDestination' { + It 'Delete' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/Remove-AzEventGridPartnerNamespace.Tests.ps1 b/swaggerci/eventgrid/test/Remove-AzEventGridPartnerNamespace.Tests.ps1 new file mode 100644 index 000000000000..22f6b43b22f6 --- /dev/null +++ b/swaggerci/eventgrid/test/Remove-AzEventGridPartnerNamespace.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzEventGridPartnerNamespace')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzEventGridPartnerNamespace.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Remove-AzEventGridPartnerNamespace' { + It 'Delete' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/Remove-AzEventGridPartnerRegistration.Tests.ps1 b/swaggerci/eventgrid/test/Remove-AzEventGridPartnerRegistration.Tests.ps1 new file mode 100644 index 000000000000..830503bca130 --- /dev/null +++ b/swaggerci/eventgrid/test/Remove-AzEventGridPartnerRegistration.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzEventGridPartnerRegistration')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzEventGridPartnerRegistration.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Remove-AzEventGridPartnerRegistration' { + It 'Delete' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/Remove-AzEventGridPartnerTopic.Tests.ps1 b/swaggerci/eventgrid/test/Remove-AzEventGridPartnerTopic.Tests.ps1 new file mode 100644 index 000000000000..b4cd6b8cf7dd --- /dev/null +++ b/swaggerci/eventgrid/test/Remove-AzEventGridPartnerTopic.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzEventGridPartnerTopic')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzEventGridPartnerTopic.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Remove-AzEventGridPartnerTopic' { + It 'Delete' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/Remove-AzEventGridPartnerTopicEventSubscription.Tests.ps1 b/swaggerci/eventgrid/test/Remove-AzEventGridPartnerTopicEventSubscription.Tests.ps1 new file mode 100644 index 000000000000..d4370984b3cc --- /dev/null +++ b/swaggerci/eventgrid/test/Remove-AzEventGridPartnerTopicEventSubscription.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzEventGridPartnerTopicEventSubscription')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzEventGridPartnerTopicEventSubscription.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Remove-AzEventGridPartnerTopicEventSubscription' { + It 'Delete' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/Remove-AzEventGridPrivateEndpointConnection.Tests.ps1 b/swaggerci/eventgrid/test/Remove-AzEventGridPrivateEndpointConnection.Tests.ps1 new file mode 100644 index 000000000000..e2ff11e1675c --- /dev/null +++ b/swaggerci/eventgrid/test/Remove-AzEventGridPrivateEndpointConnection.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzEventGridPrivateEndpointConnection')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzEventGridPrivateEndpointConnection.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Remove-AzEventGridPrivateEndpointConnection' { + It 'Delete' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/Remove-AzEventGridSystemTopic.Tests.ps1 b/swaggerci/eventgrid/test/Remove-AzEventGridSystemTopic.Tests.ps1 new file mode 100644 index 000000000000..f2a381e77692 --- /dev/null +++ b/swaggerci/eventgrid/test/Remove-AzEventGridSystemTopic.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzEventGridSystemTopic')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzEventGridSystemTopic.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Remove-AzEventGridSystemTopic' { + It 'Delete' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/Remove-AzEventGridSystemTopicEventSubscription.Tests.ps1 b/swaggerci/eventgrid/test/Remove-AzEventGridSystemTopicEventSubscription.Tests.ps1 new file mode 100644 index 000000000000..4800f117f88d --- /dev/null +++ b/swaggerci/eventgrid/test/Remove-AzEventGridSystemTopicEventSubscription.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzEventGridSystemTopicEventSubscription')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzEventGridSystemTopicEventSubscription.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Remove-AzEventGridSystemTopicEventSubscription' { + It 'Delete' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/Remove-AzEventGridTopic.Tests.ps1 b/swaggerci/eventgrid/test/Remove-AzEventGridTopic.Tests.ps1 new file mode 100644 index 000000000000..0b0827ac48a8 --- /dev/null +++ b/swaggerci/eventgrid/test/Remove-AzEventGridTopic.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzEventGridTopic')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzEventGridTopic.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Remove-AzEventGridTopic' { + It 'Delete' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/Remove-AzEventGridTopicEventSubscription.Tests.ps1 b/swaggerci/eventgrid/test/Remove-AzEventGridTopicEventSubscription.Tests.ps1 new file mode 100644 index 000000000000..20cf7a5f34e2 --- /dev/null +++ b/swaggerci/eventgrid/test/Remove-AzEventGridTopicEventSubscription.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzEventGridTopicEventSubscription')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzEventGridTopicEventSubscription.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Remove-AzEventGridTopicEventSubscription' { + It 'Delete' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/Update-AzEventGridChannel.Tests.ps1 b/swaggerci/eventgrid/test/Update-AzEventGridChannel.Tests.ps1 new file mode 100644 index 000000000000..4c31959d0704 --- /dev/null +++ b/swaggerci/eventgrid/test/Update-AzEventGridChannel.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Update-AzEventGridChannel')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Update-AzEventGridChannel.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Update-AzEventGridChannel' { + It 'UpdateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'UpdateViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/Update-AzEventGridDomain.Tests.ps1 b/swaggerci/eventgrid/test/Update-AzEventGridDomain.Tests.ps1 new file mode 100644 index 000000000000..d0ad4ffe7cbf --- /dev/null +++ b/swaggerci/eventgrid/test/Update-AzEventGridDomain.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Update-AzEventGridDomain')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Update-AzEventGridDomain.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Update-AzEventGridDomain' { + It 'UpdateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'UpdateViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/Update-AzEventGridDomainEventSubscription.Tests.ps1 b/swaggerci/eventgrid/test/Update-AzEventGridDomainEventSubscription.Tests.ps1 new file mode 100644 index 000000000000..3353e74957f8 --- /dev/null +++ b/swaggerci/eventgrid/test/Update-AzEventGridDomainEventSubscription.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Update-AzEventGridDomainEventSubscription')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Update-AzEventGridDomainEventSubscription.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Update-AzEventGridDomainEventSubscription' { + It 'UpdateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'UpdateViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/Update-AzEventGridDomainTopicEventSubscription.Tests.ps1 b/swaggerci/eventgrid/test/Update-AzEventGridDomainTopicEventSubscription.Tests.ps1 new file mode 100644 index 000000000000..87ac9266129d --- /dev/null +++ b/swaggerci/eventgrid/test/Update-AzEventGridDomainTopicEventSubscription.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Update-AzEventGridDomainTopicEventSubscription')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Update-AzEventGridDomainTopicEventSubscription.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Update-AzEventGridDomainTopicEventSubscription' { + It 'UpdateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'UpdateViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/Update-AzEventGridEventSubscription.Tests.ps1 b/swaggerci/eventgrid/test/Update-AzEventGridEventSubscription.Tests.ps1 new file mode 100644 index 000000000000..693556e99b09 --- /dev/null +++ b/swaggerci/eventgrid/test/Update-AzEventGridEventSubscription.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Update-AzEventGridEventSubscription')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Update-AzEventGridEventSubscription.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Update-AzEventGridEventSubscription' { + It 'UpdateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'UpdateViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/Update-AzEventGridPartnerConfiguration.Tests.ps1 b/swaggerci/eventgrid/test/Update-AzEventGridPartnerConfiguration.Tests.ps1 new file mode 100644 index 000000000000..83f818cc9cfc --- /dev/null +++ b/swaggerci/eventgrid/test/Update-AzEventGridPartnerConfiguration.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Update-AzEventGridPartnerConfiguration')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Update-AzEventGridPartnerConfiguration.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Update-AzEventGridPartnerConfiguration' { + It 'UpdateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'UpdateViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/Update-AzEventGridPartnerDestination.Tests.ps1 b/swaggerci/eventgrid/test/Update-AzEventGridPartnerDestination.Tests.ps1 new file mode 100644 index 000000000000..a53929fef7da --- /dev/null +++ b/swaggerci/eventgrid/test/Update-AzEventGridPartnerDestination.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Update-AzEventGridPartnerDestination')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Update-AzEventGridPartnerDestination.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Update-AzEventGridPartnerDestination' { + It 'UpdateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'UpdateViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/Update-AzEventGridPartnerNamespace.Tests.ps1 b/swaggerci/eventgrid/test/Update-AzEventGridPartnerNamespace.Tests.ps1 new file mode 100644 index 000000000000..edb122b18ecd --- /dev/null +++ b/swaggerci/eventgrid/test/Update-AzEventGridPartnerNamespace.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Update-AzEventGridPartnerNamespace')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Update-AzEventGridPartnerNamespace.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Update-AzEventGridPartnerNamespace' { + It 'UpdateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'UpdateViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/Update-AzEventGridPartnerRegistration.Tests.ps1 b/swaggerci/eventgrid/test/Update-AzEventGridPartnerRegistration.Tests.ps1 new file mode 100644 index 000000000000..7d47b7175a96 --- /dev/null +++ b/swaggerci/eventgrid/test/Update-AzEventGridPartnerRegistration.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Update-AzEventGridPartnerRegistration')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Update-AzEventGridPartnerRegistration.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Update-AzEventGridPartnerRegistration' { + It 'UpdateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'UpdateViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/Update-AzEventGridPartnerTopic.Tests.ps1 b/swaggerci/eventgrid/test/Update-AzEventGridPartnerTopic.Tests.ps1 new file mode 100644 index 000000000000..32860d925592 --- /dev/null +++ b/swaggerci/eventgrid/test/Update-AzEventGridPartnerTopic.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Update-AzEventGridPartnerTopic')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Update-AzEventGridPartnerTopic.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Update-AzEventGridPartnerTopic' { + It 'UpdateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'UpdateViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/Update-AzEventGridPartnerTopicEventSubscription.Tests.ps1 b/swaggerci/eventgrid/test/Update-AzEventGridPartnerTopicEventSubscription.Tests.ps1 new file mode 100644 index 000000000000..30b7c1a14303 --- /dev/null +++ b/swaggerci/eventgrid/test/Update-AzEventGridPartnerTopicEventSubscription.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Update-AzEventGridPartnerTopicEventSubscription')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Update-AzEventGridPartnerTopicEventSubscription.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Update-AzEventGridPartnerTopicEventSubscription' { + It 'UpdateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'UpdateViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/Update-AzEventGridSystemTopic.Tests.ps1 b/swaggerci/eventgrid/test/Update-AzEventGridSystemTopic.Tests.ps1 new file mode 100644 index 000000000000..4367714d47fd --- /dev/null +++ b/swaggerci/eventgrid/test/Update-AzEventGridSystemTopic.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Update-AzEventGridSystemTopic')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Update-AzEventGridSystemTopic.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Update-AzEventGridSystemTopic' { + It 'UpdateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'UpdateViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/Update-AzEventGridSystemTopicEventSubscription.Tests.ps1 b/swaggerci/eventgrid/test/Update-AzEventGridSystemTopicEventSubscription.Tests.ps1 new file mode 100644 index 000000000000..0322a30c2a43 --- /dev/null +++ b/swaggerci/eventgrid/test/Update-AzEventGridSystemTopicEventSubscription.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Update-AzEventGridSystemTopicEventSubscription')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Update-AzEventGridSystemTopicEventSubscription.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Update-AzEventGridSystemTopicEventSubscription' { + It 'UpdateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'UpdateViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/Update-AzEventGridTopic.Tests.ps1 b/swaggerci/eventgrid/test/Update-AzEventGridTopic.Tests.ps1 new file mode 100644 index 000000000000..c285b2faff04 --- /dev/null +++ b/swaggerci/eventgrid/test/Update-AzEventGridTopic.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Update-AzEventGridTopic')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Update-AzEventGridTopic.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Update-AzEventGridTopic' { + It 'UpdateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'UpdateViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/Update-AzEventGridTopicEventSubscription.Tests.ps1 b/swaggerci/eventgrid/test/Update-AzEventGridTopicEventSubscription.Tests.ps1 new file mode 100644 index 000000000000..0238da87f99c --- /dev/null +++ b/swaggerci/eventgrid/test/Update-AzEventGridTopicEventSubscription.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Update-AzEventGridTopicEventSubscription')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Update-AzEventGridTopicEventSubscription.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Update-AzEventGridTopicEventSubscription' { + It 'UpdateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'UpdateViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/eventgrid/test/loadEnv.ps1 b/swaggerci/eventgrid/test/loadEnv.ps1 new file mode 100644 index 000000000000..0ea394729062 --- /dev/null +++ b/swaggerci/eventgrid/test/loadEnv.ps1 @@ -0,0 +1,21 @@ +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- +$envFile = 'env.json' +if ($TestMode -eq 'live') { + $envFile = 'localEnv.json' +} + +if (Test-Path -Path (Join-Path $PSScriptRoot $envFile)) { + $envFilePath = Join-Path $PSScriptRoot $envFile +} else { + $envFilePath = Join-Path $PSScriptRoot '..\$envFile' +} +$env = @{} +if (Test-Path -Path $envFilePath) { + $env = Get-Content (Join-Path $PSScriptRoot $envFile) | ConvertFrom-Json + $PSDefaultParameterValues=@{"*:SubscriptionId"=$env.SubscriptionId; "*:Tenant"=$env.Tenant} +} \ No newline at end of file diff --git a/swaggerci/eventgrid/test/utils.ps1 b/swaggerci/eventgrid/test/utils.ps1 new file mode 100644 index 000000000000..1990edd45299 --- /dev/null +++ b/swaggerci/eventgrid/test/utils.ps1 @@ -0,0 +1,31 @@ +function RandomString([bool]$allChars, [int32]$len) { + if ($allChars) { + return -join ((33..126) | Get-Random -Count $len | % {[char]$_}) + } else { + return -join ((48..57) + (97..122) | Get-Random -Count $len | % {[char]$_}) + } +} +$env = @{} +if ($UsePreviousConfigForRecord) { + $previousEnv = Get-Content (Join-Path $PSScriptRoot 'env.json') | ConvertFrom-Json + $previousEnv.psobject.properties | Foreach-Object { $env[$_.Name] = $_.Value } +} +# Add script method called AddWithCache to $env, when useCache is set true, it will try to get the value from the $env first. +# example: $val = $env.AddWithCache('key', $val, $true) +$env | Add-Member -Type ScriptMethod -Value { param( [string]$key, [object]$val, [bool]$useCache) if ($this.Contains($key) -and $useCache) { return $this[$key] } else { $this[$key] = $val; return $val } } -Name 'AddWithCache' +function setupEnv() { + # Preload subscriptionId and tenant from context, which will be used in test + # as default. You could change them if needed. + $env.SubscriptionId = (Get-AzContext).Subscription.Id + $env.Tenant = (Get-AzContext).Tenant.Id + # For any resources you created for test, you should add it to $env here. + $envFile = 'env.json' + if ($TestMode -eq 'live') { + $envFile = 'localEnv.json' + } + set-content -Path (Join-Path $PSScriptRoot $envFile) -Value (ConvertTo-Json $env) +} +function cleanupEnv() { + # Clean resources you create for testing +} + diff --git a/swaggerci/eventgrid/utils/Unprotect-SecureString.ps1 b/swaggerci/eventgrid/utils/Unprotect-SecureString.ps1 new file mode 100644 index 000000000000..cb05b51a6220 --- /dev/null +++ b/swaggerci/eventgrid/utils/Unprotect-SecureString.ps1 @@ -0,0 +1,16 @@ +#This script converts securestring to plaintext + +param( + [Parameter(Mandatory, ValueFromPipeline)] + [System.Security.SecureString] + ${SecureString} +) + +$ssPtr = [System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($SecureString) +try { + $plaintext = [System.Runtime.InteropServices.Marshal]::PtrToStringBSTR($ssPtr) +} finally { + [System.Runtime.InteropServices.Marshal]::ZeroFreeBSTR($ssPtr) +} + +return $plaintext \ No newline at end of file